Skip to content

Commit

Permalink
feat(core): Support a date constraint on trigger parameters (#5907)
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Reynolds committed Oct 29, 2018
1 parent 6132180 commit cc68c9c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ module.exports = angular
return this.command.pipeline.stages.filter(stage => stage.type === stageType);
};

this.dateOptions = {
dateDisabled: false,
showWeeks: false,
minDate: new Date(),
startingDay: 1,
};

this.dateOpened = {};

this.openDate = parameterName => {
this.dateOpened[parameterName] = true;
};

/**
* Initialization
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,25 @@ <h3 ng-if="!vm.command.pipeline">Select Pipeline</h3>
<span ng-if="parameter.required">*</span>
<help-field content="{{parameter.description}}" ng-if="parameter.description"></help-field>
</div>
<div class="col-md-6" ng-if="!parameter.hasOptions">
<div class="col-md-6" ng-if="!parameter.hasOptions && parameter.constraint === 'date'">
<p class="input-group">
<input type="text"
class="form-control input-sm"
uib-datepicker-popup
datepicker-append-to-body="true"
ng-model="parameter.model"
ng-change="vm.parameters[parameter.name] = parameter.model.toISOString().slice(0,10); vm.updateParameters();"
is-open="vm.dateOpened[parameter.name]"
datepicker-options="vm.dateOptions"
ng-required="true"
close-text="Close"
/>
<span class="input-group-btn">
<button type="button" style="padding: 4px 8px;" class="btn btn-default" ng-click="vm.openDate(parameter.name)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
<div class="col-md-6" ng-if="!parameter.hasOptions && !parameter.constraint">
<input class="form-control input-sm"
ng-model="vm.parameters[parameter.name]"
ng-change="vm.updateParameters()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
padding-left: 20px;
}
}

.uib-datepicker-popup.dropdown-menu {
z-index: var(--layer-critical);
}

0 comments on commit cc68c9c

Please sign in to comment.