debian-mirror-gitlab/app/assets/javascripts/sidebar/components/assignees/issuable_assignees.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
1.6 KiB
Vue
Raw Normal View History

2020-11-24 15:15:51 +05:30
<script>
2021-02-22 17:27:13 +05:30
import { GlButton } from '@gitlab/ui';
2020-11-24 15:15:51 +05:30
import { n__ } from '~/locale';
import UncollapsedAssigneeList from '~/sidebar/components/assignees/uncollapsed_assignee_list.vue';
export default {
components: {
2021-02-22 17:27:13 +05:30
GlButton,
2020-11-24 15:15:51 +05:30
UncollapsedAssigneeList,
},
props: {
users: {
type: Array,
required: true,
},
2021-03-11 19:13:27 +05:30
issuableType: {
type: String,
required: false,
default: 'issue',
},
2021-04-29 21:17:54 +05:30
signedIn: {
type: Boolean,
required: false,
default: false,
},
2022-10-11 01:57:18 +05:30
editable: {
type: Boolean,
required: true,
},
2020-11-24 15:15:51 +05:30
},
computed: {
assigneesText() {
return n__('Assignee', '%d Assignees', this.users.length);
},
emptyUsers() {
return this.users.length === 0;
},
},
};
</script>
<template>
2021-04-17 20:07:23 +05:30
<div class="gl-display-flex gl-flex-direction-column issuable-assignees">
<div
v-if="emptyUsers"
2022-05-07 20:08:51 +05:30
class="gl-display-flex gl-align-items-center gl-text-gray-500 hide-collapsed"
2021-04-17 20:07:23 +05:30
data-testid="none"
>
2021-04-29 21:17:54 +05:30
<span> {{ __('None') }}</span>
2022-10-11 01:57:18 +05:30
<template v-if="signedIn && editable">
2021-04-29 21:17:54 +05:30
<span class="gl-ml-2">-</span>
<gl-button
data-testid="assign-yourself"
category="tertiary"
variant="link"
class="gl-ml-2"
@click="$emit('assign-self')"
>
<span class="gl-text-gray-500 gl-hover-text-blue-800">{{ __('assign yourself') }}</span>
</gl-button>
</template>
2020-11-24 15:15:51 +05:30
</div>
2021-04-29 21:17:54 +05:30
<uncollapsed-assignee-list
v-else
:users="users"
:issuable-type="issuableType"
2022-05-07 20:08:51 +05:30
class="gl-text-gray-800 hide-collapsed"
2021-04-29 21:17:54 +05:30
/>
2020-11-24 15:15:51 +05:30
</div>
</template>