- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 16
Add ability to move up/down in list #24
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
Conversation
| * | ||
| * @param \Cake\Datasource\EntityInterface $entity The entity that is going to be saved. | ||
| * @return bool | ||
| */ | 
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.
Can add a second param $number similar to that of TreeBehavior::moveUp(). Same for the moveDown() method.
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.
Then I'd have to worry about shifting more entities around, is that fine by you?
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.
Hmm.. If it makes the code too complicated leave it be :)
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.
Yeah I don't think that's quite necessary, and then lends itself to features like "move all the way to top/bottom". Maybe as a separate PR, but this code is probably more useful than the other features.
| 
 At least ensure existing tests pass, which don't right now :) | 
| Codecov Report
 @@             Coverage Diff              @@
##             master      #24      +/-   ##
============================================
- Coverage     95.08%   94.31%   -0.77%     
- Complexity       41       54      +13     
============================================
  Files             1        1              
  Lines           122      176      +54     
============================================
+ Hits            116      166      +50     
- Misses            6       10       +4
 Continue to review full report at Codecov. 
 | 
| Okay tests pass again, now you just need to add coverage for this :D | 
| 
 Priceless 🤣 | 
| @bravo-kernel It's no surprise then that the code was non functional. The patch has gems like  | 
| I can't believe I am saying this but that's exactly why I appreciate @jadb's insane method of only adding tests better (nowadays), leaving the implementation to the merger  | 
| 
 True TDD :) | 
| Close enough. | 

I don't believe in tests so I'll leave that as an exercise to the merger.
Closes #23.