debian-mirror-gitlab/app/assets/javascripts/sidebar/components/participants/sidebar_participants_widget.vue

77 lines
1.4 KiB
Vue
Raw Normal View History

2021-06-08 01:23:25 +05:30
<script>
import { __ } from '~/locale';
import { participantsQueries } from '~/sidebar/constants';
import Participants from './participants.vue';
export default {
i18n: {
fetchingError: __('An error occurred while fetching participants'),
},
components: {
Participants,
},
props: {
iid: {
type: String,
required: true,
},
fullPath: {
type: String,
required: true,
},
issuableType: {
required: true,
type: String,
},
},
data() {
return {
participants: [],
};
},
apollo: {
participants: {
query() {
return participantsQueries[this.issuableType].query;
},
variables() {
return {
fullPath: this.fullPath,
iid: this.iid,
};
},
update(data) {
return data.workspace?.issuable?.participants.nodes || [];
},
error(error) {
this.$emit('fetch-error', {
message: this.$options.i18n.fetchingError,
error,
});
},
},
},
computed: {
isLoading() {
return this.$apollo.queries.participants.loading;
},
},
2021-11-11 11:23:49 +05:30
methods: {
toggleSidebar() {
this.$emit('toggleSidebar');
},
},
2021-06-08 01:23:25 +05:30
};
</script>
<template>
<participants
:loading="isLoading"
:participants="participants"
:number-of-less-participants="7"
2021-10-27 15:23:28 +05:30
:lazy="false"
2021-09-04 01:27:46 +05:30
class="block participants"
2021-11-11 11:23:49 +05:30
@toggleSidebar="toggleSidebar"
2021-06-08 01:23:25 +05:30
/>
</template>