2018-06-05 23:19:04 +09:00
|
|
|
<template>
|
2019-07-28 04:44:09 +09:00
|
|
|
<x-column :name="name" :column="column" :is-stacked="isStacked" :menu="menu">
|
2019-02-18 11:13:56 +09:00
|
|
|
<template #header><fa :icon="['far', 'bell']"/>{{ name }}</template>
|
2018-06-05 23:19:04 +09:00
|
|
|
|
2019-07-28 04:44:09 +09:00
|
|
|
<x-notifications :type="column.notificationType === 'all' ? null : column.notificationType"/>
|
2018-06-08 04:21:06 +09:00
|
|
|
</x-column>
|
2018-06-05 23:19:04 +09:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2019-02-15 05:08:59 +09:00
|
|
|
import i18n from '../../../i18n';
|
2018-06-05 23:19:04 +09:00
|
|
|
import XColumn from './deck.column.vue';
|
|
|
|
import XNotifications from './deck.notifications.vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-11-09 03:44:35 +09:00
|
|
|
i18n: i18n(),
|
2018-06-05 23:19:04 +09:00
|
|
|
components: {
|
|
|
|
XColumn,
|
|
|
|
XNotifications
|
2018-06-06 05:18:08 +09:00
|
|
|
},
|
|
|
|
|
2018-06-08 05:48:27 +09:00
|
|
|
props: {
|
|
|
|
column: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
isStacked: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
2018-06-07 06:13:57 +09:00
|
|
|
|
2019-07-28 04:44:09 +09:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
menu: null,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-06-07 06:13:57 +09:00
|
|
|
computed: {
|
|
|
|
name(): string {
|
|
|
|
if (this.column.name) return this.column.name;
|
2018-11-09 03:44:35 +09:00
|
|
|
return this.$t('@deck.notifications');
|
2018-06-07 06:13:57 +09:00
|
|
|
}
|
|
|
|
},
|
2019-07-28 04:44:09 +09:00
|
|
|
|
|
|
|
created() {
|
|
|
|
if (this.column.notificationType == null) {
|
|
|
|
this.column.notificationType = 'all';
|
|
|
|
this.$store.commit('updateDeckColumn', this.column);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.menu = [{
|
|
|
|
icon: 'cog',
|
|
|
|
text: this.$t('@.notification-type'),
|
|
|
|
action: () => {
|
|
|
|
this.$root.dialog({
|
|
|
|
title: this.$t('@.notification-type'),
|
|
|
|
type: null,
|
|
|
|
select: {
|
|
|
|
items: ['all', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest'].map(x => ({
|
|
|
|
value: x, text: this.$t('@.notification-types.' + x)
|
|
|
|
}))
|
|
|
|
default: this.column.notificationType,
|
|
|
|
},
|
|
|
|
showCancelButton: true
|
|
|
|
}).then(({ canceled, result: type }) => {
|
|
|
|
if (canceled) return;
|
|
|
|
this.column.notificationType = type;
|
|
|
|
this.$store.commit('updateDeckColumn', this.column);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
},
|
2018-06-05 23:19:04 +09:00
|
|
|
});
|
|
|
|
</script>
|