-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add support to add label to menu group #1847
Draft
mkrecek234
wants to merge
6
commits into
develop
Choose a base branch
from
feature/menugroup_label
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
70c8a14
Add support to add label to menugroup
mkrecek234 b4eaa21
rm unused fallback keys
mvorisek c3e9ab8
improve var case in docs
mvorisek 63e9011
tiny size
mvorisek 10142a4
add docs example
mvorisek 93ac62f
DEBUG render/size unify
mvorisek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ public function addMenu($name) | |
$name = [$name]; | ||
} | ||
|
||
$label = $name['title'] ?? $name['text'] ?? $name['name'] ?? $name[0] ?? null; | ||
$label = $name['title'] ?? $name[0] ?? null; | ||
|
||
if ($label !== null) { | ||
$subMenu->template->set('label', $label); | ||
|
@@ -123,14 +123,16 @@ public function addGroup($name, string $template = 'menugroup.html') | |
$name = [$name]; | ||
} | ||
|
||
$title = $name['title'] ?? $name['text'] ?? $name['name'] ?? $name[0] ?? null; | ||
$title = $name['title'] ?? $name[0] ?? null; | ||
|
||
if ($title !== null) { | ||
$group->template->set('title', $title); | ||
} | ||
|
||
if (isset($name['icon'])) { | ||
Icon::addTo($group, [$name['icon']], ['Icon'])->removeClass('item'); | ||
} elseif (isset($name['label'])) { | ||
Label::addTo($group, [$name['label']], ['Icon'])->removeClass('item')->addClass('tiny'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for menu item the size is standard (class is unspecified) - ie. the font size is 12 px for menu group, the size should not be smaller (tiny is 9 px) related with https://github.com/atk4/ui/pull/1847/files#r1548874861 which should be solved first/instead |
||
} | ||
|
||
return $group; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The solution is probably to implement the "menu group item" the same way as "menu item", currently the HTML/CSS for "menu group item" is using CSS/FUI columns, but "menu item" right float positioning.
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.
in 93ac62f I have commit debug code to debug/unify this
also IMO Maestro layout should be integrated into parametrized Admin layout