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

Component marked as not required: remove properties that is updated to not set (undefined) #12726

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

lassopicasso
Copy link
Contributor

@lassopicasso lassopicasso commented Apr 30, 2024

Description

When a component is set to not required, any updates to its properties that result in undefined are now removed. This ensures cleaner property configurations.

Related to the work with #12559

Related Issue(s)

  • itself

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 30, 2024
@lassopicasso lassopicasso added quality/debt Shortcuts made for saving time. Fixing this will make us more efficient going forward. and removed solution/studio/designer Issues related to the Altinn Studio Designer solution. labels Apr 30, 2024
@github-actions github-actions bot added the solution/studio/designer Issues related to the Altinn Studio Designer solution. label Apr 30, 2024
@lassopicasso lassopicasso changed the title Delete not required undefined properties Component marked as not required: remove properties that is updated to not set (undefined) Apr 30, 2024
Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.16%. Comparing base (93a4747) to head (db0ac1c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12726   +/-   ##
=======================================
  Coverage   90.16%   90.16%           
=======================================
  Files        1304     1304           
  Lines       18673    18677    +4     
  Branches     2268     2269    +1     
=======================================
+ Hits        16837    16841    +4     
  Misses       1577     1577           
  Partials      259      259           

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

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.

LGTM 😄

@lassopicasso lassopicasso merged commit 706915b into main Apr 30, 2024
10 checks passed
@lassopicasso lassopicasso deleted the delete-not-required-undefined-properties branch April 30, 2024 07:19
@nkylstad
Copy link
Member

nkylstad commented May 13, 2024

Seems to work as expected for text/number input properties. F.ex. saveWhileTyping and maxLength.

Boolean properties (f.ex. renderAsSummary) are set to false when unchecked, but that it probably ok for now.

Another observation is that it is not possible to remove values that are set in a regular select. F.ex:
Screenshot 2024-05-13 at 09 05 13

Out of scope for this issue I would say, but we should maybe look into a pattern on how to remove a property from the layout in general 🤔 What do you think @Annikenkbrathen?

Moving this to "Done", as the behaviour seems to work as expected!

@Annikenkbrathen
Copy link

Yes, certainly! I don't have a deep understanding of this yet, but we can create an issue and look into it. I need to know when to remove a property, why, and what happens. Are we removing it from a single field, component, or page? Which properties are we talking about?

Jondyr pushed a commit that referenced this pull request Jun 10, 2024
… to not set (undefined) (#12726)

* delete unused property that is not required

* add unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added-to-sprint area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. quality/debt Shortcuts made for saving time. Fixing this will make us more efficient going forward. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants