Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
admin_toolbar
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
admin_toolbar
Merge requests
!128
Issue
#3495223
: Improve UX for Local Tasks in Toolbar
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3495223
: Improve UX for Local Tasks in Toolbar
issue/admin_toolbar-3495223:3495223-improve-ux-for
into
3.x
Overview
0
Commits
1
Pipelines
2
Changes
1
Open
Yannick
requested to merge
issue/admin_toolbar-3495223:3495223-improve-ux-for
into
3.x
3 weeks ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
Closes
#3495223
0
0
Merge request reports
Compare
3.x
version 1
58da2c46
3 weeks ago
3.x (HEAD)
and
latest version
latest version
6d79e978
1 commit,
3 weeks ago
version 1
58da2c46
1 commit,
3 weeks ago
1 file
+
12
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
admin_toolbar_tools/src/AdminToolbarToolsHelper.php
+
12
−
2
Options
@@ -102,6 +102,16 @@ class AdminToolbarToolsHelper {
}
}
$local_tasks_default_url
=
Url
::
fromRoute
(
'<none>'
);
$local_tasks_default_title
=
$this
->
t
(
'Local Tasks'
);
// Set default URL to entity edit form if available.
foreach
(
$local_task_links
[
'#links'
]
as
$route_name
=>
$link
)
{
if
(
preg_match
(
'/^entity\..+\.edit_form$/'
,
$route_name
))
{
$local_tasks_default_url
=
$link
[
'url'
];
$local_tasks_default_title
=
$link
[
'title'
];
}
}
$build
=
[
'#type'
=>
'toolbar_item'
,
'#wrapper_attributes'
=>
[
@@ -117,8 +127,8 @@ class AdminToolbarToolsHelper {
// This means that for now we always render Local Tasks item even
// when the tray is empty.
'#type'
=>
'link'
,
'#title'
=>
$
this
->
t
(
'L
ocal
T
asks
'
)
,
'#url'
=>
Url
::
fromRoute
(
'<none>'
)
,
'#title'
=>
$
l
ocal
_t
asks
_default_title
,
'#url'
=>
$local_tasks_default_url
,
'#attributes'
=>
[
'class'
=>
[
'toolbar-icon'
,
Loading