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

Handle duplicated ids in layout #12665

Merged
merged 30 commits into from
Apr 29, 2024
Merged

Conversation

lassopicasso
Copy link
Contributor

@lassopicasso lassopicasso commented Apr 13, 2024

Description

When layout edits are made manually, resulting in components or containers with duplicate IDs, the layout doesn't display in Altinn Studio without any clear warning to the user except for a message in the console.

To improve this, implemented a feature that notifies users within Altinn Studio about the issue. Users will now receive a specific message identifying the duplicated IDs and directing them to resolve the issue in Gitea. This message includes step-by-step instructions and a link that opens the layout file in Gitea (in a new tab) for immediate correction.

image

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@github-actions github-actions bot added area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution. labels Apr 13, 2024
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.16%. Comparing base (8224da2) to head (e78c285).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12665      +/-   ##
==========================================
+ Coverage   90.13%   90.16%   +0.02%     
==========================================
  Files        1301     1304       +3     
  Lines       18629    18673      +44     
  Branches     2265     2268       +3     
==========================================
+ Hits        16792    16837      +45     
+ Misses       1578     1577       -1     
  Partials      259      259              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lassopicasso lassopicasso marked this pull request as ready for review April 16, 2024 08:10
@lassopicasso lassopicasso linked an issue Apr 16, 2024 that may be closed by this pull request
2 tasks
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Lots of great work done! 👏 😄
I've added some comments

@github-actions github-actions bot added area/data-modeling Area: Related to data models - e.g. create, edit, use data models. area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc). area/dashboard Area: Related to the dashboard application area/text-editor area/studio-root Area: Issues related to studio-root application labels Apr 26, 2024
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Great job! 👏 🎉

@lassopicasso lassopicasso merged commit 0f11a07 into main Apr 29, 2024
11 checks passed
@lassopicasso lassopicasso deleted the handle-duplicated-ids-in-layout branch April 29, 2024 07:10
Jondyr pushed a commit that referenced this pull request Jun 10, 2024
* enable layout with duplicated ids to return

* display error if the layout contains duplicated ids

* some adjustments of styling in accordion header

* Display duplicated ids in the warning message

* Add warning content in accordion when duplicated ids

* add content to configWarning ++

* add endpoint for the specific layout in gitea

* open link in new window

* resize to small for list items + update text

* move pageconfig warning content to a separated file

* Make sure duplicated ids only display once

* add text to text resources

* change alert with sectionHeader, add new icon, keep the same warning color on accordion header and sectionHeader

* remove comments

* let isValid prop be optional

* Remove some text

* fix some tests + add objectutils test for flattenObjectValues

* Add tests in pageConfigPanel

* add tests to new formlayout utilities

* add test to formlayout

* fix text

* feedback - change naming of text resources

* replace @navikt/aksel-icons imports with @studio/icons in whole project

* remove duplicated import of @studio-icons

* feedbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard Area: Related to the dashboard application area/data-modeling Area: Related to data models - e.g. create, edit, use data models. area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc). area/studio-root Area: Issues related to studio-root application area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement id uniqueness validation when loading a layout
1 participant