mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Merge pull request #5052 from jlmitch5/disableScheduleToggle
RBAC Hide the things for schedules
This commit is contained in:
commit
3e23641908
@ -2239,3 +2239,22 @@ button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.CodeMirror--disabled .CodeMirror.cm-s-default,
|
||||
.CodeMirror--disabled .CodeMirror-line {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
.CodeMirror--disabled .CodeMirror-gutter.CodeMirror-lint-markers,
|
||||
.CodeMirror--disabled .CodeMirror-gutter.CodeMirror-linenumbers {
|
||||
background-color: #ebebeb;
|
||||
color: @b7grey;
|
||||
}
|
||||
|
||||
.CodeMirror--disabled .CodeMirror-lines {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.CodeMirror--disabled .CodeMirror-cursors {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ export default
|
||||
awToolTip: "{{ group.group_schedule_tooltip }}",
|
||||
ngClass: "group.scm_type_class",
|
||||
dataPlacement: 'top',
|
||||
ngShow: "!(group.summary_fields.inventory_source.source === '') && group.summary_fields.user_capabilities.schedule"
|
||||
ngShow: "!(group.summary_fields.inventory_source.source === '')"
|
||||
},
|
||||
edit: {
|
||||
//label: 'Edit',
|
||||
|
||||
@ -97,7 +97,6 @@ export default
|
||||
awToolTip: "{{ project.scm_schedule_tooltip }}",
|
||||
ngClass: "project.scm_type_class",
|
||||
dataPlacement: 'top',
|
||||
ngShow: "project.summary_fields.user_capabilities.schedule"
|
||||
},
|
||||
edit: {
|
||||
ngClick: "editProject(project.id)",
|
||||
|
||||
@ -25,6 +25,7 @@ export default
|
||||
ngClick: "toggleSchedule($event, schedule.id)",
|
||||
nosort: true,
|
||||
awToolTip: "{{ schedule.play_tip }}",
|
||||
ngDisabled: "!schedule.summary_fields.user_capabilities.edit",
|
||||
dataTipWatch: "schedule.play_tip",
|
||||
dataPlacement: 'top'
|
||||
},
|
||||
|
||||
@ -20,6 +20,7 @@ export default
|
||||
|
||||
fields: {
|
||||
toggleSchedule: {
|
||||
ngDisabled: "!schedule.summary_fields.user_capabilities.edit",
|
||||
label: '',
|
||||
columnClass: 'List-staticColumn--toggle',
|
||||
type: "toggle",
|
||||
|
||||
@ -94,7 +94,6 @@ export default
|
||||
ngClick: 'scheduleJob(template)',
|
||||
awToolTip: i18n._('Schedule future job template runs'),
|
||||
dataPlacement: 'top',
|
||||
ngShow: 'template.summary_fields.user_capabilities.schedule'
|
||||
},
|
||||
copy: {
|
||||
label: i18n._('Copy'),
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
<span translate>Name</span>
|
||||
</label>
|
||||
<input
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
type="text"
|
||||
class="form-control input-sm
|
||||
Form-textInput"
|
||||
@ -40,7 +41,8 @@
|
||||
<span translate>Start Date</span>
|
||||
</label>
|
||||
<div class="input-group Form-inputGroup SchedulerForm-inputGroup--date">
|
||||
<scheduler-date-picker date="schedulerStartDt">
|
||||
<scheduler-date-picker date="schedulerStartDt"
|
||||
disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)">
|
||||
</scheduler-date-picker>
|
||||
</div>
|
||||
<div class="error"
|
||||
@ -63,6 +65,7 @@
|
||||
</label>
|
||||
<div class="input-group SchedulerTime">
|
||||
<input name="schedulerStartHour"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
id="schedulerStartHour"
|
||||
sch-spinner="scheduler_form"
|
||||
class="scheduler-time-spinner
|
||||
@ -78,6 +81,7 @@
|
||||
:
|
||||
</span>
|
||||
<input name="schedulerStartMinute"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
id="schedulerStartMinute"
|
||||
sch-spinner="scheduler_form"
|
||||
class="scheduler-time-spinner
|
||||
@ -93,6 +97,7 @@
|
||||
:
|
||||
</span>
|
||||
<input name="schedulerStartSecond"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
id="schedulerStartSecond"
|
||||
sch-spinner="scheduler_form"
|
||||
class="scheduler-time-spinner
|
||||
@ -128,6 +133,7 @@
|
||||
<span translate>Local Time Zone</span>
|
||||
</label>
|
||||
<select
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2"
|
||||
name="schedulerTimeZone"
|
||||
id="schedulerTimeZone"
|
||||
@ -143,6 +149,7 @@
|
||||
<span translate>Repeat frequency</span>
|
||||
</label>
|
||||
<select name="schedulerFrequency"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
id="schedulerFrequency"
|
||||
class="MakeSelect2"
|
||||
ng-model="schedulerFrequency"
|
||||
@ -156,7 +163,7 @@
|
||||
</div>
|
||||
<div class="form-group SchedulerForm-formGroup" ng-if="cleanupJob && !isFactCleanup">
|
||||
<label class="Form-inputLabel"><span class="red-text">*</span> Days of data to keep</label>
|
||||
<input type="number" sch-spinner="scheduler_form" class="scheduler-time-spinner SchedulerTime-input SpinnerInput RepeatFrequencyOptions-number" name="schedulerPurgeDays" id="schedulerPurgeDays" min="1" aw-spinner="schedulerPurgeDays" ng-model="schedulerPurgeDays" required placeholder="Days of data to keep">
|
||||
<input type="number" sch-spinner="scheduler_form" class="scheduler-time-spinner SchedulerTime-input SpinnerInput RepeatFrequencyOptions-number" name="schedulerPurgeDays" id="schedulerPurgeDays" min="1" aw-spinner="schedulerPurgeDays" ng-model="schedulerPurgeDays" required placeholder="Days of data to keep" ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)">
|
||||
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$dirty && scheduler_form.schedulerPurgeDays.$error.required" translate>A value is required.</div>
|
||||
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$error.number" translate>This is not a valid number.</div>
|
||||
</div>
|
||||
@ -175,6 +182,7 @@
|
||||
Every
|
||||
</label>
|
||||
<input name="schedulerInterval"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
id="schedulerInterval"
|
||||
sch-spinner="scheduler_form"
|
||||
class="scheduler-spinner
|
||||
@ -211,6 +219,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<input
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
name="monthDay"
|
||||
id="monthDay"
|
||||
sch-spinner="scheduler_form"
|
||||
@ -232,6 +241,7 @@
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
value="other"
|
||||
ng-model="$parent.monthlyRepeatOption"
|
||||
ng-change="monthlyRepeatChange()"
|
||||
@ -246,7 +256,7 @@
|
||||
id="monthlyOccurrence"
|
||||
ng-model="$parent.monthlyOccurrence"
|
||||
ng-options="o.name for o in occurrences"
|
||||
ng-disabled="monthlyRepeatOption != 'other'"
|
||||
ng-disabled="monthlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class=" MakeSelect2 form-control
|
||||
input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
@ -257,7 +267,7 @@
|
||||
id="monthlyWeekDay"
|
||||
ng-model="$parent.monthlyWeekDay"
|
||||
ng-options="w.name for w in weekdays"
|
||||
ng-disabled="monthlyRepeatOption != 'other'"
|
||||
ng-disabled="monthlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2 form-control input-sm" >
|
||||
</select>
|
||||
</div>
|
||||
@ -270,6 +280,7 @@
|
||||
<span class="red-text">*</span>
|
||||
<label class="Form-inputLabel">
|
||||
<input type="radio"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
value="month"
|
||||
ng-model="$parent.yearlyRepeatOption"
|
||||
ng-change="yearlyRepeatChange()"
|
||||
@ -284,12 +295,13 @@
|
||||
id="yearlyMonth"
|
||||
ng-model="$parent.yearlyMonth"
|
||||
ng-options="m.name for m in months"
|
||||
ng-disabled="yearlyRepeatOption != 'month'"
|
||||
ng-disabled="yearlyRepeatOption != 'month' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2 form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect"
|
||||
>
|
||||
</select>
|
||||
<input name="yearlyMonthDay"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
id="yearlyMonthDay"
|
||||
sch-spinner="scheduler_form"
|
||||
class="scheduler-spinner
|
||||
@ -313,6 +325,7 @@
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
value="other"
|
||||
ng-model="$parent.yearlyRepeatOption"
|
||||
ng-change="yearlyRepeatChange()"
|
||||
@ -329,7 +342,7 @@
|
||||
id="yearlyOccurrence"
|
||||
ng-model="$parent.yearlyOccurrence"
|
||||
ng-options="o.name for o in occurrences"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
ng-disabled="yearlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
@ -341,7 +354,7 @@
|
||||
id="yearlyWeekDay"
|
||||
ng-model="$parent.yearlyWeekDay"
|
||||
ng-options="w.name for w in weekdays"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
ng-disabled="yearlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
@ -352,7 +365,7 @@
|
||||
id="yearlyOtherMonth"
|
||||
ng-model="$parent.yearlyOtherMonth"
|
||||
ng-options="m.name for m in months"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
ng-disabled="yearlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-thirdSelect">
|
||||
@ -374,6 +387,7 @@
|
||||
data-toggle="buttons-checkbox"
|
||||
id="weekdaySelect">
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDaySUClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -382,6 +396,7 @@
|
||||
Sun
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayMOClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -390,6 +405,7 @@
|
||||
Mon
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayTUClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -398,6 +414,7 @@
|
||||
Tue
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayWEClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -406,6 +423,7 @@
|
||||
Wed
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayTHClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -414,6 +432,7 @@
|
||||
Thu
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayFRClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -422,6 +441,7 @@
|
||||
Fri
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDaySAClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -445,6 +465,7 @@
|
||||
</label>
|
||||
<div>
|
||||
<select id="schedulerEnd"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
name="schedulerEnd"
|
||||
ng-model="$parent.schedulerEnd"
|
||||
ng-options="e.name for e in endOptions"
|
||||
@ -463,6 +484,7 @@
|
||||
Occurrence(s)
|
||||
</label>
|
||||
<input
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-name="schedulerOccurrenceCount"
|
||||
ng-id="schedulerOccurrenceCount"
|
||||
sch-spinner="scheduler_form"
|
||||
@ -486,7 +508,8 @@
|
||||
End Date
|
||||
</label>
|
||||
<div class="input-group Form-inputGroup SchedulerForm-inputGroup--date">
|
||||
<scheduler-date-picker date="$parent.schedulerEndDt">
|
||||
<scheduler-date-picker date="$parent.schedulerEndDt"
|
||||
disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)">
|
||||
</scheduler-date-picker>
|
||||
</div>
|
||||
<div class="error"
|
||||
@ -506,8 +529,8 @@
|
||||
<div class="form-group SchedulerForm-formGroup" ng-if="isFactCleanup">
|
||||
<label class="Form-inputLabel RepeatFrequencyOptions-everyLabel"><span class="red-text">*</span> Select a time period after which to remove old facts</label>
|
||||
<div class="RepeatFrequencyOptions-inputGroup RepeatFrequencyOptions-inputGroup--halvesWithSelect">
|
||||
<input type="number" id="keep_amount" name="keep_amount" ng-model="keep_amount" aw-spinner="keep_amount" ng-required="true" sch-spinner="scheduler_form" class="scheduler-time-spinner SchedulerTime-input SpinnerInput RepeatFrequencyOptions-number" aw-min=0 aw-max=9999 integer></input>
|
||||
<select id="keep_unit" name="keep_unit" ng-model="keep_unit" ng-options="type.label for type in keep_unit_choices track by type.value" ng-required="true" class="form-control input-sm MakeSelect2"></select>
|
||||
<input type="number" id="keep_amount" name="keep_amount" ng-model="keep_amount" aw-spinner="keep_amount" ng-required="true" sch-spinner="scheduler_form" class="scheduler-time-spinner SchedulerTime-input SpinnerInput RepeatFrequencyOptions-number" aw-min=0 aw-max=9999 integer ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"></input>
|
||||
<select id="keep_unit" name="keep_unit" ng-model="keep_unit" ng-options="type.label for type in keep_unit_choices track by type.value" ng-required="true" class="form-control input-sm MakeSelect2" ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"></select>
|
||||
</div>
|
||||
|
||||
<!-- The below errors are ONLY for id="keep_amount", not for id="keep_unit" -->
|
||||
@ -523,8 +546,8 @@
|
||||
<label class="Form-inputLabel RepeatFrequencyOptions-everyLabel"><span class="red-text">*</span> Select a frequency for snapshot retention</label>
|
||||
<div class="RepeatFrequencyOptions-inputGroup RepeatFrequencyOptions-inputGroup--halvesWithSelect">
|
||||
<input type="number" sch-spinner="scheduler_form" class="scheduler-time-spinner SchedulerTime-input SpinnerInput RepeatFrequencyOptions-number" id="granularity_keep_amount" name="granularity_keep_amount" ng-model="granularity_keep_amount" aw-spinner="granularity_keep_amount"
|
||||
ng-required="true" aw-min=0 aw-max=9999 >
|
||||
<select id="granularity_keep_unit" name="granularity_keep_unit" ng-model="granularity_keep_unit" ng-options="type.label for type in granularity_keep_unit_choices track by type.value" ng-required="true" class="form-control input-sm MakeSelect2"></select>
|
||||
ng-required="true" aw-min=0 aw-max=9999 ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)">
|
||||
<select id="granularity_keep_unit" name="granularity_keep_unit" ng-model="granularity_keep_unit" ng-options="type.label for type in granularity_keep_unit_choices track by type.value" ng-required="true" class="form-control input-sm MakeSelect2" ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"></select>
|
||||
</div>
|
||||
|
||||
<!-- The below errors are ONLY for id="granularity_keep_amount", not for id="granularity_keep_unit" -->
|
||||
@ -607,11 +630,18 @@
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-cancelButton"
|
||||
id="project_cancel_btn"
|
||||
ng-show="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-click="formCancel()">Close</button>
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-cancelButton"
|
||||
id="project_cancel_btn"
|
||||
ng-show="(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-click="formCancel()">Cancel</button>
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-saveButton"
|
||||
id="project_save_btn"
|
||||
ng-click="saveSchedule()"
|
||||
ng-show="(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-disabled="!schedulerIsValid"> Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -88,6 +88,11 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.RepeatFrequencyOptions-weekButton.active {
|
||||
background-color: @default-list-header-bg !important;
|
||||
border-color: @d7grey !important;
|
||||
}
|
||||
|
||||
.RepeatFrequencyOptions-everyGroup {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@ -6,9 +6,11 @@
|
||||
border-radius: 5px;
|
||||
border: 1px solid @default-icon;
|
||||
background-color: @default-icon;
|
||||
width: 40px;
|
||||
width: 42px;
|
||||
margin-top: 2px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.ScheduleToggle-switch {
|
||||
@ -22,6 +24,10 @@
|
||||
font-size: 11px;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding-top: 0px;
|
||||
margin-top: 0px;
|
||||
border-top: 0px;
|
||||
border-bottom: 0px;
|
||||
}
|
||||
|
||||
.ScheduleToggle.is-on {
|
||||
|
||||
@ -17,7 +17,8 @@ export default
|
||||
date: '=',
|
||||
minDate: '=',
|
||||
autoUpdate: '=?',
|
||||
inputClass: '&'
|
||||
inputClass: '&',
|
||||
disabled: '=?'
|
||||
},
|
||||
templateUrl: templateUrl('system-tracking/date-picker/date-picker'),
|
||||
link: function(scope, element, attrs) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<div class="DatePicker">
|
||||
<button class="DatePicker-icon"><i class="fa fa-calendar"></i></button>
|
||||
<button class="DatePicker-icon" ng-disabled="disabled"><i class="fa fa-calendar"></i></button>
|
||||
<input
|
||||
ng-disabled="disabled"
|
||||
class="DatePicker-input"
|
||||
type="text"
|
||||
readonly
|
||||
|
||||
@ -69,11 +69,14 @@ function($filter, $compile, $state, $stateParams, EditSchedule, Wait, $scope, $r
|
||||
// extra_data field is not manifested in the UI when scheduling a Management Job
|
||||
if ($state.current.name !== 'managementJobSchedules.add' && $state.current.name !== 'managementJobSchedules.edit'){
|
||||
$scope.$on('ScheduleFound', function(){
|
||||
let readOnly = !$scope.schedule_obj.summary_fields.user_capabilities
|
||||
.edit;
|
||||
ParseTypeChange({
|
||||
scope: $scope,
|
||||
variable: 'extraVars',
|
||||
parse_variable: 'parseType',
|
||||
field_id: 'SchedulerForm-extraVars'
|
||||
field_id: 'SchedulerForm-extraVars',
|
||||
readOnly: readOnly
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
name="schedulerName"
|
||||
id="schedulerName"
|
||||
ng-model="schedulerName" required
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
placeholder="Schedule name">
|
||||
<div class="error"
|
||||
ng-show="scheduler_form.$dirty && scheduler_form.schedulerName.$error.required">
|
||||
@ -40,7 +41,8 @@
|
||||
Start Date
|
||||
</label>
|
||||
<div class="input-group Form-inputGroup SchedulerForm-inputGroup--date">
|
||||
<scheduler-date-picker date="schedulerStartDt">
|
||||
<scheduler-date-picker date="schedulerStartDt"
|
||||
disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)">
|
||||
</scheduler-date-picker>
|
||||
</div>
|
||||
<div class="error"
|
||||
@ -65,6 +67,7 @@
|
||||
<input name="schedulerStartHour"
|
||||
id="schedulerStartHour"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-time-spinner
|
||||
ScheduleTime-input SpinnerInput"
|
||||
aw-spinner="schedulerStartHour"
|
||||
@ -80,6 +83,7 @@
|
||||
<input name="schedulerStartMinute"
|
||||
id="schedulerStartMinute"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-time-spinner
|
||||
SchedulerTime-input SpinnerInput"
|
||||
aw-spinner="schedulerStartMinute"
|
||||
@ -95,6 +99,7 @@
|
||||
<input name="schedulerStartSecond"
|
||||
id="schedulerStartSecond"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-time-spinner
|
||||
SchedulerTime-input SpinnerInput"
|
||||
aw-spinner="schedulerStartSecond"
|
||||
@ -116,6 +121,7 @@
|
||||
Local Time Zone
|
||||
</label>
|
||||
<select
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2"
|
||||
name="schedulerTimeZone"
|
||||
id="schedulerTimeZone"
|
||||
@ -131,6 +137,7 @@
|
||||
Repeat frequency
|
||||
</label>
|
||||
<select name="schedulerFrequency"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
id="schedulerFrequency"
|
||||
class="MakeSelect2"
|
||||
ng-model="schedulerFrequency"
|
||||
@ -159,6 +166,7 @@
|
||||
<input name="schedulerInterval"
|
||||
id="schedulerInterval"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-spinner
|
||||
SpinnerInput"
|
||||
aw-spinner="schedulerInterval"
|
||||
@ -185,6 +193,7 @@
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio" value="day"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-model="$parent.monthlyRepeatOption"
|
||||
ng-change="monthlyRepeatChange()"
|
||||
name="monthlyRepeatOption"
|
||||
@ -196,6 +205,7 @@
|
||||
name="monthDay"
|
||||
id="monthDay"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-spinner SpinnerInput"
|
||||
aw-spinner="$parent.monthDay"
|
||||
ng-model="$parent.monthDay"
|
||||
@ -214,6 +224,7 @@
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
value="other"
|
||||
ng-model="$parent.monthlyRepeatOption"
|
||||
ng-change="monthlyRepeatChange()"
|
||||
@ -228,7 +239,7 @@
|
||||
id="monthlyOccurrence"
|
||||
ng-model="$parent.monthlyOccurrence"
|
||||
ng-options="o.name for o in occurrences"
|
||||
ng-disabled="monthlyRepeatOption != 'other'"
|
||||
ng-disabled="monthlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class=" MakeSelect2 form-control
|
||||
input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
@ -239,7 +250,7 @@
|
||||
id="monthlyWeekDay"
|
||||
ng-model="$parent.monthlyWeekDay"
|
||||
ng-options="w.name for w in weekdays"
|
||||
ng-disabled="monthlyRepeatOption != 'other'"
|
||||
ng-disabled="monthlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2 form-control input-sm" >
|
||||
</select>
|
||||
</div>
|
||||
@ -252,6 +263,7 @@
|
||||
<span class="red-text">*</span>
|
||||
<label class="Form-inputLabel">
|
||||
<input type="radio"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
value="month"
|
||||
ng-model="$parent.yearlyRepeatOption"
|
||||
ng-change="yearlyRepeatChange()"
|
||||
@ -266,7 +278,7 @@
|
||||
id="yearlyMonth"
|
||||
ng-model="$parent.yearlyMonth"
|
||||
ng-options="m.name for m in months"
|
||||
ng-disabled="yearlyRepeatOption != 'month'"
|
||||
ng-disabled="yearlyRepeatOption != 'month' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2 form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect"
|
||||
>
|
||||
@ -274,6 +286,7 @@
|
||||
<input name="yearlyMonthDay"
|
||||
id="yearlyMonthDay"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-spinner
|
||||
SpinnerInput"
|
||||
aw-spinner="$parent.yearlyMonthDay"
|
||||
@ -295,6 +308,7 @@
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<input type="radio"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
value="other"
|
||||
ng-model="$parent.yearlyRepeatOption"
|
||||
ng-change="yearlyRepeatChange()"
|
||||
@ -311,7 +325,7 @@
|
||||
id="yearlyOccurrence"
|
||||
ng-model="$parent.yearlyOccurrence"
|
||||
ng-options="o.name for o in occurrences"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
ng-disabled="yearlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
@ -323,7 +337,7 @@
|
||||
id="yearlyWeekDay"
|
||||
ng-model="$parent.yearlyWeekDay"
|
||||
ng-options="w.name for w in weekdays"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
ng-disabled="yearlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-spacedSelect
|
||||
@ -334,7 +348,7 @@
|
||||
id="yearlyOtherMonth"
|
||||
ng-model="$parent.yearlyOtherMonth"
|
||||
ng-options="m.name for m in months"
|
||||
ng-disabled="yearlyRepeatOption != 'other'"
|
||||
ng-disabled="yearlyRepeatOption != 'other' || !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="MakeSelect2
|
||||
form-control input-sm
|
||||
RepeatFrequencyOptions-thirdSelect">
|
||||
@ -356,6 +370,7 @@
|
||||
data-toggle="buttons-checkbox"
|
||||
id="weekdaySelect">
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDaySUClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -364,6 +379,7 @@
|
||||
Sun
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayMOClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -372,6 +388,7 @@
|
||||
Mon
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayTUClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -380,6 +397,7 @@
|
||||
Tue
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayWEClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -388,6 +406,7 @@
|
||||
Wed
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayTHClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -396,6 +415,7 @@
|
||||
Thu
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDayFRClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -404,6 +424,7 @@
|
||||
Fri
|
||||
</button>
|
||||
<button type="button"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-class="weekDaySAClass"
|
||||
class="btn btn-default
|
||||
RepeatFrequencyOptions-weekButton"
|
||||
@ -427,6 +448,7 @@
|
||||
</label>
|
||||
<div>
|
||||
<select id="schedulerEnd"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
name="schedulerEnd"
|
||||
ng-model="$parent.schedulerEnd"
|
||||
ng-options="e.name for e in endOptions"
|
||||
@ -448,6 +470,7 @@
|
||||
ng-name="schedulerOccurrenceCount"
|
||||
ng-id="schedulerOccurrenceCount"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-spinner
|
||||
SpinnerInput"
|
||||
aw-spinner="$parent.schedulerOccurrenceCount"
|
||||
@ -468,7 +491,8 @@
|
||||
End Date
|
||||
</label>
|
||||
<div class="input-group Form-inputGroup SchedulerForm-inputGroup--date">
|
||||
<scheduler-date-picker date="$parent.schedulerEndDt">
|
||||
<scheduler-date-picker date="$parent.schedulerEndDt"
|
||||
disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)">
|
||||
</scheduler-date-picker>
|
||||
</div>
|
||||
<div class="error"
|
||||
@ -494,6 +518,7 @@
|
||||
<input name="schedulerEndHour"
|
||||
id="schedulerEndHour"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-time-spinner
|
||||
ScheduleTime-input SpinnerInput"
|
||||
aw-spinner="$parent.schedulerEndHour"
|
||||
@ -509,6 +534,7 @@
|
||||
<input name="schedulerEndMinute"
|
||||
id="$parent.schedulerEndMinute"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-time-spinner
|
||||
SchedulerTime-input SpinnerInput"
|
||||
aw-spinner="$parent.schedulerEndMinute"
|
||||
@ -524,6 +550,7 @@
|
||||
<input name="schedulerEndSecond"
|
||||
id="schedulerEndSecond"
|
||||
sch-spinner="scheduler_form"
|
||||
ng-disabled="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
class="scheduler-time-spinner
|
||||
SchedulerTime-input SpinnerInput"
|
||||
aw-spinner="$parent.schedulerEndSecond"
|
||||
@ -629,7 +656,7 @@
|
||||
</div>
|
||||
|
||||
</label>
|
||||
<div>
|
||||
<div ng-class="{'CodeMirror--disabled': !(schedule_obj.summary_fields.user_capabilities.edit || canAdd)}">
|
||||
<textarea rows="6" ng-model="extraVars" name="Scheduler-extraVars" class="form-control" id="SchedulerForm-extraVars"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@ -638,11 +665,19 @@
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-cancelButton"
|
||||
id="project_cancel_btn"
|
||||
ng-show="!(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-click="formCancel()">Close</button>
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-cancelButton"
|
||||
id="project_cancel_btn"
|
||||
ng-show="(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-click="formCancel()">Cancel</button>
|
||||
<button type="button"
|
||||
class="btn btn-sm Form-saveButton"
|
||||
id="project_save_btn"
|
||||
ng-click="saveSchedule()"
|
||||
ng-show="(schedule_obj.summary_fields.user_capabilities.edit || canAdd)"
|
||||
ng-disabled="!schedulerIsValid"> Save</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -981,6 +981,15 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper'])
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// hack to get ngDisabled to work
|
||||
if (attrs.ngDisabled) {
|
||||
scope.$watch(attrs.ngDisabled, function(val) {
|
||||
opts.disabled = (val === true) ? true : false;
|
||||
$(elm).spinner(opts);
|
||||
});
|
||||
}
|
||||
|
||||
if (disabled) {
|
||||
opts.disabled = true;
|
||||
}
|
||||
|
||||
@ -1271,7 +1271,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
|
||||
for (i = 0; i < field.options.length; i++) {
|
||||
html += "<label class=\"radio-inline ";
|
||||
html += (field.options[i].labelClass) ? ` ${field.options[i].labelClass} "` : "\"";
|
||||
html += (field.options[i].labelClass) ? ` ${field.options[i].labelClass} "` : "\"";
|
||||
html += (field.options[i].ngShow) ? this.attr(field.options[i], 'ngShow') : "";
|
||||
html += ">";
|
||||
html += "<input type=\"radio\" ";
|
||||
|
||||
@ -509,12 +509,16 @@ angular.module('GeneratorHelpers', [systemStatus.name])
|
||||
html += (field['class']) ? " " + field['class'] : "";
|
||||
html += " " + field.columnClass;
|
||||
html += "\"><div class='ScheduleToggle' ng-class='{\"is-on\": " + list.iterator + ".";
|
||||
html += (field.flag) ? field.flag : "enabled";
|
||||
html += "\}' aw-tool-tip='" + field.awToolTip + "' data-placement='" + field.dataPlacement + "' data-tip-watch='" + field.dataTipWatch + "'><div ng-show='" + list.iterator + "." ;
|
||||
html += (field.flag) ? field.flag : "enabled\}' ";
|
||||
html += "aw-tool-tip='" + field.awToolTip + "' data-placement='" + field.dataPlacement + "' data-tip-watch='" + field.dataTipWatch + "'><button ";
|
||||
html += (field.ngDisabled) ? `ng-disabled="${field.ngDisabled}" ` : "";
|
||||
html += "ng-show='" + list.iterator + "." ;
|
||||
html += (field.flag) ? field.flag : 'enabled';
|
||||
html += "' class='ScheduleToggle-switch is-on' ng-click='" + field.ngClick + "'>ON</div><div ng-show='!" + list.iterator + "." ;
|
||||
html += "' class='ScheduleToggle-switch is-on' ng-click='" + field.ngClick + "'>ON</button><button ";
|
||||
html += (field.ngDisabled) ? `ng-disabled="${field.ngDisabled}" ` : "";
|
||||
html += "ng-show='!" + list.iterator + "." ;
|
||||
html += (field.flag) ? field.flag : "enabled";
|
||||
html += "' class='ScheduleToggle-switch' ng-click='" + field.ngClick + "'>OFF</div></div></td>";
|
||||
html += "' class='ScheduleToggle-switch' ng-click='" + field.ngClick + "'>OFF</button></div></td>";
|
||||
} else {
|
||||
html += "<td class=\"List-tableCell " + fld + "-column";
|
||||
html += (field['class']) ? " " + field['class'] : "";
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
<div class="DatePicker">
|
||||
<button class="DatePicker-icon"><i class="fa fa-calendar"></i></button>
|
||||
<button class="DatePicker-icon" ng-disabled="disabled"><i class="fa fa-calendar"></i></button>
|
||||
<input
|
||||
class="DatePicker-input"
|
||||
type="text"
|
||||
readonly
|
||||
ng-model="dateValue"
|
||||
ng-class="inputClass()">
|
||||
ng-class="inputClass()"
|
||||
ng-disabled="disabled">
|
||||
<p class="error" ng-if="error">{{error}}</p>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user