? ? ? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
13 Nov 2020

This is an alternative solution to #31392 which also takes care of the dashboard icons.
Inspired by comment #31392 (comment)

Summary of Changes

Instead of guessing a language string for the title and the icon (!) of any dashboard, this PR changes it to lookup up the components manifest file and check the <dashboard> entries in there. If a corresponding entry for the current requested dashboard is found, then the title and icon attributes are taken as title and icon.

If not entry is found, the current behavior with guessed language strings for titles and icons are used. I'm not sure if we want to keep the icon stuff as it looks very fishy to me. The title guessing may be fine to keep.

Testing Instructions

Open the various dashboards (users, content, privacy, system, help, home, components, menus) and make sure the icons and title are the same as bevore

Actual result BEFORE applying this Pull Request

Title and icon are taken from guessed language strings or hardcoded in the view.

Expected result AFTER applying this Pull Request

Title and icon are taken from the manifest files where they exist (home, system, help, components have no corresponding component)

Documentation Changes Required

dashboard developer documentation needs to reflect this.

avatar Bakual Bakual - open - 13 Nov 2020
avatar Bakual Bakual - change - 13 Nov 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Nov 2020
Category Administration com_content com_cpanel com_menus com_users
avatar ceford
ceford - comment - 14 Nov 2020

The dashboard title strings are not translated:
COM_CONTENT_DASHBOARD_TITLE
COM_MENUS_DASHBOARD_TITLE
COM_USERS_DASHBOARD_TITLE


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

avatar Bakual
Bakual - comment - 14 Nov 2020

Aw crap, I forgot to commit the language changes. Done now.

avatar Bakual Bakual - change - 14 Nov 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 14 Nov 2020
Category Administration com_content com_cpanel com_menus com_users Administration com_content com_cpanel com_menus com_users Language & Strings
avatar infograf768 infograf768 - test_item - 14 Nov 2020 - Tested successfully
avatar infograf768
infograf768 - comment - 14 Nov 2020

I have tested this item successfully on 9167cc5


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

avatar richard67 richard67 - change - 14 Nov 2020
Labels Added: ?
avatar Harmageddon Harmageddon - test_item - 16 Nov 2020 - Tested successfully
avatar Harmageddon
Harmageddon - comment - 16 Nov 2020

I have tested this item successfully on 39d2a01

Looks good to me! This incorporates #31382 as a fallback solution, so either way works now. Perfect! :-)

The only point I'm not sure about: Can we assume that com_something components always have their manifest file as something.xml? I just found an extension (JEvents) using manifest.xml, but this breaks e.g. refreshing the manifest file in "Extensions - Manage", so I'd say it probably is an error on their side.


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

avatar Bakual
Bakual - comment - 16 Nov 2020

The only point I'm not sure about: Can we assume that com_something components always have their manifest file as something.xml? I just found an extension (JEvents) using manifest.xml, but this breaks e.g. refreshing the manifest file in "Extensions - Manage", so I'd say it probably is an error on their side.

I checked the refresh manifest code before I wrote this PR and just assumed that's the way this file is supposed to be named.
It would be simple enough to add another possible name but I only would do it if it's also be done in the refresh manifest code.

avatar Harmageddon
Harmageddon - comment - 17 Nov 2020

The only point I'm not sure about: Can we assume that com_something components always have their manifest file as something.xml? I just found an extension (JEvents) using manifest.xml, but this breaks e.g. refreshing the manifest file in "Extensions - Manage", so I'd say it probably is an error on their side.

I checked the refresh manifest code before I wrote this PR and just assumed that's the way this file is supposed to be named.
It would be simple enough to add another possible name but I only would do it if it's also be done in the refresh manifest code.

I agree. ?

avatar gostn gostn - test_item - 25 Nov 2020 - Tested successfully
avatar gostn
gostn - comment - 25 Nov 2020

I have tested this item successfully on 39d2a01


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

avatar alikon alikon - change - 25 Nov 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 25 Nov 2020

RTC


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

avatar wilsonge wilsonge - change - 18 Dec 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-12-18 03:04:32
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 18 Dec 2020
avatar wilsonge wilsonge - merge - 18 Dec 2020
avatar wilsonge
wilsonge - comment - 18 Dec 2020

Looks better to me. Needs documentation on https://docs.joomla.org/Manifest_files

avatar particthistle
particthistle - comment - 16 Apr 2021

In writing an upcoming JCM article on this specific feature, I've updated JDOCs https://docs.joomla.org/Manifest_files#Dashboards

Can someone please review that I've explained it correctly and sufficiently. If it's sufficient, remove the Documentation Required label as that task is now completed for this PR.

avatar ceford
ceford - comment - 15 May 2021

I tried setting up a dashboard a while back and gave up as it did not work and was not really necessary for my component. I looked into this again today and think I now understand what is needed for a third party component. The Dashboards part of the Manifest files document is not sufficient on its own. The core dashboards write the module specs directly into the database on installation. Any other component added later is going to need an installation script to call libraries/src/installer/installerScript.php->addDashboardMenu passing it a dashboard and preset. Is this written up somewhere else? It should be, and you could put in a link or placeholder link to that place.

Add a Comment

Login with GitHub to post a comment