Skip to content

Conversation

QuentiumYT
Copy link
Contributor

@QuentiumYT QuentiumYT commented Apr 29, 2025

Ajout du watch de toutes les props pour rerender les graphiques / tableaux.
Basé sur #44 avec moins de rewrite des options.

Correction aussi d'une erreur sur les composants unitaires qui avaient un shadow root quand même (erreur de CSS si ils étaient utilisés)

Closes #43
Closes #44
Resolves codegouvfr/react-dsfr#391

Copy link

netlify bot commented Apr 29, 2025

Deploy Preview for dsfr-chart ready!

Name Link
🔨 Latest commit ee0230c
🔍 Latest deploy log https://app.netlify.com/sites/dsfr-chart/deploys/68108340a799b300089b7f66
😎 Deploy Preview https://deploy-preview-47--dsfr-chart.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds watchers on all component props to trigger chart/table re-renders and fixes the incorrect shadow root configuration for unit components. Key changes include:

  • Adding a watcher on $props in multiple Vue chart components to automatically refresh the charts upon prop updates.
  • Updating custom element definitions in chart files to remove duplicate shadow root settings.
  • Correcting the shadow root configuration in unit component definitions as reflected in CONTRIBUTING.md.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

File Description
src/components/*.vue Added watcher on $props to trigger re-rendering of charts
src/charts/*.js Updated defineCustomElement calls to pass { shadowRoot: false } and simplified customElements.define calls
CONTRIBUTING.md Updated custom element definition example to remove duplicate shadowRoot configuration
Comments suppressed due to low confidence (2)

CONTRIBUTING.md:52

  • [nitpick] The custom element tag 'bar-line-chart' does not match the component name 'NewChart'. Please verify that this naming is intentional.
customElements.define('bar-line-chart', NewChartElement);

src/components/RadarChart.vue:122

  • There are no tests covering the new watcher behavior on $props. Consider adding test cases to verify that prop changes correctly trigger the intended chart re-rendering.
watch: {

@zellerbaptiste zellerbaptiste changed the base branch from main to dev April 29, 2025 09:06
@zellerbaptiste zellerbaptiste changed the base branch from dev to main April 29, 2025 09:08
@zellerbaptiste zellerbaptiste changed the base branch from main to dev April 29, 2025 09:10
@zellerbaptiste zellerbaptiste changed the title fix/watch props fix(render): watch props Apr 29, 2025
@zellerbaptiste zellerbaptiste merged commit fdd3d68 into GouvernementFR:dev May 5, 2025
4 checks passed
@QuentiumYT QuentiumYT deleted the fix/watch-props branch August 27, 2025 08:40
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.

Compatibility with @gouvfr/dsfr-chart 2.x Plus possible de modifier dynamiquement les charts
2 participants