diff --git a/ayanova/src/api/translation.js b/ayanova/src/api/translation.js index 54a747f3..ff6daa5d 100644 --- a/ayanova/src/api/translation.js +++ b/ayanova/src/api/translation.js @@ -157,6 +157,7 @@ export default { "Open", "Print", "Report", + "Refresh", "WikiPage", "Duplicate", "RecordHistory", diff --git a/ayanova/src/views/home-notifications.vue b/ayanova/src/views/home-notifications.vue index 2f1dcc42..53ba26c7 100644 --- a/ayanova/src/views/home-notifications.vue +++ b/ayanova/src/views/home-notifications.vue @@ -188,6 +188,14 @@ export default { valid: true, loading: false }); + + //Check the new count and update accordingly + //this is to ensure that when a user is viewing the latest notifications they don't see the NEW count still in the bell icon in menu since they are viewing them live + let status = await window.$gz.api.get("notify/new-count"); + if (status.error) { + throw status.error; + } + window.$gz.store.commit("setNewNotificationCount", status.data); } } catch (error) { window.$gz.errorHandler.handleFormError(error, vm); @@ -211,12 +219,9 @@ async function clickHandler(menuItem) { let m = window.$gz.menu.parseMenuItem(menuItem); if (m.owner == FORM_KEY && !m.disabled) { switch (m.key) { - // case "new": - // m.vm.$router.push({ - // name: "home-notify-subscription", - // params: { recordid: 0 } - // }); - // break; + case "refresh": + await m.vm.getDataFromApi(); + break; // case "extensions": // let res = await m.vm.$refs.extensions.open(); // break; @@ -242,15 +247,13 @@ function generateMenu(vm) { menuItems: [] }; - // if (vm.rights.change) { - // menuOptions.menuItems.push({ - // title: "New", - // icon: "fa-plus", - // surface: true, - // key: FORM_KEY + ":new", - // vm: vm - // }); - // } + menuOptions.menuItems.push({ + title: "Refresh", + icon: "fa-sync", + surface: true, + key: FORM_KEY + ":refresh", + vm: vm + }); // //STUB REPORTS // //Report not Print, print is a further option