Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
58c0d2f5
Commit
58c0d2f5
authored
May 29, 2021
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove "Switch To" tooltip from top nav
https://gitlab.com/gitlab-org/gitlab/-/issues/331466
parent
0470e3ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
49 deletions
+5
-49
app/assets/javascripts/nav/components/top_nav_app.vue
app/assets/javascripts/nav/components/top_nav_app.vue
+1
-21
locale/gitlab.pot
locale/gitlab.pot
+0
-3
spec/frontend/nav/components/top_nav_app_spec.js
spec/frontend/nav/components/top_nav_app_spec.js
+4
-25
No files found.
app/assets/javascripts/nav/components/top_nav_app.vue
View file @
58c0d2f5
<
script
>
import
{
GlNav
,
GlNavItemDropdown
,
GlDropdownForm
,
GlTooltip
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
GlNav
,
GlNavItemDropdown
,
GlDropdownForm
}
from
'
@gitlab/ui
'
;
import
TopNavDropdownMenu
from
'
./top_nav_dropdown_menu.vue
'
;
const
TOOLTIP
=
s__
(
'
TopNav|Switch to...
'
);
export
default
{
components
:
{
GlNav
,
GlNavItemDropdown
,
GlDropdownForm
,
GlTooltip
,
TopNavDropdownMenu
,
},
props
:
{
...
...
@@ -19,15 +15,6 @@ export default {
required
:
true
,
},
},
methods
:
{
findTooltipTarget
()
{
// ### Why use a target function instead of `v-gl-tooltip`?
// To get the tooltip to align correctly, we need it to target the actual
// toggle button which we don't directly render.
return
this
.
$el
.
querySelector
(
'
.js-top-nav-dropdown-toggle
'
);
},
},
TOOLTIP
,
};
</
script
>
...
...
@@ -48,12 +35,5 @@ export default {
/>
</gl-dropdown-form>
</gl-nav-item-dropdown>
<gl-tooltip
boundary=
"window"
:boundary-padding=
"0"
:target=
"findTooltipTarget"
placement=
"right"
:title=
"$options.TOOLTIP"
/>
</gl-nav>
</
template
>
locale/gitlab.pot
View file @
58c0d2f5
...
...
@@ -34330,9 +34330,6 @@ msgstr ""
msgid "Too many projects enabled. You will need to manage them via the console or the API."
msgstr ""
msgid "TopNav|Switch to..."
msgstr ""
msgid "Topics (optional)"
msgstr ""
...
...
spec/frontend/nav/components/top_nav_app_spec.js
View file @
58c0d2f5
import
{
GlNavItemDropdown
,
GlTooltip
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
{
GlNavItemDropdown
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
TopNavApp
from
'
~/nav/components/top_nav_app.vue
'
;
import
TopNavDropdownMenu
from
'
~/nav/components/top_nav_dropdown_menu.vue
'
;
import
{
TEST_NAV_DATA
}
from
'
../mock_data
'
;
...
...
@@ -7,8 +7,8 @@ import { TEST_NAV_DATA } from '../mock_data';
describe
(
'
~/nav/components/top_nav_app.vue
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
(
mountFn
=
shallowMount
)
=>
{
wrapper
=
mountFn
(
TopNavApp
,
{
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
TopNavApp
,
{
propsData
:
{
navData
:
TEST_NAV_DATA
,
},
...
...
@@ -17,7 +17,6 @@ describe('~/nav/components/top_nav_app.vue', () => {
const
findNavItemDropdown
=
()
=>
wrapper
.
findComponent
(
GlNavItemDropdown
);
const
findMenu
=
()
=>
wrapper
.
findComponent
(
TopNavDropdownMenu
);
const
findTooltip
=
()
=>
wrapper
.
findComponent
(
GlTooltip
);
afterEach
(()
=>
{
wrapper
.
destroy
();
...
...
@@ -44,25 +43,5 @@ describe('~/nav/components/top_nav_app.vue', () => {
views
:
TEST_NAV_DATA
.
views
,
});
});
it
(
'
renders tooltip
'
,
()
=>
{
expect
(
findTooltip
().
attributes
()).
toMatchObject
({
'
boundary-padding
'
:
'
0
'
,
placement
:
'
right
'
,
title
:
TopNavApp
.
TOOLTIP
,
});
});
});
describe
(
'
when full mounted
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
(
mount
);
});
it
(
'
has dropdown toggle as tooltip target
'
,
()
=>
{
const
targetFn
=
findTooltip
().
props
(
'
target
'
);
expect
(
targetFn
()).
toBe
(
wrapper
.
find
(
'
.js-top-nav-dropdown-toggle
'
).
element
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment