-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTenantPages.tsx
45 lines (38 loc) · 1.12 KB
/
TenantPages.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import routes, {createHref} from '../../routes';
import {TENANT_SUMMARY_TABS_IDS} from '../../store/reducers/tenant/constants';
import type {paramSetup} from '../../store/state-url-mapping';
import type {ExtractType} from '../../types/common';
type TenantQueryParams = {
[K in keyof (typeof paramSetup)['/tenant']]?: ExtractType<(typeof paramSetup)['/tenant'][K]>;
};
type AdditionalQueryParams = {
database?: string;
name?: string;
backend?: string;
};
type TenantQuery = TenantQueryParams | AdditionalQueryParams;
export const TenantTabsGroups = {
summaryTab: 'summaryTab',
queryTab: 'queryTab',
diagnosticsTab: 'diagnosticsTab',
metricsTab: 'metricsTab',
} as const;
export const TENANT_INFO_TABS = [
{
id: TENANT_SUMMARY_TABS_IDS.overview,
title: 'Overview',
},
{
id: TENANT_SUMMARY_TABS_IDS.acl,
title: 'ACL',
},
];
export const TENANT_SCHEMA_TAB = [
{
id: TENANT_SUMMARY_TABS_IDS.schema,
title: 'Schema',
},
];
export const getTenantPath = (query: TenantQuery) => {
return createHref(routes.tenant, undefined, query);
};