NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
25 Jan 2020

If you go to the template style and try to select which menu items etc that the style will be applied to then the wording is "Toggle selection".

The reality is that it does not toggle the selection but does either "select all" or "select none".

This PR corrects that so the toggle really does toggle the state of the checkboxes.

(Although the code is different in j3 the problem exists there as well so I can backport it if required @HLeithner @zero-24)

The same problem with the toggle not being a toggle exists in other places but again as the code is different in each place I will address those in their own PR.

To test don't forget to do npm i or node build.js --compile-js

Before

before

After

after

avatar brianteeman brianteeman - open - 25 Jan 2020
avatar brianteeman brianteeman - change - 25 Jan 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jan 2020
Category JavaScript Repository NPM Change
95b0c57 25 Jan 2020 avatar brianteeman hound
avatar brianteeman brianteeman - change - 25 Jan 2020
Labels Added: NPM Resource Changed ?
avatar brianteeman
brianteeman - comment - 25 Jan 2020

(Note toggle selections in com_finder for the filters works correctly already)

avatar Fedik
Fedik - comment - 25 Jan 2020

hm, actually there no issue with functionality, it supposed to work as it works now.
Your changes will make much more complicated to Select/Deselect all.

There only the label may a bit confusing, but we cannot easily switch it between "Select All/ Unselect All", that why it named with general string "Toggle".

Or we need to have 1-2 more buttons:
Select All / Deselect All / Toggle All

avatar brianteeman
brianteeman - comment - 25 Jan 2020

@Fedik It is not a toggle currently. Even though the value of the string is "toggle" and the key of the string is "invert" so clearly the original intent was for this to be a toggle. You will also see that the toggle string when used in com_finder for filters works correctly as a toggle and not a select all.

So if you want a select/deselect all then that is a separate and NEW issue that should have its own PR. This PR is fixing the bug that Toggle/Invert is not working correctly

avatar Fedik
Fedik - comment - 25 Jan 2020

I understand your expectation, but I do not agree with suggested fix, because in reason I wrote.

So if you want a select/deselect all then that is a separate and NEW issue that should have its own PR

Currently it not an issue, but this will be a new issue if your patch will be merged, I think it need to be fixed at once, somehow.
Otherwise the patch introduce degradation in functionality.

avatar brianteeman
brianteeman - comment - 25 Jan 2020

We can agree to disagree then. From my perspective this PR fixes a bug in expected behaviour of what a toggle will do. Think of it as a new user and not an experienced user who knows that when it says red it actually means green. Anything else is out of scope for this PR

avatar HLeithner
HLeithner - comment - 26 Jan 2020

Actually I think it a bug because the description of the button says "toggle" and not "select all" (an extra button that can do this would be useful if this get merged)

I'm also open for a backport to j3

avatar brianteeman
brianteeman - comment - 26 Jan 2020

Not just the text which could have been an error but the language key is explicit.

Will backport it tomorrow

avatar Fedik
Fedik - comment - 27 Jan 2020

If you want, please leave it just for 4.0,
The behavior 10+ years old, and changing it in last versions of j3 (especially without additional button), I not think it a good idea.
People are used to it. That what I think.

avatar brianteeman
brianteeman - comment - 27 Jan 2020

@Fedik I checked the history and the original code was for it to be a toggle. It was broken when it was converted from mootools to jquery

avatar brianteeman
brianteeman - comment - 27 Jan 2020

@HLeithner someone else will have to do the backport. its jquery and i dont get it

avatar HLeithner
HLeithner - comment - 27 Jan 2020

Ok thanks @brianteeman

avatar infograf768
infograf768 - comment - 28 Jan 2020

I would certainly not backport this to J3 and also not merge this in J4.
I agree with @Fedik that whatever the label, we are used to Unselect or Select All via the button.
The "original intention" was plain wrong and counterproductive.
A real toggle as proposed in this PR is totally useless and confusing.
Anyone using a lot of menus would have to anyway go over all items to figure what is now selected or unselected...
Let's just change the label for the purists or make it 2 buttons, or indeed add a Select and Unselect all buttons BUT in the same PR. Otherwise, if not done, this will stay forever...

avatar infograf768 infograf768 - test_item - 28 Jan 2020 - Tested unsuccessfully
avatar infograf768
infograf768 - comment - 28 Jan 2020

I have tested this item ? unsuccessfully on 95b0c57

For the reasons stated above I consider this PR "AS IS" as counterproductive.


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

avatar brianteeman
brianteeman - comment - 28 Jan 2020

It's a bug. The code originally was a toggle. A mistake when it was converted from mootools to jQuery resulted in the bug. That bug was replicated when converted to vanilla.

avatar infograf768
infograf768 - comment - 28 Jan 2020

It was a welcome bug as the feature is counterproductive.
If one really wants to Toggle as suggested add a Select and Unselect all buttons BUT in the same PR. Otherwise, if not done, this will stay forever...

avatar brianteeman
brianteeman - comment - 28 Jan 2020

Otherwise, if not done, this will stay forever...

That is your personal opinion

the feature is counterproductive.

I guess you need to change the behaviour of the toggle everywhere else that it is used then as everywhere else the toggle works as a toggle.

How do you explain to the users that here when it says toggle it doesnt really mean toggle

avatar jwaisner jwaisner - change - 6 Mar 2020
Priority Medium Low
avatar brianteeman
brianteeman - comment - 10 Mar 2020

It is quite crazy that you are refusing to allow a bug to be fixed!!

avatar roland-d
roland-d - comment - 21 Mar 2020

I have tested this item successfully on 6a65799

The button now works as a toggle and checks/unchecks as expected.


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

avatar roland-d roland-d - test_item - 21 Mar 2020 - Tested successfully
avatar Razzo1987
Razzo1987 - comment - 18 Apr 2020

@brianteeman can you pushes a change to GitHUb to generate prebuilt packages from Joomla CMS Bot please

avatar Razzo1987
Razzo1987 - comment - 18 Apr 2020

I have tested this item successfully on 6a65799

Tested and work!

Thanks to @roland-d who create the pakage for us :D


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

avatar faustonenci
faustonenci - comment - 18 Apr 2020

I have tested this item successfully on 6a65799

Good



Thanks to @roland-d for the pakage


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27631.
avatar Razzo1987 Razzo1987 - test_item - 18 Apr 2020 - Tested successfully
avatar faustonenci faustonenci - test_item - 18 Apr 2020 - Tested successfully
avatar alikon alikon - change - 18 Apr 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 18 Apr 2020

RTC


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

avatar wilsonge wilsonge - change - 2 May 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-05-02 16:11:27
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 2 May 2020
avatar wilsonge wilsonge - merge - 2 May 2020
avatar wilsonge
wilsonge - comment - 2 May 2020

I have to say I'm not convinced that toggle really is the useful functionality here as opposed to a select all/deselect all. But clearly that was the original intention so merging as a fix

avatar brianteeman
brianteeman - comment - 2 May 2020

Thanks

Add a Comment

Login with GitHub to post a comment