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 @@ +
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. +
+