From 539f0c2e95e34c09def9c3f5db48c4af54548d3c Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 28 Jun 2023 12:17:03 +0530 Subject: [PATCH 01/10] fix: add event handler based activeCell status Signed-off-by: Pranav C --- packages/nc-gui/components/cell/MultiSelect.vue | 6 +++--- packages/nc-gui/components/cell/SingleSelect.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index e2569578cc..7a22788276 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -48,11 +48,11 @@ const readOnly = inject(ReadonlyInj)! const isEditable = inject(EditModeInj, ref(false)) -const _active = inject(ActiveCellInj, ref(false)) +const activeCell = inject(ActiveCellInj, ref(false)) // use both ActiveCellInj or EditModeInj to determine the active state // since active will be false in case of form view -const active = computed(() => _active.value || isEditable.value) +const active = computed(() => activeCell.value || isEditable.value) const isPublic = inject(IsPublicInj, ref(false)) @@ -180,7 +180,7 @@ watch(isOpen, (n, _o) => { } }) -useSelectedCellKeyupListener(active, (e) => { +useSelectedCellKeyupListener(activeCell, (e) => { switch (e.key) { case 'Escape': isOpen.value = false diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue index 3b9dafbadb..d05eab3966 100644 --- a/packages/nc-gui/components/cell/SingleSelect.vue +++ b/packages/nc-gui/components/cell/SingleSelect.vue @@ -42,11 +42,11 @@ const readOnly = inject(ReadonlyInj)! const isEditable = inject(EditModeInj, ref(false)) -const _active = inject(ActiveCellInj, ref(false)) +const activeCell = inject(ActiveCellInj, ref(false)) // use both ActiveCellInj or EditModeInj to determine the active state // since active will be false in case of form view -const active = computed(() => _active.value || isEditable.value) +const active = computed(() => activeCell.value || isEditable.value) const aselect = ref() @@ -119,7 +119,7 @@ watch(isOpen, (n, _o) => { } }) -useSelectedCellKeyupListener(active, (e) => { +useSelectedCellKeyupListener(activeCell, (e) => { switch (e.key) { case 'Escape': isOpen.value = false From de65ea3041b44aab1278d8061379c918e8a7baac Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 28 Jun 2023 12:21:26 +0530 Subject: [PATCH 02/10] refactor: context menu update option Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Grid.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 659fe932e8..b16ae4518d 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -82,6 +82,8 @@ const isView = false let editEnabled = $ref(false) +const { appInfo } = useGlobal() + const { xWhere, isPkAvail, isSqlView, eventBus } = useSmartsheetStoreOrThrow() const visibleColLength = $computed(() => fields.value?.length) @@ -1129,7 +1131,7 @@ function addEmptyRow(row?: number) {
From c6147440dc00d73baa1e2688f268bb15f74b492d Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 13:25:59 +0530 Subject: [PATCH 03/10] test: fix for bulk update to be EE feature Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/tests/db/bulkUpdate.spec.ts | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/playwright/tests/db/bulkUpdate.spec.ts b/tests/playwright/tests/db/bulkUpdate.spec.ts index c3b78d40a5..9783dbd889 100644 --- a/tests/playwright/tests/db/bulkUpdate.spec.ts +++ b/tests/playwright/tests/db/bulkUpdate.spec.ts @@ -4,6 +4,8 @@ import { DashboardPage } from '../../pages/Dashboard'; import { Api } from 'nocodb-sdk'; import { createDemoTable } from '../../setup/demoTable'; import { BulkUpdatePage } from '../../pages/Dashboard/BulkUpdate'; +import { AccountLicensePage } from '../../pages/Account/License'; +import { AccountPage } from '../../pages/Account'; let bulkUpdateForm: BulkUpdatePage; async function updateBulkFields(fields) { @@ -31,6 +33,8 @@ test.describe('Bulk update', () => { context = await setup({ page, isEmptyProject: true }); dashboard = new DashboardPage(page, context.project); bulkUpdateForm = dashboard.bulkUpdateForm; + const accountPage: AccountPage = new AccountPage(page); + const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); api = new Api({ baseURL: `http://localhost:8080/`, @@ -42,6 +46,10 @@ test.describe('Bulk update', () => { table = await createDemoTable({ context, type: 'textBased', recordCnt: 50 }); await page.reload(); + await accountLicensePage.goto(); + await accountLicensePage.saveLicenseKey('1234567890'); + await dashboard.goto(); + await dashboard.treeView.openTable({ title: 'textBased' }); // Open bulk update form @@ -127,6 +135,8 @@ test.describe('Bulk update', () => { context = await setup({ page, isEmptyProject: true }); dashboard = new DashboardPage(page, context.project); bulkUpdateForm = dashboard.bulkUpdateForm; + const accountPage: AccountPage = new AccountPage(page); + const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); api = new Api({ baseURL: `http://localhost:8080/`, @@ -138,6 +148,10 @@ test.describe('Bulk update', () => { table = await createDemoTable({ context, type: 'numberBased', recordCnt: 50 }); await page.reload(); + await accountLicensePage.goto(); + await accountLicensePage.saveLicenseKey('1234567890'); + await dashboard.goto(); + await dashboard.treeView.openTable({ title: 'numberBased' }); // Open bulk update form @@ -197,6 +211,8 @@ test.describe('Bulk update', () => { context = await setup({ page, isEmptyProject: true }); dashboard = new DashboardPage(page, context.project); bulkUpdateForm = dashboard.bulkUpdateForm; + const accountPage: AccountPage = new AccountPage(page); + const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); api = new Api({ baseURL: `http://localhost:8080/`, @@ -208,6 +224,10 @@ test.describe('Bulk update', () => { table = await createDemoTable({ context, type: 'selectBased', recordCnt: 50 }); await page.reload(); + await accountLicensePage.goto(); + await accountLicensePage.saveLicenseKey('1234567890'); + await dashboard.goto(); + await dashboard.treeView.openTable({ title: 'selectBased' }); // Open bulk update form @@ -260,6 +280,8 @@ test.describe('Bulk update', () => { context = await setup({ page, isEmptyProject: true }); dashboard = new DashboardPage(page, context.project); bulkUpdateForm = dashboard.bulkUpdateForm; + const accountPage: AccountPage = new AccountPage(page); + const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); api = new Api({ baseURL: `http://localhost:8080/`, @@ -271,6 +293,10 @@ test.describe('Bulk update', () => { table = await createDemoTable({ context, type: 'miscellaneous', recordCnt: 50 }); await page.reload(); + await accountLicensePage.goto(); + await accountLicensePage.saveLicenseKey('1234567890'); + await dashboard.goto(); + await dashboard.treeView.openTable({ title: 'miscellaneous' }); // Open bulk update form @@ -323,6 +349,8 @@ test.describe('Bulk update', () => { context = await setup({ page, isEmptyProject: true }); dashboard = new DashboardPage(page, context.project); bulkUpdateForm = dashboard.bulkUpdateForm; + const accountPage: AccountPage = new AccountPage(page); + const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); api = new Api({ baseURL: `http://localhost:8080/`, @@ -334,6 +362,10 @@ test.describe('Bulk update', () => { table = await createDemoTable({ context, type: 'dateTimeBased', recordCnt: 50 }); await page.reload(); + await accountLicensePage.goto(); + await accountLicensePage.saveLicenseKey('1234567890'); + await dashboard.goto(); + await dashboard.treeView.openTable({ title: 'dateTimeBased' }); // Open bulk update form From 0487c96565ac54aeb2527499404720a64e38f68a Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:11:14 +0530 Subject: [PATCH 04/10] test: waitFor license page render Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/pages/Account/License.ts | 1 + tests/playwright/tests/db/bulkUpdate.spec.ts | 175 ++++--------------- 2 files changed, 34 insertions(+), 142 deletions(-) diff --git a/tests/playwright/pages/Account/License.ts b/tests/playwright/pages/Account/License.ts index 8501ed0864..b71d0afe03 100644 --- a/tests/playwright/pages/Account/License.ts +++ b/tests/playwright/pages/Account/License.ts @@ -28,6 +28,7 @@ export class AccountLicensePage extends BasePage { } async saveLicenseKey(licenseKey: string) { + await this.get().waitFor({ state: 'visible' }); await this.get().fill(licenseKey); await this.getSaveButton().click(); await this.verifyToast({ message: 'License key updated' }); diff --git a/tests/playwright/tests/db/bulkUpdate.spec.ts b/tests/playwright/tests/db/bulkUpdate.spec.ts index 9783dbd889..f1482f6fc3 100644 --- a/tests/playwright/tests/db/bulkUpdate.spec.ts +++ b/tests/playwright/tests/db/bulkUpdate.spec.ts @@ -8,6 +8,11 @@ import { AccountLicensePage } from '../../pages/Account/License'; import { AccountPage } from '../../pages/Account'; let bulkUpdateForm: BulkUpdatePage; +let dashboard: DashboardPage; +let context: any; +let api: Api; +let table; + async function updateBulkFields(fields) { // move all fields to active for (let i = 0; i < fields.length; i++) { @@ -23,37 +28,35 @@ async function updateBulkFields(fields) { await bulkUpdateForm.save({ awaitResponse: true }); } -test.describe('Bulk update', () => { - let dashboard: DashboardPage; - let context: any; - let api: Api; - let table; +async function beforeEachInit({ page, tableType }: { page: any; tableType: string }) { + context = await setup({ page, isEmptyProject: true }); + dashboard = new DashboardPage(page, context.project); + bulkUpdateForm = dashboard.bulkUpdateForm; + const accountPage: AccountPage = new AccountPage(page); + const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); + + api = new Api({ + baseURL: `http://localhost:8080/`, + headers: { + 'xc-auth': context.token, + }, + }); - test.beforeEach(async ({ page }) => { - context = await setup({ page, isEmptyProject: true }); - dashboard = new DashboardPage(page, context.project); - bulkUpdateForm = dashboard.bulkUpdateForm; - const accountPage: AccountPage = new AccountPage(page); - const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); + table = await createDemoTable({ context, type: tableType, recordCnt: 50 }); - table = await createDemoTable({ context, type: 'textBased', recordCnt: 50 }); - await page.reload(); + await accountLicensePage.goto(); + await accountLicensePage.saveLicenseKey('1234567890'); + await dashboard.goto(); - await accountLicensePage.goto(); - await accountLicensePage.saveLicenseKey('1234567890'); - await dashboard.goto(); + await dashboard.treeView.openTable({ title: tableType }); - await dashboard.treeView.openTable({ title: 'textBased' }); + // Open bulk update form + await dashboard.grid.updateAll(); +} - // Open bulk update form - await dashboard.grid.updateAll(); +test.describe('Bulk update', () => { + test.beforeEach(async ({ page }) => { + await beforeEachInit({ page, tableType: 'textBased' }); }); test('General- Click to add & remove', async () => { @@ -126,36 +129,8 @@ test.describe('Bulk update', () => { }); test.describe('Bulk update', () => { - let dashboard: DashboardPage; - let context: any; - let api: Api; - let table; - test.beforeEach(async ({ page }) => { - context = await setup({ page, isEmptyProject: true }); - dashboard = new DashboardPage(page, context.project); - bulkUpdateForm = dashboard.bulkUpdateForm; - const accountPage: AccountPage = new AccountPage(page); - const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'numberBased', recordCnt: 50 }); - await page.reload(); - - await accountLicensePage.goto(); - await accountLicensePage.saveLicenseKey('1234567890'); - await dashboard.goto(); - - await dashboard.treeView.openTable({ title: 'numberBased' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'numberBased' }); }); test('Number based', async () => { @@ -202,36 +177,8 @@ test.describe('Bulk update', () => { }); test.describe('Bulk update', () => { - let dashboard: DashboardPage; - let context: any; - let api: Api; - let table; - test.beforeEach(async ({ page }) => { - context = await setup({ page, isEmptyProject: true }); - dashboard = new DashboardPage(page, context.project); - bulkUpdateForm = dashboard.bulkUpdateForm; - const accountPage: AccountPage = new AccountPage(page); - const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'selectBased', recordCnt: 50 }); - await page.reload(); - - await accountLicensePage.goto(); - await accountLicensePage.saveLicenseKey('1234567890'); - await dashboard.goto(); - - await dashboard.treeView.openTable({ title: 'selectBased' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'selectBased' }); }); test('Select based', async () => { @@ -271,36 +218,8 @@ test.describe('Bulk update', () => { }); test.describe('Bulk update', () => { - let dashboard: DashboardPage; - let context: any; - let api: Api; - let table; - test.beforeEach(async ({ page }) => { - context = await setup({ page, isEmptyProject: true }); - dashboard = new DashboardPage(page, context.project); - bulkUpdateForm = dashboard.bulkUpdateForm; - const accountPage: AccountPage = new AccountPage(page); - const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'miscellaneous', recordCnt: 50 }); - await page.reload(); - - await accountLicensePage.goto(); - await accountLicensePage.saveLicenseKey('1234567890'); - await dashboard.goto(); - - await dashboard.treeView.openTable({ title: 'miscellaneous' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'miscellaneous' }); }); test('Miscellaneous (Checkbox, attachment)', async () => { @@ -340,36 +259,8 @@ test.describe('Bulk update', () => { }); test.describe('Bulk update', () => { - let dashboard: DashboardPage; - let context: any; - let api: Api; - let table; - test.beforeEach(async ({ page }) => { - context = await setup({ page, isEmptyProject: true }); - dashboard = new DashboardPage(page, context.project); - bulkUpdateForm = dashboard.bulkUpdateForm; - const accountPage: AccountPage = new AccountPage(page); - const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage); - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'dateTimeBased', recordCnt: 50 }); - await page.reload(); - - await accountLicensePage.goto(); - await accountLicensePage.saveLicenseKey('1234567890'); - await dashboard.goto(); - - await dashboard.treeView.openTable({ title: 'dateTimeBased' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'dateTimeBased' }); }); test('Date Time Based', async () => { From f150a7bf69908496726b0c52bafa8536b11a2cbc Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 16:38:22 +0530 Subject: [PATCH 05/10] test: license key wait kludge Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/pages/Account/License.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/playwright/pages/Account/License.ts b/tests/playwright/pages/Account/License.ts index b71d0afe03..ed5d1ce468 100644 --- a/tests/playwright/pages/Account/License.ts +++ b/tests/playwright/pages/Account/License.ts @@ -28,7 +28,10 @@ export class AccountLicensePage extends BasePage { } async saveLicenseKey(licenseKey: string) { - await this.get().waitFor({ state: 'visible' }); + // Kludge: fix me! + // await this.get().waitFor({ state: 'visible' }); + await this.rootPage.waitForTimeout(1000); + await this.get().fill(licenseKey); await this.getSaveButton().click(); await this.verifyToast({ message: 'License key updated' }); From 872550fd524021c15fa36e995ce296bc9870d0dd Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 16:59:43 +0530 Subject: [PATCH 06/10] Revert "refactor: context menu update option" This reverts commit de65ea3041b44aab1278d8061379c918e8a7baac. --- packages/nc-gui/components/smartsheet/Grid.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index b16ae4518d..659fe932e8 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -82,8 +82,6 @@ const isView = false let editEnabled = $ref(false) -const { appInfo } = useGlobal() - const { xWhere, isPkAvail, isSqlView, eventBus } = useSmartsheetStoreOrThrow() const visibleColLength = $computed(() => fields.value?.length) @@ -1131,7 +1129,7 @@ function addEmptyRow(row?: number) {
From 9f53f980276f0d498c7a0f2d23c67cf2f9876158 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 16:59:43 +0530 Subject: [PATCH 07/10] Revert "fix: add event handler based activeCell status" This reverts commit 539f0c2e95e34c09def9c3f5db48c4af54548d3c. --- packages/nc-gui/components/cell/MultiSelect.vue | 6 +++--- packages/nc-gui/components/cell/SingleSelect.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index 7a22788276..e2569578cc 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -48,11 +48,11 @@ const readOnly = inject(ReadonlyInj)! const isEditable = inject(EditModeInj, ref(false)) -const activeCell = inject(ActiveCellInj, ref(false)) +const _active = inject(ActiveCellInj, ref(false)) // use both ActiveCellInj or EditModeInj to determine the active state // since active will be false in case of form view -const active = computed(() => activeCell.value || isEditable.value) +const active = computed(() => _active.value || isEditable.value) const isPublic = inject(IsPublicInj, ref(false)) @@ -180,7 +180,7 @@ watch(isOpen, (n, _o) => { } }) -useSelectedCellKeyupListener(activeCell, (e) => { +useSelectedCellKeyupListener(active, (e) => { switch (e.key) { case 'Escape': isOpen.value = false diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue index d05eab3966..3b9dafbadb 100644 --- a/packages/nc-gui/components/cell/SingleSelect.vue +++ b/packages/nc-gui/components/cell/SingleSelect.vue @@ -42,11 +42,11 @@ const readOnly = inject(ReadonlyInj)! const isEditable = inject(EditModeInj, ref(false)) -const activeCell = inject(ActiveCellInj, ref(false)) +const _active = inject(ActiveCellInj, ref(false)) // use both ActiveCellInj or EditModeInj to determine the active state // since active will be false in case of form view -const active = computed(() => activeCell.value || isEditable.value) +const active = computed(() => _active.value || isEditable.value) const aselect = ref() @@ -119,7 +119,7 @@ watch(isOpen, (n, _o) => { } }) -useSelectedCellKeyupListener(activeCell, (e) => { +useSelectedCellKeyupListener(active, (e) => { switch (e.key) { case 'Escape': isOpen.value = false From 84e9bdb66a15bfc356b7e336f6a5074704bef596 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:49:19 +0530 Subject: [PATCH 08/10] test: rename file Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/tests/db/{bulkUpdate.spec.ts => updateBulk.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/playwright/tests/db/{bulkUpdate.spec.ts => updateBulk.ts} (100%) diff --git a/tests/playwright/tests/db/bulkUpdate.spec.ts b/tests/playwright/tests/db/updateBulk.ts similarity index 100% rename from tests/playwright/tests/db/bulkUpdate.spec.ts rename to tests/playwright/tests/db/updateBulk.ts From 7e8601847c36f16d7763e0d910739aea8dd49166 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:50:06 +0530 Subject: [PATCH 09/10] Revert "Revert "fix: add event handler based activeCell status"" This reverts commit 9f53f980276f0d498c7a0f2d23c67cf2f9876158. --- packages/nc-gui/components/cell/MultiSelect.vue | 6 +++--- packages/nc-gui/components/cell/SingleSelect.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index e2569578cc..7a22788276 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -48,11 +48,11 @@ const readOnly = inject(ReadonlyInj)! const isEditable = inject(EditModeInj, ref(false)) -const _active = inject(ActiveCellInj, ref(false)) +const activeCell = inject(ActiveCellInj, ref(false)) // use both ActiveCellInj or EditModeInj to determine the active state // since active will be false in case of form view -const active = computed(() => _active.value || isEditable.value) +const active = computed(() => activeCell.value || isEditable.value) const isPublic = inject(IsPublicInj, ref(false)) @@ -180,7 +180,7 @@ watch(isOpen, (n, _o) => { } }) -useSelectedCellKeyupListener(active, (e) => { +useSelectedCellKeyupListener(activeCell, (e) => { switch (e.key) { case 'Escape': isOpen.value = false diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue index 3b9dafbadb..d05eab3966 100644 --- a/packages/nc-gui/components/cell/SingleSelect.vue +++ b/packages/nc-gui/components/cell/SingleSelect.vue @@ -42,11 +42,11 @@ const readOnly = inject(ReadonlyInj)! const isEditable = inject(EditModeInj, ref(false)) -const _active = inject(ActiveCellInj, ref(false)) +const activeCell = inject(ActiveCellInj, ref(false)) // use both ActiveCellInj or EditModeInj to determine the active state // since active will be false in case of form view -const active = computed(() => _active.value || isEditable.value) +const active = computed(() => activeCell.value || isEditable.value) const aselect = ref() @@ -119,7 +119,7 @@ watch(isOpen, (n, _o) => { } }) -useSelectedCellKeyupListener(active, (e) => { +useSelectedCellKeyupListener(activeCell, (e) => { switch (e.key) { case 'Escape': isOpen.value = false From 964d185bbe4c153300d7523b5f78a0acf1ac9079 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:50:06 +0530 Subject: [PATCH 10/10] Revert "Revert "refactor: context menu update option"" This reverts commit 872550fd524021c15fa36e995ce296bc9870d0dd. --- packages/nc-gui/components/smartsheet/Grid.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 659fe932e8..b16ae4518d 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -82,6 +82,8 @@ const isView = false let editEnabled = $ref(false) +const { appInfo } = useGlobal() + const { xWhere, isPkAvail, isSqlView, eventBus } = useSmartsheetStoreOrThrow() const visibleColLength = $computed(() => fields.value?.length) @@ -1129,7 +1131,7 @@ function addEmptyRow(row?: number) {