From 175a442a3e658b82bc1be8652fd1a123d30906fd Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 4 Mar 2019 19:03:04 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 4 +- ayanova/src/api/apiutil.js | 6 ++- ayanova/src/components/gztimepicker.vue | 44 +++++++++++++++++++ ayanova/src/main.js | 47 ++------------------ ayanova/src/views/inventory-widget-edit.vue | 48 +++------------------ 5 files changed, 60 insertions(+), 89 deletions(-) create mode 100644 ayanova/src/components/gztimepicker.vue diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index d8458c5a..aacd3054 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -14,9 +14,7 @@ TODO CLIENT STUFF TODO NEXT -DATETIME - Ok, fuck a combined date and time, no one else seems to support it but me so split it into separate components: - - +DATETIME - DONE Wrap the date picker to work with our dates without losing time. - Wrap a time picker to work with our dates without losing the date. - Once this is done then combine them into a single component that: diff --git a/ayanova/src/api/apiutil.js b/ayanova/src/api/apiutil.js index 709fca40..7b2ff381 100644 --- a/ayanova/src/api/apiutil.js +++ b/ayanova/src/api/apiutil.js @@ -181,8 +181,7 @@ export default { var errorMessage = "API error: GET route =" + route + ", message =" + error.message; store.commit("logItem", errorMessage); - alert("Error: " + errorMessage); - reject(error); + if (error.message && error.message.includes("401")) { store.commit( "logItem", @@ -190,6 +189,9 @@ export default { ); auth.logout(); router.push("/login"); + } else { + alert("Error: " + errorMessage); + reject(error); } }); }); diff --git a/ayanova/src/components/gztimepicker.vue b/ayanova/src/components/gztimepicker.vue new file mode 100644 index 00000000..4b89b7d2 --- /dev/null +++ b/ayanova/src/components/gztimepicker.vue @@ -0,0 +1,44 @@ + diff --git a/ayanova/src/main.js b/ayanova/src/main.js index d41e0e8a..db8dfcb5 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -12,6 +12,7 @@ import NProgress from "nprogress"; import "nprogress/nprogress.css"; import dayjs from "dayjs"; import gzdatepicker from "./components/gzdatepicker.vue"; +import gztimepicker from "./components/gztimepicker.vue"; ///////////////////////////////////////////////////////////////// // FORM VALIDATION @@ -102,51 +103,11 @@ Vue.filter("boolastext", function(value) { return value ? "Yes" : "Nope"; }); -//COMPONENT DATE TEST +///////////////////////////////////////////////////////////// +//GZ COMPONENTS // - Vue.component("gz-date-picker", gzdatepicker); - -// Vue.component("GzDatePicker", { -// props: { -// value: Date -// }, -// render() { -// return this.$createElement("v-date-picker", { -// props: { -// ...this.$attrs, -// value: this.value ? this.value.toISOString().substr(0, 10) : null -// }, -// on: { -// ...this.$listeners, -// input: date => this.$emit("input", new Date(date)) -// } -// }); -// } -// }); - -// Vue.component("AltGzDatePicker", { -// props: { -// value: String -// }, -// data: function() { -// return { -// ogdate: "" -// }; -// }, -// render() { -// return this.$createElement("v-date-picker", { -// props: { -// ...this.$attrs, -// value: this.value ? this.value.substr(0, 10) : null -// }, -// on: { -// ...this.$listeners, -// input: date => this.$emit("input", new Date(date).toISOString()) -// } -// }); -// } -// }); +Vue.component("gz-time-picker", gztimepicker); ///////////////////////////////////////////////////////////////// // INSTANTIATE diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 51cfde78..2e052e0d 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -54,42 +54,11 @@ - - - +
{{obj.startDate}}
+ + + submit - + - @@ -172,10 +140,8 @@ export default { //return this.obj.startDate ? moment(this.date).format("dddd, MMMM Do YYYY") : ""; }, pickStartDate() { - return this.obj.startDate - ? dayjs(this.obj.startDate).toDate() - : null; - // var copiedDate = new Date(date.getTime()); + return this.obj.startDate ? dayjs(this.obj.startDate).toDate() : null; + // var copiedDate = new Date(date.getTime()); //obj.startDate.toISOString().substr(0, 10); } },