Merge pull request #14422 from Budibase/fix/saving-full-ds-in-datasource-settings

Fix saving huge amounts of unnecessary data in settings
This commit is contained in:
Andrew Kingston 2024-08-21 10:03:14 +01:00 committed by GitHub
commit 2fbc30ab08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 9 deletions

View File

@ -29,7 +29,7 @@
on:click={() => onSelect(data)} on:click={() => onSelect(data)}
> >
<span class="spectrum-Menu-itemLabel"> <span class="spectrum-Menu-itemLabel">
{data.datasource?.name ? `${data.datasource.name} - ` : ""}{data.label} {data.datasourceName ? `${data.datasourceName} - ` : ""}{data.label}
</span> </span>
<svg <svg
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon" class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"

View File

@ -1,12 +1,14 @@
export const datasourceSelect = { export const datasourceSelect = {
table: (table, datasources) => ({ table: (table, datasources) => {
label: table.name, const sourceId = table.sourceId || table.datasourceId
tableId: table._id, const datasource = datasources.find(ds => ds._id === sourceId)
type: "table", return {
datasource: datasources.find( label: table.name,
datasource => datasource._id === table.sourceId || table.datasourceId tableId: table._id,
), type: "table",
}), datasourceName: datasource?.name,
}
},
viewV2: view => ({ viewV2: view => ({
...view, ...view,
label: view.name, label: view.name,