Updated UI for editing saved views with custom fields

This commit is contained in:
shamoon
2024-04-17 20:24:31 -07:00
parent df5adadc76
commit 792ff005bb
9 changed files with 174 additions and 105 deletions

View File

@@ -1,5 +1,5 @@
<div class="d-flex flex-row mt-2 align-items-center">
<ng-container i18n>Selected</ng-container>:
{{title}}:
<div class="ms-2 d-flex flex-row gap-2 w-100"
cdkDropList #selectedList="cdkDropList"
cdkDropListOrientation="horizontal"
@@ -11,7 +11,6 @@
</div>
</div>
<div class="d-flex flex-row mt-2 align-items-center bg-light p-2">
<ng-container i18n></ng-container>
<div class="d-flex flex-row gap-2 w-100"
cdkDropList #unselectedList="cdkDropList"
cdkDropListOrientation="horizontal"

View File

@@ -1,3 +1,7 @@
.badge {
cursor: move;
}
.d-flex {
overflow-x: scroll;
}

View File

@@ -20,6 +20,8 @@ import {
styleUrl: './drag-drop-select.component.scss',
})
export class DragDropSelectComponent extends AbstractInputComponent<string[]> {
@Input() title: string = $localize`Selected items`
@Input() items: { id: string; name: string }[] = []
public selectedItems: { id: string; name: string }[] = []
@@ -53,7 +55,10 @@ export class DragDropSelectComponent extends AbstractInputComponent<string[]> {
0,
this.unselectedItems[event.previousIndex]
)
} else {
} else if (
event.container === this.unselectedList &&
event.previousContainer === this.selectedList
) {
this.selectedItems.splice(event.previousIndex, 1)
}
this.onChange(this.selectedItems.map((i) => i.id))