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 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) {
diff --git a/packages/nc-lib-gui/package.json b/packages/nc-lib-gui/package.json index 51597abe5f..0c29ea4b4f 100644 --- a/packages/nc-lib-gui/package.json +++ b/packages/nc-lib-gui/package.json @@ -1,6 +1,6 @@ { "name": "nc-lib-gui", - "version": "0.109.2", + "version": "0.109.3", "description": "NocoDB GUI", "author": { "name": "NocoDB", diff --git a/packages/nocodb-sdk/package.json b/packages/nocodb-sdk/package.json index d29e03a38c..bfd8ae9f4a 100644 --- a/packages/nocodb-sdk/package.json +++ b/packages/nocodb-sdk/package.json @@ -1,6 +1,6 @@ { "name": "nocodb-sdk", - "version": "0.109.2", + "version": "0.109.3", "description": "NocoDB SDK", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 2b3209e7d8..d613f560eb 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -1,6 +1,6 @@ { "name": "nocodb", - "version": "0.109.2", + "version": "0.109.3", "description": "NocoDB Backend", "main": "dist/bundle.js", "author": { @@ -119,7 +119,7 @@ "mysql2": "^3.2.0", "nanoid": "^3.1.20", "nc-help": "^0.2.88", - "nc-lib-gui": "0.109.2", + "nc-lib-gui": "0.109.3", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", "nocodb-sdk": "file:../nocodb-sdk", diff --git a/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts b/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts index 962d8dab64..1f667a1789 100644 --- a/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts @@ -44,6 +44,11 @@ async function upgradeModelRelations({ ncMeta, ); + // if colOptions not found then skip + if (!colOptions) { + continue; + } + switch (colOptions.type) { case RelationTypes.HAS_MANY: { @@ -77,17 +82,17 @@ async function upgradeModelRelations({ childTable: relation.tn, foreignKeyName: relation.cstn, }); - } - // skip postgres since we were already creating the index while creating the relation - if (ncMeta.knex.clientType() !== 'pg') { - // create a new index for the column - const indexArgs = { - columns: [relation.cn], - tn: relation.tn, - non_unique: true, - }; - await sqlClient.indexCreate(indexArgs); + // skip postgres since we were already creating the index while creating the relation + if (ncMeta.knex.clientType() !== 'pg') { + // create a new index for the column + const indexArgs = { + columns: [relation.cn], + tn: relation.tn, + non_unique: true, + }; + await sqlClient.indexCreate(indexArgs); + } } } break; diff --git a/tests/playwright/pages/Account/License.ts b/tests/playwright/pages/Account/License.ts index 831567b9c7..d3fa5e32ac 100644 --- a/tests/playwright/pages/Account/License.ts +++ b/tests/playwright/pages/Account/License.ts @@ -32,6 +32,10 @@ export class AccountLicensePage extends BasePage { } async saveLicenseKey(licenseKey: string) { + // 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' }); diff --git a/tests/playwright/tests/db/bulkUpdate.spec.ts b/tests/playwright/tests/db/updateBulk.ts similarity index 73% rename from tests/playwright/tests/db/bulkUpdate.spec.ts rename to tests/playwright/tests/db/updateBulk.ts index c3b78d40a5..f1482f6fc3 100644 --- a/tests/playwright/tests/db/bulkUpdate.spec.ts +++ b/tests/playwright/tests/db/updateBulk.ts @@ -4,8 +4,15 @@ 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; +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++) { @@ -21,31 +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; - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); + table = await createDemoTable({ context, type: tableType, recordCnt: 50 }); + + await accountLicensePage.goto(); + await accountLicensePage.saveLicenseKey('1234567890'); + await dashboard.goto(); - table = await createDemoTable({ context, type: 'textBased', recordCnt: 50 }); - await page.reload(); + 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 () => { @@ -118,30 +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; - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'numberBased', recordCnt: 50 }); - await page.reload(); - - await dashboard.treeView.openTable({ title: 'numberBased' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'numberBased' }); }); test('Number based', async () => { @@ -188,30 +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; - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'selectBased', recordCnt: 50 }); - await page.reload(); - - await dashboard.treeView.openTable({ title: 'selectBased' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'selectBased' }); }); test('Select based', async () => { @@ -251,30 +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; - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'miscellaneous', recordCnt: 50 }); - await page.reload(); - - await dashboard.treeView.openTable({ title: 'miscellaneous' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'miscellaneous' }); }); test('Miscellaneous (Checkbox, attachment)', async () => { @@ -314,30 +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; - - api = new Api({ - baseURL: `http://localhost:8080/`, - headers: { - 'xc-auth': context.token, - }, - }); - - table = await createDemoTable({ context, type: 'dateTimeBased', recordCnt: 50 }); - await page.reload(); - - await dashboard.treeView.openTable({ title: 'dateTimeBased' }); - - // Open bulk update form - await dashboard.grid.updateAll(); + await beforeEachInit({ page, tableType: 'dateTimeBased' }); }); test('Date Time Based', async () => {