status-desktop/test/ui-test/testSuites/suite_communities/tst_communityFlows
Jonathan Rainville 2aa759adcf refactor(section-model): change model to be sorted to fix reorder
Part of #3364

To make the drag and drop reorder work correctly on channels, we needed to change the model again so that it was sorted in the model itself.
That is because the drag and drop gives us the value of the position it is dropped to as a single list, so dragging the second item of the second category would mean from position 5 to position to position 4, but what the backend wants is moving the item 2 to position 1.
Sorting the model enables us to get the category that is the parent of that position and call the service with the right positions and id.
It also enables us to reorder the channel in and out of the category.
See the module code to see how the calculation is done with an explanatory comment.
The model needed some changes to support that. Some of the function where changed from dataChange calls to resetModel calls, since we need to re-sort the model.
I tried using beginMove, but it would crash. Maybe there is a bug in NimQML or I used it badly, I'm not sure.
2023-04-19 12:26:15 -04:00
..
bdd_hooks.py test(chore): Add Automatic Screenshots on Test Failures and Errors 2022-11-22 18:55:02 +01:00
test.feature refactor(section-model): change model to be sorted to fix reorder 2023-04-19 12:26:15 -04:00
test.py test(suite_communities): Created `bdd_hook` for each `suite_communities` test case 2022-10-25 16:01:41 +02:00