This commit is contained in:
2020-07-28 17:45:57 +00:00
parent dcef16ed18
commit a132ebebe9
3 changed files with 25 additions and 3 deletions

View File

@@ -11,7 +11,6 @@ ____________
## CURRENT STAGE: ## CURRENT STAGE:
todo: subject for direct notification? (old quick notify had subject line and would substitute "QuickNotification" if no subject was typed)
todo: direct notification edit form accept array of user id's to preselect todo: direct notification edit form accept array of user id's to preselect
This way other forms can prepopulate userlist based on their requirements and status This way other forms can prepopulate userlist based on their requirements and status

View File

@@ -106,7 +106,7 @@ export default new Router({
) )
}, },
{ {
path: "/home-notify-direct", path: "/home-notify-direct/:userIdList?",
name: "home-notify-direct", name: "home-notify-direct",
component: () => component: () =>
import( import(

View File

@@ -3,7 +3,7 @@
<v-col> <v-col>
<v-form ref="form"> <v-form ref="form">
<v-row> <v-row>
<!-- {{ toUsers }} --> {{ toUsers }}
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error> <gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
<v-row cols="12"> <v-row cols="12">
<v-col cols="9"> <v-col cols="9">
@@ -68,6 +68,7 @@ export default {
vm.rights = window.$gz.role.fullRightsObject(); vm.rights = window.$gz.role.fullRightsObject();
generateMenu(vm); generateMenu(vm);
vm.formState.ready = true; vm.formState.ready = true;
window.$gz.form.setFormState({ window.$gz.form.setFormState({
vm: vm, vm: vm,
@@ -294,6 +295,11 @@ function generateMenu(vm) {
// //
async function initForm(vm) { async function initForm(vm) {
await fetchTranslatedText(vm); await fetchTranslatedText(vm);
console.log("userIdList is ", vm.$route.params.userIdList);
if (vm.$route.params.userIdList != undefined) {
//userIdList is 1,2,3,4
await preFillSelection(vm);
}
} }
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
@@ -308,4 +314,21 @@ async function fetchTranslatedText(vm) {
"MemoToID" "MemoToID"
]); ]);
} }
//////////////////////////////////////////////////////////
//
// Pre fill if pre-selected users
//
async function preFillSelection(vm) {
//iterate the list
//vm.$route.params.userIdList;
// let temp = new Array();
// temp = vm.$route.params.userIdList.split(",");
// for (a in temp) {
// temp[a] = parseInt(temp[a], 10); // Explicitly include base as per Álvaro's comment
// }
let t = vm.$route.params.userIdList.split(",").map(z => parseInt(z, 10));
console.log("Prefill selection array is", t);
}
</script> </script>