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

fix: Error when deleting the last sub-resource from a resource in policy editor #13620

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

ErlingHauan
Copy link
Contributor

@ErlingHauan ErlingHauan commented Sep 24, 2024

Description

Removed the delete button when there is only one sub-resource. The user can instead change the existing fields.

Discussed this with @Annikenkbrathen and concluded that this is an OK fix until we replace this functionality with "tilgangspakker".

Related Issue(s)

Before

2.mov

After

Spiller.inn.2024-09-24.132133.mp4

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)

@github-actions github-actions bot added the solution/studio/designer Issues related to the Altinn Studio Designer solution. label Sep 24, 2024
@ErlingHauan ErlingHauan changed the title Hide delete button when there is only one narrowing resource/subresource fix: Error when deleting the last sub-resource from a resource Sep 24, 2024
@ErlingHauan ErlingHauan linked an issue Sep 24, 2024 that may be closed by this pull request
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.22%. Comparing base (fe4e468) to head (e55940a).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13620   +/-   ##
=======================================
  Coverage   95.22%   95.22%           
=======================================
  Files        1499     1499           
  Lines       20499    20505    +6     
  Branches     2485     2485           
=======================================
+ Hits        19520    19526    +6     
  Misses        869      869           
  Partials      110      110           

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

@ErlingHauan ErlingHauan marked this pull request as ready for review September 24, 2024 11:42
@ErlingHauan ErlingHauan mentioned this pull request Sep 24, 2024
@ErlingHauan ErlingHauan removed a link to an issue Sep 24, 2024
@ErlingHauan ErlingHauan changed the title fix: Error when deleting the last sub-resource from a resource fix: Error when deleting the last sub-resource from a resource in policy editor Sep 24, 2024
Copy link
Contributor

@wrt95 wrt95 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! 😄
Should we maybe add some tests as well to see that it works as expected?

@ErlingHauan
Copy link
Contributor Author

@wrt95 In order to test this properly, I had to add a few mocks. What do you think about this change? 😊

Copy link
Contributor

@wrt95 wrt95 left a comment

Choose a reason for hiding this comment

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

🥳

@wrt95
Copy link
Contributor

wrt95 commented Sep 24, 2024

@wrt95 In order to test this properly, I had to add a few mocks. What do you think about this change? 😊
I think this is great @ErlingHauan, well done! 👏

@wrt95 wrt95 removed their assignment Sep 24, 2024
Copy link
Contributor

@JamalAlabdullah JamalAlabdullah left a comment

Choose a reason for hiding this comment

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

Tested ok👍

@JamalAlabdullah JamalAlabdullah merged commit 8b4aa15 into main Sep 25, 2024
17 checks passed
@JamalAlabdullah JamalAlabdullah deleted the fix/error-when-deleting-sub-resources branch September 25, 2024 10:07
@JamalAlabdullah JamalAlabdullah removed their assignment Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants