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
e4580c13
Commit
e4580c13
authored
Jun 18, 2021
by
Paul Slaughter
Committed by
David O'Regan
Jun 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style polish for top nav redesign
parent
3e38f54a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
15 deletions
+16
-15
app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue
...ts/frequent_items/components/frequent_items_list_item.vue
+6
-3
app/assets/javascripts/nav/components/top_nav_menu_item.vue
app/assets/javascripts/nav/components/top_nav_menu_item.vue
+1
-1
app/assets/javascripts/nav/components/top_nav_menu_sections.vue
...sets/javascripts/nav/components/top_nav_menu_sections.vue
+1
-1
spec/frontend/frequent_items/components/frequent_items_list_item_spec.js
...requent_items/components/frequent_items_list_item_spec.js
+7
-9
spec/frontend/nav/components/top_nav_menu_item_spec.js
spec/frontend/nav/components/top_nav_menu_item_spec.js
+1
-1
No files found.
app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue
View file @
e4580c13
<
script
>
<
script
>
/* eslint-disable vue/require-default-prop, vue/no-v-html */
/* eslint-disable vue/require-default-prop, vue/no-v-html */
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
highlight
from
'
~/lib/utils/highlight
'
;
import
highlight
from
'
~/lib/utils/highlight
'
;
import
{
truncateNamespace
}
from
'
~/lib/utils/text_utility
'
;
import
{
truncateNamespace
}
from
'
~/lib/utils/text_utility
'
;
import
{
mapVuexModuleState
}
from
'
~/lib/utils/vuex_module_mappers
'
;
import
{
mapVuexModuleState
}
from
'
~/lib/utils/vuex_module_mappers
'
;
...
@@ -11,6 +12,7 @@ const trackingMixin = Tracking.mixin();
...
@@ -11,6 +12,7 @@ const trackingMixin = Tracking.mixin();
export
default
{
export
default
{
components
:
{
components
:
{
Identicon
,
Identicon
,
GlButton
,
},
},
mixins
:
[
trackingMixin
],
mixins
:
[
trackingMixin
],
inject
:
[
'
vuexModule
'
],
inject
:
[
'
vuexModule
'
],
...
@@ -56,9 +58,10 @@ export default {
...
@@ -56,9 +58,10 @@ export default {
<
template
>
<
template
>
<li
class=
"frequent-items-list-item-container"
>
<li
class=
"frequent-items-list-item-container"
>
<a
<gl-button
category=
"tertiary"
:href=
"webUrl"
:href=
"webUrl"
class=
"
clearfix dropdown-item
"
class=
"
gl-text-left gl-justify-content-start!
"
@
click=
"track('click_link',
{ label: `${dropdownType}_dropdown_frequent_items_list_item` })"
@
click=
"track('click_link',
{ label: `${dropdownType}_dropdown_frequent_items_list_item` })"
>
>
<div
<div
...
@@ -90,6 +93,6 @@ export default {
...
@@ -90,6 +93,6 @@ export default {
{{
truncatedNamespace
}}
{{
truncatedNamespace
}}
</div>
</div>
</div>
</div>
</
a
>
</
gl-button
>
</li>
</li>
</
template
>
</
template
>
app/assets/javascripts/nav/components/top_nav_menu_item.vue
View file @
e4580c13
...
@@ -42,7 +42,7 @@ export default {
...
@@ -42,7 +42,7 @@ export default {
v-on="$listeners"
v-on="$listeners"
>
>
<span
class=
"gl-display-flex"
>
<span
class=
"gl-display-flex"
>
<gl-icon
v-if=
"menuItem.icon"
:name=
"menuItem.icon"
:class=
"
{ 'gl-mr-
2
!': !iconOnly }" />
<gl-icon
v-if=
"menuItem.icon"
:name=
"menuItem.icon"
:class=
"
{ 'gl-mr-
3
!': !iconOnly }" />
<template
v-if=
"!iconOnly"
>
<template
v-if=
"!iconOnly"
>
{{
menuItem
.
title
}}
{{
menuItem
.
title
}}
<gl-icon
v-if=
"menuItem.view"
name=
"chevron-right"
class=
"gl-ml-auto"
/>
<gl-icon
v-if=
"menuItem.view"
name=
"chevron-right"
class=
"gl-ml-auto"
/>
...
...
app/assets/javascripts/nav/components/top_nav_menu_sections.vue
View file @
e4580c13
<
script
>
<
script
>
import
TopNavMenuItem
from
'
./top_nav_menu_item.vue
'
;
import
TopNavMenuItem
from
'
./top_nav_menu_item.vue
'
;
const
BORDER_CLASSES
=
'
gl-pt-3 gl-border-1 gl-border-t-solid gl-border-gray-
10
0
'
;
const
BORDER_CLASSES
=
'
gl-pt-3 gl-border-1 gl-border-t-solid gl-border-gray-
5
0
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
...
spec/frontend/frequent_items/components/frequent_items_list_item_spec.js
View file @
e4580c13
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
...
@@ -18,7 +19,7 @@ describe('FrequentItemsListItemComponent', () => {
...
@@ -18,7 +19,7 @@ describe('FrequentItemsListItemComponent', () => {
const
findAvatar
=
()
=>
wrapper
.
find
({
ref
:
'
frequentItemsItemAvatar
'
});
const
findAvatar
=
()
=>
wrapper
.
find
({
ref
:
'
frequentItemsItemAvatar
'
});
const
findAllTitles
=
()
=>
wrapper
.
findAll
({
ref
:
'
frequentItemsItemTitle
'
});
const
findAllTitles
=
()
=>
wrapper
.
findAll
({
ref
:
'
frequentItemsItemTitle
'
});
const
findNamespace
=
()
=>
wrapper
.
find
({
ref
:
'
frequentItemsItemNamespace
'
});
const
findNamespace
=
()
=>
wrapper
.
find
({
ref
:
'
frequentItemsItemNamespace
'
});
const
findAll
Anchors
=
()
=>
wrapper
.
findAll
(
'
a
'
);
const
findAll
Buttons
=
()
=>
wrapper
.
findAllComponents
(
GlButton
);
const
findAllNamespace
=
()
=>
wrapper
.
findAll
({
ref
:
'
frequentItemsItemNamespace
'
});
const
findAllNamespace
=
()
=>
wrapper
.
findAll
({
ref
:
'
frequentItemsItemNamespace
'
});
const
findAvatarContainer
=
()
=>
wrapper
.
findAll
({
ref
:
'
frequentItemsItemAvatarContainer
'
});
const
findAvatarContainer
=
()
=>
wrapper
.
findAll
({
ref
:
'
frequentItemsItemAvatarContainer
'
});
const
findAllMetadataContainers
=
()
=>
const
findAllMetadataContainers
=
()
=>
...
@@ -109,7 +110,7 @@ describe('FrequentItemsListItemComponent', () => {
...
@@ -109,7 +110,7 @@ describe('FrequentItemsListItemComponent', () => {
it
.
each
`
it
.
each
`
name | selector | expected
name | selector | expected
${
'
anchor
'
}
|
${
findAllAnchor
s
}
|
${
1
}
${
'
button
'
}
|
${
findAllButton
s
}
|
${
1
}
${
'
avatar container
'
}
|
${
findAvatarContainer
}
|
${
1
}
${
'
avatar container
'
}
|
${
findAvatarContainer
}
|
${
1
}
${
'
metadata container
'
}
|
${
findAllMetadataContainers
}
|
${
1
}
${
'
metadata container
'
}
|
${
findAllMetadataContainers
}
|
${
1
}
${
'
title
'
}
|
${
findAllTitles
}
|
${
1
}
${
'
title
'
}
|
${
findAllTitles
}
|
${
1
}
...
@@ -119,13 +120,10 @@ describe('FrequentItemsListItemComponent', () => {
...
@@ -119,13 +120,10 @@ describe('FrequentItemsListItemComponent', () => {
});
});
it
(
'
tracks when item link is clicked
'
,
()
=>
{
it
(
'
tracks when item link is clicked
'
,
()
=>
{
const
link
=
wrapper
.
find
(
'
a
'
);
const
link
=
wrapper
.
findComponent
(
GlButton
);
// NOTE: this listener is required to prevent the click from going through and causing:
// `Error: Not implemented: navigation ...`
link
.
vm
.
$emit
(
'
click
'
);
link
.
element
.
addEventListener
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
});
link
.
trigger
(
'
click
'
);
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
'
click_link
'
,
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
'
click_link
'
,
{
label
:
'
projects_dropdown_frequent_items_list_item
'
,
label
:
'
projects_dropdown_frequent_items_list_item
'
,
});
});
...
...
spec/frontend/nav/components/top_nav_menu_item_spec.js
View file @
e4580c13
...
@@ -73,7 +73,7 @@ describe('~/nav/components/top_nav_menu_item.vue', () => {
...
@@ -73,7 +73,7 @@ describe('~/nav/components/top_nav_menu_item.vue', () => {
expect
(
findButtonIcons
()).
toEqual
([
expect
(
findButtonIcons
()).
toEqual
([
{
{
name
:
TEST_MENU_ITEM
.
icon
,
name
:
TEST_MENU_ITEM
.
icon
,
classes
:
[
'
gl-mr-
2
!
'
],
classes
:
[
'
gl-mr-
3
!
'
],
},
},
{
{
name
:
'
chevron-right
'
,
name
:
'
chevron-right
'
,
...
...
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