Tryton - Issues

 

Issue8240

Title Add drag and drop support to sao
Priority feature Status resolved
Superseder Expander displayed on record without children
View: 8518
Nosy List angel, ced, nicoe, pokoli, reviewbot, roundup-bot
Type feature request Components sao
Assigned To ced Keywords review
Reviews 265181002
View: 265181002

Created on 2019-03-29.17:01:44 by nicoe, last changed by roundup-bot.

Files
File name Uploaded Type Edit Remove
Captura de 2019-04-05 13-01-06.png angel, 2019-04-05.13:07:34 image/png
Messages
New changeset 12aa2a284a52 by Cédric Krier in branch 'default':
Add drag and drop and manage sequence
https://hg.tryton.org/tryton-env/rev/12aa2a284a52
New changeset 492e62d18080 by Cédric Krier in branch 'default':
Add drag and drop and manage sequence
https://hg.tryton.org/sao/rev/492e62d18080
review265181002 updated at https://codereview.tryton.org/265181002/#ps273831002
review265181002 updated at https://codereview.tryton.org/265181002/#ps272061009
msg50775 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-07-22.16:58:57
issue8518 is needed to hide expander if the last children is DnD outside.
msg50744 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-07-19.15:10:09
You must press CTRL key when dropping so the record will be inserted inside the row above it.
msg50743 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-07-19.15:06:38
I've done a few tests and I don't not know how to insert a node as child of another node. Should I have to use any meta key? 

P.S: I am testing it on stock locations tree view.
msg50740 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-07-19.13:13:34
So I removed the DOM modification and instead I used:

* no meta key: record is positioned at the same level as the row below it (and if there is none, the first level is used)
* if CTRL key is pressed: the record is positioned inside the record above it at the last position
* if Shift key is pressed: the record is positioned at the same level as the row above it.

If the user wants to insert inside a record at a specific position, he has to expend the target row before DnD.

Normally, we can managed all the cases this way.
review265181002 updated at https://codereview.tryton.org/265181002/#ps257811002
review265181002 updated at https://codereview.tryton.org/265181002/#ps275741002
msg50717 (view) Author: [hidden] (angel) Date: 2019-07-18.17:51:37
"So I think to allow drop inside an element, we could use the shiftkey to insert inside the element above."

Ok for me.
msg50337 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-06-20.18:32:29
I think the problem comes from the modification of the DOM at the start of the drag. I'm guessing that the browser cancel the DnD because the element clicked has moved.
So I think to allow drop inside an element, we could use the shiftkey to insert inside the element above.
msg50084 (view) Author: [hidden] (nicoe) (Tryton committer) Date: 2019-06-05.18:03:14
The link to the github account of the bug (in chrome or SortableJS) preventing further inclusion: https://github.com/SortableJS/Sortable/issues/1484
review265181002 updated at https://codereview.tryton.org/265181002/#ps255241002
msg48433 (view) Author: [hidden] (nicoe) (Tryton committer) Date: 2019-04-05.18:19:47
* Angel Alvarez [2019-04-05 13:07:34]:

> Trying to move a sheet:
>  -see attached file

It's probably related to the browser you're using.
I have the issue in chromium but not in firefox.

What happens is that for some elements (the ones at the end (for a
fuzzy definition of end) of the table) chromium sends a 'dragend'
event effectively stopping the drag'n'drop.

I am still investigating this issue.
msg48428 (view) Author: [hidden] (nicoe) (Tryton committer) Date: 2019-04-05.14:20:42
* Angel Alvarez [2019-04-05 13:07:34]:

> You can not move a leaf to the last tree element:
> 1 >
>   > 2
> to:
> -1 
> -2 
> 
> It forces you to do:
> - 2
> - 1
> 
> and then move
> - 1
> - 2

This is indeed a limitation of the library we chose to implement the
drag'n'drop.

> Trying to move a sheet:
>  -see attached file

How did you succeed to do this, IIRC the new lines should be removed
after the drop. You don't have any message in the javascript console?
msg48427 (view) Author: [hidden] (angel) Date: 2019-04-05.14:09:43
In editable lists, when you create a record, it is not associated with the selected record, but with the top level.
msg48426 (view) Author: [hidden] (angel) Date: 2019-04-05.13:07:34
You can not move a leaf to the last tree element:
1 >
  > 2
to:
-1 
-2 

It forces you to do:
- 2
- 1

and then move
- 1
- 2

Trying to move a sheet:
 -see attached file
msg48425 (view) Author: [hidden] (angel) Date: 2019-04-05.12:57:14
The arrow that opens the tree is not hidden when the last leaf of the tree is moved.
review265181002 updated at https://codereview.tryton.org/265181002/#ps275161002
msg48118 (view) Author: [hidden] (nicoe) (Tryton committer) Date: 2019-03-29.17:01:43
Like the GTK client sao could have support for drag and drop.

After some investigation it seems like https://github.com/SortableJS/Sortable would be a suitable library to add drag'n'drop to sao as it's a minimalist library.

An issue I have identified is the fact that in Tryton in case of a drag'n'drop in a tree the client will open the node with children. In sao it would imply an RPC call that would in turn reconstruct the tree and break it. The option we have chosen to implement is to add a transient line that mean "drop into the node".
History
Date User Action Args
2019-09-07 23:56:43roundup-botsetmessages: + msg51758
2019-09-07 23:56:39roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg51757
2019-08-18 20:33:20reviewbotsetmessages: + msg51339
2019-08-12 12:54:53reviewbotsetmessages: + msg51269
2019-07-22 16:58:57cedsetsuperseder: + Expander displayed on record without children
messages: + msg50775
2019-07-19 15:10:09cedsetmessages: + msg50744
2019-07-19 15:06:38pokolisetnosy: + pokoli
messages: + msg50743
2019-07-19 13:13:35cedsetstatus: chatting -> testing
assignedto: nicoe -> ced
messages: + msg50740
2019-07-19 13:10:46reviewbotsetmessages: + msg50739
2019-07-19 12:37:39reviewbotsetmessages: + msg50737

Showing 10 items. Show all history (warning: this could be VERY long)