? NPM Resource Changed Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
11 Aug 2021

Pull Request for Issue # .

Summary of Changes

The categories accordion implemented in this PR #33052 won't work properly when the menu item created to display categories tree when the sub-category has image or description and one of the two settings below set to show:

  • Category Image set to Show
  • Or Subcategories Descriptions set to Show

If image or description is being show, button.nextElementSibling will point to wrong div tag (you can see it by reading the code at https://github.com/joomla/joomla-cms/blob/4.0-dev/components/com_content/tmpl/categories/default_items.php#L34-L53

This PRs solve it by adding an attribute to the button to allow getting ID of the category and use it to get the right div which contains children categories of that category

I also made small modification to build/media_source/com_categories/joomla.asset.json to define preset so that we can call usePreset to load both JS and CSS in a single line of code.

Testing Instructions

  1. Setup categories and sub-categories for articles. Please remember to enter description for these categories
  2. Create a menu item to link to List All Categories in an Article Category Tree menu item type of com_content. In the menu item parameters, look at Category tab, set :
  • Empty Categories: Show
  • Subcategories Descriptions: Show
  1. Before patch:
  • Accordion on categories page does not work properly.
  1. After patch: According on works properly. To apply patch, please update your installation to the update package generated by this PR https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/35093/downloads/46491/Joomla_4.0.0-rc7-dev+pr.35093-Development-Update_Package.zip
avatar joomdonation joomdonation - open - 11 Aug 2021
avatar joomdonation joomdonation - change - 11 Aug 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Aug 2021
Category Repository NPM Change JavaScript Front End com_content
avatar joomdonation joomdonation - change - 11 Aug 2021
Labels Added: ? NPM Resource Changed
avatar RickR2H
RickR2H - comment - 12 Aug 2021

When I apply the patch I get an error:

The requested page can't be found.
There is no "com_categories.shared-categories-accordion" asset of a "preset" type in the registry.

avatar joomdonation
joomdonation - comment - 12 Aug 2021

Thanks @RickR2H. This changes JS file, so I think the easiest way to test is update your installation to update package generated by this PR https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/35093/downloads/46491/Joomla_4.0.0-rc7-dev+pr.35093-Development-Update_Package.zip (or run npm command, but to be honest, I haven't tried that method myself)

avatar joomdonation joomdonation - change - 12 Aug 2021
The description was changed
avatar joomdonation joomdonation - edited - 12 Aug 2021
avatar RickR2H RickR2H - test_item - 12 Aug 2021 - Tested successfully
avatar RickR2H
RickR2H - comment - 12 Aug 2021

I have tested this item successfully on d0786f2

Patch works! Had to run "npm ci" again after applying the patch.
Not the nicest layout as the category image id displayed after the toggler. But this is something for a new PR I guess...?


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

avatar joomdonation
joomdonation - comment - 12 Aug 2021

Not the nicest layout as the category image id displayed after the toggler. But this is something for a new PR I guess...?

Yes. I do not have good frontend skill to make it nicer, so I just fix the js bugs here. Thanks for testing :).

avatar chmst
chmst - comment - 12 Aug 2021

@RickR2H how did you get an image? I see the description but no image.


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

avatar RickR2H
RickR2H - comment - 12 Aug 2021

@chmst simply add an image to the dedicated category image field. Just edit the category and you'll find it ?

avatar ChristineWk ChristineWk - test_item - 12 Aug 2021 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 12 Aug 2021

I have tested this item successfully on d0786f2


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

avatar ChristineWk
ChristineWk - comment - 12 Aug 2021

result

screen shot 2021-08-12 at 21 54 19


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

avatar RickR2H
RickR2H - comment - 13 Aug 2021

As soon as this PR gets merged I'll try to take a look to fix the layout.

avatar joomdonation
joomdonation - comment - 13 Aug 2021

Thanks @RickR2H . We should also do the same fix for categories view of com_contact and com_newsfeeds to (the layout and logic is the same)

avatar RickR2H
RickR2H - comment - 13 Aug 2021

@joomdonation look like a nice side project ?

avatar joomdonation joomdonation - change - 13 Aug 2021
Status Pending Ready to Commit
avatar joomdonation
joomdonation - comment - 13 Aug 2021

RTC. Hope maintainer will merge it so that we can work on the layout fixes and apply the same fix for other components.


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

avatar wilsonge wilsonge - change - 13 Aug 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-08-13 14:26:47
Closed_By wilsonge
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - close - 13 Aug 2021
avatar wilsonge wilsonge - merge - 13 Aug 2021
avatar wilsonge
wilsonge - comment - 13 Aug 2021

Thanks!

avatar joomdonation
joomdonation - comment - 13 Aug 2021

@RickR2H This PR is now merged. Could you please help making the categories view nicer :) ?

avatar RickR2H
RickR2H - comment - 14 Aug 2021

@joomdonation layout change added and ready for testing

Add a Comment

Login with GitHub to post a comment