Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Accordion to extend from a GOVUKFrontendConfigurableComponent class #5456

Closed
3 tasks
Tracked by #5373
romaricpascal opened this issue Nov 4, 2024 · 1 comment · Fixed by #5475
Closed
3 tasks
Tracked by #5373
Assignees
Milestone

Comments

@romaricpascal
Copy link
Member

romaricpascal commented Nov 4, 2024

What

After regrouping the helpers related to configuration in their own module, add a new GOVUKFrontendConfigurableComponent class to the module and use it in the Accordion to replace how the accordion gathers the different configuration to merge and merges them.

Why

This will factor some shared code across components and allow us to provide the helper as a public API to our users.

Providing this as a function will allow its name to be mangled by minifiers, and, as discovered during the spikes, make it easier to type.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • Helpers related to configuration (normaliseDataset, mergeConfigurations and validateConfig) have been moved to a common/configuration.mjs file
  • A new GOVUKFrontendConfigurableComponent helper function has been added to the file, with its own test suite
  • The Accordion component uses this new function to compute its configuration
@romaricpascal
Copy link
Member Author

If it's not too late, I think we can add extractConfigByNamespace to the functions to move inside common/configuration.mjs.

@romaricpascal romaricpascal moved this to In progress 📝 in GOV.UK Design System cycle board Nov 7, 2024
@romaricpascal romaricpascal changed the title Refactor Accordion to use a getComponentConfiguration helper to compute its configuration Refactor Accordion to extend from a GOVUKConfigurableComponent class Nov 7, 2024
@romaricpascal romaricpascal changed the title Refactor Accordion to extend from a GOVUKConfigurableComponent class Refactor Accordion to extend from a GOVUKFrontendConfigurableComponent class Nov 7, 2024
@owenatgov owenatgov modified the milestone: 5.8.0 Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress 📝
4 participants