From 9d8bc1d81bb3e4264e7c120780b2340f23a7c45e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 23 Dec 2022 11:16:57 +0530 Subject: [PATCH] fix(gui): keep parsed meta data in cache Signed-off-by: Pranav C --- packages/nocodb/src/lib/models/View.ts | 6 ++++-- .../pages/Dashboard/Grid/Column/LTAR/ChildList.ts | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/lib/models/View.ts b/packages/nocodb/src/lib/models/View.ts index cc83d8bfea..1963ded461 100644 --- a/packages/nocodb/src/lib/models/View.ts +++ b/packages/nocodb/src/lib/models/View.ts @@ -852,8 +852,6 @@ export default class View implements ViewType { 'meta', 'uuid', ]); - // if meta data defined then stringify it - stringifyMetaProp(updateObj); // get existing cache const key = `${CacheScope.VIEW}:${viewId}`; @@ -870,6 +868,10 @@ export default class View implements ViewType { // set cache await NocoCache.set(key, o); } + + // if meta data defined then stringify it + stringifyMetaProp(updateObj); + // set meta await ncMeta.metaUpdate(null, null, MetaTable.VIEWS, updateObj, viewId); return this.get(viewId); diff --git a/tests/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts b/tests/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts index d881b378f8..140e1eb3f5 100644 --- a/tests/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts +++ b/tests/playwright/pages/Dashboard/Grid/Column/LTAR/ChildList.ts @@ -20,7 +20,9 @@ export class ChildList extends BasePage { // button: Link to 'City' // icon: reload await expect(this.get().locator(`.ant-modal-title`)).toHaveText(`Child list`); - await expect(await this.get().locator(`button:has-text("Link to '${linkField}'")`).isVisible()).toBeTruthy(); + await expect( + await this.get().locator(`button:has-text("Link to"):hasText("${linkField}'")`).isVisible() + ).toBeTruthy(); await expect(await this.get().locator(`[data-testid="nc-child-list-reload"]`).isVisible()).toBeTruthy(); // child list body validation (card count, card title)