mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 17:51:06 -03:30
Makes extra variables CodeMirror shown only for JT-schedules that
have promptable extra vars in the JT. Hides vars for all other schedule types
This commit is contained in:
@@ -2,13 +2,13 @@
|
|||||||
<div class="tab-pane" id="jobs-page">
|
<div class="tab-pane" id="jobs-page">
|
||||||
<at-panel ng-cloak id="htmlTemplate">
|
<at-panel ng-cloak id="htmlTemplate">
|
||||||
<div>
|
<div>
|
||||||
<div ng-hide="$state.is('jobs.schedules') || $state.is('jobs.schedules.edit')">
|
<div ng-hide="$state.includes('jobs.schedules')">
|
||||||
<at-panel-heading hide-dismiss="true">
|
<at-panel-heading hide-dismiss="true">
|
||||||
<translate>JOBS</translate>
|
<translate>JOBS</translate>
|
||||||
</at-panel-heading>
|
</at-panel-heading>
|
||||||
<div ui-view="jobsList"></div>
|
<div ui-view="jobsList"></div>
|
||||||
</div>
|
</div>
|
||||||
<div ng-hide="!$state.is('jobs.schedules') && !$state.is('jobs.schedules.edit')">
|
<div ng-hide="!$state.includes('jobs.schedules')">
|
||||||
<at-panel-heading hide-dismiss="true">
|
<at-panel-heading hide-dismiss="true">
|
||||||
<translate>SCHEDULES</translate>
|
<translate>SCHEDULES</translate>
|
||||||
</at-panel-heading>
|
</at-panel-heading>
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
|
|||||||
scheduler.setName(schedule.name);
|
scheduler.setName(schedule.name);
|
||||||
$rootScope.breadcrumb.schedule_name = $scope.schedulerName;
|
$rootScope.breadcrumb.schedule_name = $scope.schedulerName;
|
||||||
$rootScope.breadcrumb[`${$scope.parentObject.type}_name`] = $scope.parentObject.name;
|
$rootScope.breadcrumb[`${$scope.parentObject.type}_name`] = $scope.parentObject.name;
|
||||||
|
$scope.noVars = true;
|
||||||
scheduler.scope.timeZones = timezonesResolve;
|
scheduler.scope.timeZones = timezonesResolve;
|
||||||
scheduler.scope.schedulerTimeZone = scheduleResolve.timezone;
|
scheduler.scope.schedulerTimeZone = scheduleResolve.timezone;
|
||||||
if ($scope.cleanupJob){
|
if ($scope.cleanupJob){
|
||||||
@@ -297,7 +298,19 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
|
|||||||
|
|
||||||
prompts.credentials.value = defaultCredsWithoutOverrides.concat(scheduleCredentials);
|
prompts.credentials.value = defaultCredsWithoutOverrides.concat(scheduleCredentials);
|
||||||
|
|
||||||
if (!launchConf.ask_variables_on_launch) {
|
if (launchConf.ask_variables_on_launch) {
|
||||||
|
// the extra vars codemirror is ONLY shown if the
|
||||||
|
// schedule is for a JT and the JT has
|
||||||
|
// ask_variables_on_launch = true.
|
||||||
|
$scope.extraVars = ParentObject.extra_vars === '' ? '---' : ParentObject.extra_vars;
|
||||||
|
$scope.noVars = false;
|
||||||
|
ParseTypeChange({
|
||||||
|
scope: $scope,
|
||||||
|
variable: 'extraVars',
|
||||||
|
parse_variable: 'parseType',
|
||||||
|
field_id: 'SchedulerForm-extraVars'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$scope.noVars = true;
|
$scope.noVars = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,28 +462,10 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// extra_data field is not manifested in the UI when scheduling a Management Job
|
|
||||||
if ($state.current.name !== 'managementJobsList.schedule.add' && $state.current.name !== 'managementJobsList.schedule.edit'){
|
|
||||||
if ($state.current.name === 'projects.edit.schedules.edit' ||
|
|
||||||
$state.current.name === 'inventories.edit.inventory_sources.edit.schedules.edit' ||
|
|
||||||
$state.current.name === 'templates.editWorkflowJobTemplate.schedules.add' ||
|
|
||||||
$scope.parentObject.type === 'inventory_source' ||
|
|
||||||
$scope.parentObject.type === 'project'
|
|
||||||
){
|
|
||||||
$scope.noVars = true;
|
|
||||||
} else {
|
|
||||||
ParseTypeChange({
|
|
||||||
scope: $scope,
|
|
||||||
variable: 'extraVars',
|
|
||||||
parse_variable: 'parseType',
|
|
||||||
field_id: 'SchedulerForm-extraVars',
|
|
||||||
readOnly: !$scope.schedule_obj.summary_fields.user_capabilities.edit
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
callSelect2();
|
callSelect2();
|
||||||
|
|||||||
Reference in New Issue
Block a user