Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

[Metismenu] Rename metismenu layout and integrate js into build process #221

Merged

Conversation

richard67
Copy link
Member

@richard67 richard67 commented Nov 2, 2020

Pull Request for Issues #195 (comment), #208 and #210 (comment).

Alternative to PR #217 and #224 .

Summary of Changes

This pull request (PR) changes the name of the layout to something more meaningful than "metismenu" and adds a language string for a nice layout name for the layout selection in the menu module's advanced options.

The name of the js file which already had es6 syntax is changed to extension .es6.js, and the file is moved to the right place in the build/media_source folder so that it's transpiled and minified and put at the right place in the media folder by the build script.

Finally, missing doc block with copyright information has been added to the js file.

Testing Instructions

If you have development environment for Joomla 4, checkout the development-rename-metismenu-layout-and-build-js branch, pull the latest changes, run "composer install" and "npm ci", and then make a new installation.

If you don't have that, use the following package to make a new installation: (obsolete link removed)

After that, login to backend and install "Blog Sample Data" to see the metismenu being used in frontend.

Then, still in backend, check the available layouts in the advanced options of the "Main Menu Blog" module.

Now go to frontend and verify that the metismenu works as well as before. You can also duplicate it in backend to another module position, or create another metismenu, and check in frontend that those modules still work well.

Last but not least, verify that in folder media/templates/cassiopeia/js/mod_menu (below the Joomla root, not the template folder) the following transpiled and minified js files are there:

  • menu-metismenu.es6.js
  • menu-metismenu.es6.min.js
  • menu-metismenu.js
  • menu-metismenu.min.js

Finally, make a copy of the Cassiopeia template, make the copy be the default template and check in frontend if the metimenu works also with the template copy.

Actual result BEFORE applying this Pull Request

Layout selection in the menu module's advanced options:

2020-10-29_02

The javascript file templates/cassiopeia/js/mod_menu/menu-metismenu.js to load the metismenus has es6 syntax but just a plain "js" file name extension. There is no minified file of it. The js linter will not run on that.

Expected result AFTER applying this Pull Request

Layout selection in the menu module's advanced options:

2020-11-03_02

The metismenu (one or more than one at a time) works as well as without this PR.

The javascript file build/media_source/templates/cassiopeia/js/mod_menu/menu-metismenu.es6.js to load the metismenu can be checked by the linter and is transpiled and copied to the right place by the build script.

The metismenu continues to work on copied templates. Those still use the js file mentioned before.

Documentation Changes Required

The alternative layout should be described in the J4 documentation for the Cassiopeia template.

@richard67 richard67 force-pushed the development-rename-metismenu-layout-and-build-js branch from f4716b4 to becf804 Compare November 3, 2020 08:42
@richard67 richard67 changed the title [Metismenu] [Draft] Rename metismenu layout and integrate js into build process [Metismenu] Rename metismenu layout and integrate js into build process Nov 8, 2020
@richard67 richard67 marked this pull request as ready for review November 8, 2020 14:01
@richard67 richard67 requested a review from chmst November 8, 2020 14:01
@chmst
Copy link
Collaborator

chmst commented Nov 8, 2020

Tested following the isntruction and looks good. Tested also with multiple dropdown menus. Works fine.

@richard67 richard67 merged commit bd6cf04 into development Nov 8, 2020
@richard67 richard67 deleted the development-rename-metismenu-layout-and-build-js branch November 8, 2020 18:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants