@devtron-labs/devtron-fe-common-lib 0.6.1 → 0.6.2-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.
Files changed (34) hide show
  1. package/dist/Common/Api.d.ts +1 -1
  2. package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +18 -1
  3. package/dist/Common/SortableTableHeaderCell/constants.d.ts +2 -0
  4. package/dist/Common/SortableTableHeaderCell/index.d.ts +1 -0
  5. package/dist/Common/SortableTableHeaderCell/types.d.ts +49 -16
  6. package/dist/Common/SortableTableHeaderCell/useResizableTableConfig.d.ts +6 -0
  7. package/dist/Shared/API/APIQueuing.d.ts +1 -1
  8. package/dist/Shared/Components/BulkSelection/types.d.ts +8 -5
  9. package/dist/Shared/Components/CICDHistory/StatusFilterButtonComponent.d.ts +1 -1
  10. package/dist/Shared/Components/CICDHistory/types.d.ts +1 -0
  11. package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +2 -1
  12. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +1 -0
  13. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +1 -1
  14. package/dist/Shared/constants.d.ts +1 -0
  15. package/dist/assets/index.css +1 -1
  16. package/dist/{cssMode-yND8whXX.js → cssMode-wLDaunqY.js} +1 -1
  17. package/dist/{freemarker2-_1bhJn7_.js → freemarker2-2YcTrs3e.js} +1 -1
  18. package/dist/{handlebars-BPvPJG3r.js → handlebars-BmateXUl.js} +1 -1
  19. package/dist/{html-BJsLhcY9.js → html-BKNBqUAJ.js} +1 -1
  20. package/dist/{htmlMode-Q7Zrv-Dc.js → htmlMode-Chg2lF4B.js} +1 -1
  21. package/dist/{index-CneMMKl9.js → index-DEv1lGRI.js} +15899 -15827
  22. package/dist/index.d.ts +7 -0
  23. package/dist/index.js +585 -582
  24. package/dist/{javascript-BwvO7RS4.js → javascript-DmWATuGu.js} +1 -1
  25. package/dist/{jsonMode-DZoxrOL5.js → jsonMode-DLBIXASe.js} +1 -1
  26. package/dist/{liquid-D1TlQdXU.js → liquid-REnjH_id.js} +1 -1
  27. package/dist/{mdx-BV5mwBqz.js → mdx-D-guxXeV.js} +1 -1
  28. package/dist/{python-LW2bt-N-.js → python-CmzVCBaF.js} +1 -1
  29. package/dist/{razor-BuVGCEgO.js → razor-zZ5vZHx8.js} +1 -1
  30. package/dist/{tsMode-iaI0rleM.js → tsMode-CO66B2ZB.js} +1 -1
  31. package/dist/{typescript-CgYZBXlO.js → typescript-B3XK7Tkb.js} +1 -1
  32. package/dist/{xml-BM5A5QKQ.js → xml-COBMGisq.js} +1 -1
  33. package/dist/{yaml-WvtMCNxq.js → yaml-fZJmt2-w.js} +1 -1
  34. package/package.json +1 -1
@@ -12,4 +12,4 @@ export declare const abortPreviousRequests: <T>(callback: () => Promise<T>, abor
12
12
  /**
13
13
  * Returns true if the error is due to a aborted request
14
14
  */
15
- export declare const getIsRequestAborted: (error: any) => any;
15
+ export declare const getIsRequestAborted: (error: any) => boolean;
@@ -12,6 +12,23 @@ import { SortableTableHeaderCellProps } from './types';
12
12
  * disabled={isDisabled}
13
13
  * />
14
14
  * ```
15
+ *
16
+ * @example Non-sortable cell
17
+ * ```tsx
18
+ * <SortableTableHeaderCell
19
+ * isSortable={false}
20
+ * title="Header Cell"
21
+ * />
22
+ * ```
23
+ *
24
+ * * @example Resizable cell (Layout to be controlled externally using useResizableTableConfig)
25
+ * ```tsx
26
+ * <SortableTableHeaderCell
27
+ * isSortable={false}
28
+ * isResizable
29
+ * title="Header Cell"
30
+ * />
31
+ * ```
15
32
  */
16
- declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, isSortable, showTippyOnTruncate, }: SortableTableHeaderCellProps) => JSX.Element;
33
+ declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, isSortable, showTippyOnTruncate, id, handleResize, isResizable, }: SortableTableHeaderCellProps) => JSX.Element;
17
34
  export default SortableTableHeaderCell;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_MINIMUM_HEADER_WIDTH = 70;
2
+ export declare const DEFAULT_MAXIMUM_HEADER_WIDTH = 600;
@@ -1,2 +1,3 @@
1
1
  export { default as SortableTableHeaderCell } from './SortableTableHeaderCell';
2
+ export { default as useResizableTableConfig } from './useResizableTableConfig';
2
3
  export type { SortableTableHeaderCellProps } from './types';
@@ -1,35 +1,68 @@
1
1
  import { SortingOrder } from '../Constants';
2
- export interface SortableTableHeaderCellProps {
2
+ export type SortableTableHeaderCellProps = {
3
3
  /**
4
- * If true, the cell is sorted
4
+ * Label for the cell
5
5
  */
6
- isSorted: boolean;
6
+ title: string;
7
7
  /**
8
- * Callback for handling the sorting of the cell
8
+ * If true, the tippy is shown on Sortable header if text is truncated
9
+ * @default false
9
10
  */
10
- triggerSorting: () => void;
11
+ showTippyOnTruncate?: boolean;
12
+ } & ({
11
13
  /**
12
- * Current sort order
14
+ * Unique identifier for the column
15
+ */
16
+ id: string | number;
17
+ /**
18
+ * If true, the cell is resizable
13
19
  *
14
- * Note: On click, the sort order should be updated as required
20
+ * @default false
15
21
  */
16
- sortOrder: SortingOrder;
22
+ isResizable: true | boolean;
17
23
  /**
18
- * Label for the cell
24
+ * Resize handler for the table
19
25
  */
20
- title: string;
26
+ handleResize: (id: string | number, deltaChange: number) => void;
27
+ } | {
28
+ id?: never;
29
+ isResizable?: false | undefined;
30
+ handleResize?: never;
31
+ }) & ({
32
+ /**
33
+ * If false, the cell acts like normal table header cell
34
+ * @default true
35
+ */
36
+ isSortable?: boolean | undefined;
21
37
  /**
22
38
  * If true, the cell is disabled
23
39
  */
24
40
  disabled: boolean;
25
41
  /**
26
- * If false, the cell acts like normal table header cell
27
- * @default true
42
+ * If true, the cell is sorted
28
43
  */
29
- isSortable?: boolean;
44
+ isSorted: boolean;
30
45
  /**
31
- * If true, the tippy is shown on Sortable header if text is truncated
32
- * @default false
46
+ * Callback for handling the sorting of the cell
33
47
  */
34
- showTippyOnTruncate?: boolean;
48
+ triggerSorting: () => void;
49
+ /**
50
+ * Current sort order
51
+ *
52
+ * Note: On click, the sort order should be updated as required
53
+ */
54
+ sortOrder: SortingOrder;
55
+ } | {
56
+ isSortable: false;
57
+ disabled?: never;
58
+ isSorted?: never;
59
+ triggerSorting?: never;
60
+ sortOrder?: never;
61
+ });
62
+ export interface UseResizableTableConfigProps {
63
+ headersConfig: (Pick<SortableTableHeaderCellProps, 'id'> & {
64
+ width: number | string;
65
+ maxWidth?: number;
66
+ minWidth?: number;
67
+ })[];
35
68
  }
@@ -0,0 +1,6 @@
1
+ import { UseResizableTableConfigProps } from './types';
2
+ declare const useResizableTableConfig: ({ headersConfig }: UseResizableTableConfigProps) => {
3
+ gridTemplateColumns: string;
4
+ handleResize: (headerCellId: UseResizableTableConfigProps["headersConfig"][number]["id"], deltaChange: number) => void;
5
+ };
6
+ export default useResizableTableConfig;
@@ -6,5 +6,5 @@ import { ApiQueuingWithBatchResponseItem } from '../types';
6
6
  * @param shouldRejectOnError If set to true, the promise will reject if any of the function calls rejects, i.e, acts like Promise.all else Promise.allSettled . Defaults to false.
7
7
  * @returns A promise that resolves to a array of objects containing the status and value of the batch execution.
8
8
  */
9
- declare const ApiQueuingWithBatch: <T>(functionCalls: any, httpProtocol: string, shouldRejectOnError?: boolean, batchSize?: number) => Promise<ApiQueuingWithBatchResponseItem<T>[]>;
9
+ declare const ApiQueuingWithBatch: <T>(functionCalls: any, shouldRejectOnError?: boolean, batchSize?: number) => Promise<ApiQueuingWithBatchResponseItem<T>[]>;
10
10
  export default ApiQueuingWithBatch;
@@ -24,6 +24,7 @@ export interface UseBulkSelectionReturnType<T> extends GetBulkSelectionCheckboxV
24
24
  handleBulkSelection: ({ action, data }: HandleBulkSelectionType<T>) => void;
25
25
  isBulkSelectionApplied: boolean;
26
26
  getSelectedIdentifiersCount: () => number;
27
+ setIdentifiers: React.Dispatch<React.SetStateAction<T>>;
27
28
  }
28
29
  export interface BulkSelectionProps {
29
30
  showPagination: boolean;
@@ -44,14 +45,16 @@ export declare enum SelectAllDialogStatus {
44
45
  }
45
46
  export type BulkSelectionIdentifiersType<T> = Record<string | number, T>;
46
47
  export interface UseBulkSelectionProps<T> {
47
- /**
48
- * Response from API, assuming structure to be array of objects with key and values
49
- * This will the given ids on current page
50
- */
51
- identifiers: T;
52
48
  /**
53
49
  * Act as buffer between select all across pages and select all on page state
54
50
  */
55
51
  getSelectAllDialogStatus: () => SelectAllDialogStatus;
52
+ /**
53
+ * Response from API, assuming structure to be array of objects with key and values
54
+ * This will the given ids on current page.
55
+ *
56
+ * NOTE!: Please wrap this value with a useMemo since it goes into useEffect dependency
57
+ */
58
+ identifiers?: T;
56
59
  children?: React.ReactNode;
57
60
  }
@@ -1,2 +1,2 @@
1
1
  import { StatusFilterButtonType } from './types';
2
- export declare const StatusFilterButtonComponent: ({ nodes, handleFilterClick }: StatusFilterButtonType) => JSX.Element;
2
+ export declare const StatusFilterButtonComponent: ({ nodes, selectedTab, handleFilterClick }: StatusFilterButtonType) => JSX.Element;
@@ -425,6 +425,7 @@ export interface AppStatusDetailsChartType {
425
425
  }
426
426
  export interface StatusFilterButtonType {
427
427
  nodes: Array<Node>;
428
+ selectedTab: string;
428
429
  handleFilterClick?: (selectedFilter: string) => void;
429
430
  }
430
431
  export declare enum NodeStatus {
@@ -1,4 +1,5 @@
1
- import { DetailViewDataType, ImageScan, SecurityModalStateType, TablePropsType, InfoCardPropsType, EmptyStateType, ApiResponseResultType, OpenDetailViewButtonProps } from '../types';
1
+ import { DetailViewDataType, ImageScan, SecurityModalStateType, TablePropsType, StatusType, InfoCardPropsType, EmptyStateType, ApiResponseResultType, OpenDetailViewButtonProps } from '../types';
2
+ export declare const getProgressingStateForStatus: (status: StatusType["status"]) => JSX.Element;
2
3
  export declare const getImageScanTableData: (data: ImageScan, subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], hidePolicy: boolean) => TablePropsType;
3
4
  export declare const getImageScanInfoCardData: (data: ImageScan, subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
4
5
  export declare const getImageScanEmptyState: (data: ApiResponseResultType, subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => EmptyStateType;
@@ -1,3 +1,4 @@
1
1
  export { getTableData } from './Table';
2
2
  export { getInfoCardData } from './InfoCard';
3
3
  export { SIDEBAR_DATA } from './Sidebar';
4
+ export { getProgressingStateForStatus } from './ImageScan';
@@ -1,6 +1,6 @@
1
1
  export { default as SecurityModal } from './SecurityModal';
2
2
  export { getSecurityScanSeveritiesCount, getTotalVulnerabilityCount, parseGetResourceScanDetailsResponse, parseExecutionDetailResponse, } from './utils';
3
3
  export type { AppDetailsPayload, ExecutionDetailsPayload, ApiResponseResultType, SidebarPropsType, SidebarDataChildType, SidebarDataType, GetResourceScanDetailsPayloadType, GetResourceScanDetailsResponseType, } from './types';
4
- export { SIDEBAR_DATA } from './config';
4
+ export { SIDEBAR_DATA, getProgressingStateForStatus } from './config';
5
5
  export { CATEGORY_LABELS } from './constants';
6
6
  export { getExecutionDetails } from './service';
@@ -413,3 +413,4 @@ export declare const CD_MATERIAL_SIDEBAR_TABS: OptionType<CDMaterialSidebarType,
413
413
  export declare const TRIGGER_STATUS_PROGRESSING: string[];
414
414
  export declare const CONFIGURATION_TYPE_VALUES: ConfigurationType[];
415
415
  export declare const DEFAULT_LOCKED_KEYS_CONFIG: Readonly<ConfigKeysWithLockType>;
416
+ export declare const ALL_RESOURCE_KIND_FILTER = "all";