@devtron-labs/devtron-fe-common-lib 1.5.2 → 1.5.3-beta-2

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.
@@ -2,7 +2,7 @@ import { j as t, J as $ } from "./@vendor-CwAQS8iU.js";
2
2
  import A, { forwardRef as E } from "react";
3
3
  import L, { getDefaultRegistry as D } from "@rjsf/core";
4
4
  import H from "@rjsf/validator-ajv8";
5
- import { T as v, c as U, a as k, i as J, b as w, d as S } from "./@code-editor-BOeFXRpX.js";
5
+ import { T as v, c as U, a as k, i as J, b as w, d as S } from "./@code-editor-D6GUKRXw.js";
6
6
  import M, { components as B } from "react-select";
7
7
  import { ReactComponent as W } from "./assets/ic-chevron-down.fc70d7a7.svg";
8
8
  import { getUiOptions as C, getTemplate as I, getSubmitButtonOptions as V, ADDITIONAL_PROPERTY_FLAG as P, errorId as q, englishStringTranslator as K, TranslatableString as Y, titleId as z, canExpand as G, deepEquals as Q } from "@rjsf/utils";
@@ -1,5 +1,6 @@
1
1
  export interface ScannedByToolModalProps {
2
- scanToolId?: number;
2
+ scanToolName: string;
3
+ scanToolUrl: string;
3
4
  fontSize?: number;
4
5
  spacingBetweenTextAndIcon?: number;
5
6
  }
@@ -47,7 +47,7 @@ export declare const getCodeScanLicense: (data: CodeScan["license"]) => {
47
47
  }[];
48
48
  defaultSortIndex: number;
49
49
  };
50
- export declare const getCodeScanMisconfigurations: (data: CodeScan["misConfigurations"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], lastScanTimeString: string, status: StatusType["status"], scanToolName: StatusType["scanToolName"]) => {
50
+ export declare const getCodeScanMisconfigurations: (data: CodeScan["misConfigurations"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], lastScanTimeString: string, status: StatusType["status"], scanToolName: StatusType["scanToolName"], scanToolUrl: StatusType["scanToolUrl"]) => {
51
51
  headers: ({
52
52
  headerText: string;
53
53
  isSortable: boolean;
@@ -71,7 +71,7 @@ export declare const getCodeScanMisconfigurations: (data: CodeScan["misConfigura
71
71
  })[];
72
72
  }[];
73
73
  };
74
- export declare const getCodeScanExposedSecrets: (data: CodeScan["exposedSecrets"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], lastScanTimeString: string, status: StatusType["status"], scanToolName: StatusType["scanToolName"]) => {
74
+ export declare const getCodeScanExposedSecrets: (data: CodeScan["exposedSecrets"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], lastScanTimeString: string, status: StatusType["status"], scanToolName: StatusType["scanToolName"], scanToolUrl: StatusType["scanToolUrl"]) => {
75
75
  headers: ({
76
76
  headerText: string;
77
77
  isSortable: boolean;
@@ -1,2 +1,3 @@
1
- import { SidebarDataType, SidebarPropsType } from '../types';
2
- export declare const getSidebarData: (categoriesConfig: SidebarPropsType["categoriesConfig"]) => SidebarDataType[];
1
+ import { ScanCategoriesWithLicense } from '../../types';
2
+ import { SidebarDataType } from '../types';
3
+ export declare const getSidebarData: (categoriesConfig: Record<ScanCategoriesWithLicense, boolean>) => SidebarDataType[];
@@ -1,10 +1,11 @@
1
- import { SeveritiesDTO, SortOrderEnum, EmptyStateType, StatusType, SidebarPropsType, SecurityModalStateType } from './types';
1
+ import { SeveritiesDTO, SortOrderEnum, EmptyStateType, SecurityModalStateType } from './types';
2
+ import { ScanCategoriesWithLicense } from '../types';
2
3
  export declare const DEFAULT_SECURITY_MODAL_IMAGE_STATE: {
3
4
  category: "imageScan";
4
5
  subCategory: "vulnerability";
5
6
  detailViewData: any;
6
7
  };
7
- export declare const getDefaultSecurityModalState: (categoriesConfig: SidebarPropsType["categoriesConfig"]) => SecurityModalStateType;
8
+ export declare const getDefaultSecurityModalState: (categoriesConfig: Record<ScanCategoriesWithLicense, boolean>) => SecurityModalStateType;
8
9
  export declare const CATEGORY_LABELS: {
9
10
  readonly IMAGE_SCAN: "Image Scan";
10
11
  readonly CODE_SCAN: "Code Scan";
@@ -54,4 +55,4 @@ export declare const ORDERED_SEVERITY_KEYS: readonly [SeveritiesDTO.CRITICAL, Se
54
55
  export declare const SEVERITY_DEFAULT_SORT_ORDER = SortOrderEnum['DESC'];
55
56
  export declare const SCAN_FAILED_EMPTY_STATE: EmptyStateType;
56
57
  export declare const SCAN_IN_PROGRESS_EMPTY_STATE: EmptyStateType;
57
- export declare const MAP_SCAN_TOOL_NAME_TO_SCAN_TOOL_ID: Record<StatusType['scanToolName'], number>;
58
+ export declare const TRIVY_ICON_URL = "https://cdn.devtron.ai/images/ic-trivy.webp";
@@ -3,6 +3,7 @@ import { GenericEmptyStateType } from '../../../../Common/Types';
3
3
  import { LastExecutionResultType, NodeType, Nodes } from '../../../types';
4
4
  import { SegmentedBarChartProps } from '../../../../Common/SegmentedBarChart';
5
5
  import { ServerErrors } from '../../../../Common/ServerError';
6
+ import { ScanCategories, ScanSubCategories } from '../types';
6
7
  export interface GetResourceScanDetailsPayloadType {
7
8
  name: string;
8
9
  namespace: string;
@@ -64,15 +65,15 @@ export type TableSortStateType = {
64
65
  index: number;
65
66
  order: SortOrderEnum;
66
67
  };
67
- export interface InfoCardPropsType {
68
- entities: SegmentedBarChartProps['entities'];
69
- lastScanTimeString?: string;
70
- scanToolId?: number;
71
- }
72
68
  export interface StatusType {
73
69
  status: 'Completed' | 'Running' | 'Failed' | 'Progressing';
74
70
  StartedOn: string;
75
- scanToolName: 'TRIVY' | 'CLAIR';
71
+ scanToolName: string;
72
+ scanToolUrl: string;
73
+ }
74
+ export interface InfoCardPropsType extends Pick<StatusType, 'scanToolName' | 'scanToolUrl'> {
75
+ entities: SegmentedBarChartProps['entities'];
76
+ lastScanTimeString?: string;
76
77
  }
77
78
  export type DetailViewDataType = {
78
79
  titlePrefix: string;
@@ -80,15 +81,10 @@ export type DetailViewDataType = {
80
81
  status: StatusType['status'];
81
82
  } & TablePropsType & InfoCardPropsType;
82
83
  export type SecurityModalStateType = {
83
- category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
84
- subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
84
+ category: ScanCategories;
85
+ subCategory: ScanSubCategories;
85
86
  detailViewData: DetailViewDataType[];
86
87
  };
87
- export interface SidebarPropsType {
88
- modalState: SecurityModalStateType;
89
- setModalState: React.Dispatch<React.SetStateAction<SecurityModalStateType>>;
90
- categoriesConfig: Record<(typeof CATEGORIES)[keyof typeof CATEGORIES] | 'imageScanLicenseRisks', boolean>;
91
- }
92
88
  export declare enum SeveritiesDTO {
93
89
  CRITICAL = "critical",
94
90
  HIGH = "high",
@@ -201,6 +197,11 @@ export type ScanResultDTO = {
201
197
  [CATEGORIES.CODE_SCAN]: CodeScan;
202
198
  [CATEGORIES.KUBERNETES_MANIFEST]: KubernetesManifest;
203
199
  };
200
+ export interface SidebarPropsType {
201
+ modalState: SecurityModalStateType;
202
+ setModalState: React.Dispatch<React.SetStateAction<SecurityModalStateType>>;
203
+ scanResult: ScanResultDTO;
204
+ }
204
205
  interface SecurityModalBaseProps {
205
206
  isLoading: boolean;
206
207
  error: ServerErrors;
@@ -219,8 +220,8 @@ export interface IndexedTextDisplayPropsType {
219
220
  export type SidebarDataChildType = {
220
221
  label: string;
221
222
  value: {
222
- category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
223
- subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
223
+ category: ScanCategories;
224
+ subCategory: ScanSubCategories;
224
225
  };
225
226
  };
226
227
  export type SidebarDataType = {
@@ -16,7 +16,7 @@ export declare const getSecurityScanSeveritiesCount: (data: ScanResultDTO) => {
16
16
  unknown: number;
17
17
  };
18
18
  export declare const compareSeverities: (a: Record<SeveritiesDTO, number>, b: Record<SeveritiesDTO, number>) => number;
19
- export declare const getScanCompletedEmptyState: (scanToolId: number) => {
19
+ export declare const getScanCompletedEmptyState: (scanToolName: string, scanToolUrl: string) => {
20
20
  SvgImage: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
21
21
  title: string;
22
22
  children: JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { CATEGORIES, SUB_CATEGORIES } from './SecurityModal/types';
2
2
  export type ScanCategories = (typeof CATEGORIES)[keyof typeof CATEGORIES];
3
3
  export type ScanSubCategories = (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
4
+ export type ScanCategoriesWithLicense = ScanCategories | 'imageScanLicenseRisks';
4
5
  export type CategoriesConfig = {
5
6
  imageScan: boolean;
6
7
  codeScan: boolean;
@@ -13,11 +13,6 @@ export declare const STAGE_TYPE: {
13
13
  POSTCD: string;
14
14
  ROLLBACK: string;
15
15
  };
16
- export declare const SCAN_TOOL_ID_TRIVY = 3;
17
- /**
18
- * @description This is only used to show mapping for clair, scan tool id for clair can be either 1 or 2
19
- * */
20
- export declare const SCAN_TOOL_ID_CLAIR = 2;
21
16
  export declare const IMAGE_SCAN_TOOL: {
22
17
  Clair: string;
23
18
  Trivy: string;
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3.37752 5.08241C3 5.62028 3 7.21907 3 10.4167V11.9914C3 17.6294 7.23896 20.3655 9.89856 21.5273C10.62 21.8424 10.9807 22 12 22C13.0193 22 13.38 21.8424 14.1014 21.5273C16.761 20.3655 21 17.6294 21 11.9914V10.4167C21 7.21907 21 5.62028 20.6225 5.08241C20.245 4.54454 18.7417 4.02996 15.7351 3.00079L15.1623 2.80472C13.595 2.26824 12.8114 2 12 2C11.1886 2 10.405 2.26824 8.83772 2.80472L8.26491 3.00079C5.25832 4.02996 3.75503 4.54454 3.37752 5.08241Z" fill="#FFB549"/>
3
+ <path d="M15.0888 15.0891L18.5 18.5004M16.3704 11.9953C16.3704 14.4116 14.4116 16.3704 11.9953 16.3704C9.57893 16.3704 7.62012 14.4116 7.62012 11.9953C7.62012 9.57893 9.57893 7.62012 11.9953 7.62012C14.4116 7.62012 16.3704 9.57893 16.3704 11.9953Z" stroke="#000A14" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>