From 20cd949df6ea1d14dbd275fe01e2cbd2cc3dcb1d Mon Sep 17 00:00:00 2001 From: taiebot <13300652+taiebot@users.noreply.github.com> Date: Mon, 3 Aug 2026 21:32:02 +0200 Subject: [PATCH] Fix(embedded) : column order, sort, scrolls overlays, refresh, table height * Fix: column order for embedded table Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * fix(widget): use fresh store data for rows/columns in ContentReferenceWidget Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * Fix embed col order (#12) * Fix: column order for embedded table Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * fix(widget): use fresh store data for rows/columns in ContentReferenceWidget Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> --------- Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * Embed scroll (#11) * Adjust height and z-index in ContentReferenceWidget (#7) Signed-off-by: taiebot * Fix Change height of tables-content-widget to auto Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> --------- Signed-off-by: taiebot Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * Fix: enable sorting on ContentReferenceWidget Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * Fix watcher for localViewSetting with debug logging Added a watcher for localViewSetting to log changes for debugging purposes. Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * Fix Remove debug watcher for localViewSetting Removed temporary debug watcher for localViewSetting. Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> * Fix again Refactor loadColumnsFromBE to improve column sorting logic and add comments for clarity. Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> --------- Signed-off-by: taiebot <13300652+taiebot@users.noreply.github.com> Signed-off-by: taiebot --- src/store/data.js | 25 +++--- src/views/ContentReferenceWidget.vue | 116 ++++++++++++++++++--------- 2 files changed, 90 insertions(+), 51 deletions(-) diff --git a/src/store/data.js b/src/store/data.js index 75fc23a92f..1ef85f989e 100644 --- a/src/store/data.js +++ b/src/store/data.js @@ -91,24 +91,27 @@ export const useDataStore = defineStore('data', { this.loading[stateId] = false return columns }, - + async loadColumnsFromBE({ view, tableId }) { let allColumns = await this.getColumnsFromBE({ tableId, viewId: view?.id }) if (view) { - // Transform array to object for faster access + // Meta columns aren't real DB columns, so they never come back + // from the fetch above -- append any this view has settings for. const columnSettingsMap = view.columnSettings?.reduce((acc, item) => { acc[item.columnId] = item return acc }, {}) ?? {} - allColumns = allColumns.concat(MetaColumns.filter(col => columnSettingsMap[col.id])) - if (view.columnSettings) { - allColumns = allColumns.sort((a, b) => { - const orderA = columnSettingsMap[a.id]?.order ?? Number.MAX_SAFE_INTEGER - const orderB = columnSettingsMap[b.id]?.order ?? Number.MAX_SAFE_INTEGER - return orderA - orderB - }) - } + + // Real columns carry their own order via viewColumnInformation; + // meta columns fall back to columnSettingsMap since they were + // just concatenated above and never went through server-side + // enhancement. + allColumns = allColumns.sort((a, b) => { + const orderA = a.viewColumnInformation?.order ?? columnSettingsMap[a.id]?.order ?? Number.MAX_SAFE_INTEGER + const orderB = b.viewColumnInformation?.order ?? columnSettingsMap[b.id]?.order ?? Number.MAX_SAFE_INTEGER + return orderA - orderB + }) } else { // no view: keep the backend-ordered result (ColumnService::findAllByTable already applies columnOrder) } @@ -116,7 +119,7 @@ export const useDataStore = defineStore('data', { this.columns[stateId] = allColumns return true }, - + async loadPublicColumnsFromBE({ token }) { const stateId = 'public-' + token this.loading[stateId] = true diff --git a/src/views/ContentReferenceWidget.vue b/src/views/ContentReferenceWidget.vue index f4749867d1..fca62f12d6 100644 --- a/src/views/ContentReferenceWidget.vue +++ b/src/views/ContentReferenceWidget.vue @@ -19,17 +19,18 @@
- + @@ -249,14 +278,18 @@ export default { .tables-content-widget { min-height: max(50vh, 200px); - height: 50vh; + height: auto; + max-height: calc(100dvh - 40px); overflow: scroll; + overscroll-behavior: contain; + isolation: isolate; & .header { position: sticky; top: 0; inset-inline-start: 0; - z-index: 1; + z-index: 7; + background-color: var(--color-main-background); :where(.options) { position: sticky; @@ -285,8 +318,11 @@ export default { .nc-table { min-width: var(--widget-content-width); - :where(.options.row) { - display: none; + :deep(.options.row) { + height: 0 !important; + overflow: hidden !important; + margin: 0 !important; + padding: 0 !important; } :where(thead) {