-
Notifications
You must be signed in to change notification settings - Fork 4
task/CDD-3293-CMS-FIX-Dual-category-chart-component #3208
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
Open
jeanpierrefouche-ukhsa
wants to merge
5
commits into
main
Choose a base branch
from
task/CDD-3293-CMS-FIX-Dual-category-chart-component
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f10a091
task/CDD-3293-CMS-FIX-Dual-category-chart-component
jeanpierrefouche-ukhsa d4f90a8
task/CDD-3293-CMS-FIX-Dual-category-chart-component
jeanpierrefouche-ukhsa 8110963
task/CDD-3293-CMS-FIX-Dual-category-chart-component
jeanpierrefouche-ukhsa d0122b8
task/CDD-3293-CMS-FIX-Dual-category-chart-component
jeanpierrefouche-ukhsa 6a3a47f
Merge branch 'main' into task/CDD-3293-CMS-FIX-Dual-category-chart-co…
phill-stanley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
changelog/CDD-3293-CMS-FIX-Dual-category-chart-component.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # CDD-3293-CMS-FIX-Dual-category-chart-component | ||
|
|
||
| # Author | ||
| Jean-Pierre Fouche | ||
|
|
||
| # Ticket | ||
| [CDD-3293-CMS-FIX-Dual-category-chart-component](https://ukhsa.atlassian.net/browse/CDD-3293) | ||
|
|
||
| # Date | ||
| 26 May 2026 | ||
|
|
||
| # Description | ||
|
|
||
| This change fixes the issue described in the above ticket. | ||
|
|
||
| Dual Category Charts are managed in the Wagtail CMS admin interface with two important fields: | ||
|
|
||
| ```mermaid | ||
| graph TD | ||
| xaxis["x-axis"] --> | links to | PrimaryFieldValues["Primary Field Values</br>(single multi-select <select> element)"] | ||
| SecondCategory["Second Category"] --> | links to | DualChartSegments["Dual Chart Segments</br>(multiple <select> elements)"] | ||
| ``` | ||
|
|
||
| # Expected Behaviour | ||
|
|
||
| When the x-axis field is selected for a particular "primary category" e.g. "geography", the Primary Field Values `<select>` element should display only the appropriate regions e.g. Wales, Scotland etc. | ||
|
|
||
| Similarly, when the Secondary Category is selected, the individual `<select>` elements in each "segment" must be updated accordingly to show the related options. | ||
|
|
||
| There are in effect two sets of values, one for the category ("x-axis" / "Secondary Category") and one for the sub category selectors. The x-axis and Secondary Category selectors both use the same options in each case. | ||
|
|
||
| # Fix | ||
|
|
||
| ## Isolate CSS Queries to Chart Scope | ||
|
|
||
| CSS queries have been modified to stay within the scope of the root node in which the chart has been created, thus doing away with `document.getElementById` and the like. | ||
| We now do (for example) `rootNode.querySelector` and this keeps the queries to the right chart. | ||
|
|
||
| ## DualCategoryChartCardBlockDefinition behaves as a singleton | ||
|
|
||
| `DualCategoryChartCardBlockDefinition` has been changed to create chart instancesm using a new class, `DualCategoryChartCardBlock`. This fixes the issue of leakage between two instances of "Dual Category Chart". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.