This commit is contained in:
@@ -13,11 +13,10 @@ ____________
|
||||
|
||||
|
||||
|
||||
todo: Extensions from single edit forms??
|
||||
todo: direct notification extension
|
||||
todo: from User form be able to send a direct notification to that user
|
||||
|
||||
todo: from users list form extension for direct notification
|
||||
|
||||
todo: from adm-user form be able to send a direct notification to that user
|
||||
todo: from adm-users list form extension (or just a menu link?) for direct notification
|
||||
|
||||
|
||||
todo: notification system docs
|
||||
|
||||
@@ -228,7 +228,8 @@ export default {
|
||||
"TimeSpanDays",
|
||||
"TimeSpanHours",
|
||||
"TimeSpanMinutes",
|
||||
"TimeSpanSeconds"
|
||||
"TimeSpanSeconds",
|
||||
"DirectNotification"
|
||||
],
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
@@ -608,6 +608,19 @@ async function clickHandler(menuItem) {
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "directnotify":
|
||||
//nav to direct notify with list of users appended to route
|
||||
if (m.vm.obj.id == 0) {
|
||||
m.vm.$router.push({
|
||||
name: "home-notify-direct"
|
||||
});
|
||||
} else {
|
||||
m.vm.$router.push({
|
||||
name: "home-notify-direct",
|
||||
params: { userIdList: m.vm.obj.id }
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -692,6 +705,13 @@ function generateMenu(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "DirectNotification",
|
||||
icon: "fa-comment-alt",
|
||||
key: FORM_KEY + ":directnotify",
|
||||
vm: vm
|
||||
});
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,19 @@ async function clickHandler(menuItem) {
|
||||
case "extensions":
|
||||
let res = await m.vm.$refs.extensions.open();
|
||||
break;
|
||||
case "directnotify":
|
||||
//nav to direct notify with list of users appended to route
|
||||
if (m.vm.selectedItems.length == 0) {
|
||||
m.vm.$router.push({
|
||||
name: "home-notify-direct"
|
||||
});
|
||||
} else {
|
||||
m.vm.$router.push({
|
||||
name: "home-notify-direct",
|
||||
params: { userIdList: m.vm.selectedItems.toString() }
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -123,6 +136,13 @@ function generateMenu(vm) {
|
||||
vm: vm
|
||||
});
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "DirectNotification",
|
||||
icon: "fa-comment-alt",
|
||||
key: FORM_KEY + ":directnotify",
|
||||
vm: vm
|
||||
});
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -314,8 +314,7 @@ async function fetchTranslatedText(vm) {
|
||||
await window.$gz.translation.cacheTranslations([
|
||||
"NotifySubscription",
|
||||
"Server",
|
||||
"Notifications",
|
||||
"DirectNotification"
|
||||
"Notifications"
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -161,8 +161,6 @@ export default {
|
||||
}
|
||||
},
|
||||
closeChip(item) {
|
||||
// console.log(item);
|
||||
// debugger;
|
||||
let i = this.toUsers.findIndex(z => z.id == item.id);
|
||||
if (i != -1) {
|
||||
this.toUsers.splice(i, 1);
|
||||
@@ -318,7 +316,17 @@ async function fetchTranslatedText(vm) {
|
||||
// Pre fill if pre-selected users
|
||||
//
|
||||
async function preFillSelection(vm) {
|
||||
let l = vm.$route.params.userIdList.split(",").map(z => parseInt(z, 10));
|
||||
var idParam = vm.$route.params.userIdList;
|
||||
let l = [];
|
||||
if (idParam.includes(",")) {
|
||||
//just a random list of user ids seperated by commas
|
||||
l = idParam.split(",").map(z => parseInt(z, 10));
|
||||
} else {
|
||||
//single value
|
||||
l.push(parseInt(idParam, 10));
|
||||
}
|
||||
|
||||
//l = window.$gz._.uniq(l);
|
||||
//iterate the array, fetch and store each user returned from
|
||||
//pick-list/List?ayaType=3&preId=[IDVALUE]
|
||||
//into vm.toUsers
|
||||
@@ -327,7 +335,7 @@ async function preFillSelection(vm) {
|
||||
continue;
|
||||
}
|
||||
let res = await window.$gz.api.get("pick-list/List?ayaType=3&preId=" + i);
|
||||
if (res.data) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
vm.toUsers.push(res.data[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
<template>
|
||||
<v-container fluid>
|
||||
<gz-extensions
|
||||
:ayaType="ayType"
|
||||
:selectedItems="selectedItems"
|
||||
ref="extensions"
|
||||
>
|
||||
</gz-extensions>
|
||||
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
||||
<!-- {{ formState }} -->
|
||||
<v-row v-if="formState.ready">
|
||||
@@ -363,8 +357,7 @@ export default {
|
||||
serverError: {}
|
||||
},
|
||||
rights: window.$gz.role.defaultRightsObject(),
|
||||
ayaType: window.$gz.type.Widget,
|
||||
selectedItems: [$route.params.recordid]
|
||||
ayaType: window.$gz.type.Widget
|
||||
};
|
||||
},
|
||||
//WATCHERS
|
||||
@@ -635,9 +628,6 @@ async function clickHandler(menuItem) {
|
||||
case "duplicate":
|
||||
m.vm.duplicate();
|
||||
break;
|
||||
case "extensions":
|
||||
let res = await m.vm.$refs.extensions.open();
|
||||
break;
|
||||
case "report":
|
||||
if (m.id != null) {
|
||||
//last report selected
|
||||
@@ -748,13 +738,6 @@ function generateMenu(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "Extensions",
|
||||
icon: "fa-puzzle-piece",
|
||||
key: FORM_KEY + ":extensions",
|
||||
vm: vm
|
||||
});
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user