From bc6645a541149b26bd88816abc78659f983b6e6b Mon Sep 17 00:00:00 2001 From: Jesus Guerrero Date: Wed, 18 Oct 2023 07:03:25 -0400 Subject: [PATCH 1/7] draft budget balance widget --- app/Console/Commands/CheckMonthRollover.php | 37 +++ app/Console/Kernel.php | 1 + .../Services/LogerAutomationService.php | 2 + .../Finance/FinanceTrendController.php | 2 +- app/Http/Middleware/HandleInertiaRequests.php | 10 +- components.d.ts | 1 + package-lock.json | 262 ++++++++++++++++++ package.json | 2 + .../Components/molecules/WidgetTitleCard.vue | 15 +- resources/js/Pages/BudgetWidget.vue | 215 ++++++++++++++ resources/js/Pages/Dashboard.vue | 2 + .../Trends.vue => Trends/Overview.vue} | 19 +- .../Pages/Trends/Partials/TrendSectionNav.vue | 17 ++ .../Pages/Trends/Partials/TrendTemplate.vue | 83 ++++++ resources/js/domains/app/index.ts | 10 + resources/js/domains/app/menus.ts | 30 +- .../components/AccountLinkModal.vue | 1 - tailwindTheme/colors.js | 18 +- tailwindTheme/index.js | 1 + 19 files changed, 697 insertions(+), 31 deletions(-) create mode 100644 app/Console/Commands/CheckMonthRollover.php create mode 100644 resources/js/Pages/BudgetWidget.vue rename resources/js/Pages/{Finance/Trends.vue => Trends/Overview.vue} (91%) create mode 100644 resources/js/Pages/Trends/Partials/TrendSectionNav.vue create mode 100644 resources/js/Pages/Trends/Partials/TrendTemplate.vue diff --git a/app/Console/Commands/CheckMonthRollover.php b/app/Console/Commands/CheckMonthRollover.php new file mode 100644 index 00000000..96cabc10 --- /dev/null +++ b/app/Console/Commands/CheckMonthRollover.php @@ -0,0 +1,37 @@ +without(['settings'])->get(); + dd($teams->toArray()); + + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 36c6c4d1..d06cd4a9 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -27,6 +27,7 @@ protected function schedule(Schedule $schedule) $schedule->command('app:automation-check')->everyMinute()->runInBackground(); $schedule->command('app:occurrence-reminders')->daily()->runInBackground(); + $schedule->command('app:check-month-rollover')->daily()->runInBackground(); if (config('app.demo')) { if ($scheduleTime) { $schedule->command('app:demo-reset')->dailyAt($scheduleTime)->runInBackground(); diff --git a/app/Domains/Automation/Services/LogerAutomationService.php b/app/Domains/Automation/Services/LogerAutomationService.php index 7d856959..51ee1e03 100644 --- a/app/Domains/Automation/Services/LogerAutomationService.php +++ b/app/Domains/Automation/Services/LogerAutomationService.php @@ -22,6 +22,7 @@ public static function run(Automation $automation, $eventData = null) echo "starting $automation->name with $automation->id \n"; $tasks = $automation->tasks; $trigger = $automation->triggerTask; + print_r([$tasks, $trigger]); foreach ($tasks as $index => $task) { if ($index == 0) { @@ -29,6 +30,7 @@ public static function run(Automation $automation, $eventData = null) $previousTask = null; } $entity = $task->entity; + echo "hello>"; $lastData = $entity::handle($automation, $lastData, $task, $previousTask, $trigger); if (! $lastData) { break; diff --git a/app/Http/Controllers/Finance/FinanceTrendController.php b/app/Http/Controllers/Finance/FinanceTrendController.php index 617be954..4b336b5c 100644 --- a/app/Http/Controllers/Finance/FinanceTrendController.php +++ b/app/Http/Controllers/Finance/FinanceTrendController.php @@ -37,7 +37,7 @@ public function index(Request $request, $sectionName = 'groups') $section = self::sections[$sectionName]; $data = $this->$section($request); - return inertia('Finance/Trends', + return inertia('Trends/Overview', array_merge([ 'serverSearchOptions' => $filters, 'section' => $sectionName, diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index f4960d9e..fbe7c386 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -2,13 +2,13 @@ namespace App\Http\Middleware; +use Inertia\Middleware; +use Tightenco\Ziggy\Ziggy; +use Illuminate\Http\Request; use App\Concerns\Facades\Menu; +use Insane\Journal\Models\Core\Account; use App\Domains\AppCore\Models\Category; -use Illuminate\Http\Request; -use Inertia\Middleware; -use Insane\Journal\Models\Core\Account as CoreAccount; use Insane\Journal\Models\Core\AccountDetailType; -use Tightenco\Ziggy\Ziggy; class HandleInertiaRequests extends Middleware { @@ -63,7 +63,7 @@ public function share(Request $request) }, 'menu' => $menu, 'balance' => $team ? $team->balance() : 0, - 'accounts' => $team ? CoreAccount::getByDetailTypes($team->id) : [], + 'accounts' => $team ? Account::getByDetailTypes($team->id) : [], 'categories' => $team ? Category::where([ 'categories.team_id' => $team->id, 'categories.resource_type' => 'transactions', diff --git a/components.d.ts b/components.d.ts index 87ff7248..0c1c4cd3 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,6 +7,7 @@ export {} declare module 'vue' { export interface GlobalComponents { + IClarityContractLine: typeof import('~icons/clarity/contract-line')['default'] IFluentFoodApple20Filled: typeof import('~icons/fluent/food-apple20-filled')['default'] IIcRoundQueryStats: typeof import('~icons/ic/round-query-stats')['default'] IIonEllipsisVertical: typeof import('~icons/ion/ellipsis-vertical')['default'] diff --git a/package-lock.json b/package-lock.json index afaedae2..064e77e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ }, "devDependencies": { "@headlessui/vue": "^1.7.16", + "@iconify-json/clarity": "^1.1.9", "@iconify-json/fluent": "^1.1.32", "@iconify-json/ic": "^1.1.14", "@iconify-json/ion": "^1.1.12", @@ -61,6 +62,7 @@ "vite-plugin-pwa": "^0.16.4", "vue": "^3.3.4", "vue-multiselect": "^3.0.0-beta.2", + "vue3-apexcharts": "^1.4.4", "vueuse-temporals": "^1.6.0" } }, @@ -3396,6 +3398,15 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@iconify-json/clarity": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@iconify-json/clarity/-/clarity-1.1.9.tgz", + "integrity": "sha512-U9Pj2YKZ1zVp2pikA1EOstEPmv7NuXRZR8wc31VXrZUrlMjvSWMwvcr8/VIcMBVK6smb7z/Ab3iZLvCs3mtyBw==", + "dev": true, + "dependencies": { + "@iconify/types": "*" + } + }, "node_modules/@iconify-json/fluent": { "version": "1.1.32", "resolved": "https://registry.npmjs.org/@iconify-json/fluent/-/fluent-1.1.32.tgz", @@ -5160,6 +5171,13 @@ } } }, + "node_modules/@yr/monotone-cubic-spline": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz", + "integrity": "sha512-FQXkOta0XBSUPHndIKON2Y9JeQz5ZeMqLYZVVK93FliNBFm7LNMIZmY6FrMEB9XPcDbE2bekMbZD6kzDkxwYjA==", + "dev": true, + "peer": true + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -5427,6 +5445,22 @@ "node": ">= 8" } }, + "node_modules/apexcharts": { + "version": "3.44.0", + "resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.44.0.tgz", + "integrity": "sha512-u7Xzrbcxc2yWznN78Jh5NMCYVAsWDfBjRl5ea++rVzFAqjU2hLz4RgKIFwYOBDRQtW1e/Qz8azJTqIJ1+Vu9Qg==", + "dev": true, + "peer": true, + "dependencies": { + "@yr/monotone-cubic-spline": "^1.0.3", + "svg.draggable.js": "^2.2.2", + "svg.easing.js": "^2.0.0", + "svg.filter.js": "^2.0.2", + "svg.pathmorphing.js": "^0.1.3", + "svg.resize.js": "^1.4.3", + "svg.select.js": "^3.0.1" + } + }, "node_modules/appdirsjs": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/appdirsjs/-/appdirsjs-1.2.7.tgz", @@ -13759,6 +13793,105 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/svg.draggable.js": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/svg.draggable.js/-/svg.draggable.js-2.2.2.tgz", + "integrity": "sha512-JzNHBc2fLQMzYCZ90KZHN2ohXL0BQJGQimK1kGk6AvSeibuKcIdDX9Kr0dT9+UJ5O8nYA0RB839Lhvk4CY4MZw==", + "dev": true, + "peer": true, + "dependencies": { + "svg.js": "^2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.easing.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/svg.easing.js/-/svg.easing.js-2.0.0.tgz", + "integrity": "sha512-//ctPdJMGy22YoYGV+3HEfHbm6/69LJUTAqI2/5qBvaNHZ9uUFVC82B0Pl299HzgH13rKrBgi4+XyXXyVWWthA==", + "dev": true, + "peer": true, + "dependencies": { + "svg.js": ">=2.3.x" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.filter.js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/svg.filter.js/-/svg.filter.js-2.0.2.tgz", + "integrity": "sha512-xkGBwU+dKBzqg5PtilaTb0EYPqPfJ9Q6saVldX+5vCRy31P6TlRCP3U9NxH3HEufkKkpNgdTLBJnmhDHeTqAkw==", + "dev": true, + "peer": true, + "dependencies": { + "svg.js": "^2.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.js": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/svg.js/-/svg.js-2.7.1.tgz", + "integrity": "sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA==", + "dev": true, + "peer": true + }, + "node_modules/svg.pathmorphing.js": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/svg.pathmorphing.js/-/svg.pathmorphing.js-0.1.3.tgz", + "integrity": "sha512-49HWI9X4XQR/JG1qXkSDV8xViuTLIWm/B/7YuQELV5KMOPtXjiwH4XPJvr/ghEDibmLQ9Oc22dpWpG0vUDDNww==", + "dev": true, + "peer": true, + "dependencies": { + "svg.js": "^2.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.resize.js": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/svg.resize.js/-/svg.resize.js-1.4.3.tgz", + "integrity": "sha512-9k5sXJuPKp+mVzXNvxz7U0uC9oVMQrrf7cFsETznzUDDm0x8+77dtZkWdMfRlmbkEEYvUn9btKuZ3n41oNA+uw==", + "dev": true, + "peer": true, + "dependencies": { + "svg.js": "^2.6.5", + "svg.select.js": "^2.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.resize.js/node_modules/svg.select.js": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-2.1.2.tgz", + "integrity": "sha512-tH6ABEyJsAOVAhwcCjF8mw4crjXSI1aa7j2VQR8ZuJ37H2MBUbyeqYr5nEO7sSN3cy9AR9DUwNg0t/962HlDbQ==", + "dev": true, + "peer": true, + "dependencies": { + "svg.js": "^2.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.select.js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-3.0.1.tgz", + "integrity": "sha512-h5IS/hKkuVCbKSieR9uQCj9w+zLHoPh+ce19bBYyqF53g6mnPB8sAtIbe1s9dh2S2fCmYX2xel1Ln3PJBbK4kw==", + "dev": true, + "peer": true, + "dependencies": { + "svg.js": "^2.6.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/synckit": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", @@ -14895,6 +15028,16 @@ "@vueuse/core": "^10.0.0" } }, + "node_modules/vue3-apexcharts": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/vue3-apexcharts/-/vue3-apexcharts-1.4.4.tgz", + "integrity": "sha512-TH89uZrxGjaDvkaYAISvj8+k6Bf1rUKFillc8oJirs5XZEPiwM1ELKZQ786wz0rfPqkSHHny2lqqUCK7Rw+LcQ==", + "dev": true, + "peerDependencies": { + "apexcharts": "> 3.0.0", + "vue": "> 3.0.0" + } + }, "node_modules/vueuc": { "version": "0.4.51", "resolved": "https://registry.npmjs.org/vueuc/-/vueuc-0.4.51.tgz", @@ -17838,6 +17981,15 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@iconify-json/clarity": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@iconify-json/clarity/-/clarity-1.1.9.tgz", + "integrity": "sha512-U9Pj2YKZ1zVp2pikA1EOstEPmv7NuXRZR8wc31VXrZUrlMjvSWMwvcr8/VIcMBVK6smb7z/Ab3iZLvCs3mtyBw==", + "dev": true, + "requires": { + "@iconify/types": "*" + } + }, "@iconify-json/fluent": { "version": "1.1.32", "resolved": "https://registry.npmjs.org/@iconify-json/fluent/-/fluent-1.1.32.tgz", @@ -19271,6 +19423,13 @@ } } }, + "@yr/monotone-cubic-spline": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz", + "integrity": "sha512-FQXkOta0XBSUPHndIKON2Y9JeQz5ZeMqLYZVVK93FliNBFm7LNMIZmY6FrMEB9XPcDbE2bekMbZD6kzDkxwYjA==", + "dev": true, + "peer": true + }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -19473,6 +19632,22 @@ "picomatch": "^2.0.4" } }, + "apexcharts": { + "version": "3.44.0", + "resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.44.0.tgz", + "integrity": "sha512-u7Xzrbcxc2yWznN78Jh5NMCYVAsWDfBjRl5ea++rVzFAqjU2hLz4RgKIFwYOBDRQtW1e/Qz8azJTqIJ1+Vu9Qg==", + "dev": true, + "peer": true, + "requires": { + "@yr/monotone-cubic-spline": "^1.0.3", + "svg.draggable.js": "^2.2.2", + "svg.easing.js": "^2.0.0", + "svg.filter.js": "^2.0.2", + "svg.pathmorphing.js": "^0.1.3", + "svg.resize.js": "^1.4.3", + "svg.select.js": "^3.0.1" + } + }, "appdirsjs": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/appdirsjs/-/appdirsjs-1.2.7.tgz", @@ -25723,6 +25898,86 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, + "svg.draggable.js": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/svg.draggable.js/-/svg.draggable.js-2.2.2.tgz", + "integrity": "sha512-JzNHBc2fLQMzYCZ90KZHN2ohXL0BQJGQimK1kGk6AvSeibuKcIdDX9Kr0dT9+UJ5O8nYA0RB839Lhvk4CY4MZw==", + "dev": true, + "peer": true, + "requires": { + "svg.js": "^2.0.1" + } + }, + "svg.easing.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/svg.easing.js/-/svg.easing.js-2.0.0.tgz", + "integrity": "sha512-//ctPdJMGy22YoYGV+3HEfHbm6/69LJUTAqI2/5qBvaNHZ9uUFVC82B0Pl299HzgH13rKrBgi4+XyXXyVWWthA==", + "dev": true, + "peer": true, + "requires": { + "svg.js": ">=2.3.x" + } + }, + "svg.filter.js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/svg.filter.js/-/svg.filter.js-2.0.2.tgz", + "integrity": "sha512-xkGBwU+dKBzqg5PtilaTb0EYPqPfJ9Q6saVldX+5vCRy31P6TlRCP3U9NxH3HEufkKkpNgdTLBJnmhDHeTqAkw==", + "dev": true, + "peer": true, + "requires": { + "svg.js": "^2.2.5" + } + }, + "svg.js": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/svg.js/-/svg.js-2.7.1.tgz", + "integrity": "sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA==", + "dev": true, + "peer": true + }, + "svg.pathmorphing.js": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/svg.pathmorphing.js/-/svg.pathmorphing.js-0.1.3.tgz", + "integrity": "sha512-49HWI9X4XQR/JG1qXkSDV8xViuTLIWm/B/7YuQELV5KMOPtXjiwH4XPJvr/ghEDibmLQ9Oc22dpWpG0vUDDNww==", + "dev": true, + "peer": true, + "requires": { + "svg.js": "^2.4.0" + } + }, + "svg.resize.js": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/svg.resize.js/-/svg.resize.js-1.4.3.tgz", + "integrity": "sha512-9k5sXJuPKp+mVzXNvxz7U0uC9oVMQrrf7cFsETznzUDDm0x8+77dtZkWdMfRlmbkEEYvUn9btKuZ3n41oNA+uw==", + "dev": true, + "peer": true, + "requires": { + "svg.js": "^2.6.5", + "svg.select.js": "^2.1.2" + }, + "dependencies": { + "svg.select.js": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-2.1.2.tgz", + "integrity": "sha512-tH6ABEyJsAOVAhwcCjF8mw4crjXSI1aa7j2VQR8ZuJ37H2MBUbyeqYr5nEO7sSN3cy9AR9DUwNg0t/962HlDbQ==", + "dev": true, + "peer": true, + "requires": { + "svg.js": "^2.2.5" + } + } + } + }, + "svg.select.js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-3.0.1.tgz", + "integrity": "sha512-h5IS/hKkuVCbKSieR9uQCj9w+zLHoPh+ce19bBYyqF53g6mnPB8sAtIbe1s9dh2S2fCmYX2xel1Ln3PJBbK4kw==", + "dev": true, + "peer": true, + "requires": { + "svg.js": "^2.6.5" + } + }, "synckit": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", @@ -26537,6 +26792,13 @@ "vueuse-temporals": "^1.4.3" } }, + "vue3-apexcharts": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/vue3-apexcharts/-/vue3-apexcharts-1.4.4.tgz", + "integrity": "sha512-TH89uZrxGjaDvkaYAISvj8+k6Bf1rUKFillc8oJirs5XZEPiwM1ELKZQ786wz0rfPqkSHHny2lqqUCK7Rw+LcQ==", + "dev": true, + "requires": {} + }, "vueuc": { "version": "0.4.51", "resolved": "https://registry.npmjs.org/vueuc/-/vueuc-0.4.51.tgz", diff --git a/package.json b/package.json index de0a4c0f..e74f145e 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "devDependencies": { "@headlessui/vue": "^1.7.16", + "@iconify-json/clarity": "^1.1.9", "@iconify-json/fluent": "^1.1.32", "@iconify-json/ic": "^1.1.14", "@iconify-json/ion": "^1.1.12", @@ -65,6 +66,7 @@ "vite-plugin-pwa": "^0.16.4", "vue": "^3.3.4", "vue-multiselect": "^3.0.0-beta.2", + "vue3-apexcharts": "^1.4.4", "vueuse-temporals": "^1.6.0" }, "dependencies": { diff --git a/resources/js/Components/molecules/WidgetTitleCard.vue b/resources/js/Components/molecules/WidgetTitleCard.vue index c827b0ae..c4905b7b 100644 --- a/resources/js/Components/molecules/WidgetTitleCard.vue +++ b/resources/js/Components/molecules/WidgetTitleCard.vue @@ -10,15 +10,24 @@ defineProps({ }, action: { type: Object, + }, + hideDivider: { + type: Boolean } }) \ No newline at end of file + diff --git a/resources/js/Pages/BudgetWidget.vue b/resources/js/Pages/BudgetWidget.vue new file mode 100644 index 00000000..670da8f3 --- /dev/null +++ b/resources/js/Pages/BudgetWidget.vue @@ -0,0 +1,215 @@ + + + + diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue index 593b943c..bf45db90 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/Dashboard.vue @@ -17,6 +17,7 @@ import { useAppContextStore } from '@/store'; import { ITransaction } from '@/domains/transactions/models'; import { router } from '@inertiajs/vue3'; +import BudgetWidget from './BudgetWidget.vue'; defineProps({ revenue: { @@ -167,6 +168,7 @@ /> + diff --git a/resources/js/Pages/Finance/Trends.vue b/resources/js/Pages/Trends/Overview.vue similarity index 91% rename from resources/js/Pages/Finance/Trends.vue rename to resources/js/Pages/Trends/Overview.vue index 3fab2cb8..836ce6bc 100644 --- a/resources/js/Pages/Finance/Trends.vue +++ b/resources/js/Pages/Trends/Overview.vue @@ -8,8 +8,8 @@ import AppLayout from "@/Components/templates/AppLayout.vue"; import ChartNetWorth from "@/Components/ChartNetworth.vue"; import IncomeExpenses from "@/Components/IncomeExpenses.vue"; -import FinanceTemplate from "./Partials/FinanceTemplate.vue"; -import FinanceSectionNav from "./Partials/FinanceSectionNav.vue"; +import TrendTemplate from "./Partials/TrendTemplate.vue"; +import TrendSectionNav from "./Partials/TrendSectionNav.vue"; import ChartComparison from "@/Components/widgets/ChartComparison.vue"; import WidgetTitleCard from "@/Components/molecules/WidgetTitleCard.vue"; import Collapse from "@/Components/molecules/Collapse.vue"; @@ -115,10 +115,8 @@ const isFilterSelected = (filterValue) => { - + diff --git a/resources/js/Pages/Trends/Partials/TrendSectionNav.vue b/resources/js/Pages/Trends/Partials/TrendSectionNav.vue new file mode 100644 index 00000000..fed8c62b --- /dev/null +++ b/resources/js/Pages/Trends/Partials/TrendSectionNav.vue @@ -0,0 +1,17 @@ + + + diff --git a/resources/js/Pages/Trends/Partials/TrendTemplate.vue b/resources/js/Pages/Trends/Partials/TrendTemplate.vue new file mode 100644 index 00000000..9e4edd07 --- /dev/null +++ b/resources/js/Pages/Trends/Partials/TrendTemplate.vue @@ -0,0 +1,83 @@ + + + + + + + + diff --git a/resources/js/domains/app/index.ts b/resources/js/domains/app/index.ts index aff39257..20f8bbf4 100644 --- a/resources/js/domains/app/index.ts +++ b/resources/js/domains/app/index.ts @@ -56,6 +56,16 @@ export const useAppMenu = t => { isActiveFunction(url, currentPath) { return /loger-profiles/.test(currentPath) } + }, + { + icon: 'fas fa-chart-bar', + label: t('Profiles'), + label: 'Trends', + to: '/trends', + as: Link, + isActiveFunction(url, currentPath) { + return /trends/.test(currentPath) + } } ].filter(item => !item.hidden); diff --git a/resources/js/domains/app/menus.ts b/resources/js/domains/app/menus.ts index e5106869..0b1087f6 100644 --- a/resources/js/domains/app/menus.ts +++ b/resources/js/domains/app/menus.ts @@ -2,7 +2,8 @@ export const MODULES = { HOUSING: 'housing', MEAL: 'meal', FINANCE: 'finance', - RELATIONSHIP: 'relationship' + RELATIONSHIP: 'relationship', + TRENDS: 'trends' } const menus = { @@ -61,11 +62,28 @@ const menus = { { label: 'Transactions', url: '/finance/transactions' - }, - { - label: 'Trends', - url: '/trends' - }] + }], + [MODULES.TRENDS]: [ + { + label: 'Spending', + url: '/trends' + }, + { + label: 'Net Worth', + url: '/trends/net-worth' + }, + { + label: 'Income v Expenses', + url: '/trends/income-expenses' + }, + { + label: 'Income vs Expenses Graph', + url: '/trends/income-expenses-graph' + }, + { + label: 'Year summary', + url: '/trends/year-summary' + }] } diff --git a/resources/js/domains/transactions/components/AccountLinkModal.vue b/resources/js/domains/transactions/components/AccountLinkModal.vue index 62138f0b..340e0308 100644 --- a/resources/js/domains/transactions/components/AccountLinkModal.vue +++ b/resources/js/domains/transactions/components/AccountLinkModal.vue @@ -34,7 +34,6 @@ function getIntegrations() { axios({ url: "/api/integrations" }).then(({ data }) => { - console.log(data); state.integrations = data; }) .catch((err) => console.log(err)); diff --git a/tailwindTheme/colors.js b/tailwindTheme/colors.js index 10335357..5c99b3e4 100644 --- a/tailwindTheme/colors.js +++ b/tailwindTheme/colors.js @@ -13,6 +13,20 @@ module.exports = { '900': '#161c2d' }, dodgerblue: { - - } + + }, + mauvelous: { + DEFAULT: '#F37EA1', + 50: '#FFFFFF', + 100: '#FFFFFF', + 200: '#FDEEF3', + 300: '#FAC9D7', + 400: '#F6A3BC', + 500: '#F37EA1', + 600: '#EE4B7C', + 700: '#E91756', + 800: '#B81143', + 900: '#840C30', + 950: '#6B0A27' + }, } diff --git a/tailwindTheme/index.js b/tailwindTheme/index.js index 2e0ce28c..47cb0d23 100644 --- a/tailwindTheme/index.js +++ b/tailwindTheme/index.js @@ -21,6 +21,7 @@ module.exports = { }, defaultLight: { primary: "#F37EA1", + primaryDark: customColors.mauvelous[800], secondary: "#7B77D1", "accent": "#f782c2", "neutral": "#F3F4F6", From 1f5b75e5343868f73b826587a1e742f41fb6e742 Mon Sep 17 00:00:00 2001 From: Jesus Guerrero Date: Wed, 18 Oct 2023 22:27:36 -0400 Subject: [PATCH 2/7] feat: draft dashboard widgets for v1.5.0 --- resources/js/Pages/BudgetWidget.vue | 3 + resources/js/Pages/Dashboard.vue | 2 +- resources/js/Pages/NetWorthWidget.vue | 174 +++++++++++++++++++++++++ resources/js/Pages/WidgetHeaderRow.vue | 36 +++++ 4 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 resources/js/Pages/NetWorthWidget.vue create mode 100644 resources/js/Pages/WidgetHeaderRow.vue diff --git a/resources/js/Pages/BudgetWidget.vue b/resources/js/Pages/BudgetWidget.vue index 670da8f3..f6b010cc 100644 --- a/resources/js/Pages/BudgetWidget.vue +++ b/resources/js/Pages/BudgetWidget.vue @@ -51,6 +51,9 @@ const chartConfig = { enabled: true, }, }, + fill: { + colors: ['#FFFFFF', '#E91E63', '#CF3C68'] + }, stroke: { curve: "smooth", }, diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue index bf45db90..55a5fee5 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/Dashboard.vue @@ -18,6 +18,7 @@ import { ITransaction } from '@/domains/transactions/models'; import { router } from '@inertiajs/vue3'; import BudgetWidget from './BudgetWidget.vue'; +import NetWorthWidget from './NetWorthWidget.vue'; defineProps({ revenue: { @@ -168,7 +169,6 @@ import BudgetWidget from './BudgetWidget.vue'; /> - diff --git a/resources/js/Pages/NetWorthWidget.vue b/resources/js/Pages/NetWorthWidget.vue new file mode 100644 index 00000000..ef6396cd --- /dev/null +++ b/resources/js/Pages/NetWorthWidget.vue @@ -0,0 +1,174 @@ + + + + diff --git a/resources/js/Pages/WidgetHeaderRow.vue b/resources/js/Pages/WidgetHeaderRow.vue new file mode 100644 index 00000000..1c187461 --- /dev/null +++ b/resources/js/Pages/WidgetHeaderRow.vue @@ -0,0 +1,36 @@ + + + + From 749e5125f54ab2c1df304e0a27c0642cabf3103e Mon Sep 17 00:00:00 2001 From: Jesus Guerrero Date: Sat, 21 Oct 2023 12:14:04 -0400 Subject: [PATCH 3/7] fix: transaction items don't show total --- .../components/TransactionItems.vue | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/js/domains/transactions/components/TransactionItems.vue b/resources/js/domains/transactions/components/TransactionItems.vue index 20cf0387..68ae7faa 100644 --- a/resources/js/domains/transactions/components/TransactionItems.vue +++ b/resources/js/domains/transactions/components/TransactionItems.vue @@ -61,7 +61,7 @@ const defaultRow = { counter_account_id: null, account_id: null, amount: 0, - history: [0] + history: 0 }; const splitsTotal = computed(() => @@ -122,7 +122,7 @@ const isPickerOpen = ref(false); /> -
+
{{ formatMoney(splitsTotal) }}
@@ -190,17 +190,18 @@ const isPickerOpen = ref(false);
-