Commit 58c0d2f5 authored by Paul Slaughter's avatar Paul Slaughter

Remove "Switch To" tooltip from top nav

https://gitlab.com/gitlab-org/gitlab/-/issues/331466
parent 0470e3ad
<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>
...@@ -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 ""
......
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);
});
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment