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
|
<script>
import { GlAvatarLabeled, GlTruncateText } from '@gitlab/ui';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import SafeHtml from '~/vue_shared/directives/safe_html';
export default {
name: 'OrganizationsListItem',
components: {
GlAvatarLabeled,
GlTruncateText,
},
safeHtmlConfig: {
ADD_TAGS: ['gl-emoji'],
},
directives: {
SafeHtml,
},
props: {
organization: {
type: Object,
required: true,
},
},
avatarSize: { default: 32, md: 48 },
getIdFromGraphQLId,
};
</script>
<template>
<li class="organization-row gl-py-3 gl-border-b gl-display-flex gl-align-items-flex-start">
<gl-avatar-labeled
:size="$options.avatarSize"
:src="organization.avatarUrl"
:entity-id="$options.getIdFromGraphQLId(organization.id)"
:entity-name="organization.name"
:label="organization.name"
:label-link="organization.webUrl"
shape="rect"
>
<gl-truncate-text
v-if="organization.descriptionHtml"
:lines="2"
:mobile-lines="2"
class="gl-mt-2"
>
<div
v-safe-html:[$options.safeHtmlConfig]="organization.descriptionHtml"
data-testid="organization-description-html"
class="organization-description gl-text-secondary gl-font-sm"
></div>
</gl-truncate-text>
</gl-avatar-labeled>
</li>
</template>
|