@devtron-labs/devtron-fe-common-lib 0.3.9-beta-1 → 0.3.10

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.
Files changed (73) hide show
  1. package/dist/Common/Drawer/Drawer.d.ts +1 -1
  2. package/dist/Common/RJSF/types.d.ts +8 -5
  3. package/dist/Common/RJSF/utils.d.ts +2 -0
  4. package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +2 -0
  5. package/dist/Common/Security/types.d.ts +4 -0
  6. package/dist/Common/Tooltip/constants.d.ts +3 -0
  7. package/dist/Common/Tooltip/index.d.ts +1 -0
  8. package/dist/Common/index.d.ts +1 -0
  9. package/dist/Pages/App/AppConfigurations/utils.d.ts +1 -1
  10. package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
  11. package/dist/Shared/Components/ImageCardAccordion/types.d.ts +1 -4
  12. package/dist/Shared/Components/TabGroup/TabGroup.helpers.d.ts +7 -0
  13. package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +24 -9
  14. package/dist/Shared/Components/TabGroup/TabGroup.utils.d.ts +2 -2
  15. package/dist/Shared/Components/{Security/Vulnerabilities → Vulnerabilities}/Vulnerabilities.d.ts +1 -1
  16. package/dist/Shared/Components/Vulnerabilities/constants.d.ts +4 -0
  17. package/dist/Shared/Components/{Security/Vulnerabilities → Vulnerabilities}/index.d.ts +0 -1
  18. package/dist/Shared/Components/{Security/Vulnerabilities → Vulnerabilities}/service.d.ts +1 -1
  19. package/dist/Shared/Components/Vulnerabilities/types.d.ts +7 -0
  20. package/dist/Shared/Components/Vulnerabilities/utils.d.ts +4 -0
  21. package/dist/Shared/Components/index.d.ts +1 -2
  22. package/dist/Shared/Helpers.d.ts +2 -1
  23. package/dist/Shared/constants.d.ts +0 -4
  24. package/dist/Shared/types.d.ts +0 -1
  25. package/dist/assets/index.css +1 -1
  26. package/dist/{cssMode-BQyEMz-L.js → cssMode-Ci2SYp_2.js} +1 -1
  27. package/dist/{freemarker2-Bj0DygAe.js → freemarker2-DuzaBrLs.js} +1 -1
  28. package/dist/{handlebars-CHNNn0wb.js → handlebars-CetBX0xA.js} +1 -1
  29. package/dist/{html-ryEQ_Yz_.js → html-D5MQofMO.js} +1 -1
  30. package/dist/{htmlMode-vvcEHwY9.js → htmlMode-ODxwicMz.js} +1 -1
  31. package/dist/{index-CpSdT1pU.js → index-BL0bY-zv.js} +30875 -32492
  32. package/dist/index.js +496 -508
  33. package/dist/{javascript-BgyyM4XW.js → javascript-B9n3MeA7.js} +1 -1
  34. package/dist/{jsonMode-P-vuI-Fp.js → jsonMode-Bzo4h1Bf.js} +1 -1
  35. package/dist/{liquid-C2fqEGvd.js → liquid-bNDMiWzD.js} +1 -1
  36. package/dist/{mdx-2aw84pOi.js → mdx-DGQBelbh.js} +1 -1
  37. package/dist/{python-BuTQ7kSf.js → python-BP8l6k6r.js} +1 -1
  38. package/dist/{razor-DGlu_XPP.js → razor-CP819BQo.js} +1 -1
  39. package/dist/{tsMode-BqungwBn.js → tsMode-QWFAam_c.js} +1 -1
  40. package/dist/{typescript-BI6arj9L.js → typescript-CekVoJfn.js} +1 -1
  41. package/dist/{xml-CiL6lgOI.js → xml-D49rK_7Z.js} +1 -1
  42. package/dist/{yaml-BDBCgdGm.js → yaml-D8i4om3q.js} +1 -1
  43. package/package.json +5 -6
  44. package/dist/Shared/Components/FilterButton/FilterButton.d.ts +0 -4
  45. package/dist/Shared/Components/FilterButton/index.d.ts +0 -1
  46. package/dist/Shared/Components/FilterButton/types.d.ts +0 -11
  47. package/dist/Shared/Components/FilterButton/utils.d.ts +0 -15
  48. package/dist/Shared/Components/Security/SecurityModal/SecurityModal.d.ts +0 -14
  49. package/dist/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.d.ts +0 -4
  50. package/dist/Shared/Components/Security/SecurityModal/components/InfoCard.d.ts +0 -4
  51. package/dist/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.d.ts +0 -4
  52. package/dist/Shared/Components/Security/SecurityModal/components/Table.d.ts +0 -4
  53. package/dist/Shared/Components/Security/SecurityModal/components/index.d.ts +0 -3
  54. package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +0 -100
  55. package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +0 -2
  56. package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +0 -4
  57. package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +0 -2
  58. package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +0 -4
  59. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +0 -2
  60. package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +0 -2
  61. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +0 -3
  62. package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +0 -56
  63. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +0 -6
  64. package/dist/Shared/Components/Security/SecurityModal/service.d.ts +0 -3
  65. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +0 -262
  66. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +0 -34
  67. package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +0 -3
  68. package/dist/Shared/Components/Security/SecuritySummaryCard/index.d.ts +0 -1
  69. package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +0 -11
  70. package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +0 -26
  71. package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +0 -6
  72. package/dist/Shared/Components/Security/index.d.ts +0 -4
  73. package/dist/Shared/Components/Security/utils.d.ts +0 -4
@@ -10,5 +10,5 @@ interface drawerInterface {
10
10
  parentClassName?: string;
11
11
  onEscape?: (e?: any) => void;
12
12
  }
13
- export declare const Drawer: ({ children, position, height, width, minWidth, maxWidth, parentClassName, onEscape, }: drawerInterface) => JSX.Element;
13
+ export declare const Drawer: ({ children, position, height, width, minWidth, maxWidth, parentClassName, onEscape, onClose, }: drawerInterface) => JSX.Element;
14
14
  export {};
@@ -2,14 +2,17 @@ import { ComponentProps } from 'react';
2
2
  import { default as RJSFForm } from '@rjsf/core';
3
3
  import { StrictRJSFSchema } from '@rjsf/utils';
4
4
  export type FormProps = Omit<ComponentProps<typeof RJSFForm>, 'validator'>;
5
- interface Hidden {
6
- condition: boolean;
7
- match: string;
5
+ export interface MetaHiddenType {
6
+ value: any;
7
+ path: string;
8
8
  }
9
+ export type HiddenType = MetaHiddenType | {
10
+ condition: any;
11
+ value: string;
12
+ } | string;
9
13
  export interface RJSFFormSchema extends StrictRJSFSchema {
10
14
  properties: {
11
15
  [key: string]: RJSFFormSchema;
12
16
  };
13
- hidden: Hidden;
17
+ hidden: HiddenType;
14
18
  }
15
- export {};
@@ -1,4 +1,5 @@
1
1
  import { TranslatableString } from '@rjsf/utils';
2
+ import { HiddenType, MetaHiddenType } from './types';
2
3
  /**
3
4
  * Override for the TranslatableString from RJSF
4
5
  */
@@ -23,3 +24,4 @@ export declare const getRedirectionProps: (url: string) => React.AnchorHTMLAttri
23
24
  * Infers the type for json schema from value type
24
25
  */
25
26
  export declare const getInferredTypeFromValueType: (value: any) => "string" | "number" | "boolean" | "object" | "array" | "null";
27
+ export declare const parseSchemaHiddenType: (hiddenSchema: HiddenType) => MetaHiddenType;
@@ -0,0 +1,2 @@
1
+ import { ScanVulnerabilitiesTableProps } from '../Types';
2
+ export default function ScanVulnerabilitiesTable({ vulnerabilities, hidePolicy, shouldStick, }: ScanVulnerabilitiesTableProps): JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare enum VulnerabilitiesTableSortKeys {
2
+ SEVERITY = "severity",
3
+ PACKAGE = "package"
4
+ }
@@ -0,0 +1,3 @@
1
+ export declare const TOOLTIP_CONTENTS: {
2
+ INVALID_INPUT: string;
3
+ };
@@ -1 +1,2 @@
1
1
  export { default as Tooltip } from './Tooltip';
2
+ export { TOOLTIP_CONTENTS } from './constants';
@@ -28,6 +28,7 @@ export { default as GenericFilterEmptyState } from './EmptyState/GenericFilterEm
28
28
  export * from './SearchBar';
29
29
  export * from './SortableTableHeaderCell';
30
30
  export { default as Toggle } from './Toggle/Toggle';
31
+ export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
31
32
  export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
32
33
  export * from './CIPipeline.Types';
33
34
  export * from './Policy.Types';
@@ -1,2 +1,2 @@
1
1
  import { DeploymentStageType } from '../../../Shared/constants';
2
- export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "-" | "pre-deployment" | "post-deployment" | "deployment";
2
+ export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "pre-deployment" | "post-deployment" | "deployment" | "-";
@@ -1,3 +1,3 @@
1
1
  import { ImageCardAccordionProps } from './types';
2
- declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, SecurityModalSidebar, getSecurityScan, }: ImageCardAccordionProps) => JSX.Element;
2
+ declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, }: ImageCardAccordionProps) => JSX.Element;
3
3
  export default ImageCardAccordion;
@@ -1,7 +1,6 @@
1
1
  import { default as React, ReactNode } from 'react';
2
- import { CDModalTabType, ResponseType, VulnerabilityType } from '../../../Common';
2
+ import { CDModalTabType, VulnerabilityType } from '../../../Common';
3
3
  import { MaterialSecurityInfoType } from '../../types';
4
- import { ApiResponseResultType, AppDetailsPayload, SidebarPropsType } from '../Security';
5
4
  export interface ImageCardAccordionProps extends MaterialSecurityInfoType {
6
5
  isSecurityModuleInstalled: boolean;
7
6
  artifactId: number;
@@ -10,8 +9,6 @@ export interface ImageCardAccordionProps extends MaterialSecurityInfoType {
10
9
  changesCard: ReactNode;
11
10
  isScanned: boolean;
12
11
  isScanEnabled: boolean;
13
- SecurityModalSidebar: React.FC<SidebarPropsType>;
14
- getSecurityScan: (props: Pick<AppDetailsPayload, 'appId' | 'envId' | 'artifactId'>) => Promise<ResponseType<ApiResponseResultType>>;
15
12
  }
16
13
  export interface SecurityDetailsType {
17
14
  vulnerabilities: VulnerabilityType[];
@@ -0,0 +1,7 @@
1
+ import { TabProps } from './TabGroup.types';
2
+ export declare const getTabIcon: ({ icon: Icon, showError, showWarning, className, }: Pick<TabProps, "showError" | "showWarning" | "icon"> & {
3
+ className: string;
4
+ }) => JSX.Element;
5
+ export declare const getTabBadge: (badge: TabProps["badge"], className: string) => JSX.Element;
6
+ export declare const getTabIndicator: (showIndicator: TabProps["showIndicator"]) => JSX.Element;
7
+ export declare const getTabDescription: (description: TabProps["description"]) => JSX.Element;
@@ -4,7 +4,7 @@ import { DataAttributes } from '../../types';
4
4
  type TabComponentProps<TabTypeProps> = TabTypeProps & DataAttributes;
5
5
  type ConditionalTabType = {
6
6
  /**
7
- * Type of the tab, either `button`, `link` or `navLink`.
7
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
8
8
  */
9
9
  tabType: 'button';
10
10
  /**
@@ -17,7 +17,7 @@ type ConditionalTabType = {
17
17
  active?: boolean;
18
18
  } | {
19
19
  /**
20
- * Type of the tab, either `button`, `link` or `navLink`.
20
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
21
21
  */
22
22
  tabType: 'navLink';
23
23
  /**
@@ -27,10 +27,10 @@ type ConditionalTabType = {
27
27
  /**
28
28
  * Active state is determined by matching the URL.
29
29
  */
30
- active?: false;
30
+ active?: never | false;
31
31
  } | {
32
32
  /**
33
- * Type of the tab, either `button`, `link` or `navLink`.
33
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
34
34
  */
35
35
  tabType: 'link';
36
36
  /**
@@ -41,6 +41,20 @@ type ConditionalTabType = {
41
41
  * Indicates if the tab is currently active.
42
42
  */
43
43
  active?: boolean;
44
+ } | {
45
+ /**
46
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
47
+ * @note When `tabType` is set to `block`, the tab becomes non-interactive. It won't be active and will not have hover states.
48
+ */
49
+ tabType: 'block';
50
+ /**
51
+ * Props passed to div component.
52
+ */
53
+ props?: TabComponentProps<Omit<React.ComponentProps<'div'>, 'className' | 'style'>>;
54
+ /**
55
+ * Indicates if the tab is currently active.
56
+ */
57
+ active?: never | false;
44
58
  };
45
59
  export type TabProps = {
46
60
  /**
@@ -51,15 +65,16 @@ export type TabProps = {
51
65
  * Text label for the tab.
52
66
  */
53
67
  label: string;
68
+ /**
69
+ * Description for the tab.
70
+ * @note - If passed as a `string[]`, it will be rendered with a bullet in-between strings.
71
+ */
72
+ description?: string | string[];
54
73
  /**
55
74
  * Icon component to be displayed in the tab.
56
75
  * This should be a functional component that renders an SVG.
57
76
  */
58
77
  icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
59
- /**
60
- * Type of the icon, determining whether it uses a stroke or fill style.
61
- */
62
- iconType?: 'stroke' | 'fill';
63
78
  /**
64
79
  * Badge number to be displayed on the tab, typically for notifications.
65
80
  */
@@ -92,7 +107,7 @@ export interface TabGroupProps {
92
107
  * Size of the tabs.
93
108
  * @default ComponentSizeType.large
94
109
  */
95
- size?: ComponentSizeType.large | ComponentSizeType.medium;
110
+ size?: ComponentSizeType.large | ComponentSizeType.medium | ComponentSizeType.xl;
96
111
  /**
97
112
  * Optional component to be rendered on the right side of the tab list.
98
113
  */
@@ -1,7 +1,7 @@
1
- import { TabGroupProps, TabProps } from './TabGroup.types';
1
+ import { TabGroupProps } from './TabGroup.types';
2
2
  export declare const getClassNameBySizeMap: ({ hideTopPadding, alignActiveBorderWithContainer, }: Pick<TabGroupProps, "hideTopPadding" | "alignActiveBorderWithContainer">) => Record<TabGroupProps["size"], {
3
3
  tabClassName: string;
4
4
  iconClassName: string;
5
5
  badgeClassName: string;
6
6
  }>;
7
- export declare const getIconColorClassMap: ({ active }: Pick<TabProps, "active">) => Record<TabProps["iconType"], string>;
7
+ export declare const tabGroupClassMap: Record<TabGroupProps['size'], string>;
@@ -1,3 +1,3 @@
1
1
  import { VulnerabilitiesProps } from './types';
2
- declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, SecurityModalSidebar, getSecurityScan, }: VulnerabilitiesProps) => JSX.Element;
2
+ declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, }: VulnerabilitiesProps) => JSX.Element;
3
3
  export default Vulnerabilities;
@@ -0,0 +1,4 @@
1
+ export declare const NO_VULNERABILITY_TEXT: {
2
+ SECURED: string;
3
+ NO_VULNERABILITY_FOUND: string;
4
+ };
@@ -1,3 +1,2 @@
1
1
  export { default as Vulnerabilities } from './Vulnerabilities';
2
2
  export * from './utils';
3
- export * from './service';
@@ -1,2 +1,2 @@
1
- import { LastExecutionResponseType } from '../../../types';
1
+ import { LastExecutionResponseType } from '../../types';
2
2
  export declare function getLastExecutionByArtifactAppEnv(artifactId: string | number, appId: number | string, envId: number | string): Promise<LastExecutionResponseType>;
@@ -0,0 +1,7 @@
1
+ import { MaterialSecurityInfoType } from '../../types';
2
+ export interface VulnerabilitiesProps extends MaterialSecurityInfoType {
3
+ artifactId: number;
4
+ applicationId: number;
5
+ environmentId: number;
6
+ setVulnerabilityCount: React.Dispatch<React.SetStateAction<number>>;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { LastExecutionResponseType, LastExecutionResultType } from '../../types';
2
+ export declare const getSortedVulnerabilities: (vulnerabilities: any) => any;
3
+ export declare const getParsedScanResult: (scanResult: any) => LastExecutionResultType;
4
+ export declare const parseLastExecutionResponse: (response: any) => LastExecutionResponseType;
@@ -5,6 +5,7 @@ export * from './ImageCard';
5
5
  export * from './ImageCardAccordion';
6
6
  export * from './ExcludedImageNode';
7
7
  export * from './ScannedByToolModal';
8
+ export * from './Vulnerabilities';
8
9
  export * from './FilterChips';
9
10
  export * from './ActivityIndicator';
10
11
  export * from './GenericSectionErrorState';
@@ -38,6 +39,4 @@ export * from './DetectBottom';
38
39
  export * from './TabGroup';
39
40
  export * from './EditImageFormField';
40
41
  export * from './Collapse';
41
- export * from './FilterButton';
42
- export * from './Security';
43
42
  export * from './Button';
@@ -24,7 +24,7 @@ export declare const getIsMaterialInfoAvailable: (materialInfo: MaterialInfo[])
24
24
  export declare const getGitCommitInfo: (materialInfo: MaterialInfo) => GitTriggers;
25
25
  export declare const stringComparatorBySortOrder: (a: string, b: string, sortOrder?: SortingOrder, isCaseSensitive?: boolean) => number;
26
26
  export declare const numberComparatorBySortOrder: (a: number, b: number, sortOrder?: SortingOrder) => number;
27
- export declare function versionComparatorBySortOrder(a: Record<string, any>, b: Record<string, any>, compareKey: string, orderBy: SortingOrder): any;
27
+ export declare function versionComparatorBySortOrder(a: string, b: string, orderBy?: SortingOrder): number;
28
28
  export declare const getWebhookEventIcon: (eventName: WebhookEventNameType) => JSX.Element;
29
29
  export declare const yamlComparatorBySortOrder: (a: Pair, b: Pair, sortOrder?: SortingOrder) => number;
30
30
  export declare const useIntersection: (target: React.RefObject<Element> | Element | null, options?: IntersectionOptions, callback?: IntersectionChangeHandler) => boolean;
@@ -49,4 +49,5 @@ export declare const getIsManualApprovalSpecific: (userApprovalConfig?: Pick<Use
49
49
  * @param url - url to be opened in new tab
50
50
  */
51
51
  export declare const getHandleOpenURL: (url: string) => () => void;
52
+ export declare const getDefaultValueFromType: (value: unknown) => {};
52
53
  export {};
@@ -14,10 +14,6 @@ export declare const STAGE_TYPE: {
14
14
  ROLLBACK: string;
15
15
  };
16
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
17
  export declare const IMAGE_SCAN_TOOL: {
22
18
  Clair: string;
23
19
  Trivy: string;
@@ -413,7 +413,6 @@ export interface LastExecutionResultType {
413
413
  scanned?: boolean;
414
414
  scanEnabled?: boolean;
415
415
  scanToolId?: number;
416
- imageScanDeployInfoId?: number;
417
416
  }
418
417
  export interface LastExecutionResponseType extends ResponseType<LastExecutionResultType> {
419
418
  }