From 0399fc32bef81ffa13de2940df0ba39e6e4d3a07 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 16 Sep 2025 17:35:44 +0530 Subject: [PATCH] refactor: add ForecastingSettings component and remove GeneralSettingsPage component (cherry picked from commit f4ff6bbdf306a89b78aab82df972bf55e1e0d82d) --- frontend/components.d.ts | 3 +- ...alSettings.vue => ForecastingSettings.vue} | 82 +++++++++---------- .../Settings/General/GeneralSettingsPage.vue | 34 -------- 3 files changed, 40 insertions(+), 79 deletions(-) rename frontend/src/components/Settings/{General/GeneralSettings.vue => ForecastingSettings.vue} (56%) delete mode 100644 frontend/src/components/Settings/General/GeneralSettingsPage.vue diff --git a/frontend/components.d.ts b/frontend/components.d.ts index e0a89f4c..48f009b3 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -127,11 +127,10 @@ declare module 'vue' { FileVideoIcon: typeof import('./src/components/Icons/FileVideoIcon.vue')['default'] Filter: typeof import('./src/components/Filter.vue')['default'] FilterIcon: typeof import('./src/components/Icons/FilterIcon.vue')['default'] + ForecastingSettings: typeof import('./src/components/Settings/ForecastingSettings.vue')['default'] FormattedInput: typeof import('./src/components/Controls/FormattedInput.vue')['default'] FrappeCloudIcon: typeof import('./src/components/Icons/FrappeCloudIcon.vue')['default'] GenderIcon: typeof import('./src/components/Icons/GenderIcon.vue')['default'] - GeneralSettings: typeof import('./src/components/Settings/General/GeneralSettings.vue')['default'] - GeneralSettingsPage: typeof import('./src/components/Settings/General/GeneralSettingsPage.vue')['default'] GlobalModals: typeof import('./src/components/Modals/GlobalModals.vue')['default'] GoogleIcon: typeof import('./src/components/Icons/GoogleIcon.vue')['default'] Grid: typeof import('./src/components/Controls/Grid.vue')['default'] diff --git a/frontend/src/components/Settings/General/GeneralSettings.vue b/frontend/src/components/Settings/ForecastingSettings.vue similarity index 56% rename from frontend/src/components/Settings/General/GeneralSettings.vue rename to frontend/src/components/Settings/ForecastingSettings.vue index 551b05bd..8b681926 100644 --- a/frontend/src/components/Settings/General/GeneralSettings.vue +++ b/frontend/src/components/Settings/ForecastingSettings.vue @@ -2,10 +2,10 @@

- {{ __('General') }} + {{ __('Forecasting') }}

- {{ __('Configure general settings for your CRM') }} + {{ __('Configure forecasting settings for your CRM') }}

@@ -35,28 +35,30 @@
- +
+
+ +
+ @@ -65,29 +67,8 @@ import { getSettings } from '@/stores/settings' import { Switch, toast } from 'frappe-ui' -const emit = defineEmits(['updateStep']) - const { _settings: settings } = getSettings() -const settingsList = [ - { - name: 'currency-settings', - label: 'Currency & Exchange rate provider', - description: - 'Configure the currency and exchange rate provider for your CRM', - }, - { - name: 'brand-settings', - label: 'Brand settings', - description: 'Configure your brand name, logo and favicon', - }, - { - name: 'home-actions', - label: 'Home actions', - description: 'Configure actions that appear on the home dropdown', - }, -] - function toggleForecasting(value) { settings.doc.enable_forecasting = value !== undefined ? value : !settings.doc.enable_forecasting @@ -102,4 +83,19 @@ function toggleForecasting(value) { }, }) } + +function autoUpdateExpectedDealValue() { + settings.doc.auto_update_expected_deal_value = + !settings.doc.auto_update_expected_deal_value + + settings.save.submit(null, { + onSuccess: () => { + toast.success( + settings.doc.auto_update_expected_deal_value + ? __('Auto update of expected deal value enabled') + : __('Auto update of expected deal value disabled'), + ) + }, + }) +} diff --git a/frontend/src/components/Settings/General/GeneralSettingsPage.vue b/frontend/src/components/Settings/General/GeneralSettingsPage.vue deleted file mode 100644 index 3b71f1f7..00000000 --- a/frontend/src/components/Settings/General/GeneralSettingsPage.vue +++ /dev/null @@ -1,34 +0,0 @@ - - -