Skip to content

Commit 6dbe1ac

Browse files
committed
(core): pull angular-cron-gen library internally
* pull angular-cron-gen library internally to deck to fix several issues with the library. * the latest version of the library will not allow angular expressions for the new `template-url` property as it uses the `templateUrl` function which executes before the scope is initialized so any scoped property value is not accessible. this means that our template value set via a controller property is not accessible. this is a long-standing issue [in the core library](angular/angular.js#2895) and it doesn't look to be fixed anytime soon. * an hourly cron trigger set in the UI to execute start at a specific time actually generates a daily cron expression so the portion of the hourly cron trigger that allows starting at a specific time was removed from deck's cron picker template. * the regex used by the library to match hourly cron expressions was incorrectly matching daily cron expressions which was resulting the UI displaying `hourly` instead of `daily` in the select so the regex for hourly was fixed to properly test for matching hourly cron expressions.
1 parent 887b4a6 commit 6dbe1ac

File tree

4 files changed

+390
-27
lines changed

4 files changed

+390
-27
lines changed

app/scripts/modules/core/pipeline/config/triggers/cron/cronPicker.html

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,6 @@
4141
hour<span ng-if="state.hourly.every.hours> 1">s</span>
4242
</div>
4343
</div>
44-
<div class="row">
45-
<div class="col-md-12">
46-
<input type="radio"
47-
value="specific"
48-
ng-change="regenerateCron(state)"
49-
ng-model="state.hourly.subTab"
50-
name="hourly-radio">
51-
At
52-
<select class="form-control input-sm"
53-
ng-change="regenerateCron(state)"
54-
ng-model="state.hourly.specific.hours"
55-
ng-options="hour as padNumber(hour) for hour in selectOptions.hours"
56-
ng-required="state.activeTab === 'hourly' && state.hourly.subTab === 'specific'">
57-
</select>
58-
:
59-
<select class="form-control input-sm"
60-
ng-change="regenerateCron(state)"
61-
ng-model="state.hourly.specific.minutes"
62-
ng-options="minute as padNumber(minute) for minute in selectOptions.minutes"
63-
ng-required="state.activeTab === 'hourly' && state.hourly.subTab === 'specific'">
64-
</select>
65-
<system-timezone></system-timezone>
66-
</div>
67-
</div>
6844
</div>
6945
<div ng-if="state.activeTab === 'daily'">
7046
<div class="row">

app/scripts/modules/core/pipeline/config/triggers/cron/cronTrigger.module.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {UUIDGenerator} from 'core/utils/uuid.service';
66
import './cronTrigger.less';
77

88
module.exports = angular.module('spinnaker.core.pipeline.trigger.cron', [
9-
require('angular-cron-gen'),
9+
require('core/utils/cron/cron.js'),
1010
require('../trigger.directive.js'),
1111
require('core/serviceAccount/serviceAccount.service.js'),
1212
require('./cron.validator.directive.js'),
@@ -39,5 +39,4 @@ module.exports = angular.module('spinnaker.core.pipeline.trigger.cron', [
3939
this.cronOptions = {
4040
templateUrl: require('./cronPicker.html'),
4141
};
42-
4342
});

0 commit comments

Comments
 (0)