-
Notifications
You must be signed in to change notification settings - Fork 2
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
[PR] Adding drag n drop and index-based reordering #345
Conversation
Codecov Report
@@ Coverage Diff @@
## main #345 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 22 +2
Lines 524 599 +75
=========================================
+ Hits 524 599 +75
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This should be reviewable. |
reading through the PR now and noticed that the stats section of the 🤷♂️ |
Probably there was a commit that erased the work I had done because I definitely wrote those sections. I'll open a separate issue (#348) and I'll dig through the history for the most updated version and restore that section in a different PR. |
If you need any QA testing, just let me know! |
I'm going to remove the |
Documented in: https://dwyl.github.io/book/mvp/16-lists.html and https://dwyl.github.io/book/mvp/18-reordering.html 📝 ✅ |
I'm not "happy" with the code. There are quite a few inconsistencies in event and variable names. 😕 But since we've waited way too long for the reordering feature I'm not going to do tidy up now. ⏳ |
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.
This feature is working. ✅
The migrations are non-destructive and can be rolled-back if needed. 🎢
Let's get @iteles to QA it in prod
! 👩💻
Ship.
Obvs there was an issue: #417 |
I actually noticed the issue yesterday but didn't raise any issue because, as you've stated, you had created it already over at #417, so I figured there was no point in duplicating 🤷 |
closes #145
This PR is not-completed. It was a quick attempt to get drag-n-drop working on the
mvp
by following the work done by @SimonLab and implementing a simple way of sorting theitems
through anindex
field within the schema.Every time an item is dropped to a new index, the indexes of the other items would be updated accordingly.
This is done by updating the
index
of the items before the item with the newindex
, as well as the ones after the newindex
.This is done by using
update_all
.Additionally, this PR tries to implement the changes that @SimonLab made in https://github.com/dwyl/learn-alpine.js/blob/main/drag-and-drop.md (through dwyl/learn-alpine.js#5) but I can't seem to get it to work properly (show the yellow highlight change as I drag an item through the list).
Since the focus is on https://github.com/dwyl/app, it makes sense to tackle #145 there instead of the MVP.
I'm pushing this PR because it might have relevant code to tackle this issue later when we'll eventually implement this strategy on the API, which the
Flutter
app will connect to.