debian-mirror-gitlab/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue

43 lines
988 B
Vue
Raw Normal View History

2018-03-17 18:26:18 +05:30
<script>
import Store from '../../stores/sidebar_store';
2020-10-24 23:57:45 +05:30
import { deprecatedCreateFlash as Flash } from '../../../flash';
2018-03-17 18:26:18 +05:30
import { __ } from '../../../locale';
import subscriptions from './subscriptions.vue';
export default {
components: {
subscriptions,
},
props: {
mediator: {
type: Object,
required: true,
},
},
data() {
return {
store: new Store(),
};
},
methods: {
onToggleSubscription() {
2018-12-13 13:39:08 +05:30
this.mediator.toggleSubscription().catch(() => {
Flash(__('Error occurred when toggling the notification subscription'));
});
2018-03-17 18:26:18 +05:30
},
},
};
</script>
<template>
<div class="block subscriptions">
<subscriptions
:loading="store.isFetching.subscriptions"
2019-12-26 22:10:19 +05:30
:project-emails-disabled="store.projectEmailsDisabled"
:subscribe-disabled-description="store.subscribeDisabledDescription"
2018-03-17 18:26:18 +05:30
:subscribed="store.subscribed"
2018-10-15 14:42:47 +05:30
@toggleSubscription="onToggleSubscription"
2018-03-17 18:26:18 +05:30
/>
</div>
</template>