From 78fc5fa58fbaf42c17d7f0ea274d6aada7170641 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 10 Nov 2023 07:21:55 +0000 Subject: [PATCH 001/112] fix: Added ws role icon in ws menu --- packages/nc-gui/store/sidebar.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/nc-gui/store/sidebar.ts b/packages/nc-gui/store/sidebar.ts index 9bad365ce1..7f0e5ee2bd 100644 --- a/packages/nc-gui/store/sidebar.ts +++ b/packages/nc-gui/store/sidebar.ts @@ -42,6 +42,16 @@ export const useSidebarStore = defineStore('sidebarStore', () => { const leftSidebarWidth = computed(() => (width.value * mobileNormalizedSidebarSize.value) / 100) + const nonHiddenMobileSidebarSize = computed(() => { + if (isMobileMode.value) { + return 100 + } + + return leftSideBarSize.value.current ?? leftSideBarSize.value.old + }) + + const nonHiddenLeftSidebarWidth = computed(() => (width.value * nonHiddenMobileSidebarSize.value) / 100) + return { isLeftSidebarOpen, isRightSidebarOpen, @@ -50,6 +60,7 @@ export const useSidebarStore = defineStore('sidebarStore', () => { leftSidebarState, leftSidebarWidth, mobileNormalizedSidebarSize, + nonHiddenLeftSidebarWidth, } }) From 6b67d56d5a1ddbf14bd4fab25768ae7bd24187bc Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 13 Nov 2023 05:52:51 +0000 Subject: [PATCH 002/112] fix: Fixed issue with data prepopulation in the case of creating new record through links modal in the case of many to many --- .../nc-gui/components/virtual-cell/components/ListItems.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/virtual-cell/components/ListItems.vue b/packages/nc-gui/components/virtual-cell/components/ListItems.vue index 33ba9ca447..7e91152058 100644 --- a/packages/nc-gui/components/virtual-cell/components/ListItems.vue +++ b/packages/nc-gui/components/virtual-cell/components/ListItems.vue @@ -112,7 +112,8 @@ const newRowState = computed(() => { if (isNew.value) return {} const colOpt = (injectedColumn?.value as ColumnType)?.colOptions as LinkToAnotherRecordType const colInRelatedTable: ColumnType | undefined = relatedTableMeta?.value?.columns?.find((col) => { - if (col.uidt !== UITypes.LinkToAnotherRecord) return false + // Links as for the case of 'mm' we need the 'Links' column + if (col.uidt !== UITypes.LinkToAnotherRecord && col.uidt !== UITypes.Links) return false const colOpt1 = col?.colOptions as LinkToAnotherRecordType if (colOpt1?.fk_related_model_id !== meta.value.id) return false From 9c78e031249e16174b67412a9c151f7a9e3a6583 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 13 Nov 2023 05:52:51 +0000 Subject: [PATCH 003/112] fix: Close modal when record created through links modal and reload the list and count --- .../smartsheet/expanded-form/index.vue | 5 +++++ .../virtual-cell/components/ListItems.vue | 22 +++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index e7d4b84c58..d1ba6d245a 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -41,6 +41,7 @@ interface Props { showNextPrevIcons?: boolean firstRow?: boolean lastRow?: boolean + closeAfterSave?: boolean } const props = defineProps() @@ -201,6 +202,10 @@ const save = async () => { reloadTrigger?.trigger() } isUnsavedFormExist.value = false + + if (props.closeAfterSave) { + isExpanded.value = false + } } const isPreventChangeModalOpen = ref(false) diff --git a/packages/nc-gui/components/virtual-cell/components/ListItems.vue b/packages/nc-gui/components/virtual-cell/components/ListItems.vue index 7e91152058..01eafc23ab 100644 --- a/packages/nc-gui/components/virtual-cell/components/ListItems.vue +++ b/packages/nc-gui/components/virtual-cell/components/ListItems.vue @@ -53,6 +53,8 @@ const { addLTARRef, isNew, removeLTARRef, state: rowState } = useSmartsheetRowSt const isPublic = inject(IsPublicInj, ref(false)) +const isExpandedFormCloseAfterSave = ref(false) + isChildrenExcludedLoading.value = true const isForm = inject(IsFormInj, ref(false)) @@ -113,7 +115,7 @@ const newRowState = computed(() => { const colOpt = (injectedColumn?.value as ColumnType)?.colOptions as LinkToAnotherRecordType const colInRelatedTable: ColumnType | undefined = relatedTableMeta?.value?.columns?.find((col) => { // Links as for the case of 'mm' we need the 'Links' column - if (col.uidt !== UITypes.LinkToAnotherRecord && col.uidt !== UITypes.Links) return false + if (!isLinksOrLTAR(col)) return false const colOpt1 = col?.colOptions as LinkToAnotherRecordType if (colOpt1?.fk_related_model_id !== meta.value.id) return false @@ -158,6 +160,10 @@ const relation = computed(() => { watch(expandedFormDlg, () => { if (!expandedFormDlg.value) { + isExpandedFormCloseAfterSave.value = false + if (!isForm.value) { + loadChildrenList() + } loadChildrenExcludedList(rowState.value) } }) @@ -174,6 +180,12 @@ const onClick = (refRow: any, id: string) => { linkRow(refRow, Number.parseInt(id)) } } + +const addNewRecord = () => { + expandedFormRow.value = {} + expandedFormDlg.value = true + isExpandedFormCloseAfterSave.value = true +}