-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat: Create datamodel for subform in config #14138
Conversation
…/github.com/Altinn/altinn-studio into 13764-support-link-a-sub-form-to-data-model
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14138 +/- ##
=======================================
Coverage 95.37% 95.37%
=======================================
Files 1798 1799 +1
Lines 23391 23423 +32
Branches 2703 2712 +9
=======================================
+ Hits 22308 22339 +31
Misses 836 836
- Partials 247 248 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🚀 I did a little test locally. Everything seems to works as expected 💯 , I just noticed that the submit button remains disabled when we close the create datamodel form:
datamodel-test.mov
...er/EditLayoutSetForSubform/EditLayoutSet/CreateNewSubformSection/CreateNewSubformSection.tsx
Outdated
Show resolved
Hide resolved
...er/EditLayoutSetForSubform/EditLayoutSet/CreateNewSubformSection/CreateNewSubformSection.tsx
Outdated
Show resolved
Hide resolved
...er/EditLayoutSetForSubform/EditLayoutSet/CreateNewSubformSection/CreateNewSubformSection.tsx
Outdated
Show resolved
Hide resolved
...er/EditLayoutSetForSubform/EditLayoutSet/CreateNewSubformSection/CreateNewSubformSection.tsx
Outdated
Show resolved
Hide resolved
...r/EditLayoutSetForSubform/EditLayoutSet/SelectSubformSection/SelectSubformSection.module.css
Outdated
Show resolved
Hide resolved
I also noticed that deleting a new subform fails when it’s linked to a new datamodel. We might need to generate the new datamodel when we create it 🤔 datamodel-error.mov |
Nice catch! I should have pointed this out. The issue mentioned in point 2 under Remaining tasks will address this, #14123. The "Generate" button in the data model will be removed, and creating a new data model will automatically generate it. |
Will have a 👀 on that! 😄 Thx! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🚀
Description
This PR introduces an option for users to create a new data model for a subform directly within the Next Recommended Action card when creating a new subform.
Changes in this PR
Code Refactoring
NextRecommendedAction
component into two separate components based on the user flow: one for creating a new subform and one for selecting an existing one.<form>
element withinNextRecommendedAction
to simplify state management, reducing the reliance onuseState
Bug Fix
Video: bug
select-datamodel-for-subform-bug.mp4
Video: create datamodel for subform
create-datamodel-for-subform.mp4
Remaining Tasks
Before the linked issue is done, two additional tasks must be addressed, which depends on related issues in domain 1:
Add validation for subform creation input
Extend Backend and Frontend for Subform Data Models (Edit: this is probably not needed to extend anymore)
Extend the endpoint for creating new data models to include a parameter that indicates the data model is for a subform. This ensures that theThis task depends on the issue EnsureallowInSubform
prop inappLogic
is set totrue
.dataModelId
is added toappMetadata
on create new model #14123.Edit: this may not be needed anymore, seems like
allowInSubform
will not be used in the app, but the issue is still relevant when it comes to create the data model in appMetaData.Related Issue(s)
Verification
Documentation