Skip to content

Bind List/MultipleSelect/Checkboxes to a repeating group #3236

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

Merged
merged 70 commits into from
May 7, 2025

Conversation

paal2707
Copy link
Contributor

@paal2707 paal2707 commented Apr 4, 2025

Description

Bind List/MultipleSelect/Checkboxes to a list of Objects/a repeating group.
Added a group, checked and deletionStrategy property to the List/MultipleSelect/Checkboxes, to support saving to a list of Objects and to support toggling soft deletion.

Related Issue(s)

Verification/QA

  • Manual functionality testing

    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests

    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)

    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs

    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio

    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board

    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels

    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

walldenfilippa and others added 30 commits February 6, 2025 11:30
Co-authored-by: Johanne Lie <joli@patentstyret.no>
Co-authored-by: adamhaeger <adamgullerud@gmail.com>
# Conflicts:
#	src/layout/List/ListComponent.tsx
# Conflicts:
#	src/layout/List/ListComponent.tsx
@paal2707 paal2707 marked this pull request as ready for review April 14, 2025 13:32
Copy link
Contributor

@olemartinorg olemartinorg left a comment

Choose a reason for hiding this comment

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

I think we should go the extra mile to support varying depths of properties inside these rows, so that we can support any data model instead of apps having to tailor their data model to our functionality. We don't currently have any such limitations elsewhere in the product (at least that I know), and these limitations in List was previously removed in #3136.

We can also team up to pair-program the rest of this, if you want, or if my suggestions were unclear. 🙌

paal2707 and others added 15 commits April 25, 2025 13:30
…ucing looping to only loop the array once (not twice, once to get the index and another time to get the object)
… for the others). I messed up here, thinking that I could make valueBindings an array - but keys matter in List (though they don't matter in the other components).
# Conflicts:
#	src/language/texts/en.ts
#	src/language/texts/nb.ts
#	src/language/texts/nn.ts
…jest preview on, as the class names change when you turn on that feature (and will cause the tests to fail). Since jest preview is off on the github runner, we have to update them with preview off and commit that instead.
…ation. Had to open up a few protected methods to do this, but I think that's fine.
…aries (which it is right now, so that's wrong)
@olemartinorg
Copy link
Contributor

The failing test (in repeating-group.ts) is because of changes to the repeating group setup in the test app since #3320. I didn't notice them, so I didn't revert them when pushing a new version of component library to tt02. Can be safely ignored.

Other than that, most issues seem to be resolved now, but I found that there is no support for this 'group' functionality in Checkboxes + MultipleSelect when shown in Summary + Summary2. I added those components to the component library app, but I didn't start implementing summary support. List has it already, so there should be at least one source there for inspiration.

Copy link
Contributor

@olemartinorg olemartinorg left a comment

Choose a reason for hiding this comment

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

Approving now, pending tests for summaries. 🙌 Good job! 🚀

Copy link

sonarqubecloud bot commented May 7, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
42.6% Coverage on New Code (required ≥ 45%)
11.1% Duplication on New Code (required ≤ 3%)
35.31% Condition Coverage on New Code (required ≥ 45%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@paal2707 paal2707 merged commit 354ab02 into main May 7, 2025
13 of 15 checks passed
@paal2707 paal2707 deleted the feat/multiselect-to-repeating-group branch May 7, 2025 07:57
@github-project-automation github-project-automation bot moved this from 👷 In Progress to 🧪 Test in Team Apps May 7, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues SSB May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/product-feature Pull requests containing new features
Projects
Status: Done
Status: 🧪 Test
Development

Successfully merging this pull request may close these issues.

Binde MultipleSelect/Checkboxes til en repeterende gruppe i datamodellen
4 participants