2018-05-09 12:01:36 +05:30
|
|
|
<script>
|
2021-01-03 14:25:43 +05:30
|
|
|
import { GlLoadingIcon, GlIcon } from '@gitlab/ui';
|
|
|
|
import { n__, __ } from '~/locale';
|
2022-07-16 23:28:13 +05:30
|
|
|
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
|
2019-09-30 21:07:59 +05:30
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
export default {
|
|
|
|
name: 'AssigneeTitle',
|
2020-04-08 14:13:33 +05:30
|
|
|
components: {
|
|
|
|
GlLoadingIcon,
|
2021-01-03 14:25:43 +05:30
|
|
|
GlIcon,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
2022-07-16 23:28:13 +05:30
|
|
|
mixins: [glFeatureFlagMixin()],
|
2018-05-09 12:01:36 +05:30
|
|
|
props: {
|
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
numberOfAssignees: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
editable: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
showToggle: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-01-03 14:25:43 +05:30
|
|
|
changing: {
|
|
|
|
type: Boolean,
|
2021-01-29 00:20:46 +05:30
|
|
|
required: false,
|
|
|
|
default: false,
|
2021-01-03 14:25:43 +05:30
|
|
|
},
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
assigneeTitle() {
|
|
|
|
const assignees = this.numberOfAssignees;
|
2019-09-30 21:07:59 +05:30
|
|
|
return n__('Assignee', `%d Assignees`, assignees);
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
2021-01-03 14:25:43 +05:30
|
|
|
titleCopy() {
|
|
|
|
return this.changing ? __('Apply') : __('Edit');
|
|
|
|
},
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
2022-07-16 23:28:13 +05:30
|
|
|
<div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900 gl-font-weight-bold">
|
2018-05-09 12:01:36 +05:30
|
|
|
{{ assigneeTitle }}
|
2021-09-30 23:02:18 +05:30
|
|
|
<gl-loading-icon v-if="loading" size="sm" inline class="align-bottom" />
|
2019-12-04 20:38:33 +05:30
|
|
|
<a
|
|
|
|
v-if="editable"
|
2021-10-27 15:23:28 +05:30
|
|
|
class="js-sidebar-dropdown-toggle edit-link btn gl-text-gray-900! gl-ml-auto hide-collapsed btn-default btn-sm gl-button btn-default-tertiary float-right"
|
2019-12-04 20:38:33 +05:30
|
|
|
href="#"
|
2021-01-03 14:25:43 +05:30
|
|
|
data-test-id="edit-link"
|
2023-01-13 00:05:48 +05:30
|
|
|
data-qa-selector="edit_link"
|
2021-11-11 11:23:49 +05:30
|
|
|
data-track-action="click_edit_button"
|
2019-12-21 20:55:43 +05:30
|
|
|
data-track-label="right_sidebar"
|
|
|
|
data-track-property="assignee"
|
2019-12-04 20:38:33 +05:30
|
|
|
>
|
2021-01-03 14:25:43 +05:30
|
|
|
{{ titleCopy }}
|
2018-05-09 12:01:36 +05:30
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
v-if="showToggle"
|
2019-09-30 21:07:59 +05:30
|
|
|
:aria-label="__('Toggle sidebar')"
|
2018-11-08 19:23:39 +05:30
|
|
|
class="gutter-toggle float-right js-sidebar-toggle"
|
2022-07-16 23:28:13 +05:30
|
|
|
:class="{ 'gl-display-block gl-md-display-none!': glFeatures.movedMrSidebar }"
|
2018-05-09 12:01:36 +05:30
|
|
|
href="#"
|
|
|
|
role="button"
|
|
|
|
>
|
2021-02-22 17:27:13 +05:30
|
|
|
<gl-icon data-hidden="true" name="chevron-double-lg-right" :size="12" />
|
2018-05-09 12:01:36 +05:30
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|