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

[Admin] Improve highlighting menu items #14324

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

GSadee
Copy link
Member

@GSadee GSadee commented Sep 19, 2022

Q A
Branch? 1.11
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets
License MIT

Examples:
Before:
Zrzut ekranu 2022-09-19 o 11 46 10

After:
Zrzut ekranu 2022-09-19 o 11 45 49

@GSadee GSadee added UX Issues and PRs aimed at improving User eXperience. Admin AdminBundle related issues and PRs. labels Sep 19, 2022
@GSadee GSadee requested a review from a team as a code owner September 19, 2022 10:09
Comment on lines +52 to +55
->addChild('taxons', ['route' => 'sylius_admin_taxon_create', 'extras' => ['routes' => [
['route' => 'sylius_admin_taxon_create_for_parent'],
['route' => 'sylius_admin_taxon_update'],
]]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't you use the ::setExtra method instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but it doesn't work, I'm not sure why and haven't searched deeper 🤷🏻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you recheck, because I just added

->setExtra('routes', [
    ['route' => 'sylius_admin_taxon_create'],
    ['route' => 'sylius_admin_taxon_create_for_parent'],
    ['route' => 'sylius_admin_taxon_update'],
])

and it seems to work just fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see the difference, you are passing also the "main" route to extras, which I didn't do, so this approach requires duplication of one route in each menu item, now, I'm not sure if it looks better 😄

Copy link
Member

@lchrusciel lchrusciel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some doubts, that we have to declare it manually, but let's go with what we have right now and perhaps improve it in the future

@lchrusciel lchrusciel added the Bug Confirmed bugs or bugfixes. label Sep 21, 2022
@lchrusciel lchrusciel merged commit 5635997 into Sylius:1.11 Sep 21, 2022
@GSadee GSadee deleted the admin-improve-menu branch September 21, 2022 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin AdminBundle related issues and PRs. Bug Confirmed bugs or bugfixes. UX Issues and PRs aimed at improving User eXperience.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants