From 49f1a78c4c8b0ed26307ccb3b0a8fb1f71ee5a82 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 28 Jul 2020 18:04:39 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 3 +++ ayanova/src/views/home-notify-direct.vue | 25 ++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 54917ac1..4de4ac9b 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -26,6 +26,9 @@ todo: notification system docs Big overview then drill down ########################## +todo: generated user names have numbers in them and are not the same as the id. Do they need numbers? Can it just keep an internal list of used names and bump + or query the db to see if it's already used because there are not that many generated users generally. + todo: User edit form role control is not working todo: server state form is not getting dirtied when setting radio button, only on text (try going to closed then open and not change text on open) todo: ops backup file list not in order by date, seems to be random or something, I want newest at top oldest at bottom diff --git a/ayanova/src/views/home-notify-direct.vue b/ayanova/src/views/home-notify-direct.vue index c87839d0..205f40f3 100644 --- a/ayanova/src/views/home-notify-direct.vue +++ b/ayanova/src/views/home-notify-direct.vue @@ -295,9 +295,7 @@ function generateMenu(vm) { // async function initForm(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); } } @@ -320,15 +318,18 @@ async function fetchTranslatedText(vm) { // 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); + let l = vm.$route.params.userIdList.split(",").map(z => parseInt(z, 10)); + //iterate the array, fetch and store each user returned from + //pick-list/List?ayaType=3&preId=[IDVALUE] + //into vm.toUsers + for (let i of l) { + if (vm.toUsers.find(z => z.id == i)) { + continue; + } + let res = await window.$gz.api.get("pick-list/List?ayaType=3&preId=" + i); + if (res.data) { + vm.toUsers.push(res.data[0]); + } + } }