blob: ef27251dc6c4196557948269ca5a7b3505f3420b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
<script>
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import ProjectAvatar from '~/vue_shared/components/project_avatar.vue';
import NavItem from './nav_item.vue';
export default {
components: {
GlButton,
ProjectAvatar,
NavItem,
},
directives: {
GlTooltip: GlTooltipDirective,
},
props: {
items: {
type: Array,
required: false,
default: () => [],
},
},
};
</script>
<template>
<ul class="gl-p-0 gl-list-style-none">
<nav-item
v-for="item in items"
:key="item.id"
:item="item"
:link-classes="{ 'gl-py-2!': true }"
>
<template #icon>
<project-avatar
:project-id="item.id"
:project-name="item.title"
:project-avatar-url="item.avatar"
:size="24"
aria-hidden="true"
/>
</template>
<template #actions>
<gl-button
v-gl-tooltip.right.viewport
size="small"
category="tertiary"
icon="dash"
:aria-label="__('Remove')"
:title="__('Remove')"
class="gl-align-self-center gl-p-1! gl-absolute gl-right-4"
data-testid="item-remove"
@click.stop.prevent="$emit('remove-item', item)"
/>
</template>
</nav-item>
<slot name="view-all-items"></slot>
</ul>
</template>
|