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 occuring when adding a data task after creating a subform #13736

Conversation

ErlingHauan
Copy link
Contributor

@ErlingHauan ErlingHauan commented Oct 8, 2024

Description

This fixes an error that occurs when adding a new task in the process editor, when layout-sets.json contains a layout set without the tasks property. The solution was to add null checks.

Since we now allow layout sets to not contain tasks (which is the case for subform layout sets), we have to check if the tasks property exists before trying to access it.

Note: the backend build warnings in the PR comments should likely be solved en masse, see this issue: #13738

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)

@ErlingHauan ErlingHauan linked an issue Oct 8, 2024 that may be closed by this pull request
@github-actions github-actions bot added area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc). solution/studio/designer Issues related to the Altinn Studio Designer solution. backend frontend labels Oct 8, 2024
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.54%. Comparing base (a591d37) to head (00700e9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13736   +/-   ##
=======================================
  Coverage   94.54%   94.54%           
=======================================
  Files        1621     1621           
  Lines       21677    21678    +1     
  Branches     2549     2549           
=======================================
+ Hits        20495    20496    +1     
  Misses        939      939           
  Partials      243      243           

☔ 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 October 8, 2024 11:59
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.

I tested it and I wonder about the erro-toast that showing when adding a task?
https://github.com/user-attachments/assets/c9421389-1a4b-4618-9cb3-a845c4a1e697

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.

Bra jobba😊; I tested it now and works fine.

@ErlingHauan ErlingHauan added the skip-manual-testing PRs that do not need to be tested manually label Oct 10, 2024
@ErlingHauan
Copy link
Contributor Author

Added label skip-manual-testing to get an automatic approval, since this is a very small PR that @JamalAlabdullah has both code reviewed and tested.

@ErlingHauan ErlingHauan removed their assignment Oct 10, 2024
@ErlingHauan ErlingHauan added skip-manual-testing PRs that do not need to be tested manually and removed skip-manual-testing PRs that do not need to be tested manually labels Oct 11, 2024
@ErlingHauan ErlingHauan merged commit 63247ee into main Oct 11, 2024
17 checks passed
@ErlingHauan ErlingHauan deleted the 13690-an-error-occurs-when-adding-a-data-task-after-creating-a-subform branch October 11, 2024 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc). backend frontend skip-manual-testing PRs that do not need to be tested manually solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An error occurs when adding a data task after creating a subform
2 participants