-
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
Eliminate the need to provide index in DragAndDrop #11252
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #11252 +/- ##
==========================================
+ Coverage 80.85% 80.92% +0.06%
==========================================
Files 751 753 +2
Lines 11940 11982 +42
Branches 1597 1598 +1
==========================================
+ Hits 9654 9696 +42
Misses 2038 2038
Partials 248 248
☔ 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.
LGTM!👏 🎖️
* Add titles and helpTexts to components (#11263) * remove unused import & update test * Apply suggestions from code review Co-authored-by: andreastanderen <71079896+standeren@users.noreply.github.com> * Make varaiblename- and variable-usage in cypress tests consistent (#11243) * Make varaiblename- and variable-usage in cypress tests consistent * Removed unused value in local cypress config file * Use same usernames for dev and prod test users as before * Use same usernames for staging test users as before * remove invalid properties (#11257) * remove invalid properties * use correct property name in test * Base successfully added expression on the expression property (#11250) * Base successfully added expression on the property * Eliminate the need to provide index in DragAndDrop (#11252) * 11177 move sidegrupper to dropdownselect (#11245) * Added dropdown list in left menu * Replace LegacyCheckbox with Switch (#11244) * Replace LegacyCheckbox with Switch * Fix Switch errors * Remove duplicate labels * Replace LegacyCheckbox with Switch * refactor: use context class (#11264) * Context classes added * Used context class in AppDevelopmentController * Rename context generator method * use context class in datamodelign controller * use new context class in process modelling * Add cancellation tokens * format * Delete unused methods from RepositorySI * remove unused methods * More unused methods * repositorySi more unused * Some repositorySi mehods migrated to use context * CodeQl fix * Add preview column (#11240) * Update nb.json (#11268) Fix typo * Drag and drop tree view (#11270) * updated tests * added text resource binding * merge issues * sorting keys * fix test --------- Co-authored-by: andreastanderen <71079896+standeren@users.noreply.github.com> Co-authored-by: Tomas Engebretsen <tomas.engebretsen@digdir.no> Co-authored-by: JamalAlabdullah <90609090+JamalAlabdullah@users.noreply.github.com> Co-authored-by: Michael Queyrichon <michael.queyrichon@digdir.no> Co-authored-by: Mirko Sekulic <misha.sekulic@gmail.com> Co-authored-by: andreas-didriksen <75472603+andreas-didriksen@users.noreply.github.com>
Description
Now, consumers have to provide an index to the
DragAndDrop
items, like this:Providing the wrong index will lead to buggy behaviour, so this is not ideal. This pull request introduces a
findPositionInList
function that is used to find the correct index from within the component using the DOM model. It is only called when the user drags something, so there should not be any risk of it being called before the DOM is fully rendered.In order to avoid selector collisions, I have also added a
useDomSelectors
hook that generates unique ids and class names that are used byfindPositionInList
.Verification