This commit is contained in:
@@ -13,6 +13,15 @@ todo: notification
|
||||
https://github.com/vuetifyjs/vuetify/blob/3513d76774ce4ed02c34220ba6389fa0f42467c1/packages/docs/src/components/app/Notifications.vue
|
||||
|
||||
|
||||
|
||||
todo: Test server down while polling in release mode, does it recover when server starts again or...?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
todo: PickLists based on AyaPickList at server, need one for each type, so far have widget and user only
|
||||
Not sure if should just make them all or...??
|
||||
Maybe when I hit a form that uses it, that's when I really need it?
|
||||
|
||||
@@ -149,9 +149,13 @@
|
||||
<span v-if="appBar.title">{{ $ay.t(appBar.title) }}</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text icon :data-cy="!!$ay.dev ? 'notification' : false">
|
||||
<!-- :value="unreadMsgs.length > 1" -->
|
||||
<v-badge color="red" overlap left :value="newNotificationCount() > 0">
|
||||
<v-btn
|
||||
text
|
||||
icon
|
||||
to="/home-notifications"
|
||||
:data-cy="!!$ay.dev ? 'notification' : false"
|
||||
>
|
||||
<v-badge color="deep-purple" :value="newNotificationCount() > 0">
|
||||
<template v-slot:badge>
|
||||
{{ newNotificationCount() }}
|
||||
</template>
|
||||
@@ -259,6 +263,7 @@ import ayaNovaVersion from "./api/ayanova-version";
|
||||
import gzconfirm from "./components/gzconfirm";
|
||||
import gznotify from "./components/gznotify";
|
||||
import openObjectHandler from "./api/open-object-handler";
|
||||
import notifyPoll from "./api/notifypoll";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -346,6 +351,12 @@ export default {
|
||||
window.$gz.eventBus.$emit("openobject", null);
|
||||
}
|
||||
|
||||
//RELOAD / REFRESH HANDLING
|
||||
//Restart notification polling due to refresh?
|
||||
if (window.$gz.store.state.authenticated) {
|
||||
notifyPoll.startPolling();
|
||||
}
|
||||
|
||||
//FUTURE: If need to detect a reload, this works reliably
|
||||
//OK if here then is this a reliable way to detect a reload or refresh or re-open of the app from a closed window but still authenticated?
|
||||
//console.log("APP.VUE::Mounted=>RELOAD DETECTED?");
|
||||
|
||||
@@ -97,6 +97,14 @@ export default new Router({
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "ay-common" */ "./views/home-memos.vue")
|
||||
},
|
||||
{
|
||||
path: "/home-notifications",
|
||||
name: "home-notifications",
|
||||
component: () =>
|
||||
import(
|
||||
/* webpackChunkName: "ay-common" */ "./views/home-notifications.vue"
|
||||
)
|
||||
},
|
||||
{
|
||||
path: "/home-reminders",
|
||||
name: "home-reminders",
|
||||
|
||||
29
ayanova/src/views/home-notifications.vue
Normal file
29
ayanova/src/views/home-notifications.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>New notification count: {{ newNotificationCount() }}</h1>
|
||||
<UnderConstruction />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UnderConstruction from "../components/underconstruction.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
UnderConstruction
|
||||
},
|
||||
beforeCreate() {
|
||||
window.$gz.eventBus.$emit("menu-change", {
|
||||
isMain: true,
|
||||
icon: "fa-bell",
|
||||
title: "Notifications",
|
||||
helpUrl: "form-home-notifications"
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
newNotificationCount() {
|
||||
return this.$store.state.newNotificationCount;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user