diff --git a/packages/server/src/api/controllers/row.js b/packages/server/src/api/controllers/row.js index d7dad88628..b1aad6d2ca 100644 --- a/packages/server/src/api/controllers/row.js +++ b/packages/server/src/api/controllers/row.js @@ -256,7 +256,9 @@ exports.search = async function(ctx) { } } - ctx.body = await linkRows.attachLinkInfo(appId, rows) + const table = await db.get(ctx.params.tableId) + + ctx.body = await enrichRows(appId, table, rows) } exports.fetchTableRows = async function(ctx) { diff --git a/packages/server/src/api/routes/row.js b/packages/server/src/api/routes/row.js index 3c36fe579b..be14910f3e 100644 --- a/packages/server/src/api/routes/row.js +++ b/packages/server/src/api/routes/row.js @@ -41,6 +41,7 @@ router ) .post( "/api/:tableId/rows/search", + paramResource("tableId"), authorized(PermissionTypes.TABLE, PermissionLevels.READ), rowController.search ) diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json index 7f30f10886..9d9d603f54 100644 --- a/packages/standard-components/manifest.json +++ b/packages/standard-components/manifest.json @@ -146,7 +146,8 @@ { "type": "text", "label": "No Rows Message", - "key": "noRowsMessage" + "key": "noRowsMessage", + "defaultValue": "No Rows" } ] }, diff --git a/packages/standard-components/src/Search.svelte b/packages/standard-components/src/Search.svelte index fc31645fc3..e3f91081de 100644 --- a/packages/standard-components/src/Search.svelte +++ b/packages/standard-components/src/Search.svelte @@ -16,7 +16,7 @@ export let table = [] export let columns = [] export let pageSize = 50 - export let noRowsMessage = "No Rows" + export let noRowsMessage let rows = [] let loaded = false @@ -94,23 +94,32 @@ }}> Reset - + - {#if rows.length > 0} - {#if $component.children === 0 && $builderStore.inBuilder} -
Add some components too
+ {#if loaded} + {#if rows.length > 0} + {#if $component.children === 0 && $builderStore.inBuilder} +Add some components too
+ {:else} + {#each rows as row} +Feed me some data
{:else} - {#each rows as row} -{noRowsMessage}
{/if} - {:else if loaded && $builderStore.inBuilder} -Feed me some data
- {:else} -{noRowsMessage}
{/if}