From 1a8fd25ec34c6b55439c6023ff9e06db0df0d420 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 22 Dec 2020 17:22:50 +0100 Subject: [PATCH] Rebuild front with some vuex storage. --- frontend/package.json | 3 +- frontend/src/bootstrap.js | 6 +- .../components/dashboard/BudgetLimitRow.vue | 8 +- .../src/components/dashboard/Calendar.vue | 78 ++++++++++++------- .../src/components/dashboard/Dashboard.vue | 42 ++-------- .../src/components/dashboard/TopBoxes.vue | 18 +++-- frontend/src/components/store/index.js | 77 ++++++++++++++++++ frontend/src/pages/dashboard.js | 16 +++- frontend/yarn.lock | 5 ++ public/v2/js/accounts/index.js | 2 +- public/v2/js/accounts/show.js | 2 +- public/v2/js/dashboard.js | 2 +- public/v2/js/dashboard.js.map | 2 +- public/v2/js/empty.js | 2 +- public/v2/js/new-user/index.js | 2 +- public/v2/js/register.js | 2 +- public/v2/js/transactions/create.js | 2 +- public/v2/js/vendor.js | 2 +- public/v2/js/vendor.js.LICENSE.txt | 6 ++ public/v2/js/vendor.js.map | 2 +- 20 files changed, 188 insertions(+), 91 deletions(-) create mode 100644 frontend/src/components/store/index.js diff --git a/frontend/package.json b/frontend/package.json index 0fd3b66a72..3ebca7ccdd 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -36,6 +36,7 @@ "tempusdominus": "^5.16.0", "v-calendar": "^2.1.3", "vue-chartjs": "^3.5.1", - "vue-router": "^3.4.9" + "vue-router": "^3.4.9", + "vuex": "^3.6.0" } } diff --git a/frontend/src/bootstrap.js b/frontend/src/bootstrap.js index 725b2116ff..3c47f882b3 100644 --- a/frontend/src/bootstrap.js +++ b/frontend/src/bootstrap.js @@ -23,6 +23,7 @@ import Vue from 'vue'; import VueI18n from 'vue-i18n' import * as uiv from 'uiv'; + // export jquery for others scripts to use window.$ = window.jQuery = require('jquery'); @@ -55,9 +56,10 @@ require('bootstrap'); // bootstrap CSS? require('./dist/js/adminlte'); require('overlayscrollbars'); + // vue window.vuei18n = VueI18n; -window.uiv =uiv; +window.uiv = uiv; Vue.use(vuei18n); Vue.use(uiv); -window.Vue = Vue; +window.Vue = Vue; \ No newline at end of file diff --git a/frontend/src/components/dashboard/BudgetLimitRow.vue b/frontend/src/components/dashboard/BudgetLimitRow.vue index af404fb393..5d832951ff 100644 --- a/frontend/src/components/dashboard/BudgetLimitRow.vue +++ b/frontend/src/components/dashboard/BudgetLimitRow.vue @@ -104,11 +104,15 @@ export default { props: { budgetLimit: { type: Object, - default: {} + default: function () { + return {}; + } }, budget: { type: Object, - default: {} + default: function () { + return {}; + } } } } diff --git a/frontend/src/components/dashboard/Calendar.vue b/frontend/src/components/dashboard/Calendar.vue index 480a8fc22d..0d34744359 100644 --- a/frontend/src/components/dashboard/Calendar.vue +++ b/frontend/src/components/dashboard/Calendar.vue @@ -35,36 +35,41 @@ is-range > @@ -73,8 +78,12 @@ \ No newline at end of file diff --git a/frontend/src/components/dashboard/Dashboard.vue b/frontend/src/components/dashboard/Dashboard.vue index 8b7aa5d583..4b0bb0f3ed 100644 --- a/frontend/src/components/dashboard/Dashboard.vue +++ b/frontend/src/components/dashboard/Dashboard.vue @@ -20,10 +20,6 @@