-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feature/110 Add content local task for alert banners #111
Feature/110 Add content local task for alert banners #111
Conversation
@tebb is this reviewable? |
Thanks @andybroomfield - Yes please. (We thought that creating pull requests automatically queued things for review. Should we be requesting code reviews?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've installed this and it worked fine at first, however the tabs are missing when a user goes to the manage alert banners page.
Will post screenshots shortly.
Looking at how the /admin/content/media and /admin/content/files views work, I think the tab has to be in the view, and the menu item should be added to localgov_alert_banner.links.menu.yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work @tebb and apologies for late reviewing.
I had a look and overall good, however there are some quirks I spotted with the tabs not showing once I go to the manage alert banner page. See inline comments.
localgov_alert_banner.links.task.yml
Outdated
title: Delete | ||
weight: 10 | ||
|
||
entity.localgov_alert_banner.collection: | ||
route_name: view.localgov_admin_manage_alert_banners.localgov_alert_banner_admin_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the route name to entity.localgov_alert_banner.collection
Theres a weird bug that when you go to the alert banner page the tabs no longer show. I think its to do with defining a collection route in the entity class, but we don't use the collection, we use the view. This causes issues with the menu / tab display but we will sort these out in another issue.
localgov_alert_banner.links.task.yml
Outdated
|
||
entity.localgov_alert_banner.collection: | ||
route_name: view.localgov_admin_manage_alert_banners.localgov_alert_banner_admin_list | ||
base_route: system.admin_content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the extra space
base_route: system.admin_content
entity.localgov_alert_banner.collection: | ||
route_name: view.localgov_admin_manage_alert_banners.localgov_alert_banner_admin_list | ||
base_route: system.admin_content | ||
title: 'Alert banners' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add weight: 50
to the bottom so it shows last in list.
…rs page Need to use the entity.localgov_alert_banner.collection route not the view.
I've added the fixes, if theres anyone who can give this a review before I merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, tested and working as expected.
Thanks @danchamp |
I have added the 'Alert banners' local task and tested that it appears after routing and links cache is flushed.
I added a second commit which (I believe) corrects some capitalisation and a typo. I wasn't sure if it's OK to do that in this specific issue.