MultiFieldRepeat page controller#609
Open
micolgiannelli2 wants to merge 41 commits into
Open
Conversation
…making this into a seprate component
Dashue
requested changes
Jun 16, 2026
| @@ -0,0 +1,18 @@ | |||
| Feature: Repeating multi field - add multiple sections | |||
There was a problem hiding this comment.
File is called addAndEditSection.featuure (spelling error)
Test does not edit
There's a fair bit of overlap in the tests, would it be easier to have a single one for add, edit and delete?
| And the summary card "Item 2" contains a row "Your name" with value "Bob" | ||
| And the summary card "Item 2" contains a row "Language" with value "Italian" | ||
| And the summary card "Item 2" has a "Change" link to "?view=1" | ||
| And the summary card "Item 2" has a "Remove" link to "?remove=1" No newline at end of file |
There was a problem hiding this comment.
Test doesn't actually verify deletion, should it or is it enough with verifying there's a link to remove?
| And the summary card "Item 2" has a "Change" link to "?view=1" | ||
| And the summary card "Item 2" has a "Remove" link to "?remove=1" | ||
| And I edit the summary card "Item 2" | ||
| // TODO: view syntax for editing a field that has already been pre-filled |
There was a problem hiding this comment.
Todo needs sorting
Again a fair bit of overlap in test coverage
This test doesn't seem to test anything more than "addAndDeleteSection.feature" ?
| ); | ||
|
|
||
| // State schema (Pass 2) — shape only | ||
| // TODO: fix landline number is no-longer read |
| name: String(index), // macro delete link → ?remove={{ data.name }} | ||
| title: this.cardTitle(index), // "Item 1" | ||
| index, | ||
| card: `?view=${index}`, // macro change link → href="{{ data.card }}" /// TODO: unsure Where this si actually used |
| // This somewhat duplicates the logic in Summary View Model --- consider whether to re-use the Summary View Model instead of having this logic in two places | ||
| // Decision to not do the above was postponed for now as it would require some refactoring of the Summary View Model | ||
| // The other suitable option would be to create a View Model that extends Summary View Model and contains this additional logic for handling multiple entries, and then use this new View Model in both the Summary Page Controller and the Repeated Multi Field Summary Page Controller | ||
| getViewModel(formData: any) { |
| title: this.cardTitle(index), // "Item 1" | ||
| index, | ||
| card: `?view=${index}`, // macro change link → href="{{ data.card }}" /// TODO: unsure Where this si actually used | ||
| items: (this.inputComponents ?? []).map((comp: any) => ({ |
| } | ||
|
|
||
| private cardTitle(index: number): string { | ||
| // TODO: the name of this should probably have another default as opposed to "Item {index}", and this default should be used in the summary page template as well, so that it's consistent with the case where there is no custom text at all |
| } | ||
|
|
||
| // I don't understand why we need this extra function this should be the same as everyere else | ||
| private formatValue(comp: any, value: unknown): string { |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Created a new component to remove hard to maintain tech debt and extend existing functionality of repeat field component
https://ukhsa.atlassian.net/browse/SBS-213
Context
TODO..
Changes
Challenges encountered and work arounds
SummaryViewModelso that the summary transormations would be implemented I am not sure what the other possible solutions to this would beType of change
What is the type of change you are making?
PR title
PR titles should be prefixed with the type of change you are making, based on the README.md#versioning.
This is so that when performing a squash merge, the PR title is automatically used as the commit message.
Have you updated the PR title to match the type of change you are making?
Testing
Automated tests
Have you added automated tests?
Manual tests
Have you manually tested your changes?
Have you attached an example form JSON or snippet for the reviewer in this PR?
Steps to test
Documentation
Have you updated the documentation?
Discussion
Warning
Large or complex changes may require discussion with the maintainers before they can be merged. If it has not yet been discussed, it may delay the review process
Have you discussed this change with the maintainers?