Skip to content

Commit

Permalink
Disable adding to options lists (#1564)
Browse files Browse the repository at this point in the history
* disable adding to options lists

* remove handler for + button
  • Loading branch information
laineyhm authored Nov 1, 2022
1 parent bd1bea0 commit 04f641b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
13 changes: 0 additions & 13 deletions src/angular-app/bellows/shared/pick-list-editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@
<option value="">(no default)</option>
</select>
</div>
<div class="row">
<div class="col-12 clearfix">
<div class="input-group">
<input class="form-control" id="new-value" data-ng-model="$ctrl.newValue" data-on-enter="$ctrl.pickAddItem()" name="newValue"
type="text" placeholder="new value" no-dirty-check>
<span class="input-group-btn">
<a class="btn btn-primary add-item-to-list" href data-ng-click="$ctrl.pickAddItem()">
<i class="fa fa-plus iconPadding" aria-hidden="true"></i>Add to List</a>
</span>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-12 clearfix" drag-to-reorder-bind="$ctrl.items">
<div data-ng-repeat="item in $ctrl.items" class="picklist-group" dtr-draggable>
Expand Down
8 changes: 0 additions & 8 deletions src/angular-app/bellows/shared/pick-list-editor.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ export class PickListEditorController implements angular.IController {
}
}

pickAddItem(): void {
if (this.newValue) {
const key = PickListEditorController.keyFromValue(this.newValue);
this.items.push({ key, value: this.newValue });
this.isDeletable[key] = true;
this.newValue = undefined;
}
}

pickRemoveItem(index: number): void {
delete this.isDeletable[this.items[index].key];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<div class="col-md-9">
<div class="card card-body bg-light settings-panel" id="picklistEditorFieldset">
<h3 class="col-form-label">{{$ctrl.olcOptionListsDirty[$ctrl.currentListIndex].name}}</h3>
<i>(At this time {{$ctrl.olcOptionListsDirty[$ctrl.currentListIndex].name}} items cannot be deleted)</i>
<div style="padding: 10px">
<small>To add or remove items from this list, please use FieldWorks (FLEx).</small>
</div>
<div class="controls">
<picklist-editor items="$ctrl.olcOptionListsDirty[$ctrl.currentListIndex].items"></picklist-editor>
</div>
Expand Down

0 comments on commit 04f641b

Please sign in to comment.