User tests: Successful: Unsuccessful:
This is an alternative solution to #31392 which also takes care of the dashboard icons.
Inspired by comment #31392 (comment)
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.
Open the various dashboards (users, content, privacy, system, help, home, components, menus) and make sure the icons and title are the same as bevore
Title and icon are taken from guessed language strings or hardcoded in the view.
Title and icon are taken from the manifest files where they exist (home, system, help, components have no corresponding component)
dashboard developer documentation needs to reflect this.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content com_cpanel com_menus com_users |
Aw crap, I forgot to commit the language changes. Done now.
Labels |
Added:
?
|
Category | Administration com_content com_cpanel com_menus com_users | ⇒ | Administration com_content com_cpanel com_menus com_users Language & Strings |
I have tested this item
Labels |
Added:
?
|
I have tested this item
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.
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.
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.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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:
?
|
Looks better to me. Needs documentation on https://docs.joomla.org/Manifest_files
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.
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.
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.