From aa164360cc864668421c9d598408dd5923e5fb5d Mon Sep 17 00:00:00 2001 From: sreehari jayaraj Date: Sat, 30 Sep 2023 22:16:15 +0530 Subject: [PATCH] fix: refactor type and skelton computation --- .../smartsheet/expanded-form/index.vue | 2 +- .../components/ListChildItems.vue | 20 ++++++++----------- packages/nc-gui/utils/iconUtils.ts | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index a6cc7b5446..449b97b6fd 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -397,7 +397,7 @@ export default { {{ displayValue }}
- + All {{ meta.title }}
diff --git a/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue b/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue index b805107487..a38f34677d 100644 --- a/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue +++ b/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue @@ -18,13 +18,13 @@ import { useVModel, } from '#imports' -interface Iprop { +interface Prop { modelValue?: boolean cellValue: any column: any } -const props = defineProps() +const props = defineProps() const emit = defineEmits(['update:modelValue', 'attachRecord']) @@ -130,22 +130,20 @@ onKeyStroke('Escape', () => { vModel.value = false }) -/* +/* to render same number of skelton as the number of cards displayed */ - const skeltonCount = computed(() => { if (childrenListCount.value < 10 && childrenListPagination.page === 1) { - return childrenListCount.value === 0 ? 10 : childrenListCount.value + return childrenListCount.value || 10 } - const totlaRows = Math.ceil(childrenListCount.value / 10) + const totalRows = Math.ceil(childrenListCount.value / 10) - if (totlaRows === childrenListPagination.page) { + if (totalRows === childrenListPagination.page) { return childrenListCount.value % 10 - } else { - return 10 } + return 10 }) const isDataExist = computed(() => { @@ -154,9 +152,7 @@ const isDataExist = computed(() => { const linkOrUnLink = (rowRef: Record, id: string) => { if (isPublic.value && !isForm.value) return - if (isNew.value) { - unlinkRow(rowRef, parseInt(id)) - } else if (isChildrenListLinked.value[parseInt(id)]) { + if (isNew.value || isChildrenListLinked.value[parseInt(id)]) { unlinkRow(rowRef, parseInt(id)) } else { linkRow(rowRef, parseInt(id)) diff --git a/packages/nc-gui/utils/iconUtils.ts b/packages/nc-gui/utils/iconUtils.ts index faa221e9c1..49256ecd3a 100644 --- a/packages/nc-gui/utils/iconUtils.ts +++ b/packages/nc-gui/utils/iconUtils.ts @@ -238,7 +238,7 @@ import MaterialSymbolsBlock from '~icons/material-symbols/block' } as const */ export const iconMap = { - recordIcon: RecordIcon, + record: RecordIcon, workspaceDefault: MsGroup, search: NcSearch, error: h('span', { class: 'material-symbols' }, 'error'),