From 18d1d389bee64c248da4e457f0778c96507f4a5e Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Fri, 2 Oct 2026 12:43:50 +0000 Subject: [PATCH] Poster section element: card-action="dashboard" turns each card's sticker into Show dashboard and dispatches dxm-poster-dashboard for the host (absent keeps Show on map) --- .../components/poster/PosterSectionView.vue | 21 ++++++++++++++++++- library/elements/posterSectionConfig.js | 5 ++++- library/elements/posterSectionElement.js | 4 +++- library/i18n/locales/ar/posterCard.json | 4 ++++ library/i18n/locales/de/posterCard.json | 4 ++++ library/i18n/locales/en/posterCard.json | 4 ++++ library/i18n/locales/es/posterCard.json | 4 ++++ library/i18n/locales/fr/posterCard.json | 4 ++++ library/i18n/locales/hi/posterCard.json | 4 ++++ library/i18n/locales/it/posterCard.json | 4 ++++ library/i18n/locales/pt/posterCard.json | 4 ++++ library/i18n/locales/ro/posterCard.json | 4 ++++ library/i18n/locales/ru/posterCard.json | 4 ++++ library/i18n/locales/zh/posterCard.json | 4 ++++ 14 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 library/i18n/locales/ar/posterCard.json create mode 100644 library/i18n/locales/de/posterCard.json create mode 100644 library/i18n/locales/en/posterCard.json create mode 100644 library/i18n/locales/es/posterCard.json create mode 100644 library/i18n/locales/fr/posterCard.json create mode 100644 library/i18n/locales/hi/posterCard.json create mode 100644 library/i18n/locales/it/posterCard.json create mode 100644 library/i18n/locales/pt/posterCard.json create mode 100644 library/i18n/locales/ro/posterCard.json create mode 100644 library/i18n/locales/ru/posterCard.json create mode 100644 library/i18n/locales/zh/posterCard.json diff --git a/library/components/poster/PosterSectionView.vue b/library/components/poster/PosterSectionView.vue index c7cf74aa9..19c8548f7 100644 --- a/library/components/poster/PosterSectionView.vue +++ b/library/components/poster/PosterSectionView.vue @@ -1,7 +1,7 @@ @@ -55,11 +71,14 @@ const noneLine = computed(() => t('poster.sectionNone', { scope: String(cfg.valu 's attributes → its profile-config. Pure (no Vue), so it is testable on its own. -export const ATTRS = ['type', 'scope', 'collapsible', 'collapsed', 'locale', 'assets-base', 'api-base-url', 'is-dark', 'columns', 'min-card-px', 'show-header'] +export const ATTRS = ['type', 'scope', 'collapsible', 'collapsed', 'locale', 'assets-base', 'api-base-url', 'is-dark', 'columns', 'min-card-px', 'show-header', 'card-action'] export const TAG = 'dxm-poster-section' export function posterSectionConfig(el) { @@ -19,6 +19,9 @@ export function posterSectionConfig(el) { // show-header="false": no section head, so the HOST's own layout is the header (a key only then: every other host's // config is unchanged). The head is also the collapse toggle, so a headless section never collapses (PosterSectionView). if (flag('show-header', true) === false) cfg.showHeader = false + // card-action="dashboard": each card's sticker reads "Show dashboard" and asks the HOST to open its own page + // (PosterSectionView dispatches dxm-poster-dashboard). Only a known value sets a key; absent = "Show on map". + if (a('card-action') === 'dashboard') cfg.cardAction = 'dashboard' return cfg } diff --git a/library/elements/posterSectionElement.js b/library/elements/posterSectionElement.js index 799d9df41..7eb1fc7b4 100644 --- a/library/elements/posterSectionElement.js +++ b/library/elements/posterSectionElement.js @@ -6,7 +6,9 @@ * Attributes: type (default "country"), scope (a region / continent / list key), collapsible (default on; * collapsible="false" turns it off), collapsed (start shut), locale, assets-base, api-base-url, is-dark, columns * (posters per row, 1-5), min-card-px (the narrowest a card gets before a row holds one fewer), show-header (default - * on; show-header="false" hides the section's head so the host's layout is its header). + * on; show-header="false" hides the section's head so the host's layout is its header), card-action ("dashboard": each + * card reads "Show dashboard" and dispatches a bubbling, composed dxm-poster-dashboard { type, id, iso3, name, scope } for + * the host to open its own page; absent = "Show on map"). * They are mapped into the standard element's profile-config, so the element keeps defineMapElement's per-instance * i18n and store, and the profile (PosterSectionView.vue) reads them like every other profile reads its config. * Any bundle can call registerPosterSectionElement(); a second call is a no-op. diff --git a/library/i18n/locales/ar/posterCard.json b/library/i18n/locales/ar/posterCard.json new file mode 100644 index 000000000..a8cb18d1c --- /dev/null +++ b/library/i18n/locales/ar/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "عرض لوحة المعلومات", + "showDashboardAria": "عرض لوحة معلومات {label}" +} diff --git a/library/i18n/locales/de/posterCard.json b/library/i18n/locales/de/posterCard.json new file mode 100644 index 000000000..30bee41fb --- /dev/null +++ b/library/i18n/locales/de/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Dashboard anzeigen", + "showDashboardAria": "Dashboard anzeigen: {label}" +} diff --git a/library/i18n/locales/en/posterCard.json b/library/i18n/locales/en/posterCard.json new file mode 100644 index 000000000..3fc0c30ad --- /dev/null +++ b/library/i18n/locales/en/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Show dashboard", + "showDashboardAria": "Show the {label} dashboard" +} diff --git a/library/i18n/locales/es/posterCard.json b/library/i18n/locales/es/posterCard.json new file mode 100644 index 000000000..4c5842bb7 --- /dev/null +++ b/library/i18n/locales/es/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Ver el panel", + "showDashboardAria": "Ver el panel de {label}" +} diff --git a/library/i18n/locales/fr/posterCard.json b/library/i18n/locales/fr/posterCard.json new file mode 100644 index 000000000..baad954bf --- /dev/null +++ b/library/i18n/locales/fr/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Voir le tableau de bord", + "showDashboardAria": "Voir le tableau de bord : {label}" +} diff --git a/library/i18n/locales/hi/posterCard.json b/library/i18n/locales/hi/posterCard.json new file mode 100644 index 000000000..576bade51 --- /dev/null +++ b/library/i18n/locales/hi/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "डैशबोर्ड देखें", + "showDashboardAria": "{label} डैशबोर्ड देखें" +} diff --git a/library/i18n/locales/it/posterCard.json b/library/i18n/locales/it/posterCard.json new file mode 100644 index 000000000..4924aeb41 --- /dev/null +++ b/library/i18n/locales/it/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Vedi il cruscotto", + "showDashboardAria": "Vedi il cruscotto di {label}" +} diff --git a/library/i18n/locales/pt/posterCard.json b/library/i18n/locales/pt/posterCard.json new file mode 100644 index 000000000..3bfedd85f --- /dev/null +++ b/library/i18n/locales/pt/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Ver o painel", + "showDashboardAria": "Ver o painel: {label}" +} diff --git a/library/i18n/locales/ro/posterCard.json b/library/i18n/locales/ro/posterCard.json new file mode 100644 index 000000000..c23322a40 --- /dev/null +++ b/library/i18n/locales/ro/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Vezi panoul", + "showDashboardAria": "Vezi panoul {label}" +} diff --git a/library/i18n/locales/ru/posterCard.json b/library/i18n/locales/ru/posterCard.json new file mode 100644 index 000000000..cdd091303 --- /dev/null +++ b/library/i18n/locales/ru/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "Открыть панель", + "showDashboardAria": "Открыть панель: {label}" +} diff --git a/library/i18n/locales/zh/posterCard.json b/library/i18n/locales/zh/posterCard.json new file mode 100644 index 000000000..dab3b8a31 --- /dev/null +++ b/library/i18n/locales/zh/posterCard.json @@ -0,0 +1,4 @@ +{ + "showDashboard": "查看仪表板", + "showDashboardAria": "查看 {label} 仪表板" +}