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
>
<
script
>
import
{
GlNav
,
GlNavItemDropdown
,
GlDropdownForm
,
GlTooltip
}
from
'
@gitlab/ui
'
;
import
{
GlNav
,
GlNavItemDropdown
,
GlDropdownForm
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
TopNavDropdownMenu
from
'
./top_nav_dropdown_menu.vue
'
;
import
TopNavDropdownMenu
from
'
./top_nav_dropdown_menu.vue
'
;
const
TOOLTIP
=
s__
(
'
TopNav|Switch to...
'
);
export
default
{
export
default
{
components
:
{
components
:
{
GlNav
,
GlNav
,
GlNavItemDropdown
,
GlNavItemDropdown
,
GlDropdownForm
,
GlDropdownForm
,
GlTooltip
,
TopNavDropdownMenu
,
TopNavDropdownMenu
,
},
},
props
:
{
props
:
{
...
@@ -19,15 +15,6 @@ export default {
...
@@ -19,15 +15,6 @@ export default {
required
:
true
,
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
>
</
script
>
...
@@ -48,12 +35,5 @@ export default {
...
@@ -48,12 +35,5 @@ export default {
/>
/>
</gl-dropdown-form>
</gl-dropdown-form>
</gl-nav-item-dropdown>
</gl-nav-item-dropdown>
<gl-tooltip
boundary=
"window"
:boundary-padding=
"0"
:target=
"findTooltipTarget"
placement=
"right"
:title=
"$options.TOOLTIP"
/>
</gl-nav>
</gl-nav>
</
template
>
</
template
>
locale/gitlab.pot
View file @
58c0d2f5
...
@@ -34330,9 +34330,6 @@ msgstr ""
...
@@ -34330,9 +34330,6 @@ msgstr ""
msgid "Too many projects enabled. You will need to manage them via the console or the API."
msgid "Too many projects enabled. You will need to manage them via the console or the API."
msgstr ""
msgstr ""
msgid "TopNav|Switch to..."
msgstr ""
msgid "Topics (optional)"
msgid "Topics (optional)"
msgstr ""
msgstr ""
...
...
spec/frontend/nav/components/top_nav_app_spec.js
View file @
58c0d2f5
import
{
GlNavItemDropdown
,
GlTooltip
}
from
'
@gitlab/ui
'
;
import
{
GlNavItemDropdown
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
TopNavApp
from
'
~/nav/components/top_nav_app.vue
'
;
import
TopNavApp
from
'
~/nav/components/top_nav_app.vue
'
;
import
TopNavDropdownMenu
from
'
~/nav/components/top_nav_dropdown_menu.vue
'
;
import
TopNavDropdownMenu
from
'
~/nav/components/top_nav_dropdown_menu.vue
'
;
import
{
TEST_NAV_DATA
}
from
'
../mock_data
'
;
import
{
TEST_NAV_DATA
}
from
'
../mock_data
'
;
...
@@ -7,8 +7,8 @@ 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
'
,
()
=>
{
describe
(
'
~/nav/components/top_nav_app.vue
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
createComponent
=
(
mountFn
=
shallowMount
)
=>
{
const
createComponent
=
()
=>
{
wrapper
=
mountFn
(
TopNavApp
,
{
wrapper
=
shallowMount
(
TopNavApp
,
{
propsData
:
{
propsData
:
{
navData
:
TEST_NAV_DATA
,
navData
:
TEST_NAV_DATA
,
},
},
...
@@ -17,7 +17,6 @@ describe('~/nav/components/top_nav_app.vue', () => {
...
@@ -17,7 +17,6 @@ describe('~/nav/components/top_nav_app.vue', () => {
const
findNavItemDropdown
=
()
=>
wrapper
.
findComponent
(
GlNavItemDropdown
);
const
findNavItemDropdown
=
()
=>
wrapper
.
findComponent
(
GlNavItemDropdown
);
const
findMenu
=
()
=>
wrapper
.
findComponent
(
TopNavDropdownMenu
);
const
findMenu
=
()
=>
wrapper
.
findComponent
(
TopNavDropdownMenu
);
const
findTooltip
=
()
=>
wrapper
.
findComponent
(
GlTooltip
);
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
...
@@ -44,25 +43,5 @@ describe('~/nav/components/top_nav_app.vue', () => {
...
@@ -44,25 +43,5 @@ describe('~/nav/components/top_nav_app.vue', () => {
views
:
TEST_NAV_DATA
.
views
,
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