From 5bab5ff4b7fd9fca81e8de9c1509ca62aa035752 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 9 Oct 2023 15:57:17 +0000 Subject: [PATCH 1/8] fix(nc-gui): Fixed shared base editor issue --- .../components/dlg/share-and-collaborate/ShareBase.vue | 2 +- packages/nocodb/src/services/shared-bases.service.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue b/packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue index f9512e8fd0..a042adf281 100644 --- a/packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue +++ b/packages/nc-gui/components/dlg/share-and-collaborate/ShareBase.vue @@ -159,7 +159,7 @@ const onRoleToggle = async () => {
-
+
{{ $t('activity.editingAccess') }}
Date: Mon, 9 Oct 2023 15:57:17 +0000 Subject: [PATCH 2/8] fix(nc-gui): Fixed shared base editor issue --- .../virtual-cell/components/ListChildItems.vue | 4 ++++ .../virtual-cell/components/ListItem.vue | 4 +++- .../virtual-cell/components/ListItems.vue | 18 ++++++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue b/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue index 8426ac3838..f340e6585e 100644 --- a/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue +++ b/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue @@ -41,6 +41,8 @@ const injectedColumn = inject(ColumnInj, ref()) const readonly = inject(ReadonlyInj, ref(false)) +const { isSharedBase } = storeToRefs(useBase()) + const { childrenList, childrenListCount, @@ -165,6 +167,8 @@ const isDataExist = computed(() => { }) const linkOrUnLink = (rowRef: Record, id: string) => { + if (isSharedBase.value) return + if (isPublic.value && !isForm.value) return if (isNew.value || isChildrenListLinked.value[parseInt(id)]) { unlinkRow(rowRef, parseInt(id)) diff --git a/packages/nc-gui/components/virtual-cell/components/ListItem.vue b/packages/nc-gui/components/virtual-cell/components/ListItem.vue index 3bd8345cd2..745d7efefe 100644 --- a/packages/nc-gui/components/virtual-cell/components/ListItem.vue +++ b/packages/nc-gui/components/virtual-cell/components/ListItem.vue @@ -38,6 +38,8 @@ const row = useVModel(props, 'row') const isPublic = inject(IsPublicInj, ref(false)) +const readonly = inject(ReadonlyInj, ref(false)) + const { getPossibleAttachmentSrc } = useAttachment() interface Attachment { @@ -151,7 +153,7 @@ const attachments: ComputedRef = computed(() => {
{ onKeyStroke('Escape', () => { vModel.value = false }) + +const onClick = (refRow: any, id: string) => { + if (isSharedBase.value) return + if (isChildrenExcludedListLinked.value[Number.parseInt(id)]) { + unlinkRow(refRow, Number.parseInt(id)) + } else { + linkRow(refRow, Number.parseInt(id)) + } +}
From 48fb3c0804e1e02d80be47dbfca91c473cc07267 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 9 Oct 2023 15:57:17 +0000 Subject: [PATCH 3/8] fix(nc-gui): Fixed shared base editor issue --- .../tests/db/features/baseShare.spec.ts | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/tests/playwright/tests/db/features/baseShare.spec.ts b/tests/playwright/tests/db/features/baseShare.spec.ts index ed675f5b32..08e3918d36 100644 --- a/tests/playwright/tests/db/features/baseShare.spec.ts +++ b/tests/playwright/tests/db/features/baseShare.spec.ts @@ -67,34 +67,36 @@ test.describe('Shared base', () => { let url = ''; // share button visible only if a table is opened await dashboard.treeView.openTable({ title: 'Country' }); - url = await dashboard.grid.topbar.getSharedBaseUrl({ role: 'editor', enableSharedBase: true }); - - await dashboard.rootPage.waitForTimeout(2000); - // access shared base link - await dashboard.signOut(); - await dashboard.rootPage.waitForTimeout(2000); - // todo: Move this to a page object - await dashboard.rootPage.goto(url); - - await roleTest('editor'); + if (!isEE()) { + url = await dashboard.grid.topbar.getSharedBaseUrl({ role: 'editor', enableSharedBase: true }); + + await dashboard.rootPage.waitForTimeout(2000); + // access shared base link + await dashboard.signOut(); + await dashboard.rootPage.waitForTimeout(2000); + // todo: Move this to a page object + await dashboard.rootPage.goto(url); + + await roleTest('editor'); + + await loginPage.signIn({ + email: `user-${process.env.TEST_PARALLEL_INDEX}@nocodb.com`, + password: getDefaultPwd(), + withoutPrefix: true, + }); - await loginPage.signIn({ - email: `user-${process.env.TEST_PARALLEL_INDEX}@nocodb.com`, - password: getDefaultPwd(), - withoutPrefix: true, - }); + await dashboard.rootPage.waitForTimeout(1000); - await dashboard.rootPage.waitForTimeout(1000); + if (isEE()) { + await dashboard.grid.workspaceMenu.switchWorkspace({ + workspaceTitle: context.workspace.title, + }); + } - if (isEE()) { - await dashboard.grid.workspaceMenu.switchWorkspace({ - workspaceTitle: context.workspace.title, - }); + await dashboard.treeView.openProject({ title: context.base.title, context }); + await dashboard.treeView.openTable({ title: 'Country' }); } - await dashboard.treeView.openProject({ title: context.base.title, context }); - await dashboard.treeView.openTable({ title: 'Country' }); - url = await dashboard.grid.topbar.getSharedBaseUrl({ role: 'viewer', enableSharedBase: false }); await dashboard.rootPage.waitForTimeout(2000); From 906dbcd5be360195ad2b3ea8403316a448df8b96 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 9 Oct 2023 15:57:17 +0000 Subject: [PATCH 4/8] fix(nc-gui): Fixed table icon for ERD --- packages/nc-gui/components/erd/TableNode.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/components/erd/TableNode.vue b/packages/nc-gui/components/erd/TableNode.vue index cf300c689e..22a36200da 100644 --- a/packages/nc-gui/components/erd/TableNode.vue +++ b/packages/nc-gui/components/erd/TableNode.vue @@ -65,7 +65,7 @@ watch( :class="[showSkeleton ? '' : '', hasColumns ? '' : '']" class="text-gray-800 text-sm py-4 border-b-1 border-gray-200 rounded-t-lg w-full h-full px-3 font-medium flex items-center" > - +
{{ table.title }}
From dda6ade8cf10174399da12acb66921eb69329e72 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 9 Oct 2023 15:57:17 +0000 Subject: [PATCH 5/8] fix(nc-gui): Typo --- packages/nc-gui/components/dlg/TableDuplicate.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/components/dlg/TableDuplicate.vue b/packages/nc-gui/components/dlg/TableDuplicate.vue index 60a34485f7..2c4ee4b70c 100644 --- a/packages/nc-gui/components/dlg/TableDuplicate.vue +++ b/packages/nc-gui/components/dlg/TableDuplicate.vue @@ -80,7 +80,7 @@ const isEaster = ref(false)
- {{ $t('labels.includeData') }}a + {{ $t('labels.includeData') }} {{ $t('labels.includeView') }} {{ $t('labels.includeWebhook') }}
From 67da33cfccbbfe896bf0075870737f62388b592f Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 9 Oct 2023 15:57:18 +0000 Subject: [PATCH 6/8] fix(nc-gui): Fixed issue with json cell --- packages/nc-gui/components/cell/Json.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/cell/Json.vue b/packages/nc-gui/components/cell/Json.vue index fa28ad10a0..b6e327ef3e 100644 --- a/packages/nc-gui/components/cell/Json.vue +++ b/packages/nc-gui/components/cell/Json.vue @@ -42,7 +42,9 @@ const localValueState = ref() const error = ref() -const isExpanded = inject(JsonExpandInj, ref(false)) +const _isExpanded = inject(JsonExpandInj, ref(false)) + +const isExpanded = ref(false) const localValue = computed | undefined>({ get: () => localValueState.value, @@ -137,6 +139,10 @@ useSelectedCellKeyupListener(active, (e) => { break } }) + +watch(isExpanded, () => { + _isExpanded.value = isExpanded.value +})