Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the order of tabs in the Content view #718

Open
willguv opened this issue May 23, 2024 · 9 comments
Open

Change the order of tabs in the Content view #718

willguv opened this issue May 23, 2024 · 9 comments
Assignees

Comments

@willguv
Copy link
Member

willguv commented May 23, 2024

This is the current order

Image

Media and Alert banners are used often but are too far over to the right

I think the order should be:

  • Content
  • Blocks (if user has permissions)
  • Media
  • Files (if user has permissions)
  • Alert banners
  • Directory facets
  • Locations
  • Page components
  • Scheduling
  • Service contacts

The reasoning for this is as follows:

  • Content, blocks, media and files are used most so they're first
  • The rest are used less so they're in alphabetical order
@MariosORION
Copy link

This needed a combination of changes in the following PRs:

The resulting order of the Content page tabs after the above PRs make it into the main branch are:

  • Content (weight -10, unchanged)
  • Blocks (weight 0, unchanged)
  • Media (weight 10, unchanged)
  • Files (weight updated to 20)
  • Alert banners (weight updated to 30)
  • Directory facets (weight updated to 40)
  • Locations (weight updated to 50)
  • Page components (weight updated to 60)
  • Scheduling (weight updated to 70)
  • Service contacts (weight updated to 80)

@willguv
Copy link
Member Author

willguv commented Jun 4, 2024

Thanks @MariosORION !

@finnlewis
Copy link
Member

Thanks for this @MariosORION !
Here's how I tested:

  1. Fresh install (on Gitpod @willguv 😄 )
  2. Enabling localgov_demo module.
  3. Composer required all the branches. (@willguv like this https://docs.localgovdrupal.org/devs/how-to/how-to-test-modules-with-gitpod.html#_5-testing-branches-from-github )
  4. Clear the cache. (drush cr)
  5. See the following order of the local tasks:

image

Crikey, quite a few pull requests to get through to re-arrange the tabs! I guess that makes sense.
Although, thinking about it now, could all this code be in one module? localgov_core for example? Oh no... I see now, lots of them are the default weight from config: https://github.com/localgovdrupal/localgov_directories/pull/379/files

Sorry! Totally makes sense!

Thanks @MariosORION and @willguv 😺

@willguv
Copy link
Member Author

willguv commented Jun 4, 2024

This is brilliant, thanks Finn for testing and writing up these docs. I'll be able to take modules and branches for a spin, freeing up dev time. Will encourage others to get involved too.

Also thanks very much @MariosORION for picking this up at short notice.

Great work all round!

@MariosORION
Copy link

This is great, thanks both! Indeed @finnlewis , I wanted to keep the changes as "local" as possible hence the separate PRs.
I was thinking about a testing workflow for this kind of change (e.g. referencing the actual branches in composer.json for local testing) - it looks like the Gitpod approach works really well - nice one! 👍👍

@finnlewis
Copy link
Member

@MariosORION - quick question ( came up while reviewing and merging) - do the local tasks weights get exported as config, and so is it something that a specific site can override with config import?

@MariosORION
Copy link

@finnlewis short answer is yes.
Long answer: Local tasks are made to primarily be static. Defaults are defined in example.links.task.yml files and hook_menu_local_tasks_alter can be used to alter these.
The PRs here use a combination of the two, depending on the relative weight required for each item and how each item's weight is already defined (or altered) in the corresponding module.
A specific site could override all of these using the same hook (also assuming that the weight of the module of the specific site where the hook implementation is added is greater than the weights of the modules utilising the same hook in these PRs).

@willguv
Copy link
Member Author

willguv commented Jun 18, 2024

Just installed this - looks great, thanks @MariosORION!

@MariosORION
Copy link

Great to hear, @willguv !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants