-
Notifications
You must be signed in to change notification settings - Fork 73
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
Update DragAndDropListItemContext
to assign the correct id to the parent
#12589
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
area/data-modeling
Area: Related to data models - e.g. create, edit, use data models.
solution/studio/designer
Issues related to the Altinn Studio Designer solution.
labels
Mar 25, 2024
lassopicasso
changed the title
Add selectedTypePointer as parentId if schema tree is for a type
Include Mar 25, 2024
selectedTypePointer
as parentId when the schema tree corresponds to a type
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12589 +/- ##
==========================================
+ Coverage 88.69% 88.70% +0.01%
==========================================
Files 1288 1288
Lines 18534 18526 -8
Branches 2270 2269 -1
==========================================
- Hits 16439 16434 -5
+ Misses 1836 1834 -2
+ Partials 259 258 -1 ☔ View full report in Codecov by Sentry. |
lassopicasso
changed the title
Include
Update Apr 2, 2024
selectedTypePointer
as parentId when the schema tree corresponds to a typeDragAndDropListItemContext
to assign the correct id to the parent
ghost
approved these changes
Apr 3, 2024
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.
LGTM 😄
Jondyr
pushed a commit
that referenced
this pull request
Jun 10, 2024
…arent (#12589) * Add selectedTypePointer as parentId if schema tree is for a type * remove console.log and rewrite comment * add `DragAndDropListItemContext` to DragAndDropProvider * itemId - set to optional in dragAndDropProvider
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/data-modeling
Area: Related to data models - e.g. create, edit, use data models.
solution/studio/designer
Issues related to the Altinn Studio Designer solution.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses an issue where drag and drop type properties incorrectly saves/moves to the root instead of its actual parent (type).
The issue stems from the fact that the
listItemContext
used in theuseParentId
hook isn't updated with itemId, leading it to default to therootContext.id
, which represents the main data model. This might possibly due to the sequencing of updatinguseContext(DragAndDropListItemContext)
.To solve this I added
<DragAndDropListItemContext.Provider/>
to the functionDragAndDropProvider
so it can be used on a higher level.Also removed some code that isn't used anymore, the useStates:
expandedProps
andexpandedDefNodes
Related Issue(s)
Verification
Documentation