File tree Expand file tree Collapse file tree 4 files changed +7
-0
lines changed
containers/Tenant/Diagnostics Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ function Diagnostics(props: DiagnosticsProps) {
70
70
isTopLevel : path === database ,
71
71
hasBackups : typeof uiFactory . renderBackups === 'function' && Boolean ( controlPlane ) ,
72
72
hasConfigs : isViewerUser ,
73
+ hasAccess : uiFactory . hasAccess ,
73
74
} ) ;
74
75
let activeTab = pages . find ( ( el ) => el . id === diagnosticsTab ) ;
75
76
if ( ! activeTab ) {
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ export const getPagesByType = (
177
177
isTopLevel ?: boolean ;
178
178
hasBackups ?: boolean ;
179
179
hasConfigs ?: boolean ;
180
+ hasAccess ?: boolean ;
180
181
} ,
181
182
) => {
182
183
const subTypePages = subType ? pathSubTypeToPages [ subType ] : undefined ;
@@ -198,6 +199,9 @@ export const getPagesByType = (
198
199
if ( ! options ?. hasConfigs ) {
199
200
pages = pages . filter ( ( item ) => item . id !== TENANT_DIAGNOSTICS_TABS_IDS . configs ) ;
200
201
}
202
+ if ( ! options ?. hasAccess ) {
203
+ pages = pages . filter ( ( item ) => item . id !== TENANT_DIAGNOSTICS_TABS_IDS . access ) ;
204
+ }
201
205
return pages ;
202
206
} ;
203
207
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export interface UIFactory<H extends string = CommonIssueType> {
42
42
getHealthcheckViewsOrder : GetHealthcheckViewsOrder < H > ;
43
43
countHealthcheckIssuesByType : ( issueTrees : IssuesTree [ ] ) => Record < H , number > ;
44
44
} ;
45
+ hasAccess ?: boolean ;
45
46
}
46
47
47
48
export type HandleCreateDB = ( params : { clusterName : string } ) => Promise < boolean > ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const uiFactoryBase: UIFactory = {
18
18
getHealthcheckViewsOrder,
19
19
countHealthcheckIssuesByType,
20
20
} ,
21
+ hasAccess : true ,
21
22
} ;
22
23
23
24
export function configureUIFactory < H extends string > ( overrides : Partial < UIFactory < H > > ) {
You can’t perform that action at this time.
0 commit comments