@devtron-labs/devtron-fe-common-lib 0.1.19 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Common/Constants.d.ts +3 -0
- package/dist/Shared/Components/FilterChips/FilterChips.component.d.ts +1 -1
- package/dist/Shared/Components/FilterChips/types.d.ts +18 -6
- package/dist/Shared/Helpers.d.ts +1 -0
- package/dist/Shared/Hooks/index.d.ts +1 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/index.d.ts +2 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/service.d.ts +9 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/types.d.ts +31 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/useGetResourceKindsOptions.d.ts +16 -0
- package/dist/Shared/Hooks/useGetResourceKindsOptions/utils.d.ts +4 -0
- package/dist/Shared/Services/common.service.d.ts +3 -2
- package/dist/Shared/Services/types.d.ts +15 -4
- package/dist/Shared/constants.d.ts +9 -0
- package/dist/Shared/types.d.ts +7 -1
- package/dist/{cssMode-3b8730e0.js → cssMode-ff7b28ed.js} +1 -1
- package/dist/{freemarker2-3d674165.js → freemarker2-d7cb7ecb.js} +1 -1
- package/dist/{handlebars-778549d5.js → handlebars-a864e9e7.js} +1 -1
- package/dist/{html-b63a30b8.js → html-46ef1a3c.js} +1 -1
- package/dist/{htmlMode-71ffb01f.js → htmlMode-305d8331.js} +1 -1
- package/dist/{index-7ab4ff11.js → index-3b5b3392.js} +21294 -21212
- package/dist/index.js +275 -270
- package/dist/{javascript-d699b3d7.js → javascript-f981d833.js} +1 -1
- package/dist/{jsonMode-d3fbc4fe.js → jsonMode-88428091.js} +1 -1
- package/dist/{liquid-fd3ed14a.js → liquid-330a3d26.js} +1 -1
- package/dist/{mdx-f058f4dd.js → mdx-916cf8dd.js} +1 -1
- package/dist/{python-07b5b6a2.js → python-72b31467.js} +1 -1
- package/dist/{razor-c25a9f7c.js → razor-a9b6ed22.js} +1 -1
- package/dist/{tsMode-ab463e44.js → tsMode-3b90c215.js} +1 -1
- package/dist/{typescript-b6036ce0.js → typescript-1c340db6.js} +1 -1
- package/dist/{xml-a48a96c1.js → xml-1dbe56e6.js} +1 -1
- package/dist/{yaml-9d0856b9.js → yaml-505221d9.js} +1 -1
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ export declare const PATTERNS: {
|
|
|
16
16
|
KUBERNETES_KEY_NAME: RegExp;
|
|
17
17
|
START_END_ALPHANUMERIC: RegExp;
|
|
18
18
|
ALPHANUMERIC_WITH_SPECIAL_CHAR: RegExp;
|
|
19
|
+
ESCAPED_CHARACTERS: RegExp;
|
|
19
20
|
};
|
|
20
21
|
export declare const URLS: {
|
|
21
22
|
LOGIN_SSO: string;
|
|
@@ -75,6 +76,8 @@ export declare const ROUTES: {
|
|
|
75
76
|
CONFIG_CD_PIPELINE: string;
|
|
76
77
|
MODULE_CONFIGURED: string;
|
|
77
78
|
RESOURCE_HISTORY_DEPLOYMENT: string;
|
|
79
|
+
APP_LIST_MIN: string;
|
|
80
|
+
CLUSTER_LIST_MIN: string;
|
|
78
81
|
PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
|
|
79
82
|
PLUGIN_GLOBAL_LIST_V2: string;
|
|
80
83
|
PLUGIN_GLOBAL_LIST_TAGS: string;
|
|
@@ -3,5 +3,5 @@ import { FilterChipsProps } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Component for rendering the applied filter chips
|
|
5
5
|
*/
|
|
6
|
-
declare const FilterChips: <T = Record<string, unknown>>({ filterConfig, clearFilters, onRemoveFilter, getFormattedLabel, getFormattedValue, className, clearButtonClassName, shouldHideLabel, }: FilterChipsProps<T>) => JSX.Element;
|
|
6
|
+
declare const FilterChips: <T = Record<string, unknown>>({ filterConfig, clearFilters, onRemoveFilter, getFormattedLabel, getFormattedValue, className, clearButtonClassName, showClearAndRemove, shouldHideLabel, }: FilterChipsProps<T>) => JSX.Element;
|
|
7
7
|
export default FilterChips;
|
|
@@ -21,17 +21,33 @@ export interface FilterChipProps {
|
|
|
21
21
|
* If passed, the label will be formatted accordingly
|
|
22
22
|
*/
|
|
23
23
|
getFormattedValue?: (filterKey: string, filterValue: unknown) => ReactNode;
|
|
24
|
+
showRemoveIcon: boolean;
|
|
24
25
|
/**
|
|
25
26
|
* If true, would hide the label
|
|
26
27
|
* @default false
|
|
27
28
|
*/
|
|
28
29
|
shouldHideLabel?: boolean;
|
|
29
30
|
}
|
|
30
|
-
export
|
|
31
|
+
export type FilterChipsProps<T = Record<string, unknown>> = Pick<FilterChipProps, 'getFormattedLabel' | 'getFormattedValue' | 'shouldHideLabel'> & {
|
|
31
32
|
/**
|
|
32
33
|
* Current filter configuration
|
|
33
34
|
*/
|
|
34
35
|
filterConfig: T;
|
|
36
|
+
/**
|
|
37
|
+
* Class name for the container
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
} & ({
|
|
41
|
+
/**
|
|
42
|
+
* If false, anything related to removing filters is not shown
|
|
43
|
+
* @default 'true'
|
|
44
|
+
*/
|
|
45
|
+
showClearAndRemove: false;
|
|
46
|
+
clearFilters?: never;
|
|
47
|
+
onRemoveFilter?: never;
|
|
48
|
+
clearButtonClassName?: never;
|
|
49
|
+
} | {
|
|
50
|
+
showClearAndRemove?: true;
|
|
35
51
|
/**
|
|
36
52
|
* Callback handler for removing the filters
|
|
37
53
|
*/
|
|
@@ -40,12 +56,8 @@ export interface FilterChipsProps<T = Record<string, unknown>> extends Pick<Filt
|
|
|
40
56
|
* Handler for removing a applied filter
|
|
41
57
|
*/
|
|
42
58
|
onRemoveFilter: (filterConfig: T) => void;
|
|
43
|
-
/**
|
|
44
|
-
* Class name for the container
|
|
45
|
-
*/
|
|
46
|
-
className?: string;
|
|
47
59
|
/**
|
|
48
60
|
* Class name for the clear filter button
|
|
49
61
|
*/
|
|
50
62
|
clearButtonClassName?: string;
|
|
51
|
-
}
|
|
63
|
+
});
|
package/dist/Shared/Helpers.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ interface HighlightSearchTextProps {
|
|
|
17
17
|
*/
|
|
18
18
|
highlightClasses?: string;
|
|
19
19
|
}
|
|
20
|
+
export declare const escapeRegExp: (text: string) => string;
|
|
20
21
|
export declare const highlightSearchText: ({ searchText, text, highlightClasses }: HighlightSearchTextProps) => string;
|
|
21
22
|
export declare const preventBodyScroll: (lock: boolean) => void;
|
|
22
23
|
export declare const getIsMaterialInfoAvailable: (materialInfo: MaterialInfo[]) => boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Teams } from '../../../Common/Types';
|
|
2
|
+
import { ClusterType } from '../../Services';
|
|
3
|
+
import { EnvironmentType } from '../../types';
|
|
4
|
+
import { AppsGroupedByProjectsType } from './types';
|
|
5
|
+
|
|
6
|
+
export declare const getAppOptionsGroupedByProjects: () => Promise<AppsGroupedByProjectsType>;
|
|
7
|
+
export declare const getProjectOptions: () => Promise<Pick<Teams, 'id' | 'name'>[]>;
|
|
8
|
+
export declare const getClusterOptions: () => Promise<ClusterType[]>;
|
|
9
|
+
export declare const getEnvironmentOptions: () => Promise<EnvironmentType[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ResourceKindType } from '../../types';
|
|
2
|
+
import { ServerErrors } from '../../../Common/ServerError';
|
|
3
|
+
import { getAppOptionsGroupedByProjects, getClusterOptions, getEnvironmentOptions, getProjectOptions } from './service';
|
|
4
|
+
|
|
5
|
+
export interface AppType {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export type AppsGroupedByProjectsType = {
|
|
9
|
+
projectId: number;
|
|
10
|
+
projectName: string;
|
|
11
|
+
appList: AppType[];
|
|
12
|
+
}[];
|
|
13
|
+
export interface ClusterDTO {
|
|
14
|
+
id: number;
|
|
15
|
+
cluster_name: string;
|
|
16
|
+
isVirtualCluster: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface UseGetResourceKindsOptionsProps {
|
|
19
|
+
resourcesToFetch: Extract<ResourceKindType, ResourceKindType.devtronApplication | ResourceKindType.project | ResourceKindType.cluster | ResourceKindType.environment>[];
|
|
20
|
+
}
|
|
21
|
+
export interface UseGetResourceKindOptionsReturnType {
|
|
22
|
+
isResourcesOptionsLoading: boolean;
|
|
23
|
+
resourcesOptionsMap: {
|
|
24
|
+
[ResourceKindType.devtronApplication]: Awaited<ReturnType<typeof getAppOptionsGroupedByProjects>>;
|
|
25
|
+
[ResourceKindType.project]: Awaited<ReturnType<typeof getProjectOptions>>;
|
|
26
|
+
[ResourceKindType.cluster]: Awaited<ReturnType<typeof getClusterOptions>>;
|
|
27
|
+
[ResourceKindType.environment]: Awaited<ReturnType<typeof getEnvironmentOptions>>;
|
|
28
|
+
};
|
|
29
|
+
resourcesOptionsError: ServerErrors;
|
|
30
|
+
refetchResourcesOptions: () => void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UseGetResourceKindOptionsReturnType, UseGetResourceKindsOptionsProps } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generic hook to fetch the options list for the supported resource kinds.
|
|
5
|
+
*
|
|
6
|
+
* Note: no call would be made for empty resource kind list
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const data = useGetResourceKindsOptions({
|
|
11
|
+
* resourcesToFetch: [ResourceKindType.devtronApplication, ResourceKindType.environment]
|
|
12
|
+
* })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const useGetResourceKindsOptions: ({ resourcesToFetch, }: UseGetResourceKindsOptionsProps) => UseGetResourceKindOptionsReturnType;
|
|
16
|
+
export default useGetResourceKindsOptions;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ResourceKindType } from '../../types';
|
|
2
|
+
import { UseGetResourceKindsOptionsProps } from './types';
|
|
3
|
+
|
|
4
|
+
export declare const getResourcesToFetchMap: (resourcesToFetch: UseGetResourceKindsOptionsProps['resourcesToFetch']) => Record<ResourceKindType.devtronApplication | ResourceKindType.cluster | ResourceKindType.environment | ResourceKindType.project, boolean>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { GetResourceApiUrlProps } from './types';
|
|
1
|
+
import { GetPolicyApiUrlProps, GetResourceApiUrlProps } from './types';
|
|
2
2
|
|
|
3
|
-
export declare const getResourceApiUrl: <T>({ baseUrl, kind, version, queryParams }: GetResourceApiUrlProps<T>) => string;
|
|
3
|
+
export declare const getResourceApiUrl: <T>({ baseUrl, kind, version, suffix, queryParams }: GetResourceApiUrlProps<T>) => string;
|
|
4
|
+
export declare const getPolicyApiUrl: <T>({ kind, version, queryParams, suffix }: GetPolicyApiUrlProps<T>) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getUrlWithSearchParams } from '../../Common';
|
|
2
|
-
import { ResourceKindType, ResourceVersionType } from '../types';
|
|
2
|
+
import { PolicyKindType, ResourceKindType, ResourceVersionType } from '../types';
|
|
3
3
|
|
|
4
4
|
export interface ClusterType {
|
|
5
5
|
id: number;
|
|
@@ -9,9 +9,20 @@ export interface ClusterType {
|
|
|
9
9
|
*/
|
|
10
10
|
isVirtual: boolean;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* T => Type of query params
|
|
14
|
+
* K => Type of kind
|
|
15
|
+
* P => Type of version
|
|
16
|
+
*/
|
|
17
|
+
interface BaseGetApiUrlProps<T, K extends ResourceKindType | PolicyKindType, P extends ResourceVersionType> {
|
|
13
18
|
baseUrl: string;
|
|
14
|
-
kind:
|
|
15
|
-
version:
|
|
19
|
+
kind: K;
|
|
20
|
+
version: P;
|
|
21
|
+
suffix?: string;
|
|
16
22
|
queryParams?: T extends Parameters<typeof getUrlWithSearchParams>[1] ? T : never;
|
|
17
23
|
}
|
|
24
|
+
export interface GetResourceApiUrlProps<T> extends BaseGetApiUrlProps<T, ResourceKindType, ResourceVersionType> {
|
|
25
|
+
}
|
|
26
|
+
export interface GetPolicyApiUrlProps<T> extends Omit<BaseGetApiUrlProps<T, PolicyKindType, ResourceVersionType>, 'baseUrl'> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -388,3 +388,12 @@ export declare enum ComponentSizeType {
|
|
|
388
388
|
medium = "medium",
|
|
389
389
|
large = "large"
|
|
390
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* Identifiers for grouped / all resources
|
|
393
|
+
*/
|
|
394
|
+
export declare enum SelectAllGroupedResourceIdentifiers {
|
|
395
|
+
allProjects = "-1",
|
|
396
|
+
allExistingAndFutureNonProdEnvironments = "-1",
|
|
397
|
+
allExistingAndFutureProdEnvironments = "-2",
|
|
398
|
+
allExistingAndFutureEnvironments = "-3"
|
|
399
|
+
}
|
package/dist/Shared/types.d.ts
CHANGED
|
@@ -368,15 +368,21 @@ export declare enum ResourceKindType {
|
|
|
368
368
|
tenant = "tenant",
|
|
369
369
|
installation = "installation",
|
|
370
370
|
environment = "environment",
|
|
371
|
-
cdPipeline = "cd-pipeline"
|
|
371
|
+
cdPipeline = "cd-pipeline",
|
|
372
|
+
project = "project"
|
|
372
373
|
}
|
|
373
374
|
/**
|
|
374
375
|
* Versions support for the resources on BE
|
|
376
|
+
*
|
|
377
|
+
* TODO: Rename to ApiVersionType
|
|
375
378
|
*/
|
|
376
379
|
export declare enum ResourceVersionType {
|
|
377
380
|
v1 = "v1",
|
|
378
381
|
alpha1 = "alpha1"
|
|
379
382
|
}
|
|
383
|
+
export declare enum PolicyKindType {
|
|
384
|
+
lockConfiguration = "lock-configuration"
|
|
385
|
+
}
|
|
380
386
|
export interface LastExecutionResultType {
|
|
381
387
|
lastExecution: string;
|
|
382
388
|
severityCount: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Le = Object.defineProperty;
|
|
2
2
|
var je = (e, n, i) => n in e ? Le(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
|
|
3
3
|
var k = (e, n, i) => (je(e, typeof n != "symbol" ? n + "" : n, i), i);
|
|
4
|
-
import { m as Ne } from "./index-
|
|
4
|
+
import { m as Ne } from "./index-3b5b3392.js";
|
|
5
5
|
/*!-----------------------------------------------------------------------------
|
|
6
6
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
7
|
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as F } from "./index-
|
|
1
|
+
import { m as F } from "./index-3b5b3392.js";
|
|
2
2
|
/*!-----------------------------------------------------------------------------
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as i } from "./index-
|
|
1
|
+
import { m as i } from "./index-3b5b3392.js";
|
|
2
2
|
/*!-----------------------------------------------------------------------------
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as d } from "./index-
|
|
1
|
+
import { m as d } from "./index-3b5b3392.js";
|
|
2
2
|
/*!-----------------------------------------------------------------------------
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var $e = Object.defineProperty;
|
|
2
2
|
var qe = (e, n, i) => n in e ? $e(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
|
|
3
3
|
var k = (e, n, i) => (qe(e, typeof n != "symbol" ? n + "" : n, i), i);
|
|
4
|
-
import { m as Qe } from "./index-
|
|
4
|
+
import { m as Qe } from "./index-3b5b3392.js";
|
|
5
5
|
/*!-----------------------------------------------------------------------------
|
|
6
6
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
7
|
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
|