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

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

73 lines
1.7 KiB
Vue
Raw Normal View History

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';
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
},
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>
2021-09-04 01:27:46 +05:30
<div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900">
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"
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"
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>