From 95424f42a7dd8b701f101a4e59d22f35be02d219 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 23 Apr 2020 00:03:39 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 4 +++ ayanova/src/components/attachment-control.vue | 33 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 8f256c48..9f72143c 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -109,6 +109,10 @@ todo: AFTER ATTACHMENTS WIKI IMAGES todo: after attachments - integration tests update + +todo: THIS! At this point, upload to dev server and thoroughly test with devices, it seems a bit slow at times + - Might need to hide attachments until user clicks on something to reveal as it seems odd to fetch every open + todo: after attachments - DATADUMP - v7 wiki to RAVEN markdown - https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3468 - Need to export images and attached docs as attachments diff --git a/ayanova/src/components/attachment-control.vue b/ayanova/src/components/attachment-control.vue index e9ecb69b..3c1084a7 100644 --- a/ayanova/src/components/attachment-control.vue +++ b/ayanova/src/components/attachment-control.vue @@ -86,7 +86,7 @@ {{ $ay.t("Cancel") }} - {{ + {{ $ay.t("OK") }} @@ -233,6 +233,37 @@ export default { this.$nextTick(() => { this.editMenu = true; }); + }, + saveEdit() { + let vm = this; + if (!vm.editName) { + //todo: some error here, name is required.. + return; + } + //check if they differ first + let o = null; + for (let i = 0; i < vm.displayList.length; i++) { + if (vm.displayList[i].id == vm.editId) { + o = vm.displayList[i]; + break; + } + } + //any changes? + if (o.name == vm.editName && o.notes == vm.editNotes) { + return; + } + + //post to server + //get concurrency token for PUT from master list? + //or do away with master list and just have updateDisplayList become createDisplayList (and it adds concurrency token) and + //get called from all routes that return a list? **BETTER IDEA!** + //todo: MAKE A PUT ROUTE then POST THIS + + //Update item in list + //(attempting to cheat here, rather than refresh the whole list from server) + //but I do like a clean refresh so if this doesn't work then just call get list + o.name = vm.editName; + o.notes = vm.editNotes; } //----- }