diff --git a/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts b/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts index 311e4ecb58..d68089001d 100644 --- a/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts +++ b/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts @@ -96,11 +96,11 @@ router.post( ); router.get( - '/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/mm/:colId', + '/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/mm/:columnId', catchError(publicMmList) ); router.get( - '/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/hm/:colId', + '/api/v1/db/public/shared-view/:sharedViewUuid/rows/:rowId/hm/:columnId', catchError(publicHmList) ); diff --git a/packages/nocodb/src/lib/services/dbData/index.ts b/packages/nocodb/src/lib/services/dbData/index.ts index 6bacb1f1b0..e7221b527e 100644 --- a/packages/nocodb/src/lib/services/dbData/index.ts +++ b/packages/nocodb/src/lib/services/dbData/index.ts @@ -131,9 +131,7 @@ export async function getDataList(param: { count = await baseModel.count(listArgs); } catch (e) { console.log(e); - NcError.internalServerError( - 'Internal Server Error, check server log for more details' - ); + NcError.internalServerError('Please check server log for more details'); } return new PagedResponseImpl(data, { @@ -642,9 +640,7 @@ export async function dataReadByViewId(param: { ); } catch (e) { console.log(e); - NcError.internalServerError( - 'Internal Server Error, check server log for more details' - ); + NcError.internalServerError('Please check server log for more details'); } } diff --git a/packages/nocodb/src/lib/services/public/publicData.svc.ts b/packages/nocodb/src/lib/services/public/publicData.svc.ts index 9fa100d312..c3c8975e9d 100644 --- a/packages/nocodb/src/lib/services/public/publicData.svc.ts +++ b/packages/nocodb/src/lib/services/public/publicData.svc.ts @@ -69,10 +69,7 @@ export async function dataList(param: { count = await baseModel.count(listArgs); } catch (e) { console.log(e); - // show empty result instead of throwing error here - // e.g. search some text in a numeric field - - NcError.internalServerError('Please try after some time'); + NcError.internalServerError('Please check server log for more details'); } return new PagedResponseImpl(data, { ...param.query, count }); @@ -294,6 +291,7 @@ export async function relDataList(param: { } const column = await Column.get({ colId: param.columnId }); + const colOptions = await column.getColOptions(); const model = await colOptions.getRelatedTable(); @@ -306,25 +304,27 @@ export async function relDataList(param: { dbDriver: await NcConnectionMgrv2.get(base), }); - const { ast } = await getAst({ + const { ast, dependencyFields } = await getAst({ query: param.query, model, extractOnlyPrimaries: true, }); let data = []; + let count = 0; + try { data = data = await nocoExecute( ast, - await baseModel.list(param.query), + await baseModel.list(dependencyFields), {}, - param.query + dependencyFields ); - count = await baseModel.count(param.query); + count = await baseModel.count(dependencyFields); } catch (e) { - // show empty result instead of throwing error here - // e.g. search some text in a numeric field + console.log(e); + NcError.internalServerError('Please check server log for more details'); } return new PagedResponseImpl(data, { ...param.query, count }); diff --git a/tests/playwright/pages/Dashboard/common/Cell/index.ts b/tests/playwright/pages/Dashboard/common/Cell/index.ts index bede598f4e..1b287cb595 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/index.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/index.ts @@ -264,9 +264,11 @@ export class CellPageObject extends BasePage { columnHeader, count, value, + verifyChildList = false, }: CellProps & { count?: number; value: string[]; + verifyChildList?: boolean; }) { // const count = value.length; const cell = await this.get({ index, columnHeader }); @@ -281,6 +283,27 @@ export class CellPageObject extends BasePage { for (let i = 0; i < value.length; ++i) { await expect(await chips.nth(i).locator('.name')).toHaveText(value[i]); } + + if (verifyChildList) { + // open child list + await this.get({ index, columnHeader }).hover(); + const arrow_expand = await this.get({ index, columnHeader }).locator('.nc-arrow-expand'); + + // arrow expand doesn't exist for bt columns + if (await arrow_expand.count()) { + await arrow_expand.click(); + + // wait for child list to open + await this.rootPage.waitForSelector('.nc-modal-child-list:visible'); + + // verify child list count & contents + const childList = await this.rootPage.locator('.ant-card:visible'); + expect(await childList.count()).toBe(count); + + // close child list + await this.rootPage.locator('.nc-modal-child-list').locator('button.ant-modal-close:visible').click(); + } + } } async unlinkVirtualCell({ index, columnHeader }: CellProps) { diff --git a/tests/playwright/tests/viewGridShare.spec.ts b/tests/playwright/tests/viewGridShare.spec.ts index b83bdde221..ec932816e1 100644 --- a/tests/playwright/tests/viewGridShare.spec.ts +++ b/tests/playwright/tests/viewGridShare.spec.ts @@ -90,7 +90,7 @@ test.describe('Shared view', () => { // verify virtual records for (const record of expectedVirtualRecordsByDb) { - await sharedPage.grid.cell.verifyVirtualCell(record); + await sharedPage.grid.cell.verifyVirtualCell({ ...record, verifyChildList: true }); } /**