@devtron-labs/devtron-fe-common-lib 1.9.0 → 1.9.1-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 (29) hide show
  1. package/dist/{@code-editor-QMyIT4Mv.js → @code-editor-CN0hf86o.js} +5578 -5412
  2. package/dist/{@common-rjsf-wlJzHPcQ.js → @common-rjsf-0ODT_4Sz.js} +1 -1
  3. package/dist/Common/DeleteCINodeButton/DeleteCINodeButton.d.ts +2 -0
  4. package/dist/Common/DeleteCINodeButton/index.d.ts +3 -0
  5. package/dist/Common/DeleteCINodeButton/types.d.ts +17 -0
  6. package/dist/Common/DeleteCINodeButton/utils.d.ts +2 -0
  7. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  8. package/dist/Common/ErrorPage.d.ts +1 -1
  9. package/dist/Common/ErrorScreenManager.d.ts +1 -1
  10. package/dist/Common/Reload.d.ts +1 -1
  11. package/dist/Common/SegmentedBarChart/types.d.ts +1 -0
  12. package/dist/Common/Types.d.ts +0 -4
  13. package/dist/Common/index.d.ts +1 -0
  14. package/dist/Shared/Components/Icon/Icon.d.ts +2 -0
  15. package/dist/Shared/Helpers.d.ts +1 -0
  16. package/dist/Shared/Hooks/UseDownload/UseDownload.d.ts +2 -2
  17. package/dist/Shared/Hooks/UseDownload/types.d.ts +8 -0
  18. package/dist/Shared/Hooks/index.d.ts +1 -0
  19. package/dist/Shared/Hooks/useStickyEvent/constants.d.ts +3 -0
  20. package/dist/Shared/Hooks/useStickyEvent/index.d.ts +1 -0
  21. package/dist/Shared/Hooks/useStickyEvent/types.d.ts +32 -0
  22. package/dist/Shared/Hooks/useStickyEvent/useStickyEvent.d.ts +8 -0
  23. package/dist/Shared/Hooks/useStickyEvent/utils.d.ts +2 -0
  24. package/dist/Shared/constants.d.ts +10 -0
  25. package/dist/assets/@code-editor.css +1 -1
  26. package/dist/assets/ic-add.18a93616.svg +19 -0
  27. package/dist/assets/ic-delete.a6e8d3ad.svg +19 -0
  28. package/dist/index.js +640 -633
  29. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { j as n, ae as y, ag as k, af as W } from "./@vendor-CmKnC58P.js";
2
2
  import V, { forwardRef as J, useMemo as P } from "react";
3
3
  import K, { getDefaultRegistry as q } from "@rjsf/core";
4
- import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-QMyIT4Mv.js";
4
+ import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-CN0hf86o.js";
5
5
  import Q, { components as D } from "react-select";
6
6
  import { ReactComponent as X } from "./assets/ic-chevron-down.fc70d7a7.svg";
7
7
  import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as se, deepEquals as ae } from "@rjsf/utils";
@@ -0,0 +1,2 @@
1
+ import { DeleteCINodeButtonProps } from './types';
2
+ export declare const DeleteCINodeButton: ({ testId, isCIPipeline, disabled, title, isJobView, deletePayloadConfig, onDelete, getWorkflows, }: DeleteCINodeButtonProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './DeleteCINodeButton';
2
+ export * from './utils';
3
+ export * from './types';
@@ -0,0 +1,17 @@
1
+ interface DeletePayloadConfig {
2
+ appId: string;
3
+ appWorkflowId: number;
4
+ pipelineId: number;
5
+ pipelineName: string;
6
+ }
7
+ export interface DeleteCINodeButtonProps {
8
+ testId: string;
9
+ isCIPipeline?: boolean;
10
+ disabled: boolean;
11
+ title: string;
12
+ isJobView?: boolean;
13
+ deletePayloadConfig: DeletePayloadConfig;
14
+ onDelete?: () => void;
15
+ getWorkflows: () => void;
16
+ }
17
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function savePipeline(request: any, isRegexMaterial?: boolean): Promise<any>;
2
+ export declare function deleteWorkflow(appId: string, workflowId: number): Promise<import('..').ResponseType<any>>;
@@ -1,3 +1,3 @@
1
1
  import { GenericEmptyStateType } from '../Types';
2
- declare const GenericEmptyState: ({ title, image, subTitle, isButtonAvailable, classname, styles, heightToDeduct, imageType, renderButton, imageClassName, children, SvgImage, noImage, layout, contentClassName, imageStyles, }: GenericEmptyStateType) => JSX.Element;
2
+ declare const GenericEmptyState: ({ title, image, subTitle, isButtonAvailable, classname, styles, imageType, renderButton, imageClassName, children, SvgImage, noImage, layout, contentClassName, imageStyles, }: GenericEmptyStateType) => JSX.Element;
3
3
  export default GenericEmptyState;
@@ -1,3 +1,3 @@
1
1
  import { ErrorPageType } from './Types';
2
- declare const ErrorPage: ({ code, image, title, subTitle, imageType, heightToDeduct, redirectURL, reload }: ErrorPageType) => JSX.Element;
2
+ declare const ErrorPage: ({ code, image, title, subTitle, imageType, redirectURL, reload }: ErrorPageType) => JSX.Element;
3
3
  export default ErrorPage;
@@ -1,3 +1,3 @@
1
1
  import { ErrorScreenManagerProps } from './Types';
2
- declare const ErrorScreenManager: ({ code, reload, subtitle, reloadClass, heightToDeduct, redirectURL, imageType, }: ErrorScreenManagerProps) => JSX.Element;
2
+ declare const ErrorScreenManager: ({ code, reload, subtitle, reloadClass, redirectURL, imageType, }: ErrorScreenManagerProps) => JSX.Element;
3
3
  export default ErrorScreenManager;
@@ -2,4 +2,4 @@ import { ReloadType } from './Types';
2
2
  /**
3
3
  * @deprecated Use APIResponseHandler (Preferred) or error screen manager instead
4
4
  */
5
- export default function Reload({ reload, className, heightToDeduct }: ReloadType): JSX.Element;
5
+ export default function Reload({ reload, className }: ReloadType): JSX.Element;
@@ -11,4 +11,5 @@ export interface SegmentedBarChartProps {
11
11
  isProportional?: boolean;
12
12
  swapLegendAndBar?: boolean;
13
13
  showAnimationOnBar?: boolean;
14
+ isLoading?: boolean;
14
15
  }
@@ -107,7 +107,6 @@ export interface GenericEmptyStateType {
107
107
  subTitle?: ReactNode;
108
108
  isButtonAvailable?: boolean;
109
109
  styles?: CSSProperties;
110
- heightToDeduct?: number;
111
110
  imageType?: string;
112
111
  SvgImage?: any;
113
112
  renderButton?: () => JSX.Element;
@@ -123,7 +122,6 @@ export interface GenericEmptyStateType {
123
122
  }
124
123
  export interface ErrorPageType extends Pick<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'renderButton' | 'imageType'>, Pick<ErrorScreenManagerProps, 'reload' | 'redirectURL'> {
125
124
  code: number;
126
- heightToDeduct?: number;
127
125
  redirectURL?: string;
128
126
  reload?: () => void;
129
127
  }
@@ -133,7 +131,6 @@ export interface ErrorScreenManagerProps {
133
131
  reload?: (...args: any[]) => any;
134
132
  subtitle?: React.ReactChild;
135
133
  reloadClass?: string;
136
- heightToDeduct?: number;
137
134
  /**
138
135
  * Would be used to redirect URL in case of 404
139
136
  * @default - APP_LIST
@@ -194,7 +191,6 @@ export type InfoColourBarType = InfoColourBarMessageProp & {
194
191
  export interface ReloadType {
195
192
  reload?: (event?: any) => void;
196
193
  className?: string;
197
- heightToDeduct?: number;
198
194
  }
199
195
  export interface RadioGroupItemProps {
200
196
  value: string;
@@ -50,3 +50,4 @@ export * from './SegmentedBarChart';
50
50
  export * from './CodeEditor/types';
51
51
  export * from './Tooltip';
52
52
  export * from './SegmentedControl';
53
+ export * from './DeleteCINodeButton';
@@ -1,6 +1,7 @@
1
1
  import { IconBaseProps } from './types';
2
2
  export declare const iconMap: {
3
3
  'ic-aborted': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
4
+ 'ic-add': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
4
5
  'ic-app-group': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
5
6
  'ic-arrow-right': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
6
7
  'ic-azure': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -18,6 +19,7 @@ export declare const iconMap: {
18
19
  'ic-container': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
19
20
  'ic-crown': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
20
21
  'ic-cube': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
22
+ 'ic-delete': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
21
23
  'ic-dockerhub': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
22
24
  'ic-ecr': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
23
25
  'ic-env': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -99,4 +99,5 @@ export declare const deriveBorderRadiusAndBorderClassFromConfig: ({ borderConfig
99
99
  borderConfig: BorderConfigType | undefined;
100
100
  borderRadiusConfig: BorderConfigType | undefined;
101
101
  }) => string;
102
+ export declare const getClassNameForStickyHeaderWithShadow: (isStuck: boolean, topClassName?: string) => string;
102
103
  export {};
@@ -1,3 +1,3 @@
1
- import { UseDownloadReturnType } from './types';
2
- declare const useDownload: () => UseDownloadReturnType;
1
+ import { UseDownloadProps, UseDownloadReturnType } from './types';
2
+ declare const useDownload: ({ shouldOpenInNewTab }?: UseDownloadProps) => UseDownloadReturnType;
3
3
  export default useDownload;
@@ -6,6 +6,14 @@ export interface HandleDownloadProps {
6
6
  showSuccessfulToast?: boolean;
7
7
  downloadSuccessToastContent?: string;
8
8
  }
9
+ export interface UseDownloadProps {
10
+ /**
11
+ * If true, the download will open in a new tab
12
+ *
13
+ * @default false
14
+ */
15
+ shouldOpenInNewTab?: boolean;
16
+ }
9
17
  export interface UseDownloadReturnType {
10
18
  handleDownload: (props: HandleDownloadProps) => Promise<Error | ServerErrors>;
11
19
  isDownloading: boolean;
@@ -2,3 +2,4 @@ export * from './UsePrompt';
2
2
  export * from './useGetResourceKindsOptions';
3
3
  export * from './UseDownload';
4
4
  export * from './useForm';
5
+ export * from './useStickyEvent';
@@ -0,0 +1,3 @@
1
+ export declare const FALLBACK_SENTINEL_HEIGHT = "1px";
2
+ export declare const OBSERVER_THRESHOLD = 1;
3
+ export declare const OBSERVER_ROOT_MARGIN = "0px";
@@ -0,0 +1 @@
1
+ export { default as useStickyEvent } from './useStickyEvent';
@@ -0,0 +1,32 @@
1
+ import { MutableRefObject } from 'react';
2
+ export type UseStickyEventProps<T extends HTMLElement = HTMLDivElement> = {
3
+ /**
4
+ * Unique identifier used to create the id of the sentinel element
5
+ *
6
+ * A sentinel element is used to determine when the sticky element is 'stuck'
7
+ * It is dynamically created and appended to the DOM
8
+ */
9
+ identifier: string;
10
+ /**
11
+ * Indicates whether the sticky element is conditionally rendered.
12
+ * - Set to true if the sticky element is mounted.
13
+ * - Set to false if the sticky element is not mounted.
14
+ * - If the sticky element is always rendered, this flag can be ignored.
15
+ */
16
+ isStickyElementMounted?: boolean;
17
+ } & ({
18
+ /**
19
+ * Reference to the scroll container element that contains the sticky element
20
+ *
21
+ * Either the reference can be passed or its querySelector
22
+ */
23
+ containerRef: MutableRefObject<T>;
24
+ containerSelector?: never;
25
+ } | {
26
+ containerSelector: string;
27
+ containerRef?: never;
28
+ });
29
+ export interface UseStickyEventReturnType<T extends HTMLElement = HTMLDivElement> {
30
+ isStuck: boolean;
31
+ stickyElementRef: MutableRefObject<T>;
32
+ }
@@ -0,0 +1,8 @@
1
+ import { UseStickyEventProps, UseStickyEventReturnType } from './types';
2
+ /**
3
+ * Please read
4
+ * https://developer.chrome.com/docs/css-ui/sticky-headers
5
+ * as a reference for the implementation
6
+ */
7
+ declare const useStickyEvent: <T extends HTMLElement = HTMLDivElement>({ containerSelector, containerRef, identifier, isStickyElementMounted, }: UseStickyEventProps<T>) => UseStickyEventReturnType<T>;
8
+ export default useStickyEvent;
@@ -0,0 +1,2 @@
1
+ import { UseStickyEventReturnType } from './types';
2
+ export declare const getHeightForStickyElementTopOffset: <T extends HTMLElement>({ stickyElementRef, }: Pick<UseStickyEventReturnType<T>, "stickyElementRef">) => string;
@@ -364,6 +364,7 @@ export declare const ANSI_UP_REGEX: RegExp;
364
364
  * Size variants for components
365
365
  */
366
366
  export declare enum ComponentSizeType {
367
+ xxs_small_icon = "xxs-small-icon",
367
368
  xxs = "xxs",
368
369
  xs = "xs",
369
370
  small = "small",
@@ -407,3 +408,12 @@ export declare const DC_DELETE_SUBTITLES: {
407
408
  DELETE_ENVIRONMENT_SUBTITLE: string;
408
409
  DELETE_CLUSTER_SUBTITLES: string;
409
410
  };
411
+ export declare const enum DeleteComponentsName {
412
+ Cluster = "cluster",
413
+ Job = "job pipeline",
414
+ BuildPipeline = "build pipeline"
415
+ }
416
+ export declare const Routes: {
417
+ CI_PIPELINE_PATCH: string;
418
+ WORKFLOW: string;
419
+ };