joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[6.0] Batch Copy & Move tags

Open beni71 opened this issue 2 years ago • 35 comments

Pull Request for Issue #23304, only partially. This PR is based on #38583 and fixes the comments.

Summary of Changes

Adds the ability to batch copy/move tags in the tags list. Copying a tag also copies its children (same behavior as in other tree models like categories, menues). Moving a tag also moves its children (same behavior as in other tree models like categories, menues). For example, it is possible to move a child tag from one parent to another (including its children), or to copy a child tag from one parent to another (including its children). In the batch tag drop down there is also an item "Root" to move/copy selected tags to the root level.

Changed visualization "Action to Perform" of copy/move action, it is now hidden as long as the user does not touch the select field for copy/move. See example in video below. This change affects batch copy/move dialog of menues and articles as well.

It also fixes a browser console error when the batch dialog is opened and cancel is clicked, on systems where multilingual is disabled.

Testing Instructions

It contains an updated javascript so run: npm run build:js

Initial tag structure for each of the tests below: Tag1 -Tag2 --Tag3 Tag4

Test 1 Move Tag2 to Tag4 results in: Tag1 Tag4 -Tag2 --Tag3

Test 2 Move Tag1 to Tag4 results in: Tag4 -Tag1 --Tag2 ---Tag3

Test 3 Copy Tag4 to Tag2 result in: Tag1 -Tag2 --Tag3 --Tag4 (2) Tag4

Test 4 Check whether the visualization of "Action to Perform" of copy/move action is first hidden for views like menues, articles. Only if a target item is selected "Action to Perform" appears.

Actual result BEFORE applying this Pull Request

The tags list batch processing does not support copy move.

Expected result AFTER applying this Pull Request

The tags list batch processing supports copy move:

tag-copy-move

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:

  • [ ] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [ ] No documentation changes for manual.joomla.org needed

beni71 avatar Sep 26 '23 06:09 beni71

I have tested this item :white_check_mark: successfully on c503b035749dca4acc30300fc3699058d75f22c3

Easy to get into a muddle but works as described.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41927.

ceford avatar Sep 26 '23 08:09 ceford

Thanks a lot for working on this issue! Unfortunately I am not in favour of this implementation, from UX point of view. Batch copy and move is not quite easy to understand, but at least the process should be everywhere the same. Behavoiur must be predictable. Would it be possible to implement this behaviour "as always"?

Always:

user selects an item in the list and activates the batch button (the system has the ids of the selected items)

on the modal: the users selects a target for his copy or move from the dropdown

decides if the action copy or move is to be performed.

your implementation

user selects an item in the list and activates the batch button (as he uses to do in other places) (the system ignores the selection)

grafik The "keep original tag" is misleading. The user's selection in the list is ignored, he must select the items now in the dropdown list.

After the selection of an item from the list, the select is replaced by another question. This change is so fast and the texts look similiar that it is difficult to notice the replacement. The user could think that he still sees his selection.

grafik

It would be clearer if the new block is appended to the first one.

The process then works like a charm.

I think that this causes confusion

In my opinion, the process should be the same in all categories and all other components, then it does not need extra documentation.

chmst avatar Sep 26 '23 20:09 chmst

@chmst isnt this identical to the ui for batch copying and moving menu items??

brianteeman avatar Sep 26 '23 20:09 brianteeman

@brianteeman not if I understand this correctly

You choose a menuitem in the list (the systems holds the id), opens the batch modal

grafik

then you choose a target menuitem and decides if you want a copy or move.

You must not do this first step and select your item in the batch modal.

chmst avatar Sep 26 '23 20:09 chmst

image

image

image

image

I dont see the difference

I think the confusion is because the language string is wrong it should not be Keep Original Tags it should be Dont Copy or move

image

brianteeman avatar Sep 26 '23 21:09 brianteeman

Yes, thanks for explainingt. The language string is the first reason for confusion. But it must be "select a tag". Just open the dropdown.

The second is: Why not accept the selection of items to move or copy from the overview? In com_menus and in categories we don't have an extra step for that. Maybe there is something special in tags which requires that?

chmst avatar Sep 27 '23 05:09 chmst

@chmst Sorry I dont understand what you are talking about

brianteeman avatar Sep 27 '23 06:09 brianteeman

I am sorry that I cannot explain. Will try it later with videos.

chmst avatar Sep 27 '23 06:09 chmst

@brianteeman you were correct. - it seems that this language string caused the whole confusion and my folloing action was overreaction. So it will be an easy fix. Thanks for your patience.

chmst avatar Sep 27 '23 11:09 chmst

Sorry for that confusion. I fixed the text and updated the description part of the PR.

beni71 avatar Sep 27 '23 18:09 beni71

This pull request has been automatically rebased to 5.1-dev.

HLeithner avatar Sep 30 '23 22:09 HLeithner

Please fix phpcs https://ci.joomla.org/joomla/joomla-cms/71117/1/7

Quy avatar Oct 07 '23 16:10 Quy

I have tested this item :red_circle: unsuccessfully on 78aad67cbc53c14c610e9a7627ddfdac2ade5bf0

My result for Test 2 looks like this, which is what i would expect. But its not mentioned in the test instructions.

Test 2 Tag4 -Tag2 --Tag3 -Tag1

Fails to copy the tags recursively, somehow the Tag 4 is added 2x, see Tag4 (15) and --Tag4 (8)?

Test 3 Tag4 -Tag2 --Tag3 --Tag4 (8) ---Tag2 (8) ----Tag3 (5) ----Tag4 (15) ---Tag1 (2) -Tag1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41927.

steffans avatar Feb 24 '24 10:02 steffans

I have tested this item :red_circle: unsuccessfully on 78aad67cbc53c14c610e9a7627ddfdac2ade5bf0

When I try to do the first move of -Tag2 --Tag3 under Tab4, I do not even have a Move or Copy dialog/set of buttons underneath the "To Move or Copy your selection please select a Tag or parent item" dropdown.

:(


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41927.

exlemor avatar Feb 24 '24 10:02 exlemor

@exlemor You need to compile the Javascript using "npm ci" in order to test this PR

steffans avatar Feb 24 '24 10:02 steffans

I have tested this item :white_check_mark: successfully on 78aad67cbc53c14c610e9a7627ddfdac2ade5bf0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41927.

crimle avatar Feb 24 '24 10:02 crimle

The process works, but in the batch a way to override the parent tag would be useful. Take it to the root level


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41927.

adj9 avatar Feb 24 '24 17:02 adj9

@beni71 Thank you for your work, however it looks as if we need some more adjustments. It seems as if the hierarchy is not maintained? Could you have a look?

Hackwar avatar Feb 26 '24 10:02 Hackwar

Hi all. Thanks for testing this feature. There are a couple of things I have to go one by one.

@steffans I'm not sure whether you didn't exactly follow the test instructions or you really found an issue. So let's go into details of test2 first: The initial tag structure is: Tag1 -Tag2 --Tag3 Tag4

Which means that Tag1 an Tag4 are both on root level, Tag2 is a sub-tag of Tag1 and Tag3 is a sub-tag of Tag2. So when I move Tag1 to Tag4 then Tag1 should be a sub-tag of Tag4, like: Tag4 -Tag1 --Tag2 ---Tag3

Can you tell me how your repro steps were to get: Tag4 -Tag2 --Tag3 -Tag1

beni71 avatar Feb 26 '24 18:02 beni71

@adj9 Regarding

The process works, but in the batch a way to override the parent tag would be useful. Take it to the root level

Do you mean something like: -Root-

Screenshot 2024-02-26 201648

Or what about: - No parent -

beni71 avatar Feb 26 '24 19:02 beni71

Extended the batch tag drop down with a "Root" item to move/copy selected tags to the root level, suggested by @adj9. I updated the description.

beni71 avatar Mar 03 '24 14:03 beni71

@bembelimen Can you please tell me where the breaking change is? Do I need to fix it?

beni71 avatar Apr 06 '24 14:04 beni71

This pull request has been automatically rebased to 5.2-dev.

HLeithner avatar Apr 24 '24 09:04 HLeithner

I have tested this item :red_circle: unsuccessfully on 715e848376c32ac1d3c1678762f1c9afa17234e3

The copy and move radio buttons did not show up for me.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41927.

cybersalt avatar Aug 20 '24 10:08 cybersalt

did you run: npm run build:js first ?

alikon avatar Aug 20 '24 10:08 alikon

~~Download Prebuilt packages result in a 404.~~

@Quy Thanks solving Problem.

fgsw avatar Aug 21 '24 03:08 fgsw

I have tested this item :white_check_mark: successfully on 715e848376c32ac1d3c1678762f1c9afa17234e3


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41927.

fgsw avatar Aug 21 '24 06:08 fgsw