mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 10:40:01 -03:30
Properly show prompt button when re-selecting a node with promptable fields
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="Prompt-previewTags--outer">
|
<div class="Prompt-previewTags--outer">
|
||||||
<div ng-show="promptData.launchConf.defaults.inventory.id && !promptData.prompts.inventory.value.id" class="Prompt-noSelectedItem">{{:: vm.strings.get('prompt.NO_INVENTORY_SELECTED') }}</div>
|
<div ng-show="promptData.launchConf.defaults.inventory.id && !promptData.prompts.inventory.value.id" class="Prompt-noSelectedItem">{{:: vm.strings.get('prompt.NO_INVENTORY_SELECTED') }}</div>
|
||||||
<at-tag tag="promptData.prompts.inventory.value.name" remove-tag="vm.deleteSelectedInventory()" ng-show="!readOnlyPrompts"></at-tag>
|
<at-tag tag="promptData.prompts.inventory.value.name" remove-tag="vm.deleteSelectedInventory()" ng-show="!readOnlyPrompts && promptData.prompts.inventory.value.id"></at-tag>
|
||||||
<at-tag tag="promptData.prompts.inventory.value.name" ng-show="readOnlyPrompts"></at-tag>
|
<at-tag tag="promptData.prompts.inventory.value.name" ng-show="readOnlyPrompts && promptData.prompts.inventory.value.id"></at-tag>
|
||||||
</div>
|
</div>
|
||||||
<div class="Prompt-previewTagRevert">
|
<div class="Prompt-previewTagRevert">
|
||||||
<a class="Prompt-revertLink" href="" ng-hide="readOnlyPrompts || promptData.prompts.inventory.value.id === promptData.launchConf.defaults.inventory.id" ng-click="vm.revert()">{{:: vm.strings.get('prompt.REVERT') }}</a>
|
<a class="Prompt-revertLink" href="" ng-hide="readOnlyPrompts || promptData.prompts.inventory.value.id === promptData.launchConf.defaults.inventory.id" ng-click="vm.revert()">{{:: vm.strings.get('prompt.REVERT') }}</a>
|
||||||
|
|||||||
@@ -641,6 +641,31 @@ export default ['$scope', 'WorkflowService', 'GetBasePath', 'TemplatesService',
|
|||||||
|
|
||||||
if (!_.isEmpty($scope.nodeBeingEdited.promptData)) {
|
if (!_.isEmpty($scope.nodeBeingEdited.promptData)) {
|
||||||
$scope.promptData = _.cloneDeep($scope.nodeBeingEdited.promptData);
|
$scope.promptData = _.cloneDeep($scope.nodeBeingEdited.promptData);
|
||||||
|
const launchConf = $scope.promptData.launchConf;
|
||||||
|
|
||||||
|
if (!launchConf.survey_enabled &&
|
||||||
|
!launchConf.ask_inventory_on_launch &&
|
||||||
|
!launchConf.ask_credential_on_launch &&
|
||||||
|
!launchConf.ask_verbosity_on_launch &&
|
||||||
|
!launchConf.ask_job_type_on_launch &&
|
||||||
|
!launchConf.ask_limit_on_launch &&
|
||||||
|
!launchConf.ask_tags_on_launch &&
|
||||||
|
!launchConf.ask_skip_tags_on_launch &&
|
||||||
|
!launchConf.ask_diff_mode_on_launch &&
|
||||||
|
!launchConf.survey_enabled &&
|
||||||
|
!launchConf.credential_needed_to_start &&
|
||||||
|
launchConf.variables_needed_to_start.length === 0) {
|
||||||
|
$scope.showPromptButton = false;
|
||||||
|
$scope.promptModalMissingReqFields = false;
|
||||||
|
} else {
|
||||||
|
$scope.showPromptButton = true;
|
||||||
|
|
||||||
|
if (launchConf.ask_inventory_on_launch && !_.has(launchConf, 'defaults.inventory') && !_.has($scope, 'nodeBeingEdited.originalNodeObj.summary_fields.inventory')) {
|
||||||
|
$scope.promptModalMissingReqFields = true;
|
||||||
|
} else {
|
||||||
|
$scope.promptModalMissingReqFields = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (
|
} else if (
|
||||||
_.get($scope, 'nodeBeingEdited.unifiedJobTemplate.unified_job_type') === 'job_template' ||
|
_.get($scope, 'nodeBeingEdited.unifiedJobTemplate.unified_job_type') === 'job_template' ||
|
||||||
_.get($scope, 'nodeBeingEdited.unifiedJobTemplate.type') === 'job_template'
|
_.get($scope, 'nodeBeingEdited.unifiedJobTemplate.type') === 'job_template'
|
||||||
|
|||||||
Reference in New Issue
Block a user