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

73 lines
1.5 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>
2020-01-01 13:55:28 +05:30
<div class="title hide-collapsed">
2018-05-09 12:01:36 +05:30
{{ assigneeTitle }}
2020-04-08 14:13:33 +05:30
<gl-loading-icon v-if="loading" inline class="align-bottom" />
2019-12-04 20:38:33 +05:30
<a
v-if="editable"
class="js-sidebar-dropdown-toggle edit-link float-right"
href="#"
2021-01-03 14:25:43 +05:30
data-test-id="edit-link"
2019-12-21 20:55:43 +05:30
data-track-event="click_edit_button"
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>