From 6e21ca4dce6c62bc483b160fb18c76ab7cb1e716 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 22 Apr 2020 23:24:54 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 3 +++ ayanova/src/components/attachment-control.vue | 24 +++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 0a63eca9..86c0e05b 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -70,6 +70,9 @@ todo: Attachments / wiki: wiki html processor needs to append dl token to local todo: attachments - form key for hiding / showing customization todo: attachment - rename a file or add notes after already uploaded todo: attachment EVENTLOG user download file, maybe it's event on object attached to but textra says file name +todo: History icon for attachments, make them all paperclips? + - Maybe red paperclip for delete, green paperclip for attach?? + https://medium.com/js-dojo/upload-files-to-cloudinary-using-vue-vuetify-dd45472c4fd6 1578595824571 diff --git a/ayanova/src/components/attachment-control.vue b/ayanova/src/components/attachment-control.vue index 59f3ec44..82e016a4 100644 --- a/ayanova/src/components/attachment-control.vue +++ b/ayanova/src/components/attachment-control.vue @@ -33,7 +33,7 @@ fa-edit - + fa-trash @@ -115,6 +115,25 @@ export default { window.$gz.errorHandler.handleFormError(error); }); }, + remove(item) { + let vm = this; + window.$gz.dialog.confirmDelete().then(dialogResult => { + if (dialogResult == true) { + window.$gz.api + .remove("Attachment/" + item.id) + .then(res => { + if (res.error) { + window.$gz.errorHandler.handleFormError(res.error); + } else { + vm.getList(); + } + }) + .catch(function handleUploadError(error) { + window.$gz.errorHandler.handleFormError(error); + }); + } + }); + }, getList() { let vm = this; window.$gz.api @@ -131,9 +150,6 @@ export default { window.$gz.errorHandler.handleFormError(error); }); }, - download(item) { - console.log("CLICK", item); - }, updateDisplayList() { //{"data":[{"id":1,"concurrencyToken":7733332,"contentType":"image/png","displayFileName":"Screen Shot 2020-01-09 at 10.50.24.png","lastModified":"0001-01-01T00:00:00Z","notes":"Here are notes"},{"id":4,"concurrencyToken":7733354,"contentType":"text/plain","displayFileName":"TNT log file ayanova.txt","lastModified":"0001-01-01T00:00:00Z","notes":"Here are notes"},{"id":2,"concurrencyToken":7733342,"contentType":"text/plain","displayFileName":"stack.txt","lastModified":"0001-01-01T00:00:00Z","notes":"Here are notes"},{"id":3,"concurrencyToken":7733348,"contentType":"image/jpeg","displayFileName":"t2cx6sloffk41.jpg","lastModified":"0001-01-01T00:00:00Z","notes":"Here are notes"}]} if (!this.attachedFiles) {