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

Number of positions left in repeating group #2035

Closed
xmrsa opened this issue Apr 22, 2024 · 1 comment
Closed

Number of positions left in repeating group #2035

xmrsa opened this issue Apr 22, 2024 · 1 comment
Assignees
Labels
area/table related to grid/list/repeating groups kind/bug Something isn't working

Comments

@xmrsa
Copy link

xmrsa commented Apr 22, 2024

Blocked by: digdir/designsystemet#2042

Description of the bug

I have a field in a repeating group with a frontend-restriction of 9 digits (actually char, since it is a string). When I write a number, it shows the number of positions left correctly. But after I have saved the value and opened the row again, it shows the incorrect message "Du har 9 av 9 tegn igjen" (the field is already full). It does not matter the value in the field has f.ex. 3, 4 or 9 digits, the massage is always the same. If I start editing in the opened field again, it behaves as expected.

Steps To Reproduce

  1. Fill in a field in a repeating group with a number (or text) that has a restriction for "maxLength", in my case "maxLength": 9.
  2. Close the row and open it again, the incorrect massage should show
    DuHar9av9TegnIgjen

I don't know it this would have happened if my repeating group had a table layout.

Additional Information

Here is the code for the page that has the problem:
{ "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", "data": { "layout": [ { "id": "Header-XkWm6K", "type": "Header", "size": "L", "textResourceBindings": { "title": "ra0481.S04_Poolordning.Header-XkWm6K.title" } }, { "id": "Header-efFwLL", "type": "Header", "size": "h4", "textResourceBindings": { "title": "ra0481.S04_Poolordning.Header-efFwLL.title" } }, { "id": "RadioButtons-deltok-i-pool", "type": "RadioButtons", "dataModelBindings": { "simpleBinding": "SkjemaData.f502_Pool.f502_PDeltokPool" }, "required": false, "optionsId": "JaNeiOptionlist", "layout": "column", "textResourceBindings": { "title": "ra0481.S04_Poolordning.Radio-deltok-poolordning" } }, { "id": "Group-RXVisI", "children": [ "Header-nytt-foretak-i-poolordning", "Input-orgnrForetakPool-8sNME1", "Input-navnForetakPool-MUjdeQ" ], "type": "RepeatingGroup", "tableColumns": { "Header-nytt-foretak-i-poolordning": { "showInExpandedEdit": true }, "Input-orgnrForetakPool-8sNME1": { "editInTable": false, "showInExpandedEdit": true, "width": "16%", "textOverflow": { "lineWrap": true, "maxHeight": 5 } }, "Input-navnForetakPool-MUjdeQ": { "editInTable": false, "showInExpandedEdit": true, "width": "50%", "textOverflow": { "lineWrap": true, "maxHeight": 5 } } }, "maxCount": 100, "textResourceBindings": { "add_button_full": "ra0481.S04_Poolordning.legg-til-knapp.title", "edit_button_close": "ra0481.S04_Poolordning.kun-lagre-tekst.knapp", "save_button": "ra0481.S04_Poolordning.kun-lagre-tekst.knapp" }, "dataModelBindings": { "group": "SkjemaData.f502_ForetakPool" }, "edit": { "openByDefault": true, "alwaysShowAddButton": true, "editButton": true }, "validateOnSaveRow": [ "All" ] }, { "id": "Header-nytt-foretak-i-poolordning", "type": "Header", "textResourceBindings": { "title": "ra0481.S04_Poolordning.Header-rIpWwL.title" }, "size": "h3" }, { "id": "Input-orgnrForetakPool-8sNME1", "type": "Input", "dataModelBindings": { "simpleBinding": "SkjemaData.f502_ForetakPool.f502_orgnrForetakPool" }, "required": false, "textResourceBindings": { "tableTitle": "ra0481.S04_Poolordning.Input-8sNME1.title", "title": "ra0481.S04_Poolordning.Input-8sNME1.title" }, "maxLength": 9, "autocomplete": "off", "formatting": { "align": "left", "number": { "allowNegative": false, "allowLeadingZeros": true, "decimalScale": 0 } }, "grid": { "innerGrid": { "xs": 8, "md": 6, "lg": 3, "xl": 3 } } }, { "id": "Input-navnForetakPool-MUjdeQ", "type": "Input", "dataModelBindings": { "simpleBinding": "SkjemaData.f502_ForetakPool.f502_navnForetakPool" }, "required": true, "textResourceBindings": { "tableTitle": "ra0481.S04_Poolordning.Input-MUjdeQ.title", "title": "ra0481.S04_Poolordning.Input-MUjdeQ.title" } }, { "id": "Checkboxes-0fQ6O3", "type": "Checkboxes", "dataModelBindings": { "simpleBinding": "SkjemaData.f502_FraktkPool.f502_typeKontraktPool" }, "required": false, "textResourceBindings": { "title": "ra0481.S04_Poolordning.Checkboxes-0fQ6O3.title" }, "optionsId": "f502_FraktkontraktPoolValg" }, { "id": "TextArea-MFp4Ta", "type": "TextArea", "dataModelBindings": { "simpleBinding": "SkjemaData.f502_FraktkPool.f502_annenKontraktSpes" }, "required": false, "textResourceBindings": { "title": "ra0481.S04_Poolordning.TextArea-MFp4Ta.title" } }, { "id": "TextArea-78Kdag", "type": "TextArea", "dataModelBindings": { "simpleBinding": "SkjemaData.f502_KommSide.f502_kommPoolordning" }, "required": false, "textResourceBindings": { "title": "lang.kommentarer.til.spoersmaal.siden.title" } }, { "id": "NavigationButtons-wjTnt0", "showBackButton": true, "textResourceBindings": { "next": "lang.tittel.navigation.neste", "back": "lang.tittel.navigation.tilbake" }, "type": "NavigationButtons" } ] } }

@xmrsa xmrsa added the kind/bug Something isn't working label Apr 22, 2024
@HanneLauritsen1967 HanneLauritsen1967 added the area/table related to grid/list/repeating groups label Apr 23, 2024
@paal2707 paal2707 self-assigned this May 15, 2024
@paal2707 paal2707 moved this to 👷 In Progress in Team Apps May 15, 2024
@paal2707 paal2707 moved this from 👷 In Progress to 🔎 Review in Team Apps May 22, 2024
@HanneLauritsen1967 HanneLauritsen1967 moved this from 🔎 Review to ⚠️ Blocked in Team Apps May 29, 2024
@paal2707 paal2707 moved this from ⚠️ Blocked to 🧪 Test in Team Apps Jul 8, 2024
@Magnusrm
Copy link
Contributor

Magnusrm commented Jul 9, 2024

Seems to work fine after the update from Designsystemet! 🎉

@Magnusrm Magnusrm closed this as completed Jul 9, 2024
@Magnusrm Magnusrm moved this from 🧪 Test to ✅ Done in Team Apps Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/table related to grid/list/repeating groups kind/bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants