@devtron-labs/devtron-fe-common-lib 0.1.15-beta-8 → 0.1.15-beta-9
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 +2 -0
- package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +1 -5
- package/dist/Common/Types.d.ts +1 -1
- package/dist/Pages/ResourceBrowser/ResourceBrowser.Types.d.ts +1 -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/Components/ScannedObjectBar/ScannedObjectBar.d.ts +4 -0
- package/dist/Shared/Components/ScannedObjectBar/index.d.ts +1 -0
- package/dist/Shared/Components/ScannedObjectBar/types.d.ts +7 -0
- package/dist/Shared/Components/index.d.ts +1 -1
- 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 +13 -12
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-0427118b.js → cssMode-3e6ec700.js} +1 -1
- package/dist/{freemarker2-c4865b88.js → freemarker2-5b5ee393.js} +1 -1
- package/dist/{handlebars-58e42395.js → handlebars-bf398b6d.js} +1 -1
- package/dist/{html-d2b737a2.js → html-b35def4f.js} +1 -1
- package/dist/{htmlMode-d8f2054d.js → htmlMode-48e61b21.js} +1 -1
- package/dist/{index-aacc3c2b.js → index-109adc1e.js} +16745 -16774
- package/dist/index.js +347 -343
- package/dist/{javascript-0738e781.js → javascript-27a2b43d.js} +1 -1
- package/dist/{jsonMode-d0d7fa44.js → jsonMode-950b6194.js} +1 -1
- package/dist/{liquid-95d095c0.js → liquid-c64aed12.js} +1 -1
- package/dist/{mdx-5ac02f1f.js → mdx-479da7c4.js} +1 -1
- package/dist/{python-f8d0c7d0.js → python-7b9f7243.js} +1 -1
- package/dist/{razor-3603793d.js → razor-7aeb2aac.js} +1 -1
- package/dist/{tsMode-8d6a81c6.js → tsMode-43b9c3bb.js} +1 -1
- package/dist/{typescript-da26d4a8.js → typescript-1166a256.js} +1 -1
- package/dist/{xml-0bfce6bc.js → xml-8a093524.js} +1 -1
- package/dist/{yaml-703b1d5d.js → yaml-0ad40107.js} +1 -1
- package/package.json +1 -1
- package/dist/Shared/Components/FilterButton/FilterButton.d.ts +0 -5
- package/dist/Shared/Components/FilterButton/index.d.ts +0 -1
- package/dist/Shared/Components/FilterButton/types.d.ts +0 -11
- package/dist/Shared/Components/FilterButton/utils.d.ts +0 -15
|
@@ -75,6 +75,8 @@ export declare const ROUTES: {
|
|
|
75
75
|
CONFIG_CD_PIPELINE: string;
|
|
76
76
|
MODULE_CONFIGURED: string;
|
|
77
77
|
RESOURCE_HISTORY_DEPLOYMENT: string;
|
|
78
|
+
APP_LIST_MIN: string;
|
|
79
|
+
CLUSTER_LIST_MIN: string;
|
|
78
80
|
PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
|
|
79
81
|
PLUGIN_GLOBAL_LIST_V2: string;
|
|
80
82
|
PLUGIN_GLOBAL_LIST_TAGS: string;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { ScanVulnerabilitiesTableProps } from '../Types';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
SEVERITY = "severity",
|
|
5
|
-
PACKAGE = "package"
|
|
6
|
-
}
|
|
7
|
-
export default function ScanVulnerabilitiesTable({ vulnerabilities, hidePolicy, shouldStick, }: ScanVulnerabilitiesTableProps): JSX.Element;
|
|
3
|
+
export default function ScanVulnerabilitiesTable({ vulnerabilities, hidePolicy, shouldStick }: ScanVulnerabilitiesTableProps): JSX.Element;
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -492,7 +492,7 @@ export declare enum DeploymentAppTypes {
|
|
|
492
492
|
}
|
|
493
493
|
export interface VulnerabilityType {
|
|
494
494
|
name: string;
|
|
495
|
-
severity: '
|
|
495
|
+
severity: 'CRITICAL' | 'MODERATE' | 'LOW';
|
|
496
496
|
package: string;
|
|
497
497
|
version: string;
|
|
498
498
|
fixedVersion: 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
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ScannedObjectBarProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const ScannedObjectBar: ({ criticalVulnerabilitiesCount, moderateVulnerabilitiesCount, lowVulnerabilitiesCount, objectBarClassName, removeObjectCountMargin, }: ScannedObjectBarProps) => JSX.Element;
|
|
4
|
+
export default ScannedObjectBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ScannedObjectBar } from './ScannedObjectBar';
|
|
@@ -10,6 +10,7 @@ export * from './FilterChips';
|
|
|
10
10
|
export * from './ActivityIndicator';
|
|
11
11
|
export * from './GenericSectionErrorState';
|
|
12
12
|
export * from './KeyValueList';
|
|
13
|
+
export * from './ScannedObjectBar';
|
|
13
14
|
export * from './InfoIconTippy';
|
|
14
15
|
export * from './EditableTextArea';
|
|
15
16
|
export * from './Header';
|
|
@@ -33,4 +34,3 @@ export * from './Plugin';
|
|
|
33
34
|
export * from './KeyValueTable';
|
|
34
35
|
export * from './SelectPicker';
|
|
35
36
|
export * from './DetectBottom';
|
|
36
|
-
export * from './FilterButton';
|
|
@@ -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 {};
|
|
@@ -362,3 +362,12 @@ export declare enum ComponentSizeType {
|
|
|
362
362
|
medium = "medium",
|
|
363
363
|
large = "large"
|
|
364
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Identifiers for grouped / all resources
|
|
367
|
+
*/
|
|
368
|
+
export declare enum SelectAllGroupedResourceIdentifiers {
|
|
369
|
+
allProjects = "-1",
|
|
370
|
+
allExistingAndFutureNonProdEnvironments = "-1",
|
|
371
|
+
allExistingAndFutureProdEnvironments = "-2",
|
|
372
|
+
allExistingAndFutureEnvironments = "-3"
|
|
373
|
+
}
|
package/dist/Shared/types.d.ts
CHANGED
|
@@ -202,10 +202,8 @@ export declare enum DefaultUserKey {
|
|
|
202
202
|
}
|
|
203
203
|
export declare enum Severity {
|
|
204
204
|
CRITICAL = "critical",
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
LOW = "low",
|
|
208
|
-
UNKNOWN = "unknown"
|
|
205
|
+
MODERATE = "moderate",
|
|
206
|
+
LOW = "low"
|
|
209
207
|
}
|
|
210
208
|
export declare enum ImagePromotionTabs {
|
|
211
209
|
REQUEST = "request",
|
|
@@ -362,25 +360,28 @@ export declare enum ResourceKindType {
|
|
|
362
360
|
tenant = "tenant",
|
|
363
361
|
installation = "installation",
|
|
364
362
|
environment = "environment",
|
|
365
|
-
cdPipeline = "cd-pipeline"
|
|
363
|
+
cdPipeline = "cd-pipeline",
|
|
364
|
+
project = "project"
|
|
366
365
|
}
|
|
367
366
|
/**
|
|
368
367
|
* Versions support for the resources on BE
|
|
368
|
+
*
|
|
369
|
+
* TODO: Rename to ApiVersionType
|
|
369
370
|
*/
|
|
370
371
|
export declare enum ResourceVersionType {
|
|
371
372
|
v1 = "v1",
|
|
372
373
|
alpha1 = "alpha1"
|
|
373
374
|
}
|
|
374
|
-
export
|
|
375
|
-
|
|
376
|
-
high: number;
|
|
377
|
-
medium: number;
|
|
378
|
-
low: number;
|
|
379
|
-
unknown: number;
|
|
375
|
+
export declare enum PolicyKindType {
|
|
376
|
+
lockConfiguration = "lock-configuration"
|
|
380
377
|
}
|
|
381
378
|
export interface LastExecutionResultType {
|
|
382
379
|
lastExecution: string;
|
|
383
|
-
severityCount:
|
|
380
|
+
severityCount: {
|
|
381
|
+
critical: number;
|
|
382
|
+
moderate: number;
|
|
383
|
+
low: number;
|
|
384
|
+
};
|
|
384
385
|
vulnerabilities: VulnerabilityType[];
|
|
385
386
|
scanExecutionId?: number;
|
|
386
387
|
appId?: number;
|