Skip to content

Commit 85ee372

Browse files
authored
Merge pull request ceph#64447 from afreen23/smb-fix
mgr/dashboard: Fix smb module enablement Reviewed-by: Pedro Gonzalez Gomez <[email protected]>
2 parents 569ca19 + 8f2a88e commit 85ee372

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ const routes: Routes = [
446446
uiApiPath: 'smb',
447447
redirectTo: 'error',
448448
header: 'SMB module is not enabled',
449-
button_to_enable_module: 'SMB',
449+
module_name: 'smb',
450450
navigate_to: 'cephfs/smb'
451451
},
452452
breadcrumbs: 'File/SMB'

src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ <h3 i18n><b>Page not Found</b></h3>
6868

6969
<ng-template #enableButton>
7070
<div class="mt-4 text-center"
71-
*ngIf="buttonToEnableModule && !(buttonName && buttonRoute)">
71+
*ngIf="module_name && !(buttonName && buttonRoute)">
7272
<button class="btn btn-primary"
7373
(click)="enableModule()"
74-
i18n>Enable {{ buttonToEnableModule | upperFirst }} module</button>
74+
i18n>Enable {{ module_name | upperFirst }} module</button>
7575
</div>
7676
</ng-template>

src/pybind/mgr/dashboard/frontend/src/app/core/error/error.component.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class ErrorComponent implements OnDestroy, OnInit {
3333
secondaryButtonRoute: string;
3434
secondaryButtonName: string;
3535
secondaryButtonTitle: string;
36-
buttonToEnableModule: string;
36+
module_name: string;
3737
navigateTo: string;
3838
component: string;
3939
icons = Icons;
@@ -93,7 +93,7 @@ export class ErrorComponent implements OnDestroy, OnInit {
9393
this.secondaryButtonRoute = history.state.secondary_button_route;
9494
this.secondaryButtonName = history.state.secondary_button_name;
9595
this.secondaryButtonTitle = history.state.secondary_button_title;
96-
this.buttonToEnableModule = history.state.button_to_enable_module;
96+
this.module_name = history.state.module_name;
9797
this.navigateTo = history.state.navigate_to;
9898
this.component = history.state.component;
9999
this.docUrl = this.docService.urlGenerator(this.section);
@@ -109,11 +109,6 @@ export class ErrorComponent implements OnDestroy, OnInit {
109109
}
110110

111111
enableModule(): void {
112-
this.mgrModuleService.updateModuleState(
113-
this.buttonToEnableModule,
114-
false,
115-
null,
116-
this.navigateTo
117-
);
112+
this.mgrModuleService.updateModuleState(this.module_name, false, null, this.navigateTo);
118113
}
119114
}

src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class ModuleStatusGuardService {
8686
secondary_button_name: config.secondary_button_name,
8787
secondary_button_route: config.secondary_button_route,
8888
secondary_button_title: config.secondary_button_title,
89-
button_to_enable_module: config.button_to_enable_module,
89+
module_name: config.module_name,
9090
navigate_to: config.navigate_to,
9191
uiConfig: config.uiConfig,
9292
uiApiPath: config.uiApiPath,

0 commit comments

Comments
 (0)