Skip to content

feat(charts): show charts cards in admin - #1210

Open
nicolaskempf57 wants to merge 15 commits into
mainfrom
feat/show-charts-cards-in-admin
Open

feat(charts): show charts cards in admin#1210
nicolaskempf57 wants to merge 15 commits into
mainfrom
feat/show-charts-cards-in-admin

Conversation

@nicolaskempf57

@nicolaskempf57 nicolaskempf57 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Closes datagouv/data.gouv.fr#2021

Show chart cards in the site administration

  • New /admin/site/charts page (superadmin) listing all charts as cards with pagination, plus a "Graphiques" entry in the admin sidebar. Cards link to the edit page /admin/beta/charts/{id}.
  • New ChartCard component in @datagouv/components-next (image or placeholder, title, producer, update date, views, description), with an xl media size on ObjectCard, a Chart type on Placeholder and an image field on the Chart type. Also showcased on /design/cards.
  • Chart edit page refactored: the page loads the chart (with LoadingBlock) and passes it to ChartConfigurator via an initialChart prop instead of chartId.
  • Admin fetches use server: false (/admin/** is server-rendered; SSR fetches bypass e2e mocks and caused hydration mismatches — same pattern as the metrics pages).
  • Tests: new e2e specs for the admin page and the card, plus chart-configurator tests for loading an existing chart (waiting for the echarts canvas before saving to fix a flaky image upload). tests/visualizations/ is 42/42 green on chromium, typecheck and lint pass.

Comment on lines +21 to +22
v-model="chartForm"
:initial-chart="chart"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the component is not using the v-model and recomputing the form based on the initial-chart, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True ! I'm updating so that initial-chart is only use for the first producer / resource / dataset

Comment thread tests/visualizations/admin-site-charts.spec.ts
Comment thread datagouv-components/src/components/ChartCard.vue
Comment thread components/Charts/AdminChartsPage.vue
Comment thread components/Charts/ChartConfigurator.vue Outdated
Comment thread tests/visualizations/admin-site-charts.spec.ts Outdated
Comment thread components/AdminSidebar/AdminSidebarMenu/AdminSidebarMenu.vue Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datastudio : Afficher les cartes de viz dans l'admin

2 participants