Addressing comments

This commit is contained in:
Tyler Rockwood
2017-05-15 13:51:01 -07:00
parent b675cd19d7
commit 4ecc8da398
3 changed files with 7 additions and 3 deletions

View File

@@ -23,7 +23,7 @@
<label>Global</label>
<input type="checkbox" class="form-inline" ng-model="$ctrl.parameter.global">
</div>
<div class="form-group">
<div class="form-group" ng-if="$ctrl.parameter.type === 'enum'">
<label>Values (newline delimited)</label>
<textarea class="form-control" rows="3" ng-model="$ctl.parameter.enumOptions">
</div>

View File

@@ -8,7 +8,7 @@
<input ng-switch-when="date" type="date" class="form-control" ng-model="param.ngModel">
<span ns-switch-when="enum">
<select ns-model="param.value" class="form-control">
<option ng-repeat="option in param.enumOptions.split('\n')" value="{{option}}">{{option}}</option>
<option ng-repeat="option in extractEnumOptions(param.enumOptions)" value="{{option}}">{{option}}</option>
</select>
</span>
<input ng-switch-default type="{{param.type}}" class="form-control" ng-model="param.ngModel">

View File

@@ -40,7 +40,11 @@ function ParametersDirective($location, $uibModal) {
});
}, true);
}
scope.extractEnumOptions = (enumOptions) => {
// These are input as newline delimited values,
// so we split them here.
return enumOptions.split('\n');
};
scope.showParameterSettings = (param) => {
$uibModal.open({
component: 'parameterSettings',