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) {
7070 isTopLevel : path === database ,
7171 hasBackups : typeof uiFactory . renderBackups === 'function' && Boolean ( controlPlane ) ,
7272 hasConfigs : isViewerUser ,
73+ hasAccess : uiFactory . hasAccess ,
7374 } ) ;
7475 let activeTab = pages . find ( ( el ) => el . id === diagnosticsTab ) ;
7576 if ( ! activeTab ) {
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ export const getPagesByType = (
177177 isTopLevel ?: boolean ;
178178 hasBackups ?: boolean ;
179179 hasConfigs ?: boolean ;
180+ hasAccess ?: boolean ;
180181 } ,
181182) => {
182183 const subTypePages = subType ? pathSubTypeToPages [ subType ] : undefined ;
@@ -198,6 +199,9 @@ export const getPagesByType = (
198199 if ( ! options ?. hasConfigs ) {
199200 pages = pages . filter ( ( item ) => item . id !== TENANT_DIAGNOSTICS_TABS_IDS . configs ) ;
200201 }
202+ if ( ! options ?. hasAccess ) {
203+ pages = pages . filter ( ( item ) => item . id !== TENANT_DIAGNOSTICS_TABS_IDS . access ) ;
204+ }
201205 return pages ;
202206} ;
203207
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export interface UIFactory<H extends string = CommonIssueType> {
4242 getHealthcheckViewsOrder : GetHealthcheckViewsOrder < H > ;
4343 countHealthcheckIssuesByType : ( issueTrees : IssuesTree [ ] ) => Record < H , number > ;
4444 } ;
45+ hasAccess ?: boolean ;
4546}
4647
4748export type HandleCreateDB = ( params : { clusterName : string } ) => Promise < boolean > ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const uiFactoryBase: UIFactory = {
1818 getHealthcheckViewsOrder,
1919 countHealthcheckIssuesByType,
2020 } ,
21+ hasAccess : true ,
2122} ;
2223
2324export function configureUIFactory < H extends string > ( overrides : Partial < UIFactory < H > > ) {
You can’t perform that action at this time.
0 commit comments