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

Checkbox component should support mapping to an array #273

Open
1 of 12 tasks
Tracked by #339
lorang92 opened this issue Sep 2, 2021 · 3 comments
Open
1 of 12 tasks
Tracked by #339

Checkbox component should support mapping to an array #273

lorang92 opened this issue Sep 2, 2021 · 3 comments
Labels
feature-complete Features needed for parity with Altinn 2 (target: June 2023) kind/user-story Used for issues that describes functionality for our users.

Comments

@lorang92
Copy link
Contributor

lorang92 commented Sep 2, 2021

Description

The current implementation of the checkbox component maps answers to a comma-separated string. As an app developer, it feels more natural that these values are mapped as an array. We should support both cases 🦅 and make this setting configurable on the component.

Considerations

  • Default config? We have to stick to the current implementation as default as this could break existing apps. (or if we strongly belive that an array is better we should create a new major versjon.)
  • Adding a checkbox-component from studio could potentially be setup as array mapping as default for all new boxes

Depends on #345 to be solved first.

Acceptance criteria

  • Checkbox component should support mapping data to an array structure
  • Make this mapping configurable at the component
  • Default mapping should be a comma-separated string

Specification tasks

  • Development tasks are defined

Development tasks

  • Implement configurable setting in formlayout.json
    • update json-schema with new possible config values
  • update checkbox-component to handle both cases
  • unit tests

Test

Add test cases here as checkboxes that are being tested as part of the changes.

Definition of done

Verify that this issue meets DoD (Only for project members) before closing.

  • Documentation is updated (if relevant)
    • Technical documentation (docs.altinn.studio)
    • User documentation (altinn.github.io/docs)
  • QA
  • Manual test is complete (if relevant)
  • Automated test is implemented (if relevant)
  • All tasks in this userstory are closed (i.e. remaining tasks are moved to other user stories or marked obsolete)
@lorang92 lorang92 added kind/user-story Used for issues that describes functionality for our users. solution/app-frontend labels Sep 2, 2021
@ivarne
Copy link
Member

ivarne commented Dec 21, 2021

Is this actually possible as long as we convert all the datamodel fields to string in app-frontend?

@haakemon haakemon transferred this issue from Altinn/altinn-studio Jun 28, 2022
@olemartinorg
Copy link
Contributor

Psst! We now have backend support for scalar arrays, and the frontend includes support for the list binding for attachment references (see Altinn/altinn-studio#246). I've noticed this issue myself, and it should be fairly easy to add support for the list binding here as well.

@FinnurO
Copy link

FinnurO commented Dec 13, 2022

I am sure I saw an issue where the need for checkbox mapping to datamodel fields was mentioned. It said it is a common pattern i Altinn 2.

Here it is: #789

@FinnurO FinnurO added the feature-complete Features needed for parity with Altinn 2 (target: June 2023) label Dec 13, 2022
@lassopicasso lassopicasso moved this to 👷 In Progress in Team Apps May 9, 2023
@lassopicasso lassopicasso self-assigned this May 9, 2023
@HanneLauritsen1967 HanneLauritsen1967 moved this from 👷 In Progress to ⚠️ Blocked in Team Apps May 10, 2023
@olemartinorg olemartinorg added the fe-v4 Issues to be solved before v4 goes gold label Sep 25, 2023
@RonnyB71 RonnyB71 mentioned this issue Nov 22, 2023
Closed
@olemartinorg olemartinorg removed the status in Team Apps Jan 2, 2024
@olemartinorg olemartinorg removed the fe-v4 Issues to be solved before v4 goes gold label Feb 12, 2024
@RonnyB71 RonnyB71 added good-first-issue Issues that are easy to fix for new team members or external contributors and removed good-first-issue Issues that are easy to fix for new team members or external contributors labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-complete Features needed for parity with Altinn 2 (target: June 2023) kind/user-story Used for issues that describes functionality for our users.
Projects
Status: No status
Development

No branches or pull requests

6 participants