From 8f2a88eb4dd8e779044e7cd5b48c90f290303912 Mon Sep 17 00:00:00 2001 From: Afreen Misbah Date: Fri, 11 Jul 2025 02:45:08 +0530 Subject: [PATCH] mgr/dashboard: Fix smb module enablement - changed prop name to `module_name` to avoid confusion while pasisng input props - the module name is required to enable module Signed-off-by: Afreen Misbah --- .../dashboard/frontend/src/app/app-routing.module.ts | 2 +- .../frontend/src/app/core/error/error.component.html | 4 ++-- .../frontend/src/app/core/error/error.component.ts | 11 +++-------- .../shared/services/module-status-guard.service.ts | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts index 941606865cf..fc2dd0b5610 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts @@ -446,7 +446,7 @@ const routes: Routes = [ uiApiPath: 'smb', redirectTo: 'error', header: 'SMB module is not enabled', - button_to_enable_module: 'SMB', + module_name: 'smb', navigate_to: 'cephfs/smb' }, breadcrumbs: 'File/SMB' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.html index 06881a861a2..0359f6d0ec4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.html @@ -68,9 +68,9 @@
+ *ngIf="module_name && !(buttonName && buttonRoute)"> + i18n>Enable {{ module_name | upperFirst }} module
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.ts index d63264f2a2f..8b5847c8651 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.ts @@ -33,7 +33,7 @@ export class ErrorComponent implements OnDestroy, OnInit { secondaryButtonRoute: string; secondaryButtonName: string; secondaryButtonTitle: string; - buttonToEnableModule: string; + module_name: string; navigateTo: string; component: string; icons = Icons; @@ -93,7 +93,7 @@ export class ErrorComponent implements OnDestroy, OnInit { this.secondaryButtonRoute = history.state.secondary_button_route; this.secondaryButtonName = history.state.secondary_button_name; this.secondaryButtonTitle = history.state.secondary_button_title; - this.buttonToEnableModule = history.state.button_to_enable_module; + this.module_name = history.state.module_name; this.navigateTo = history.state.navigate_to; this.component = history.state.component; this.docUrl = this.docService.urlGenerator(this.section); @@ -109,11 +109,6 @@ export class ErrorComponent implements OnDestroy, OnInit { } enableModule(): void { - this.mgrModuleService.updateModuleState( - this.buttonToEnableModule, - false, - null, - this.navigateTo - ); + this.mgrModuleService.updateModuleState(this.module_name, false, null, this.navigateTo); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.ts index e828a5ba523..5c7eee256db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.ts @@ -86,7 +86,7 @@ export class ModuleStatusGuardService { secondary_button_name: config.secondary_button_name, secondary_button_route: config.secondary_button_route, secondary_button_title: config.secondary_button_title, - button_to_enable_module: config.button_to_enable_module, + module_name: config.module_name, navigate_to: config.navigate_to, uiConfig: config.uiConfig, uiApiPath: config.uiApiPath, -- 2.39.5