From 656cd330502deb3b82f606ec7a671ef4ec48ae1d Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 13 Jul 2024 17:28:38 +0200 Subject: [PATCH] stash --- web/src/components/Timeline.vue | 2 +- web/src/store.js | 8 +++++- web/src/views/Tickets.vue | 2 +- web/src/views/admin/Notifications.vue | 37 +++++++++++++++++++++++---- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/web/src/components/Timeline.vue b/web/src/components/Timeline.vue index f3ac1d8..88bfa94 100644 --- a/web/src/components/Timeline.vue +++ b/web/src/components/Timeline.vue @@ -73,7 +73,7 @@ import TimelineMail from "@/components/TimelineMail.vue"; import TimelineComment from "@/components/TimelineComment.vue"; import TimelineStateChange from "@/components/TimelineStateChange.vue"; -import {mapGetters} from "vuex"; +import {mapActions, mapGetters} from "vuex"; import TimelineAssignment from "@/components/TimelineAssignment.vue"; import TimelineRelatedItem from "@/components/TimelineRelatedItem.vue"; import TimelineShippingVoucher from "@/components/TimelineShippingVoucher.vue"; diff --git a/web/src/store.js b/web/src/store.js index b5fba1c..0724070 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -47,6 +47,7 @@ const store = createStore({ states: 0, messageTemplates: 0, shippingVouchers: 0, + userNotificationChannels: 0, }, persistent_loaded: false, shared_loaded: false, @@ -241,6 +242,10 @@ const store = createStore({ state.shippingVouchers = codes; state.fetchedData = {...state.fetchedData, shippingVouchers: Date.now()}; }, + setUserNotificationChannels(state, channels) { + state.userNotificationChannels = channels; + state.fetchedData = {...state.fetchedData, userNotificationChannels: Date.now()}; + }, }, actions: { async login({commit}, {username, password, remember}) { @@ -536,9 +541,10 @@ const store = createStore({ }, async fetchUserNotificationChannels({commit, state}) { if (!state.user.token) return; + if (state.fetchedData.userNotificationChannels > Date.now() - 1000 * 60 * 60 * 24) return; const {data, success} = await http.get('/2/user_notification_channels/', state.user.token); if (data && success) { - state.userNotificationChannels = data; + commit('setUserNotificationChannels', data); } }, }, diff --git a/web/src/views/Tickets.vue b/web/src/views/Tickets.vue index 55574c8..f1497bb 100644 --- a/web/src/views/Tickets.vue +++ b/web/src/views/Tickets.vue @@ -3,7 +3,7 @@
- -
    -
  • - {{ channel.id }} - {{ channel.channel_type }} - {{ channel.channel_target }} - {{ channel.event_filter }} - {{ channel.active }} - {{ channel.created }} - {{ channel.user }} -
  • -
+
+ + +
+
+
+
+ + + + +
+ +
+
+
+
+