Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Clean up v2.
James Colea60882d5f5cf
diff --git a/resources/assets/v2/src/boot/bootstrap.js b/resources/assets/v2/src/boot/bootstrap.jsindex 8c1ed325f5..1c9fc67b35 100644--- a/resources/assets/v2/src/boot/bootstrap.js+++ b/resources/assets/v2/src/boot/bootstrap.js@@ -48,6 +48,10 @@ window.bootstrap = bootstrap;// always grab the preference "marker" from Firefly III.getFreshVariable('lastActivity').then((serverValue) => {+ if(null === serverValue) {+ console.log('Server value is null in getFreshVariable.');+ throw new Error('401 in getFreshVariable.');+ }const localValue = store.get('lastActivity');store.set('cacheValid', localValue === serverValue);store.set('lastActivity', serverValue);@@ -78,6 +82,8 @@ getFreshVariable('lastActivity').then((serverValue) => {window.bootstrapped = true;});});+}).catch((error) => {+ console.error('Error while bootstrapping: ' + error);});window.axios = axios;window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';diff --git a/resources/assets/v2/src/css/grid-ff3-theme.css b/resources/assets/v2/src/css/grid-ff3-theme.cssindex db6a734e58..2a5071b745 100644--- a/resources/assets/v2/src/css/grid-ff3-theme.css+++ b/resources/assets/v2/src/css/grid-ff3-theme.css@@ -30,3 +30,4 @@border:0;}+.skip-links {display: none;}diff --git a/resources/assets/v2/src/sass/adminlte-filtered.scss b/resources/assets/v2/src/sass/adminlte-filtered.scssindex 5a322c63f9..d8ac9b78ac 100644--- a/resources/assets/v2/src/sass/adminlte-filtered.scss+++ b/resources/assets/v2/src/sass/adminlte-filtered.scss@@ -1,5 +1,5 @@/*!- * adminlte-filteres.scss+ * adminlte-filtered.scss* Copyright (c) 2024 [email protected].** This file is part of Firefly III (https://github.com/firefly-iii).@@ -23,7 +23,7 @@// copied from:/*!- * AdminLTE v4.0.0-alpha2+ * AdminLTE v4.0.0-rc3* Author: Colorlib* Website: AdminLTE.io <https://adminlte.io>* License: Open source - MIT <https://opensource.org/licenses/MIT>@@ -84,7 +84,6 @@// Bootstrap Utilities@import "bootstrap/scss/utilities/api";-// AdminLTE Configuration// ---------------------------------------------------@import "admin-lte/src/scss/variables";@@ -97,9 +96,12 @@@import "admin-lte/src/scss/parts/components";@import "admin-lte/src/scss/parts/extra-components";-// @import "admin-lte/src/scss/parts/pages";-@import "admin-lte/src/scss/pages/login_and_register";+//+// Part: Pages+//+@import "admin-lte/src/scss/pages/login_and_register";@import "admin-lte/src/scss/parts/miscellaneous";-+// AdminLTE Accessibility Styles - WCAG 2.1 AA Compliance+@import "admin-lte/src/scss/accessibility";diff --git a/resources/assets/v2/src/sass/app.scss b/resources/assets/v2/src/sass/app.scssindex 115df4d8fd..641ee0cd29 100644--- a/resources/assets/v2/src/sass/app.scss+++ b/resources/assets/v2/src/sass/app.scss@@ -26,6 +26,9 @@ $danger: #CD5029 !default;$primary: #1E6581 !default;$success: #64B624 !default;++.skip-links {display: none;}+/*Remove bottom margin from unstyled lists*/diff --git a/resources/assets/v2/src/store/get-fresh-variable.js b/resources/assets/v2/src/store/get-fresh-variable.jsindex 9f425d5711..e591d9c006 100644--- a/resources/assets/v2/src/store/get-fresh-variable.js+++ b/resources/assets/v2/src/store/get-fresh-variable.js@@ -26,13 +26,17 @@ export function getFreshVariable(name, defaultValue = null) {return getter.getByName(name).then((response) => {// console.log('Get from API');return Promise.resolve(parseResponse(name, response));- }).catch(() => {- // preference does not exist (yet).- // POST it and then return it anyway.- let poster = (new Post);- poster.post(name, defaultValue).then((response) => {- return Promise.resolve(parseResponse(name, response));- });+ }).catch((response) => {+ if(response.status === 404) {+ // preference does not exist (yet).+ // POST it and then return it anyway.+ let poster = (new Post);+ poster.post(name, defaultValue).then((response) => {+ return Promise.resolve(parseResponse(name, response));+ });+ return;+ }+ return Promise.resolve(null);});}diff --git a/resources/assets/v2/src/support/page-settings/show-internals-button.js b/resources/assets/v2/src/support/page-settings/show-internals-button.jsindex d9b466718d..948fdcab6f 100644--- a/resources/assets/v2/src/support/page-settings/show-internals-button.js+++ b/resources/assets/v2/src/support/page-settings/show-internals-button.js@@ -21,5 +21,9 @@export function showInternalsButton() {// console.log('showInternalsButton');- document.querySelector('.toggle-page-internals').classList.remove('d-none');+ let obj = document.querySelector('.toggle-page-internals');+ if (obj === null) {+ return;+ }+ obj.classList.remove('d-none');}diff --git a/resources/assets/v2/vite.config.js b/resources/assets/v2/vite.config.jsindex 50b1b24e05..79b2feae6d 100644--- a/resources/assets/v2/vite.config.js+++ b/resources/assets/v2/vite.config.js@@ -83,7 +83,8 @@ export default defineConfig(({command, mode, isSsrBuild, isPreview}) => {server: {cors: true,- origin: 'https://192.168.96.154:5173',+ // make sure this IP matches the IP of the dev machine.+ origin: 'https://192.168.96.162:5173',watch: {usePolling: true,},diff --git a/resources/views/v2/partials/dashboard/boxes.blade.php b/resources/views/v2/partials/dashboard/boxes.blade.phpindex 574fb6a791..479821e80d 100644--- a/resources/views/v2/partials/dashboard/boxes.blade.php+++ b/resources/views/v2/partials/dashboard/boxes.blade.php@@ -2,7 +2,7 @@<div class="col-xl-3 col-lg-6 col-md-12 col-sm-12"><div class="small-box text-bg-primary"><div class="inner balance-box">- <h3 class="hover-expand">+ <h4 class="hover-expand"><template x-if="0 === balanceBox.amounts.length"><span> </span></template>@@ -12,7 +12,7 @@:class="{ 'invisible': (balanceBox.amounts.length == index+1) }">, </span></span></template>- </h3>+ </h4><template x-if="loading"><p class="d-none d-xs-block"><em class="fa-solid fa-spinner fa-spin"></em>@@ -53,17 +53,17 @@<div class="small-box text-bg-success"><div class="inner"><template x-if="0 === billBox.unpaid.length">- <h3> </h3>+ <h4> </h4></template><template x-if="billBox.unpaid.length > 0">- <h3 class="hover-expand">+ <h4 class="hover-expand"><template x-for="(amount, index) in billBox.unpaid" :key="index"><span><span x-text="amount"></span><span:class="{ 'invisible': (billBox.unpaid.length == index+1) }">, </span></span></template>- </h3>+ </h4></template><template x-if="loading"><p class="d-none d-sm-block">@@ -104,7 +104,7 @@<!--begin::Small Box Widget 3--><div class="small-box text-bg-warning"><div class="inner">- <h3 class="hover-expand">+ <h4 class="hover-expand"><template x-if="0 === leftBox.left.length"><span> </span></template>@@ -114,7 +114,7 @@:class="{ 'invisible': (leftBox.left.length == index+1) }">, </span></span></template>- </h3>+ </h4><template x-if="loading"><p class="d-none d-sm-block">@@ -153,14 +153,14 @@<!--begin::Small Box Widget 4--><div class="small-box text-bg-danger"><div class="inner">- <h3 class="hover-expand">+ <h4 class="hover-expand"><template x-for="(amount, index) in netBox.net" :key="index"><span><span x-text="amount"></span><span:class="{ 'invisible': (netBox.net.length == index+1) }">, </span></span></template>- </h3>+ </h4><template x-if="loading"><p class="d-none d-sm-block">