From 3606fd9a0ae1c55fe8af14d7fe09b66deec8e2a6 Mon Sep 17 00:00:00 2001 From: Padreug Date: Sun, 24 May 2026 18:51:51 +0200 Subject: [PATCH] feat(admin): Owner column on All Users' Events card Adds the event's wallet owner (user_id) as the first column of the admin-only All Users' Events table so cross-tenant rows are attributable at a glance. Server-side join: GET /events/all now resolves each event.wallet -> wallet.user and stamps the result on the response as wallet_user_id. Frontend gets a dedicated allUsersEventsTable.columns definition so the user's own-events table stays unchanged. Follow-up #22 covers letting the admin actually edit those events once attributed. --- static/js/index.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ static/js/index.vue | 2 +- views_api.py | 19 ++++++++++++++++--- 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index a65f5f8..2b4bcb9 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -14,6 +14,51 @@ window.PageEvents = { settings: { auto_approve: false }, + allUsersEventsTable: { + // Shown on the admin All Users' Events card. Includes the + // wallet owner (`wallet_user_id` resolved server-side) so + // cross-tenant rows are attributable to a user. + columns: [ + { + name: 'wallet_user_id', + align: 'left', + label: 'Owner', + field: 'wallet_user_id' + }, + {name: 'id', align: 'left', label: 'ID', field: 'id'}, + {name: 'name', align: 'left', label: 'Name', field: 'name'}, + { + name: 'event_start_date', + align: 'left', + label: 'Start date', + field: 'event_start_date' + }, + { + name: 'event_end_date', + align: 'left', + label: 'End date', + field: 'event_end_date' + }, + { + name: 'closing_date', + align: 'left', + label: 'Ticket close', + field: 'closing_date' + }, + { + name: 'canceled', + align: 'left', + label: 'Canceled', + field: row => { + if (row.extra && row.extra.conditional && row.canceled) { + return 'Yes' + } + return 'No' + } + }, + {name: 'status', align: 'left', label: 'Status', field: 'status'} + ] + }, eventsTable: { columns: [ {name: 'id', align: 'left', label: 'ID', field: 'id'}, diff --git a/static/js/index.vue b/static/js/index.vue index 4b97fab..6e6891f 100644 --- a/static/js/index.vue +++ b/static/js/index.vue @@ -384,7 +384,7 @@ flat :rows="allUserEvents" row-key="id" - :columns="eventsTable.columns" + :columns="allUsersEventsTable.columns" :pagination="{rowsPerPage: 10}" >