@devtron-labs/devtron-fe-common-lib 1.4.0-beta-1 → 1.4.0-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 (48) hide show
  1. package/dist/{@code-editor-DKwWMrM8.js → @code-editor-DVKOAVeb.js} +5931 -5576
  2. package/dist/{@common-rjsf-Dkh3jTCW.js → @common-rjsf-B-AVBwcg.js} +2 -2
  3. package/dist/{@framer-motion-CdgdF0KV.js → @framer-motion-BxQTtYmm.js} +1 -1
  4. package/dist/{@react-dates-CtQV2TLr.js → @react-dates-M_eJUVeH.js} +1 -1
  5. package/dist/{@react-select-Cn3OpC9h.js → @react-select-CywptBlV.js} +1 -1
  6. package/dist/{@vendor-CwAQS8iU.js → @vendor-QI4m26H1.js} +5491 -5894
  7. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +1 -13
  8. package/dist/Common/CodeEditor/types.d.ts +2 -4
  9. package/dist/Common/Constants.d.ts +3 -0
  10. package/dist/Common/Drawer/Drawer.d.ts +3 -3
  11. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.d.ts +1 -0
  12. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/constants.d.ts +6 -0
  13. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/index.d.ts +3 -0
  14. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/services.d.ts +2 -0
  15. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +36 -2
  16. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/utils.d.ts +10 -0
  17. package/dist/Pages/ResourceBrowser/ResourceBrowser.Types.d.ts +24 -28
  18. package/dist/Pages/ResourceBrowser/service.d.ts +4 -2
  19. package/dist/Pages/index.d.ts +0 -1
  20. package/dist/Shared/Components/BulkOperations/BulkOperations.component.d.ts +3 -0
  21. package/dist/Shared/Components/BulkOperations/BulkOperationsResultModal.d.ts +3 -0
  22. package/dist/Shared/Components/BulkOperations/OperationResultStore.d.ts +21 -0
  23. package/dist/Shared/Components/BulkOperations/constants.d.ts +13 -0
  24. package/dist/Shared/Components/BulkOperations/index.d.ts +2 -0
  25. package/dist/Shared/Components/BulkOperations/types.d.ts +69 -0
  26. package/dist/Shared/Components/ConfirmationModal/types.d.ts +14 -13
  27. package/dist/Shared/Components/index.d.ts +1 -1
  28. package/dist/Shared/Hooks/UseDownload/UseDownload.d.ts +2 -6
  29. package/dist/Shared/Hooks/UseDownload/types.d.ts +5 -0
  30. package/dist/Shared/Hooks/useGetResourceKindsOptions/types.d.ts +0 -1
  31. package/dist/Shared/Services/types.d.ts +0 -4
  32. package/dist/Shared/constants.d.ts +1 -0
  33. package/dist/Shared/types.d.ts +2 -6
  34. package/dist/assets/@code-editor.css +1 -1
  35. package/dist/assets/ic-arrows-clockwise.424f0538.svg +7 -0
  36. package/dist/index.js +627 -621
  37. package/package.json +1 -6
  38. package/dist/@react-virtualized-sticky-tree-CVJYfMx0.js +0 -452
  39. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/index.d.ts +0 -1
  40. package/dist/Pages/App/AppConfiguration/index.d.ts +0 -1
  41. package/dist/Pages/App/index.d.ts +0 -1
  42. package/dist/Shared/Components/VirtualizedList/VirtualizedList.component.d.ts +0 -2
  43. package/dist/Shared/Components/VirtualizedList/VirtualizedList.constants.d.ts +0 -2
  44. package/dist/Shared/Components/VirtualizedList/VirtualizedList.types.d.ts +0 -36
  45. package/dist/Shared/Components/VirtualizedList/index.d.ts +0 -2
  46. /package/dist/Pages/{App/AppConfiguration → Applications/DevtronApps/Details/AppConfigurations}/DeploymentTemplate/GUIView/index.d.ts +0 -0
  47. /package/dist/Pages/{App/AppConfiguration → Applications/DevtronApps/Details/AppConfigurations}/DeploymentTemplate/GUIView/types.d.ts +0 -0
  48. /package/dist/Pages/{App/AppConfiguration → Applications/DevtronApps/Details/AppConfigurations}/DeploymentTemplate/GUIView/utils.d.ts +0 -0
@@ -5,35 +5,24 @@ export declare const CodeEditorReducer: (state: CodeEditorState, action: Action)
5
5
  diffMode: boolean;
6
6
  theme: CodeEditorThemesKeys;
7
7
  code: string;
8
- defaultCode: string;
9
8
  noParsing: boolean;
10
9
  } | {
11
10
  diffMode: any;
12
11
  mode: MODES;
13
12
  theme: CodeEditorThemesKeys;
14
13
  code: string;
15
- defaultCode: string;
16
14
  noParsing: boolean;
17
15
  } | {
18
16
  theme: any;
19
17
  mode: MODES;
20
18
  diffMode: boolean;
21
19
  code: string;
22
- defaultCode: string;
23
20
  noParsing: boolean;
24
21
  } | {
25
22
  code: any;
26
23
  mode: MODES;
27
24
  diffMode: boolean;
28
25
  theme: CodeEditorThemesKeys;
29
- defaultCode: string;
30
- noParsing: boolean;
31
- } | {
32
- defaultCode: any;
33
- mode: MODES;
34
- diffMode: boolean;
35
- theme: CodeEditorThemesKeys;
36
- code: string;
37
26
  noParsing: boolean;
38
27
  } | {
39
28
  height: any;
@@ -41,8 +30,7 @@ export declare const CodeEditorReducer: (state: CodeEditorState, action: Action)
41
30
  diffMode: boolean;
42
31
  theme: CodeEditorThemesKeys;
43
32
  code: string;
44
- defaultCode: string;
45
33
  noParsing: boolean;
46
34
  };
47
35
  export declare const parseValueToCode: (value: string, mode: string, tabSize: number) => string;
48
- export declare const initialState: ({ mode, theme, value, defaultValue, diffView, noParsing, tabSize, }: CodeEditorInitialValueType) => CodeEditorState;
36
+ export declare const initialState: ({ mode, theme, value, diffView, noParsing, tabSize, }: CodeEditorInitialValueType) => CodeEditorState;
@@ -8,7 +8,7 @@ interface CodeEditorBaseInterface {
8
8
  value?: string;
9
9
  lineDecorationsWidth?: number;
10
10
  responseType?: string;
11
- onChange?: (value: string, defaultValue: string) => void;
11
+ onChange?: (string: any) => void;
12
12
  onBlur?: () => void;
13
13
  onFocus?: () => void;
14
14
  children?: any;
@@ -63,7 +63,7 @@ export interface CodeEditorHeaderComposition {
63
63
  ValidationError?: React.FC<any>;
64
64
  Clipboard?: React.FC<any>;
65
65
  }
66
- export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setDefaultCode' | 'setHeight';
66
+ export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setHeight';
67
67
  export interface Action {
68
68
  type: ActionTypes;
69
69
  value: any;
@@ -80,7 +80,6 @@ export interface CodeEditorInitialValueType {
80
80
  diffView: boolean;
81
81
  theme?: string;
82
82
  value: string;
83
- defaultValue: string;
84
83
  noParsing?: boolean;
85
84
  tabSize: number;
86
85
  }
@@ -89,7 +88,6 @@ export interface CodeEditorState {
89
88
  diffMode: boolean;
90
89
  theme: CodeEditorThemesKeys;
91
90
  code: string;
92
- defaultCode: string;
93
91
  noParsing: boolean;
94
92
  }
95
93
  export declare enum CodeEditorActionTypes {
@@ -107,6 +107,9 @@ export declare const ROUTES: {
107
107
  FILE_UPLOAD: string;
108
108
  PLUGIN_GLOBAL_VARIABLES: string;
109
109
  CONFIG_COMPARE_SECRET: string;
110
+ CD_TRIGGER_POST: string;
111
+ DELETE_RESOURCE: string;
112
+ NODE_CAPACITY: string;
110
113
  };
111
114
  export declare enum KEY_VALUE {
112
115
  KEY = "key",
@@ -1,4 +1,4 @@
1
- interface drawerInterface {
1
+ export interface DrawerProps {
2
2
  position: 'left' | 'right' | 'bottom' | 'top';
3
3
  children?: any;
4
4
  backdrop?: boolean;
@@ -9,6 +9,6 @@ interface drawerInterface {
9
9
  height?: string;
10
10
  parentClassName?: string;
11
11
  onEscape?: (e?: any) => void;
12
+ disableTransition?: boolean;
12
13
  }
13
- export declare const Drawer: ({ children, position, height, width, minWidth, maxWidth, parentClassName, onEscape, onClose, }: drawerInterface) => JSX.Element;
14
- export {};
14
+ export declare const Drawer: ({ children, position, height, width, minWidth, maxWidth, parentClassName, onEscape, onClose, disableTransition, }: DrawerProps) => JSX.Element;
@@ -2,3 +2,4 @@ export * from './types';
2
2
  export * from './service';
3
3
  export { default as DTApplicationMetricsFormField } from './DTApplicationMetricsFormField';
4
4
  export { GET_RESOLVED_DEPLOYMENT_TEMPLATE_EMPTY_RESPONSE } from './constants';
5
+ export * from './GUIView';
@@ -0,0 +1,6 @@
1
+ export declare const STAGE_MAP: {
2
+ readonly PRECD: "PRE";
3
+ readonly CD: "DEPLOY";
4
+ readonly POSTCD: "POST";
5
+ readonly APPROVAL: "APPROVAL";
6
+ };
@@ -1,2 +1,5 @@
1
1
  export * from './types';
2
2
  export * from './services';
3
+ export { getAPIOptionsWithTriggerTimeout } from './utils';
4
+ export { STAGE_MAP } from './constants';
5
+ export { isImageActiveOnEnvironment } from './utils';
@@ -1,7 +1,9 @@
1
1
  import { MutableRefObject } from 'react';
2
2
  import { UploadFileDTO, UploadFileProps } from '../../../../../Shared/types';
3
+ import { TriggerCDNodeServiceProps } from './types';
3
4
  export declare const uploadCDPipelineFile: ({ file, appId, envId, allowedExtensions, maxUploadSize, abortControllerRef, }: UploadFileProps & {
4
5
  appId: number;
5
6
  envId: number;
6
7
  abortControllerRef?: MutableRefObject<AbortController>;
7
8
  }) => Promise<UploadFileDTO>;
9
+ export declare const triggerCDNode: ({ pipelineId, ciArtifactId, appId, stageType, deploymentWithConfig, wfrId, runtimeParamsPayload, abortControllerRef, }: TriggerCDNodeServiceProps) => Promise<import('../../../../../Common/Types').ResponseType<any>>;
@@ -1,7 +1,8 @@
1
1
  import { BuildStageType, FormType } from '../../../../../Common/CIPipeline.Types';
2
- import { DeploymentAppTypes } from '../../../../../Common/Types';
2
+ import { APIOptions, DeploymentAppTypes, DeploymentNodeType } from '../../../../../Common/Types';
3
+ import { STAGE_MAP } from '../../../../index';
3
4
  import { DeploymentStrategy } from '../../../../../Shared/Components';
4
- import { EnvListMinDTO } from '../../../../../Shared/types';
5
+ import { EnvListMinDTO, RuntimeParamsTriggerPayloadType } from '../../../../../Shared/types';
5
6
  interface ConfigSecretType {
6
7
  label: string;
7
8
  value: string;
@@ -77,4 +78,37 @@ export interface PipelineFormType extends Partial<FormType>, Partial<CDFormType>
77
78
  isDigestEnforcedForPipeline?: boolean;
78
79
  isDigestEnforcedForEnv?: boolean;
79
80
  }
81
+ export interface OptionsBase {
82
+ name: string;
83
+ isInitContainer?: boolean;
84
+ isEphemeralContainer?: boolean;
85
+ isExternal?: boolean;
86
+ }
87
+ export interface SelectedResourceType {
88
+ clusterId: number;
89
+ group: string;
90
+ version: string;
91
+ kind: string;
92
+ namespace: string;
93
+ name: string;
94
+ containers: OptionsBase[];
95
+ selectedContainer?: string;
96
+ clusterName?: string;
97
+ }
98
+ export interface TriggerCDNodeServiceProps extends Pick<APIOptions, 'abortControllerRef'> {
99
+ pipelineId: number;
100
+ ciArtifactId: number;
101
+ appId: number;
102
+ stageType: DeploymentNodeType;
103
+ deploymentWithConfig?: string;
104
+ wfrId?: number;
105
+ /**
106
+ * Would be available only case of PRE/POST CD
107
+ */
108
+ runtimeParamsPayload?: RuntimeParamsTriggerPayloadType;
109
+ }
110
+ export interface TriggerCDPipelinePayloadType extends Pick<TriggerCDNodeServiceProps, 'pipelineId' | 'appId' | 'ciArtifactId' | 'runtimeParamsPayload' | 'deploymentWithConfig'> {
111
+ cdWorkflowType: (typeof STAGE_MAP)[keyof typeof STAGE_MAP];
112
+ wfrIdForDeploymentWithSpecificTrigger?: number;
113
+ }
80
114
  export {};
@@ -0,0 +1,10 @@
1
+ import { APIOptions, CDMaterialType } from '../../../../../Common/Types';
2
+ export declare const getAPIOptionsWithTriggerTimeout: (options?: APIOptions) => APIOptions;
3
+ /**
4
+ * This check is used to find the image that is currently deployed on the environment
5
+ * from the image list fetched from genericCDMaterialsService for a given environment
6
+ *
7
+ * @param material CDMaterialType
8
+ * @returns if image is currently deployed
9
+ */
10
+ export declare const isImageActiveOnEnvironment: (material: CDMaterialType) => boolean;
@@ -49,34 +49,6 @@ export interface BulkSelectionActionWidgetProps {
49
49
  parentRef: RefObject<HTMLDivElement>;
50
50
  showBulkRestartOption: boolean;
51
51
  }
52
- interface BulkOperationAdditionalKeysType {
53
- label: string;
54
- value: string;
55
- isSortable: boolean;
56
- /**
57
- * width to be given in gridTemplateColumns
58
- */
59
- width: string;
60
- }
61
- export interface BulkOperation {
62
- name: string;
63
- /**
64
- * Would these keys beside the name
65
- */
66
- additionalKeys?: BulkOperationAdditionalKeysType[];
67
- operation: (signal: AbortSignal, data?: unknown) => Promise<void>;
68
- }
69
- export type BulkOperationModalProps = {
70
- operationType: 'restart' | 'delete' | 'creation';
71
- clusterName: string;
72
- operations: NonNullable<BulkOperation[]>;
73
- handleModalClose: () => void;
74
- resourceKind: string;
75
- handleReloadDataAfterBulkOperation?: () => void;
76
- hideResultsDrawer?: boolean;
77
- shouldAllowForceOperation?: true;
78
- };
79
- export type BulkOperationModalState = BulkOperationModalProps['operationType'] | 'closed';
80
52
  export interface CreateResourceRequestBodyType {
81
53
  appId: string;
82
54
  clusterId: number;
@@ -107,4 +79,28 @@ export interface CreateResourceDTO {
107
79
  isUpdate: boolean;
108
80
  error: string;
109
81
  }
82
+ export interface ResourceListPayloadType {
83
+ clusterId: number;
84
+ k8sRequest: {
85
+ resourceIdentifier: {
86
+ groupVersionKind: GVKType;
87
+ namespace?: string;
88
+ name?: string;
89
+ };
90
+ patch?: string;
91
+ forceDelete?: boolean;
92
+ };
93
+ }
94
+ export interface ResourceType {
95
+ kind: string;
96
+ name: string;
97
+ isUpdate: boolean;
98
+ error: string;
99
+ }
100
+ export interface NodeActionRequest {
101
+ clusterId?: number;
102
+ name: string;
103
+ version: string;
104
+ kind: string;
105
+ }
110
106
  export {};
@@ -1,4 +1,6 @@
1
- import { ResponseType } from '../../Common/Types';
2
- import { CreateResourceDTO, CreateResourcePayload, K8sResourceDetailType, K8sResourceListPayloadType } from './ResourceBrowser.Types';
1
+ import { APIOptions, ResponseType } from '../../Common/Types';
2
+ import { CreateResourceDTO, CreateResourcePayload, K8sResourceDetailType, K8sResourceListPayloadType, NodeActionRequest, ResourceListPayloadType, ResourceType } from './ResourceBrowser.Types';
3
3
  export declare const getK8sResourceList: (resourceListPayload: K8sResourceListPayloadType, signal?: AbortSignal) => Promise<ResponseType<K8sResourceDetailType>>;
4
4
  export declare const createNewResource: (resourceListPayload: CreateResourcePayload) => Promise<ResponseType<CreateResourceDTO[]>>;
5
+ export declare const deleteResource: (resourceListPayload: ResourceListPayloadType, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType<ResourceType[]>>;
6
+ export declare const deleteNodeCapacity: (requestPayload: NodeActionRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
@@ -1,4 +1,3 @@
1
1
  export * from './GlobalConfigurations';
2
2
  export * from './ResourceBrowser';
3
3
  export * from './Applications';
4
- export * from './App';
@@ -0,0 +1,3 @@
1
+ import { BulkOperationModalProps } from './types';
2
+ declare const BulkOperations: ({ handleModalClose: handleModalCloseProp, operations: userOperations, getResultsChartSummaryText, handleReloadDataAfterBulkOperation, hideResultsDrawer, textConfig, shouldSkipConfirmation, confirmationModalConfig, data, disableTransition, }: BulkOperationModalProps) => JSX.Element;
3
+ export default BulkOperations;
@@ -0,0 +1,3 @@
1
+ import { BulkOperationsResultModalProps } from './types';
2
+ declare const BulkOperationsResultModal: ({ apiCallInProgress, handleModalClose, isOperationAborted, resultsStore, handleAbortBulkOperation, handleRetryFailedOperations, resultsHeader: headerText, getResultsChartSummaryText, disableTransition, }: BulkOperationsResultModalProps) => JSX.Element;
3
+ export default BulkOperationsResultModal;
@@ -0,0 +1,21 @@
1
+ import { OperationResultStoreType } from './types';
2
+ export declare class OperationResultStore implements OperationResultStoreType {
3
+ #private;
4
+ private size;
5
+ private results;
6
+ private map;
7
+ private retryOperations;
8
+ private retryOperationsSet;
9
+ private barChartEntities;
10
+ constructor(size: number);
11
+ private updateStatus;
12
+ addResult: OperationResultStoreType['addResult'];
13
+ getResults: OperationResultStoreType['getResults'];
14
+ getBarChartEntities: OperationResultStoreType['getBarChartEntities'];
15
+ getResultsStatusCount: OperationResultStoreType['getResultsStatusCount'];
16
+ getSize: OperationResultStoreType['getSize'];
17
+ updateResultStatus: OperationResultStoreType['updateResultStatus'];
18
+ getRetryOperations: OperationResultStoreType['getRetryOperations'];
19
+ hasAnyOperationFailed: OperationResultStoreType['hasAnyOperationFailed'];
20
+ getHasAnyOperationSucceeded: OperationResultStoreType['getHasAnyOperationSucceeded'];
21
+ }
@@ -0,0 +1,13 @@
1
+ export declare const COLOR_MAPPING: {
2
+ Completed: string;
3
+ Pending: string;
4
+ Failed: string;
5
+ };
6
+ export declare const RESULTS_MODAL_HEADERS: {
7
+ label: string;
8
+ isSortable: boolean;
9
+ width: string;
10
+ }[];
11
+ export declare const SORT_ORDER_TO_KEY: Partial<Record<(typeof RESULTS_MODAL_HEADERS)[number]['label'], string>>;
12
+ export declare const SORT_KEY_TO_NORMALIZER: Partial<Record<(typeof RESULTS_MODAL_HEADERS)[number]['label'], Function | null>>;
13
+ export type SORTABLE_KEYS_TYPE = (typeof SORT_ORDER_TO_KEY)[keyof typeof SORT_ORDER_TO_KEY];
@@ -0,0 +1,2 @@
1
+ export { default as BulkOperations } from './BulkOperations.component';
2
+ export type { BulkOperationModalProps, BulkOperation } from './types';
@@ -0,0 +1,69 @@
1
+ import { SegmentedBarChartProps } from '../../../Common/SegmentedBarChart';
2
+ import { ReactNode } from 'react';
3
+ import { APIOptions, DrawerProps } from '../../../Common/index';
4
+ import { getProgressingStateForStatus } from '../Security';
5
+ import { ConfirmationModalProps } from '../ConfirmationModal/types';
6
+ interface BulkOperationAdditionalKeysType {
7
+ label: string;
8
+ value: string;
9
+ isSortable: boolean;
10
+ /**
11
+ * width to be given in gridTemplateColumns
12
+ */
13
+ width: string;
14
+ }
15
+ export interface BulkOperation {
16
+ name: string;
17
+ /**
18
+ * Would show these keys beside the name
19
+ */
20
+ additionalKeys?: BulkOperationAdditionalKeysType[];
21
+ operation: (abortControllerRef: APIOptions['abortControllerRef'], data?: unknown) => Promise<unknown | void>;
22
+ renderContentAtResultRowEnd?: (data: Awaited<ReturnType<BulkOperation['operation']>>) => ReactNode;
23
+ }
24
+ export type FailedOperationType = {
25
+ status: 'Failed';
26
+ retryOperation: BulkOperation;
27
+ };
28
+ export type OtherStatusOperationType = {
29
+ status: Exclude<Parameters<typeof getProgressingStateForStatus>[0], 'Failed' | 'Running'> | 'Pending';
30
+ };
31
+ export type BulkOperationResultType = {
32
+ message?: string;
33
+ renderContentAtResultRowEnd?: () => void;
34
+ } & (FailedOperationType | OtherStatusOperationType) & Pick<BulkOperation, 'name' | 'additionalKeys'>;
35
+ export type BulkOperationResultWithIdType = BulkOperationResultType & Record<'id', number>;
36
+ export interface OperationResultStoreType {
37
+ addResult: (result: BulkOperationResultType) => number;
38
+ getResults: (sortComparator: (a: BulkOperationResultType, b: BulkOperationResultType) => number) => BulkOperationResultWithIdType[];
39
+ getBarChartEntities: () => SegmentedBarChartProps['entities'];
40
+ getResultsStatusCount: () => Record<BulkOperationResultType['status'], number>;
41
+ getSize: () => number;
42
+ updateResultStatus: (id: number, result: Partial<Pick<BulkOperationResultType, 'message' | 'renderContentAtResultRowEnd'>> & (FailedOperationType | OtherStatusOperationType)) => void;
43
+ getRetryOperations: () => FailedOperationType['retryOperation'][];
44
+ hasAnyOperationFailed: () => boolean;
45
+ getHasAnyOperationSucceeded: () => boolean;
46
+ }
47
+ export type BulkOperationModalProps = {
48
+ operations: NonNullable<BulkOperation[]>;
49
+ handleModalClose: () => void;
50
+ textConfig: Record<'prompt' | 'resultsHeader', string>;
51
+ getResultsChartSummaryText: (counts: Record<BulkOperationResultType['status'], number>) => ReactNode;
52
+ data?: unknown;
53
+ handleReloadDataAfterBulkOperation?: () => void;
54
+ hideResultsDrawer?: boolean;
55
+ } & ({
56
+ shouldSkipConfirmation?: never;
57
+ confirmationModalConfig: ConfirmationModalProps<true>;
58
+ } | {
59
+ shouldSkipConfirmation: true;
60
+ confirmationModalConfig?: never;
61
+ }) & Pick<DrawerProps, 'disableTransition'>;
62
+ export interface BulkOperationsResultModalProps extends Pick<BulkOperationModalProps, 'handleModalClose' | 'getResultsChartSummaryText' | 'disableTransition'>, Pick<BulkOperationModalProps['textConfig'], 'resultsHeader'> {
63
+ resultsStore: OperationResultStoreType;
64
+ apiCallInProgress: boolean;
65
+ isOperationAborted: boolean;
66
+ handleAbortBulkOperation: () => void;
67
+ handleRetryFailedOperations: () => void;
68
+ }
69
+ export {};
@@ -6,22 +6,22 @@ export declare enum ConfirmationModalVariantType {
6
6
  warning = "warning",
7
7
  custom = "custom"
8
8
  }
9
- interface CommonButtonProps extends Pick<ButtonProps, 'text'>, Partial<Pick<ButtonProps, 'startIcon' | 'endIcon'>> {
10
- onClick: (e?: SyntheticEvent) => void;
11
- }
9
+ type CommonButtonProps<isConfig extends boolean, isCustomVariant extends boolean> = Pick<ButtonProps, 'text'> & Partial<Pick<ButtonProps, 'startIcon' | 'endIcon'>> & (isConfig extends false ? Pick<ButtonProps, 'disabled'> & {
10
+ onClick: (...args: Partial<Parameters<ButtonProps['onClick']>>) => void;
11
+ } : {}) & (isCustomVariant extends true ? Pick<ButtonProps, 'style'> : {});
12
12
  interface CustomInputConfig {
13
13
  identifier: string;
14
14
  confirmationKeyword: string;
15
15
  }
16
- type ButtonConfig<PrimaryButtonConfig, SecondaryButtonConfig> = {
17
- primaryButtonConfig: PrimaryButtonConfig & CommonButtonProps;
18
- secondaryButtonConfig: SecondaryButtonConfig & CommonButtonProps;
16
+ type ButtonConfig<isConfig extends boolean, isCustomVariant extends boolean> = {
17
+ primaryButtonConfig: Pick<ButtonProps, 'isLoading'> & CommonButtonProps<isConfig, isCustomVariant>;
18
+ secondaryButtonConfig: CommonButtonProps<isConfig, isCustomVariant>;
19
19
  } | {
20
- primaryButtonConfig: PrimaryButtonConfig & CommonButtonProps;
20
+ primaryButtonConfig: Pick<ButtonProps, 'isLoading'> & CommonButtonProps<isConfig, isCustomVariant>;
21
21
  secondaryButtonConfig?: never;
22
22
  } | {
23
23
  primaryButtonConfig?: never;
24
- secondaryButtonConfig?: SecondaryButtonConfig & CommonButtonProps;
24
+ secondaryButtonConfig?: CommonButtonProps<isConfig, isCustomVariant>;
25
25
  };
26
26
  type CustomInputConfigOrChildrenType = {
27
27
  customInputConfig: CustomInputConfig;
@@ -33,20 +33,21 @@ type CustomInputConfigOrChildrenType = {
33
33
  customInputConfig?: never;
34
34
  children?: never;
35
35
  };
36
- type ButtonConfigAndVariantType = {
36
+ type ButtonConfigAndVariantType<isConfig extends boolean> = {
37
37
  variant: Exclude<ConfirmationModalVariantType, ConfirmationModalVariantType.custom>;
38
38
  Icon?: never;
39
- buttonConfig: ButtonConfig<Pick<ButtonProps, 'isLoading' | 'disabled'>, Pick<ButtonProps, 'disabled'>>;
39
+ buttonConfig: ButtonConfig<isConfig, false>;
40
40
  } | {
41
41
  variant: ConfirmationModalVariantType.custom;
42
42
  Icon: FunctionComponent<SVGProps<SVGSVGElement>>;
43
- buttonConfig: ButtonConfig<Pick<ButtonProps, 'isLoading' | 'disabled' | 'style'>, Pick<ButtonProps, 'disabled' | 'style'>>;
43
+ buttonConfig: ButtonConfig<isConfig, true>;
44
44
  };
45
- export type ConfirmationModalProps = {
45
+ export type ConfirmationModalProps<isConfig extends boolean = false> = {
46
46
  title: string;
47
47
  subtitle: ReactNode;
48
+ } & ButtonConfigAndVariantType<isConfig> & CustomInputConfigOrChildrenType & (isConfig extends false ? {
48
49
  handleClose: (e?: SyntheticEvent) => void;
49
50
  showConfirmationModal: boolean;
50
- } & ButtonConfigAndVariantType & CustomInputConfigOrChildrenType;
51
+ } : {});
51
52
  export type ConfirmationModalBodyProps = Omit<ConfirmationModalProps, 'showConfirmationModal'>;
52
53
  export {};
@@ -49,4 +49,4 @@ export * from './DynamicDataTable';
49
49
  export * from './TagsKeyValueTable';
50
50
  export * from './FileUpload';
51
51
  export * from './AnimatedDeployButton';
52
- export * from './VirtualizedList';
52
+ export * from './BulkOperations';
@@ -1,7 +1,3 @@
1
- import { ServerErrors } from '../../../Common/ServerError';
2
- import { HandleDownloadProps } from './types';
3
- declare const useDownload: () => {
4
- handleDownload: ({ downloadUrl, showFilePreparingToast, fileName, showSuccessfulToast, downloadSuccessToastContent, }: HandleDownloadProps) => Promise<Error | ServerErrors>;
5
- isDownloading: boolean;
6
- };
1
+ import { UseDownloadReturnType } from './types';
2
+ declare const useDownload: () => UseDownloadReturnType;
7
3
  export default useDownload;
@@ -1,3 +1,4 @@
1
+ import { ServerErrors } from '../../../Common/ServerError';
1
2
  export interface HandleDownloadProps {
2
3
  downloadUrl: string;
3
4
  showFilePreparingToast?: boolean;
@@ -5,3 +6,7 @@ export interface HandleDownloadProps {
5
6
  showSuccessfulToast?: boolean;
6
7
  downloadSuccessToastContent?: string;
7
8
  }
9
+ export interface UseDownloadReturnType {
10
+ handleDownload: (props: HandleDownloadProps) => Promise<Error | ServerErrors>;
11
+ isDownloading: boolean;
12
+ }
@@ -17,7 +17,6 @@ export interface ClusterDTO {
17
17
  id: number;
18
18
  cluster_name: string;
19
19
  isVirtualCluster: boolean;
20
- isProd: boolean;
21
20
  }
22
21
  export interface UseGetResourceKindsOptionsProps {
23
22
  resourcesToFetch: Extract<ResourceKindType, ResourceKindType.devtronApplication | ResourceKindType.project | ResourceKindType.cluster | ResourceKindType.environment>[];
@@ -7,10 +7,6 @@ export interface ClusterType {
7
7
  * If true, denotes virtual cluster
8
8
  */
9
9
  isVirtual: boolean;
10
- /**
11
- * If true, denotes prod labelled cluster
12
- */
13
- isProd: boolean;
14
10
  }
15
11
  /**
16
12
  * T => Type of query params
@@ -427,3 +427,4 @@ export declare const BASE_CONFIGURATION_ENV_ID = -1;
427
427
  export declare const DEVTRON_BASE_MAIN_ID = "devtron-base-main-identifier";
428
428
  export declare const SKIP_LABEL_KEY_VALIDATION_PREFIX = "devtron.ai/";
429
429
  export declare const UNSAVED_CHANGES_PROMPT_MESSAGE = "You have unsaved changes. Are you sure you want to leave?";
430
+ export declare const DEFAULT_ROUTE_PROMPT_MESSAGE = "Please don't wander off! Reloading or going back might disrupt the ongoing operation.";
@@ -1,5 +1,5 @@
1
1
  import { Dayjs } from 'dayjs';
2
- import { ApprovalConfigDataType } from '../Common/Types';
2
+ import { APIOptions, ApprovalConfigDataType } from '../Common/Types';
3
3
  import { OptionType, CommonNodeAttr, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, TriggerBlockType, ValueConstraintType, VariableType, RefVariableType, PluginType } from '../Common';
4
4
  import { BASE_CONFIGURATION_ENV_ID, EnvironmentTypeEnum, PatchOperationType } from './constants';
5
5
  export declare enum EnvType {
@@ -220,10 +220,6 @@ export declare enum Severity {
220
220
  LOW = "low",
221
221
  UNKNOWN = "unknown"
222
222
  }
223
- export declare enum ImagePromotionTabs {
224
- REQUEST = "request",
225
- PENDING = "pending"
226
- }
227
223
  export interface ArtifactPromotionMetadata {
228
224
  isConfigured: boolean;
229
225
  isApprovalPendingForPromotion: boolean;
@@ -776,7 +772,7 @@ export interface PolicyConsequencesDTO {
776
772
  cd: PipelineStageBlockInfo;
777
773
  ci: PipelineStageBlockInfo;
778
774
  }
779
- export interface GetPolicyConsequencesProps {
775
+ export interface GetPolicyConsequencesProps extends Pick<APIOptions, 'abortControllerRef'> {
780
776
  appId: number;
781
777
  envId: number;
782
778
  }