From fdd9c2be6812d8f968ac583ee5ab66f177166fed Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:39:22 +0000 Subject: [PATCH] fix(nc-gui): pr review changes --- .../nc-gui/components/cell/MultiSelect.vue | 10 ++--- .../nc-gui/components/cell/SingleSelect.vue | 8 ++-- packages/nc-gui/components/cell/User.vue | 41 +++++++++---------- .../components/general/ImageCropper.vue | 8 +--- .../nc-gui/components/smartsheet/Form.vue | 9 ++-- .../smartsheet/form/LimitOptions.vue | 18 ++------ packages/nc-gui/utils/parseUtils.ts | 2 +- 7 files changed, 40 insertions(+), 56 deletions(-) diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index 9559bcb48c..4f0c8346d0 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -100,7 +100,7 @@ const options = computed<(SelectOptionType & { value?: string })[]>(() => { const limitOptionsById = ((parseProp(column.value.meta)?.limitOptions || []).reduce( (o: Record, f: FormFieldsLimitOptionsType) => { - if (f?.order !== undefined && order < f.order) { + if (order < (f?.order ?? 0)) { order = f.order } return { @@ -118,18 +118,18 @@ const options = computed<(SelectOptionType & { value?: string })[]>(() => { (parseProp(column.value.meta)?.limitOptions || []).length ) { return opts - ?.filter((o: SelectOptionType) => { + .filter((o: SelectOptionType) => { if (limitOptionsById[o.id!]?.show !== undefined) { return limitOptionsById[o.id!]?.show } return false }) - ?.map((o) => ({ + .map((o) => ({ ...o, value: o.title, order: o.id && limitOptionsById[o.id] ? limitOptionsById[o.id]?.order : order++, })) - ?.sort((a, b) => a.order - b.order) + .sort((a, b) => a.order - b.order) } else { return opts.map((o: SelectOptionType) => ({ ...o, value: o.title })) } @@ -390,7 +390,7 @@ const onFocus = () => {