Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable adding to options lists #1564

Merged
merged 3 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 9 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,15 @@ 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;
}
}
//Used in adding an item to the Options lists under Configuration, which is currently disabled in Language Forge 2022-10
// 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;
// }
// }
laineyhm marked this conversation as resolved.
Show resolved Hide resolved

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