learnGitBranching icon indicating copy to clipboard operation
learnGitBranching copied to clipboard

Drag and drop for git interactive rebase doesn't work

Open zahitz opened this issue 6 years ago • 15 comments

Hi, When trying to change the order of commits when doing for example git rebase -i HEAD~4 (as in level Moving Work Around:2) nothing happens. Tried this in different browsers (chrome, firefox, Internet explorer) on linux and windows pcs. And thanks for this wonderful site btw

zahitz avatar Apr 22 '20 06:04 zahitz

Same with me

Kshitij09 avatar Apr 22 '20 12:04 Kshitij09

21 hours ago #681 was merged which bumped jQuery from 1.8.0 to 3.4.0 but from 1.9 $.browser endpoint was removed (was deprecated since 1.3) - docs: https://api.jquery.com/jQuery.browser/

That's probably what broke it

Werseter avatar Apr 22 '20 14:04 Werseter

Screen Shot 2020-04-22 at 11 35 20 AM hrm I downgraded the version but I'm still getting errors now :/

pcottle avatar Apr 22 '20 18:04 pcottle

oh we need to specify even lower, justasec

pcottle avatar Apr 22 '20 18:04 pcottle

hrm, I think this was broken actually before #681 . it seems related to #680

I am reverting the prod version temporarily:

remote: GitHub found 4 vulnerabilities on pcottle/learnGitBranching's default branch (1 critical, 3 moderate). To find out more, visit:
remote:      https://github.com/pcottle/learnGitBranching/network/alerts
remote: 
To github.com:pcottle/learnGitBranching.git
 + 38c7320...ec6f612 gh-pages -> gh-pages (forced update)

wait, somehow this messed up the gh-pages hosting: https://learngitbranching.js.org/?demo

🤦🏼‍♂️ so it it'll work in prod as we figure this out

pcottle avatar Apr 22 '20 18:04 pcottle

oh somehow we dropped index.html, justasec

pcottle avatar Apr 22 '20 18:04 pcottle

Gah, still broken. few notes for myself:

  • the .gitignore is actually different depending on if we're on gh-pages or the master branch. this is a good thing to clean up eventually so we don't have issues like this (where we dropped the index and build assets on the gh-pages branch)
  • for some reason the build files werent resolving, so I had to inline their absolute URIs. but now they are getting blocked due to cross origin

I have a few meetings, will check in later

pcottle avatar Apr 22 '20 19:04 pcottle

Alright! I reverted prod gh-pages back to a version that works, phew 🥵. Drag and drop in the rebase view should be fully functional.

@hong4rc I think the issue we need to resolve is that although we are "depending" on jquery 3.4.1 in yarn.lock before #680, we're actually running 1.8.0 in the browser. So when you made the changes to index.html and we started running on the correct version in our dependencies, the drag and drop functionality broke.

ideally I'd love to just upgrade the drag and drop functionality to a modern version rather than have this old dependency... anyways I have to get back to my real work for today, so I'll try looking at this later. for now, we can't really push prod against master :(

pcottle avatar Apr 22 '20 19:04 pcottle

hrm I downgraded the version but I'm still getting errors now :/

Can you give me reproduce this error?

hong4rc avatar Apr 23 '20 01:04 hong4rc

I think the problem is jquery-ui. I use jquery-ui 1.12 for jquery 3.5 => don't see error about find(...).andSelf (not sure other errors)

I try use

require('jquery-ui/ui/widget');
require('jquery-ui/ui/widgets/mouse');
require('jquery-ui/ui/plugin');
require('jquery-ui/ui/widgets/draggable');
require('jquery-ui/ui/widgets/sortable');

We can build it to lib file to avoid rebuild lib(without change)

hong4rc avatar Apr 23 '20 01:04 hong4rc

ah yeah, I found this example as well: https://bugs.jqueryui.com/ticket/15020

I think thats what was confusing me -- we have to explicitly require it in rebase view to make it work now :P

pcottle avatar Apr 23 '20 16:04 pcottle

derp, I merged the wrong PR >___< justasec

pcottle avatar Apr 23 '20 16:04 pcottle

Ok everyone! After a hard refresh, the latest version of prod has this all working: https://learngitbranching.js.org/?NODEMO&command=gc;gc;gc;git%20rebase%20-i%20HEAD~3

Let me know if you spot any other issues but we should be all fixed up here 😇security vulnerabilities fixed AND jquery UI integrated in a more modern way in our build infra

pcottle avatar Apr 23 '20 16:04 pcottle

ah yeah, I found this example as well: https://bugs.jqueryui.com/ticket/15020

I think thats what was confusing me -- we have to explicitly require it in rebase view to make it work now :P

You forgot draggable

Open https://learngitbranching.js.org/ and click next until type any command :)

image

We need to add this:

require('jquery-ui/ui/plugin');
require('jquery-ui/ui/safe-active-element');
require('jquery-ui/ui/safe-blur');
require('jquery-ui/ui/widgets/draggable');

I can't test now, so can you help me test it?

Thanks

hong4rc avatar Apr 23 '20 16:04 hong4rc

Ah my bad! Let me try to update

pcottle avatar Apr 25 '20 18:04 pcottle