? Pending

User tests: Successful: Unsuccessful:

avatar izharaazmi
izharaazmi
14 Sep 2018

Pull Request for Issue #22154, #19827

Summary of Changes

Do not show Batch action in the toolbar if batch action is not possible.

Testing Instructions

  • Create an admin menu
  • Create some menu items in this admin menu
  • Trash some of these menu items
  • Filter by menu type or published state or both

Earlier - Batch button is displayed in the toolbar but "Process" button is hidden when filtered by trash or menu type is not selected.

After this patch - The Batch button is only displayed when some menu type is selected and filtered by states other than trashed.

Documentation Changes Required

NA

avatar izharaazmi izharaazmi - open - 14 Sep 2018
avatar izharaazmi izharaazmi - change - 14 Sep 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Sep 2018
Category Administration com_menus
avatar izharaazmi izharaazmi - change - 14 Sep 2018
Labels Added: ?
avatar infograf768
infograf768 - comment - 14 Sep 2018

I have tested this item successfully on 28e30b0

Tks.


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

avatar infograf768 infograf768 - test_item - 14 Sep 2018 - Tested successfully
avatar chmst
chmst - comment - 14 Sep 2018

I like the idea of hiding a button if there are no items where the function can be applied.
I have made a similiar proposal some time ago. https://issues.joomla.org/tracker/joomla-cms/20559. It was a discussion on how and when showing buttons in the toolbar and it should be a general solution for all buttons.

But I don't like hiding buttons if no items are selected.
When I teach new adminitrators who are nor experienced in managing websites, I am sure that they never try selecting items to get a surprise toolbar and see what they can do.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22178.
avatar izharaazmi
izharaazmi - comment - 14 Sep 2018

I don't mean to hide the button based on selection of rows. It is depending on the active filters (menutype + state)

avatar SharkyKZ
SharkyKZ - comment - 14 Sep 2018

Why don't we allow batch actions when filter is set to trashed?

avatar chmst
chmst - comment - 14 Sep 2018

Yes it works and I too like the idea, showing buttons only if they can be applied. I think if we do that for one button, it should be made for all butttons and everywhere. Or do you think it is possible only here?


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

EDIT: @SharkyKZ indeed

avatar izharaazmi
izharaazmi - comment - 14 Sep 2018

@chmst Yes, this idea can be applied everywhere. I am using this concept in my extensions since long. Not sure if can be accepted in 3.x core.

@SharkyKZ @chmst Please see #22154 (comment)

avatar infograf768
infograf768 - comment - 14 Sep 2018

hmm
I did not remark this when testing
Although I do reluctantly agree that the button may not show when filtering by trash, I am not sure it is a good idea to also make it depend on the menu type as we have a nice error in that case which makes sense and it keeps letting users know we can batch.
I change my test now to negative because of that.

avatar infograf768
infograf768 - comment - 14 Sep 2018

I have tested this item ? unsuccessfully on 28e30b0

For the reason stated above.


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

avatar infograf768
infograf768 - comment - 14 Sep 2018

I have tested this item ? unsuccessfully on 28e30b0

For the reason stated above.


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

avatar infograf768 infograf768 - test_item - 14 Sep 2018 - Tested unsuccessfully
avatar SharkyKZ
SharkyKZ - comment - 14 Sep 2018

Trashed filter check was added much earlier in #13649 but wasn't explained why. We can perform batch operations on trashed items when filter is set to All, so it doesn't make much sense to add a limitation when filtering by trashed.

avatar brianteeman
brianteeman - comment - 14 Sep 2018

@chmst some of us have been trying to do this for joomla for 4 years but everyone the concept of not showing a button if it cannot be used is mentioned it is shot down and blocked by one person. Progressive disclosure of actions is a ui pattern adopted by everyone except joomla all because maintainers are scared of one person

avatar infograf768
infograf768 - comment - 14 Sep 2018

ROTFLOL

because maintainers are scared of one person

Just state directly it is because of me that this is not done, as if I could scare anyone here... and specially maintainers.
I suggest you complain —again— to OSM to try to get me fired if I scare people so much.
ROTFLOL again.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Sep 2018

Haven't read Discussins 4 Years ago. But Today i hope Decisions are made by Arguments, which fits Joomla. In my Opinion the Target of Joomla has to be the non-Experienced User.

avatar izharaazmi
izharaazmi - comment - 14 Sep 2018

From my understanding, its okay to hide action buttons if that is not applicable. However, the argument by @infograf768 is valid, that we need to tell users that they need to filter the list in a specific way to get that action.

And further, I don't see a reason why trashed item cannot be batch processed neither do I understand it for menutype filtering. We may need to adjust the "move" target field. But that should be better.

PS: Irrespective of this debate here, I am going to change this PR the older way, viz. just hide the process button in the modal.

avatar jsubri
jsubri - comment - 14 Sep 2018

my 2ct here, not being an expert and not every day on this list. I've seen many exchanges on similar discussion related to show/hide buttons. Current settings is the buttons are shown in a contextual manner (actionable/non-actionable) such as the "Empty Trash" that shows-up only when filtering is on Trashed, however the "Empty Trash" is not showing-up when filtering is on All,

My personal preference would be that all buttons be visible but grayed-out when not-actionable, that would give you an immediate visual indication that you are in a non-actionable state. The UI draw back with this is that the toolbar is often taking 2 lines in your screen for non English languages.

avatar infograf768
infograf768 - comment - 15 Sep 2018

As @SharkyKZ wrote:

We can perform batch operations on trashed items when filter is set to All, so it doesn't make much sense to add a limitation when filtering by trashed.

This is indeed a contradiction.

The code is in default_batch_body.php and I would suggest to refactor this too.
basically we would only get 2 types of messages:

  1. The js alert when no menu item has been selected in the list.
  2. The text in the modal when no menutype has been selected
    <p><?php echo JText::_('COM_MENUS_SELECT_MENU_FIRST'); ?></p>

Therefore we would be able to batch Trashed items (why not do it?) and the code would make sense and be simplified both for site and admin.
After all, batching trashed items makes no sense but that is the responsibility of the site admin to clutter the db...

avatar ivankomlev
ivankomlev - comment - 16 Nov 2018

The problem is not solved. I have a "trashed" filter and "Batch" buttons appears but even if you have menu items selected the modal message appears any way, saying "Filter the list by a state other than trashed or clear the filter."

avatar ivankomlev
ivankomlev - comment - 16 Nov 2018

I have tested this item ? unsuccessfully on 5b17667


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

avatar ivankomlev ivankomlev - test_item - 16 Nov 2018 - Tested unsuccessfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Apr 2019

Can this be closed as new Feature doesn't go in J3 and J4 have this kind of Stuff?

avatar brianteeman
brianteeman - comment - 26 Apr 2019

its not a feature its a bug fix

avatar laoneo
laoneo - comment - 28 Mar 2022

Sorry that it took so long to respond. As this is a nice fix for Joomla, can you recheck why the test failed from @joomlaboat and have a look the remark from @infograf768. Also would be good to identify if the issue still exists in Joomla 4. In the meantime I'm closing this pr, when ready, please reopen again so we can make another round of testing. Thank you very much for your help making Joomla better.

avatar laoneo laoneo - change - 28 Mar 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-03-28 07:48:19
Closed_By laoneo
Labels Added: ?
Removed: ?
avatar laoneo laoneo - close - 28 Mar 2022

Add a Comment

Login with GitHub to post a comment