diff --git a/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js b/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js index a45cfcab31..21196a2b73 100644 --- a/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js +++ b/awx/ui/client/lib/angular-scheduler/lib/angular-scheduler.js @@ -406,6 +406,14 @@ angular.module('AngularScheduler', ['underscore']) return validity; }; + + var that = this; + + that.scope.$on("loadSchedulerDetailPane", function() { + console.log("loaded scheduler detail pane"); + that.isValid(); + }); + // Returns an rrule object this.getRRule = function() { var options = this.getOptions(); diff --git a/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less b/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less index 6b046d8a42..956ad9e3ce 100644 --- a/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less +++ b/awx/ui/client/src/scheduler/repeatFrequencyOptions.block.less @@ -132,3 +132,8 @@ .RepeatFrequencyOptions-yearlyOccurence { text-transform: capitalize; } + +.RepeatFrequencyOptions-error { + flex: initial; + width: 100%; +} diff --git a/awx/ui/client/src/scheduler/schedulerAdd.controller.js b/awx/ui/client/src/scheduler/schedulerAdd.controller.js index c04db19cab..a6eb3e12be 100644 --- a/awx/ui/client/src/scheduler/schedulerAdd.controller.js +++ b/awx/ui/client/src/scheduler/schedulerAdd.controller.js @@ -1,21 +1,41 @@ -export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$scope', function($compile, $state, $stateParams, AddSchedule, Wait, $scope) { +export default ['$compile', '$state', '$stateParams', 'AddSchedule', 'Wait', '$scope', '$rootScope', function($compile, $state, $stateParams, AddSchedule, Wait, $scope, $rootScope) { $scope.$on("ScheduleFormCreated", function(e, scope) { $scope.hideForm = false; $scope = angular.extend($scope, scope); - $scope.$watchGroup(["schedulerStartDt", + + $scope.$on("formUpdated", function() { + $rootScope.$broadcast("loadSchedulerDetailPane"); + }); + + $scope.$watchGroup(["schedulerName", + "schedulerStartDt", "schedulerStartHour", "schedulerStartMinute", "schedulerStartSecond", "schedulerTimeZone", "schedulerFrequency", - "schedulerInterval"], function(val) { - if (!$scope.scheduler_form.$invalid) { - $scope.schedulerIsValid = true; - } else { - $scope.schedulerIsValid = false; - } - return val; - }); + "schedulerInterval", + "monthlyRepeatOption", + "monthDay", + "monthlyOccurrence", + "monthlyWeekDay", + "yearlyRepeatOption", + "yearlyMonth", + "yearlyMonthDay", + "yearlyOccurrence", + "yearlyWeekDay", + "yearlyOtherMonth", + "schedulerEnd", + "schedulerOccurrenceCount", + "schedulerEndDt" + ], function() { + $scope.$emit("formUpdated"); + }, true); + + $scope.$watch("weekDays", function() { + $scope.$emit("formUpdated"); + }, true); + Wait('stop'); }); diff --git a/awx/ui/client/src/scheduler/schedulerEdit.controller.js b/awx/ui/client/src/scheduler/schedulerEdit.controller.js index 4dcdf4ccf5..82d9fa26e4 100644 --- a/awx/ui/client/src/scheduler/schedulerEdit.controller.js +++ b/awx/ui/client/src/scheduler/schedulerEdit.controller.js @@ -1,21 +1,42 @@ -export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$scope', function($compile, $state, $stateParams, EditSchedule, Wait, $scope) { +export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$scope', '$rootScope', function($compile, $state, $stateParams, EditSchedule, Wait, $scope, $rootScope) { $scope.$on("ScheduleFormCreated", function(e, scope) { $scope.hideForm = false; $scope = angular.extend($scope, scope); - $scope.$watchGroup(["schedulerStartDt", + + $scope.$on("formUpdated", function() { + $rootScope.$broadcast("loadSchedulerDetailPane"); + }); + + $scope.$watchGroup(["schedulerName", + "schedulerStartDt", "schedulerStartHour", "schedulerStartMinute", "schedulerStartSecond", "schedulerTimeZone", "schedulerFrequency", - "schedulerInterval"], function(val) { - if (!$scope.scheduler_form.$invalid) { - $scope.schedulerIsValid = true; - } else { - $scope.schedulerIsValid = false; - } - return val; - }); + "schedulerInterval", + "monthlyRepeatOption", + "monthDay", + "monthlyOccurrence", + "monthlyWeekDay", + "yearlyRepeatOption", + "yearlyMonth", + "yearlyMonthDay", + "yearlyOccurrence", + "yearlyWeekDay", + "yearlyOtherMonth", + "schedulerEnd", + "schedulerOccurrenceCount", + "schedulerEndDt" + ], function() { + $scope.$emit("formUpdated"); + }, true); + + $scope.$watch("weekDays", function() { + $scope.$emit("formUpdated"); + }, true); + + $rootScope.$broadcast("loadSchedulerDetailPane"); Wait('stop'); }); diff --git a/awx/ui/client/src/scheduler/schedulerForm.partial.html b/awx/ui/client/src/scheduler/schedulerForm.partial.html index 038192c675..af503a49ce 100644 --- a/awx/ui/client/src/scheduler/schedulerForm.partial.html +++ b/awx/ui/client/src/scheduler/schedulerForm.partial.html @@ -59,6 +59,10 @@ +
+
-->
+ ng-show="scheduler_startTime_error"> + The time must be in HH24:MM:SS format.
-
- The time must be in HH24:MM:SS format. -
+ class="error + RepeatFrequencyOptions-error" + ng-show="$parent.scheduler_interval_error"> Please provide a value between 1 and 999.
@@ -218,7 +219,7 @@ min="1" max="31" ng-change="resetError('scheduler_monthDay_error')" >
+ ng-show="$parent.scheduler_monthDay_error"> The day must be between 1 and 31.
@@ -289,7 +290,7 @@ ng-change="resetError('scheduler_yearlyMonthDay_error')" >
+ ng-show="$parent.scheduler_yearlyMonthDay_error"> The day must be between 1 and 31.
@@ -354,7 +355,7 @@ class="btn btn-default RepeatFrequencyOptions-weekButton" data-value="SU" - ng-click="setWeekday($event,'su')"> + ng-click="$parent.setWeekday($event,'su')"> Sun
+ ng-show="$parent.scheduler_weekDays_error"> Please select one or more days.
@@ -442,12 +443,13 @@ sch-spinner="scheduler_form" class="scheduler-spinner SpinnerInput" - ng-model="schedulerOccurrenceCount" + ng-model="$parent.schedulerOccurrenceCount" min="1" max="999" on-change="resetError('scheduler_occurrenceCount_error')" > -
+
Please provide a value between 1 and 999.
@@ -480,7 +482,7 @@
+ ng-show="$parent.scheduler_endDt_error"> Please provide a valid date.
@@ -530,34 +532,70 @@ --> -
-
-

The scheduler options are invalid or incomplete. Make the needed changes on the options tab, then come back here to see details.

+
+

+ The scheduler options are invalid or incomplete. +

+
+
+ +
+ {{ rrule_nlp_description }}
-
-
- - -
-
- - -
-
- -
- - - -
-
    -
  • {{ occurrence.utc }}
  • -
-
    -
  • {{ occurrence.local }}
  • -
+
+ +
+ + +
+
    +
  • + {{ occurrence.utc }} +
  • +
+
    +
  • + {{ occurrence.local }} +
  • +
@@ -565,7 +603,7 @@ class="btn btn-sm Form-saveButton" id="project_save_btn" ng-click="saveSchedule()" - ng-disabled="scheduler_form.$invalid"> Save + ng-disabled="!schedulerIsValid"> Save