From 3811aff206ac935b9a3c550d37a57b60fb374266 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 3 Aug 2024 18:27:19 +0200 Subject: [PATCH] Expand view. --- app/Policies/AccountPolicy.php | 5 +--- .../assets/v2/src/pages/accounts/index.js | 2 +- .../assets/v2/src/pages/dashboard/accounts.js | 6 ++--- .../v2/src/pages/dashboard/dashboard.js | 4 ++++ resources/views/v2/accounts/index.blade.php | 2 ++ resources/views/v2/index.blade.php | 24 +++++++++++++++++++ .../partials/dashboard/account-list.blade.php | 7 +++++- 7 files changed, 40 insertions(+), 10 deletions(-) diff --git a/app/Policies/AccountPolicy.php b/app/Policies/AccountPolicy.php index 3e4b6f85c6..8bedfaef0e 100644 --- a/app/Policies/AccountPolicy.php +++ b/app/Policies/AccountPolicy.php @@ -30,13 +30,10 @@ use Illuminate\Support\Facades\Log; class AccountPolicy { /** - * TODO needs better authentication. + * TODO needs better authentication, also for group. */ public function view(User $user, Account $account): bool { - die('OK1'); - return true; - return auth()->check() && $user->id === $account->user_id; } diff --git a/resources/assets/v2/src/pages/accounts/index.js b/resources/assets/v2/src/pages/accounts/index.js index eb8e70bd25..422202ee24 100644 --- a/resources/assets/v2/src/pages/accounts/index.js +++ b/resources/assets/v2/src/pages/accounts/index.js @@ -345,7 +345,7 @@ let index = function () { this.pageOptions.isLoading = true; // sort instructions (only one column) let sorting = this.pageOptions.sortingColumn; - if('asc' === this.pageOptions.sortDirection) { + if('asc' === this.pageOptions.sortDirection && '' !== sorting) { sorting = '-' + sorting; } //const sorting = [{column: this.pageOptions.sortingColumn, direction: this.pageOptions.sortDirection}]; diff --git a/resources/assets/v2/src/pages/dashboard/accounts.js b/resources/assets/v2/src/pages/dashboard/accounts.js index 3bdd8a3076..e22da6a86c 100644 --- a/resources/assets/v2/src/pages/dashboard/accounts.js +++ b/resources/assets/v2/src/pages/dashboard/accounts.js @@ -243,10 +243,8 @@ export default () => ({ name: parent.attributes.name, order: parent.attributes.order, id: parent.id, - balance_raw: parseFloat(parent.attributes.current_balance), - balance: formatMoney(parent.attributes.current_balance, parent.attributes.currency_code), - native_balance_raw: parseFloat(parent.attributes.native_current_balance), - native_balance: formatMoney(parent.attributes.native_current_balance, parent.attributes.native_currency_code), + balance: parent.attributes.balance, + native_balance: parent.attributes.native_balance, groups: groups, }); // console.log(parent.attributes); diff --git a/resources/assets/v2/src/pages/dashboard/dashboard.js b/resources/assets/v2/src/pages/dashboard/dashboard.js index e23dea9867..bc9706b2a1 100644 --- a/resources/assets/v2/src/pages/dashboard/dashboard.js +++ b/resources/assets/v2/src/pages/dashboard/dashboard.js @@ -45,6 +45,8 @@ import { Tooltip } from "chart.js"; import 'chartjs-adapter-date-fns'; +import {showInternalsButton} from "../../support/page-settings/show-internals-button.js"; +import {showWizardButton} from "../../support/page-settings/show-wizard-button.js"; // register things Chart.register({ @@ -75,6 +77,8 @@ const comps = { piggies }; +showInternalsButton(); + //let i18n; function loadPage(comps) { diff --git a/resources/views/v2/accounts/index.blade.php b/resources/views/v2/accounts/index.blade.php index 8a043a0ef3..712d58c2bc 100644 --- a/resources/views/v2/accounts/index.blade.php +++ b/resources/views/v2/accounts/index.blade.php @@ -422,6 +422,7 @@ +