@devtron-labs/devtron-fe-common-lib 0.2.0 → 0.2.2-beta-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.
Files changed (44) hide show
  1. package/dist/Common/Constants.d.ts +8 -0
  2. package/dist/Common/RJSF/constants.d.ts +0 -4
  3. package/dist/Common/RJSF/utils.d.ts +0 -2
  4. package/dist/Common/SearchBar/types.d.ts +1 -1
  5. package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +1 -1
  6. package/dist/Common/Security/types.d.ts +4 -0
  7. package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +1 -1
  8. package/dist/Common/SortableTableHeaderCell/types.d.ts +5 -0
  9. package/dist/Common/Tooltip/Tooltip.d.ts +4 -0
  10. package/dist/Common/Tooltip/index.d.ts +1 -0
  11. package/dist/Common/Tooltip/types.d.ts +33 -0
  12. package/dist/Common/Types.d.ts +2 -2
  13. package/dist/Common/index.d.ts +1 -1
  14. package/dist/Shared/Components/FilterButton/FilterButton.d.ts +5 -0
  15. package/dist/Shared/Components/FilterButton/index.d.ts +1 -0
  16. package/dist/Shared/Components/FilterButton/types.d.ts +12 -0
  17. package/dist/Shared/Components/FilterButton/utils.d.ts +15 -0
  18. package/dist/Shared/Components/Vulnerabilities/utils.d.ts +1 -0
  19. package/dist/Shared/Components/index.d.ts +1 -1
  20. package/dist/Shared/Helpers.d.ts +1 -0
  21. package/dist/Shared/types.d.ts +12 -7
  22. package/dist/assets/index.css +1 -1
  23. package/dist/{cssMode-dbee7387.js → cssMode-8bbe7b26.js} +1 -1
  24. package/dist/{freemarker2-fb697141.js → freemarker2-4e38f3fa.js} +1 -1
  25. package/dist/{handlebars-6ec06359.js → handlebars-6a218f19.js} +1 -1
  26. package/dist/{html-6ae050e1.js → html-1e977516.js} +1 -1
  27. package/dist/{htmlMode-702558fa.js → htmlMode-1f60bcaa.js} +1 -1
  28. package/dist/{index-6ebd2fed.js → index-1677d859.js} +20810 -20649
  29. package/dist/index.js +317 -314
  30. package/dist/{javascript-8679ff0b.js → javascript-8e82bcb7.js} +1 -1
  31. package/dist/{jsonMode-91fb45a0.js → jsonMode-1a629e71.js} +1 -1
  32. package/dist/{liquid-f14dacac.js → liquid-e957c145.js} +1 -1
  33. package/dist/{mdx-b6b90a55.js → mdx-5fda765d.js} +1 -1
  34. package/dist/{python-2727f363.js → python-ba467742.js} +1 -1
  35. package/dist/{razor-a39b435a.js → razor-ddd16486.js} +1 -1
  36. package/dist/{tsMode-a672c6cb.js → tsMode-b43d8821.js} +1 -1
  37. package/dist/{typescript-7552adf0.js → typescript-7315f3a1.js} +1 -1
  38. package/dist/{xml-bd5dc492.js → xml-19a6afe6.js} +1 -1
  39. package/dist/{yaml-02909a35.js → yaml-605c2eab.js} +1 -1
  40. package/package.json +1 -1
  41. package/dist/Common/Tippy.d.ts +0 -4
  42. package/dist/Shared/Components/ScannedObjectBar/ScannedObjectBar.d.ts +0 -4
  43. package/dist/Shared/Components/ScannedObjectBar/index.d.ts +0 -1
  44. package/dist/Shared/Components/ScannedObjectBar/types.d.ts +0 -7
@@ -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;
@@ -269,3 +270,10 @@ export declare const DATE_TIME_FORMATS: {
269
270
  DD_MMM_YYYY_HH_MM: string;
270
271
  DD_MMM_YYYY: string;
271
272
  };
273
+ export declare const VULNERABILITIES_SORT_PRIORITY: {
274
+ critical: number;
275
+ high: number;
276
+ medium: number;
277
+ low: number;
278
+ unknown: number;
279
+ };
@@ -4,7 +4,3 @@ export declare const PLACEHOLDERS: {
4
4
  OBJECT_KEY: string;
5
5
  };
6
6
  export declare const DEFAULT_FIELD_TITLE = "Key not available";
7
- export declare const ADD_BUTTON_WIDTH: {
8
- MAX_WIDTH_VALUE: number;
9
- MAX_WIDTH_CLASSNAME: string;
10
- };
@@ -1,5 +1,4 @@
1
1
  import { TranslatableString } from '@rjsf/utils';
2
- import { default as Tippy } from '../Tippy';
3
2
 
4
3
  /**
5
4
  * Override for the TranslatableString from RJSF
@@ -25,4 +24,3 @@ export declare const getRedirectionProps: (url: string) => import('react').Ancho
25
24
  * Infers the type for json schema from value type
26
25
  */
27
26
  export declare const getInferredTypeFromValueType: (value: any) => "string" | "number" | "boolean" | "object" | "array" | "null";
28
- export declare const getTippyWrapperWithContent: (content: any, placement?: React.ComponentProps<typeof Tippy>['placement'], truncateWidth?: number) => (children: any) => JSX.Element;
@@ -18,7 +18,7 @@ export interface SearchBarProps {
18
18
  /**
19
19
  * Input props for the search input
20
20
  */
21
- inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
21
+ inputProps?: React.InputHTMLAttributes<HTMLInputElement> & Partial<Record<'ref', React.MutableRefObject<HTMLInputElement>>>;
22
22
  /**
23
23
  * Class name for the container; can be used for handling width
24
24
  */
@@ -1,3 +1,3 @@
1
1
  import { ScanVulnerabilitiesTableProps } from '../Types';
2
2
 
3
- export default function ScanVulnerabilitiesTable({ vulnerabilities, hidePolicy, shouldStick }: ScanVulnerabilitiesTableProps): JSX.Element;
3
+ 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
+ }
@@ -14,5 +14,5 @@ import { SortableTableHeaderCellProps } from './types';
14
14
  * />
15
15
  * ```
16
16
  */
17
- declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, isSortable, }: SortableTableHeaderCellProps) => JSX.Element;
17
+ declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, isSortable, showTippyOnTruncate, }: SortableTableHeaderCellProps) => JSX.Element;
18
18
  export default SortableTableHeaderCell;
@@ -28,4 +28,9 @@ export interface SortableTableHeaderCellProps {
28
28
  * @default true
29
29
  */
30
30
  isSortable?: boolean;
31
+ /**
32
+ * If true, the tippy is shown on Sortable header if text is truncated
33
+ * @default false
34
+ */
35
+ showTippyOnTruncate?: boolean;
31
36
  }
@@ -0,0 +1,4 @@
1
+ import { TooltipProps } from './types';
2
+
3
+ declare const Tooltip: ({ alwaysShowTippyOnHover, showOnTruncate, wordBreak, children: child, ...rest }: TooltipProps) => JSX.Element;
4
+ export default Tooltip;
@@ -0,0 +1 @@
1
+ export { default as Tooltip } from './Tooltip';
@@ -0,0 +1,33 @@
1
+ import { TippyProps } from '@tippyjs/react';
2
+
3
+ type BaseTooltipProps = {
4
+ /**
5
+ * If true, show tippy on truncate
6
+ * @default true
7
+ */
8
+ showOnTruncate?: boolean;
9
+ /**
10
+ * If showOnTruncate is defined this prop doesn't work
11
+ * @default false
12
+ */
13
+ alwaysShowTippyOnHover?: never;
14
+ } | {
15
+ /**
16
+ * If alwaysShowTippyOnHover is defined this prop doesn't work
17
+ * @default false
18
+ */
19
+ showOnTruncate?: never;
20
+ /**
21
+ * If true, wrap with tippy irrespective of other options
22
+ * @default false
23
+ */
24
+ alwaysShowTippyOnHover?: boolean;
25
+ };
26
+ export type TooltipProps = BaseTooltipProps & TippyProps & {
27
+ /**
28
+ * If true, apply dc__word-break-all
29
+ * @default true
30
+ */
31
+ wordBreak?: boolean;
32
+ };
33
+ export {};
@@ -2,7 +2,7 @@ import { default as React, ReactNode, CSSProperties } from 'react';
2
2
  import { Placement } from 'tippy.js';
3
3
  import { ImageComment, ReleaseTag } from './ImageTags.Types';
4
4
  import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.';
5
- import { RegistryType } from '../Shared';
5
+ import { RegistryType, Severity } from '../Shared';
6
6
 
7
7
  /**
8
8
  * Generic response type object with support for overriding the result type
@@ -493,7 +493,7 @@ export declare enum DeploymentAppTypes {
493
493
  }
494
494
  export interface VulnerabilityType {
495
495
  name: string;
496
- severity: 'CRITICAL' | 'MODERATE' | 'LOW';
496
+ severity: Severity;
497
497
  package: string;
498
498
  version: string;
499
499
  fixedVersion: string;
@@ -54,4 +54,4 @@ export * from './GenericDescription';
54
54
  export * from './SegmentedBarChart';
55
55
  export * from './CodeEditor';
56
56
  export * from './AppStatus';
57
- export { default as Tippy } from './Tippy';
57
+ export * from './Tooltip';
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { FilterButtonPropsType } from './types';
3
+
4
+ declare const FilterButton: React.FC<FilterButtonPropsType>;
5
+ export default FilterButton;
@@ -0,0 +1 @@
1
+ export { default as FilterButton } from './FilterButton';
@@ -0,0 +1,12 @@
1
+ import { OptionType } from '../../../Common/Types';
2
+
3
+ export interface FilterButtonPropsType {
4
+ placeholder: string;
5
+ appliedFilters: string[];
6
+ options: OptionType[];
7
+ handleApplyChange: (selectedOptions: string[]) => void;
8
+ disabled?: boolean;
9
+ getFormattedFilterLabelValue?: (identifier: string) => string;
10
+ menuAlignFromRight?: boolean;
11
+ controlWidth?: string;
12
+ }
@@ -0,0 +1,15 @@
1
+ export declare const getFilterStyle: (controlWidth?: string, menuAlignFromRight?: boolean) => {
2
+ menu: (base: any) => any;
3
+ control: (base: any, state: any) => any;
4
+ container: (base: any) => any;
5
+ option: (base: any, state: any) => any;
6
+ singleValue: (base: any) => any;
7
+ valueContainer: (base: any) => any;
8
+ dropdownIndicator: (base: any, state: any) => any;
9
+ group: (base: any) => any;
10
+ groupHeading: (base: any) => any;
11
+ menuList: (base: any) => any;
12
+ multiValue: (base: any) => any;
13
+ multiValueLabel: (base: any) => any;
14
+ placeholder: (base: any) => any;
15
+ };
@@ -1,4 +1,5 @@
1
1
  import { LastExecutionResponseType, LastExecutionResultType } from '../../types';
2
2
 
3
+ export declare const getSortedVulnerabilities: (vulnerabilities: any) => any;
3
4
  export declare const getParsedScanResult: (scanResult: any) => LastExecutionResultType;
4
5
  export declare const parseLastExecutionResponse: (response: any) => LastExecutionResponseType;
@@ -10,7 +10,6 @@ export * from './FilterChips';
10
10
  export * from './ActivityIndicator';
11
11
  export * from './GenericSectionErrorState';
12
12
  export * from './KeyValueList';
13
- export * from './ScannedObjectBar';
14
13
  export * from './InfoIconTippy';
15
14
  export * from './EditableTextArea';
16
15
  export * from './Header';
@@ -34,3 +33,4 @@ export * from './Plugin';
34
33
  export * from './KeyValueTable';
35
34
  export * from './SelectPicker';
36
35
  export * from './DetectBottom';
36
+ export * from './FilterButton';
@@ -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;
@@ -210,8 +210,10 @@ export declare enum DefaultUserKey {
210
210
  }
211
211
  export declare enum Severity {
212
212
  CRITICAL = "critical",
213
- MODERATE = "moderate",
214
- LOW = "low"
213
+ HIGH = "high",
214
+ MEDIUM = "medium",
215
+ LOW = "low",
216
+ UNKNOWN = "unknown"
215
217
  }
216
218
  export declare enum ImagePromotionTabs {
217
219
  REQUEST = "request",
@@ -380,16 +382,19 @@ export declare enum ResourceVersionType {
380
382
  v1 = "v1",
381
383
  alpha1 = "alpha1"
382
384
  }
385
+ export interface SeverityCount {
386
+ critical: number;
387
+ high: number;
388
+ medium: number;
389
+ low: number;
390
+ unknown: number;
391
+ }
383
392
  export declare enum PolicyKindType {
384
393
  lockConfiguration = "lock-configuration"
385
394
  }
386
395
  export interface LastExecutionResultType {
387
396
  lastExecution: string;
388
- severityCount: {
389
- critical: number;
390
- moderate: number;
391
- low: number;
392
- };
397
+ severityCount: SeverityCount;
393
398
  vulnerabilities: VulnerabilityType[];
394
399
  scanExecutionId?: number;
395
400
  appId?: number;