Fixed various bugs with the select dropdown

This commit is contained in:
Michael Abashian 2017-06-06 12:03:54 -04:00
parent 024bfc4dad
commit 51f44b6f6a
3 changed files with 13 additions and 9 deletions

View File

@ -210,7 +210,7 @@ export default
$scope.selected_credentials.machine = angular.copy($scope.defaults.credential);
}
if($scope.has_default_extra_credentials) {
if($scope.ask_extra_credentials_on_launch) {
// Go out and get the credential types
Rest.setUrl(GetBasePath('credential_types'));
Rest.get()
@ -219,13 +219,17 @@ export default
$scope.credentialKindOptions = [];
credentialTypeData.results.forEach((credentialType => {
credential_types[credentialType.id] = credentialType;
$scope.credentialKindOptions.push({
name: credentialType.name,
value: credentialType.id
});
if($scope.ask_credential_on_launch || (!$scope.ask_credential_on_launch && credentialType.id !== 1)) {
$scope.credentialKindOptions.push({
name: credentialType.name,
value: credentialType.id
});
}
}));
$scope.credential_types = credential_types;
$scope.selected_credentials.extra = angular.copy($scope.defaults.extra_credentials);
if($scope.has_default_extra_credentials) {
$scope.selected_credentials.extra = angular.copy($scope.defaults.extra_credentials);
}
});
}

View File

@ -29,7 +29,7 @@ export default [ 'templateUrl', 'CreateDialog', 'Wait', 'CreateSelect2', 'ParseT
scope.includeInventoryList = true;
}
if(scope.ask_credential_on_launch || scope.ask_extra_credentials_on_launch) {
scope.credentialKind = (scope.ask_credential_on_launch) ? "1" : "1";
scope.credentialKind = (scope.ask_credential_on_launch) ? "1" : "5";
scope.includeCredentialList = true;
}

View File

@ -15,7 +15,7 @@
<div class="JobSubmission-stepsContainer">
<div class="JobSubmission-steps">
<div class="JobSubmission-step" ng-class="{'JobSubmission-step--active': step==='inventory'}" ng-if="ask_inventory_on_launch" ng-click="setStep('inventory')" translate>Inventory</div>
<div class="JobSubmission-step" ng-class="{'JobSubmission-step--active': step==='credential', 'JobSubmission-step--disabled': !credentialTabEnabled}" ng-if="ask_credential_on_launch || password_needed" ng-click="!credentialTabEnabled || setStep('credential')" translate>Credential</div>
<div class="JobSubmission-step" ng-class="{'JobSubmission-step--active': step==='credential', 'JobSubmission-step--disabled': !credentialTabEnabled}" ng-if="ask_credential_on_launch || ask_extra_credentials_on_launch || password_needed" ng-click="!credentialTabEnabled || setStep('credential')" translate>Credential</div>
<div class="JobSubmission-step" ng-class="{'JobSubmission-step--active': step==='otherprompts', 'JobSubmission-step--disabled': !otherPromptsTabEnabled}" ng-if="has_other_prompts" ng-click="!otherPromptsTabEnabled || setStep('otherprompts')" translate>Other Prompts</div>
<div class="JobSubmission-step" ng-class="{'JobSubmission-step--active': step==='survey', 'JobSubmission-step--disabled': !surveyTabEnabled}" ng-if="survey_enabled" ng-click="!surveyTabEnabled || setStep('survey')" translate>Survey</div>
</div>
@ -36,7 +36,7 @@
<job-sub-inv-list ng-if="includeInventoryList" selected-inventory="$parent.selected_inventory"></job-sub-inv-list>
</div>
</div>
<div ng-if="ask_credential_on_launch || password_needed" ng-show="step === 'credential'" class="JobSubmission-form">
<div ng-if="ask_credential_on_launch || ask_extra_credentials_on_launch || password_needed" ng-show="step === 'credential'" class="JobSubmission-form">
<div class="JobSubmission-selectedItemContainer">
<div class="JobSubmission-selectedItem">
<div class="JobSubmission-selectedItemInfo">