@devtron-labs/devtron-fe-common-lib 1.4.4 → 1.4.6
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.
- package/dist/{@code-editor-BryMtpyV.js → @code-editor-CgHQxf33.js} +6524 -6079
- package/dist/{@common-rjsf-B_ynsLBs.js → @common-rjsf-DulF6J49.js} +1 -1
- package/dist/Common/Constants.d.ts +3 -0
- package/dist/Common/Drawer/Drawer.d.ts +3 -3
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.d.ts +1 -0
- package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/constants.d.ts +6 -0
- package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/index.d.ts +3 -0
- package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/services.d.ts +2 -0
- package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +36 -2
- package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/utils.d.ts +10 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +2 -2
- package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +3 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +39 -17
- package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +4 -3
- package/dist/Pages/ResourceBrowser/ResourceBrowser.Types.d.ts +24 -28
- package/dist/Pages/ResourceBrowser/service.d.ts +4 -2
- package/dist/Pages/index.d.ts +0 -1
- package/dist/Shared/Components/BulkOperations/BulkOperations.component.d.ts +3 -0
- package/dist/Shared/Components/BulkOperations/BulkOperationsResultModal.d.ts +3 -0
- package/dist/Shared/Components/BulkOperations/OperationResultStore.d.ts +21 -0
- package/dist/Shared/Components/BulkOperations/constants.d.ts +13 -0
- package/dist/Shared/Components/BulkOperations/index.d.ts +2 -0
- package/dist/Shared/Components/BulkOperations/types.d.ts +69 -0
- package/dist/Shared/Components/ConfirmationModal/types.d.ts +14 -13
- package/dist/Shared/Components/index.d.ts +1 -0
- package/dist/Shared/Hooks/UseDownload/UseDownload.d.ts +2 -6
- package/dist/Shared/Hooks/UseDownload/types.d.ts +5 -0
- package/dist/Shared/constants.d.ts +1 -0
- package/dist/Shared/types.d.ts +2 -6
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-arrows-clockwise.424f0538.svg +7 -0
- package/dist/index.js +636 -628
- package/package.json +1 -1
- package/dist/Pages/App/AppConfiguration/DeploymentTemplate/index.d.ts +0 -1
- package/dist/Pages/App/AppConfiguration/index.d.ts +0 -1
- package/dist/Pages/App/index.d.ts +0 -1
- /package/dist/Pages/{App/AppConfiguration → Applications/DevtronApps/Details/AppConfigurations}/DeploymentTemplate/GUIView/index.d.ts +0 -0
- /package/dist/Pages/{App/AppConfiguration → Applications/DevtronApps/Details/AppConfigurations}/DeploymentTemplate/GUIView/types.d.ts +0 -0
- /package/dist/Pages/{App/AppConfiguration → Applications/DevtronApps/Details/AppConfigurations}/DeploymentTemplate/GUIView/utils.d.ts +0 -0
@@ -2,7 +2,7 @@ import { j as n, J as A } from "./@vendor-CwAQS8iU.js";
|
|
2
2
|
import E, { forwardRef as $ } from "react";
|
3
3
|
import L, { getDefaultRegistry as k } from "@rjsf/core";
|
4
4
|
import D from "@rjsf/validator-ajv8";
|
5
|
-
import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor-
|
5
|
+
import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor-CgHQxf33.js";
|
6
6
|
import M, { components as O } from "react-select";
|
7
7
|
import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as W, ADDITIONAL_PROPERTY_FLAG as P, errorId as V, englishStringTranslator as q, TranslatableString as K, titleId as Y, canExpand as z, deepEquals as G } from "@rjsf/utils";
|
8
8
|
import { ReactComponent as Q } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
@@ -108,6 +108,9 @@ export declare const ROUTES: {
|
|
108
108
|
FILE_UPLOAD: string;
|
109
109
|
PLUGIN_GLOBAL_VARIABLES: string;
|
110
110
|
CONFIG_COMPARE_SECRET: string;
|
111
|
+
CD_TRIGGER_POST: string;
|
112
|
+
DELETE_RESOURCE: string;
|
113
|
+
NODE_CAPACITY: string;
|
111
114
|
};
|
112
115
|
export declare enum KEY_VALUE {
|
113
116
|
KEY = "key",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
interface
|
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, }:
|
14
|
-
export {};
|
14
|
+
export declare const Drawer: ({ children, position, height, width, minWidth, maxWidth, parentClassName, onEscape, onClose, disableTransition, }: DrawerProps) => JSX.Element;
|
@@ -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;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { UseBuildInfraFormProps, UseBuildInfraFormResponseType } from '../../index';
|
2
|
-
declare const useBuildInfraForm: ({ name, editProfile, handleSuccessRedirection, }: UseBuildInfraFormProps) => UseBuildInfraFormResponseType;
|
2
|
+
declare const useBuildInfraForm: ({ name, editProfile, handleSuccessRedirection, canConfigureUseK8sDriver, }: UseBuildInfraFormProps) => UseBuildInfraFormResponseType;
|
3
3
|
export default useBuildInfraForm;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { UseBreadcrumbProps } from '@Common/BreadCrumb/Types';
|
2
|
-
import { BuildInfraConfigTypes, BuildInfraFormFieldType, BuildInfraLocators, BuildInfraMetaConfigTypes, ProfileInputErrorType,
|
2
|
+
import { BuildInfraConfigTypes, BuildInfraFormFieldType, BuildInfraLocators, BuildInfraMetaConfigTypes, ProfileInputErrorType, HandleProfileInputChangeType, BuildInfraAPIVersionType, TargetPlatformErrorFields, ValidateRequestLimitType, RequestLimitConfigType, BuildInfraToleranceEffectType, BuildInfraToleranceOperatorType } from './types';
|
3
3
|
export declare const BUILD_INFRA_INPUT_CONSTRAINTS: {
|
4
4
|
readonly STEP: "any";
|
5
5
|
readonly MIN: 0;
|
@@ -43,7 +43,6 @@ export declare const BUILD_INFRA_FORM_FIELDS: Readonly<BuildInfraFormFieldType[]
|
|
43
43
|
export declare const NUMERIC_BUILD_INFRA_FORM_FIELD_CONFIGURATION_MAP: Readonly<Record<BuildInfraLocators, BuildInfraFormFieldType>>;
|
44
44
|
export declare const PROFILE_INPUT_ERROR_FIELDS: ProfileInputErrorType;
|
45
45
|
export declare const CREATE_MODE_REQUIRED_INPUT_FIELDS: BuildInfraMetaConfigTypes[];
|
46
|
-
export declare const CREATE_PROFILE_BASE_VALUE: BuildInfraProfileBase;
|
47
46
|
export declare const BUILD_INFRA_TEST_IDS: {
|
48
47
|
readonly SUBMIT_BUTTON: "build-infra-submit-button";
|
49
48
|
readonly CANCEL_BUTTON: "build-infra-cancel-button";
|
@@ -60,3 +59,4 @@ export declare const ACTION_TO_PERSISTED_VALUE_MAP: Readonly<Record<RequestLimit
|
|
60
59
|
export declare const DEFAULT_TOLERANCE_EFFECT = BuildInfraToleranceEffectType.NO_SCHEDULE;
|
61
60
|
export declare const DEFAULT_TOLERANCE_OPERATOR = BuildInfraToleranceOperatorType.EQUALS;
|
62
61
|
export declare const INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X: Partial<Record<BuildInfraConfigTypes, true>>;
|
62
|
+
export declare const USE_BUILD_X_DRIVER_FALLBACK = true;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { BuildInfraProfileResponseType,
|
2
|
-
export declare const getBuildInfraProfileByName: ({ name, fromCreateView, }: GetBuildInfraProfileType) => Promise<BuildInfraProfileResponseType>;
|
3
|
-
export declare const
|
4
|
-
export declare const createBuildInfraProfile: ({ profileInput }: CreateBuildInfraProfileType) => Promise<import('../../../Common').ResponseType<Promise<import('../../../Common').ResponseType<unknown>>>>;
|
1
|
+
import { BuildInfraProfileResponseType, GetBuildInfraProfileType, UpsertBuildInfraProfileServiceParamsType } from './types';
|
2
|
+
export declare const getBuildInfraProfileByName: ({ name, fromCreateView, canConfigureUseK8sDriver, }: GetBuildInfraProfileType) => Promise<BuildInfraProfileResponseType>;
|
3
|
+
export declare const upsertBuildInfraProfile: ({ name, profileInput, canConfigureUseK8sDriver, }: UpsertBuildInfraProfileServiceParamsType) => Promise<import('../../../Common').ResponseType<Promise<import('../../../Common').ResponseType<unknown>>>>;
|
@@ -166,6 +166,10 @@ export type BuildInfraConfigurationMapTypeWithoutDefaultFallback = {
|
|
166
166
|
[key in BuildInfraConfigTypes]?: BuildInfraConfigInfoType;
|
167
167
|
};
|
168
168
|
export type BuildInfraConfigurationMapType = Record<BuildInfraConfigTypes, BuildInfraConfigurationType>;
|
169
|
+
export declare enum BuildXDriverType {
|
170
|
+
KUBERNETES = "kubernetes",
|
171
|
+
DOCKER_CONTAINER = "docker-container"
|
172
|
+
}
|
169
173
|
interface BuildInfraProfileBaseDTO {
|
170
174
|
id?: number;
|
171
175
|
name?: string;
|
@@ -173,8 +177,13 @@ interface BuildInfraProfileBaseDTO {
|
|
173
177
|
type: BuildInfraProfileVariants;
|
174
178
|
appCount?: number;
|
175
179
|
active?: boolean;
|
180
|
+
/**
|
181
|
+
* @default `BuildXDriverType.KUBERNETES`
|
182
|
+
*/
|
183
|
+
buildxDriverType?: BuildXDriverType;
|
176
184
|
}
|
177
|
-
export interface BuildInfraProfileBase extends BuildInfraProfileBaseDTO {
|
185
|
+
export interface BuildInfraProfileBase extends Omit<BuildInfraProfileBaseDTO, 'buildxDriverType'> {
|
186
|
+
useK8sDriver?: boolean;
|
178
187
|
}
|
179
188
|
export interface BuildInfraProfileInfoDTO extends BuildInfraProfileBaseDTO {
|
180
189
|
configurations: BuildInfraPlatformConfigurationMapDTO;
|
@@ -185,18 +194,6 @@ export interface BuildInfraProfileData extends BuildInfraProfileBase {
|
|
185
194
|
*/
|
186
195
|
configurations: Record<string, BuildInfraConfigurationMapType>;
|
187
196
|
}
|
188
|
-
export interface GetBuildInfraProfileType {
|
189
|
-
name: string;
|
190
|
-
fromCreateView?: boolean;
|
191
|
-
}
|
192
|
-
export interface BuildInfraProfileResponseType {
|
193
|
-
configurationUnits: BuildInfraUnitsMapType | null;
|
194
|
-
profile: BuildInfraProfileData | null;
|
195
|
-
/**
|
196
|
-
* To be used in case user is creating configuration for new platform
|
197
|
-
*/
|
198
|
-
fallbackPlatformConfigurationMap: BuildInfraProfileData['configurations'];
|
199
|
-
}
|
200
197
|
export interface UseBuildInfraFormProps {
|
201
198
|
/**
|
202
199
|
* Name of the profile, if not provided assumption would be for create view
|
@@ -210,6 +207,22 @@ export interface UseBuildInfraFormProps {
|
|
210
207
|
* If true, call this on form submission success
|
211
208
|
*/
|
212
209
|
handleSuccessRedirection?: () => void;
|
210
|
+
/**
|
211
|
+
* @default false
|
212
|
+
*/
|
213
|
+
canConfigureUseK8sDriver?: boolean;
|
214
|
+
}
|
215
|
+
export interface GetBuildInfraProfileType extends Pick<UseBuildInfraFormProps, 'canConfigureUseK8sDriver'> {
|
216
|
+
name: string;
|
217
|
+
fromCreateView?: boolean;
|
218
|
+
}
|
219
|
+
export interface BuildInfraProfileResponseType {
|
220
|
+
configurationUnits: BuildInfraUnitsMapType | null;
|
221
|
+
profile: BuildInfraProfileData | null;
|
222
|
+
/**
|
223
|
+
* To be used in case user is creating configuration for new platform
|
224
|
+
*/
|
225
|
+
fallbackPlatformConfigurationMap: BuildInfraProfileData['configurations'];
|
213
226
|
}
|
214
227
|
export declare enum BuildInfraProfileAdditionalErrorKeysType {
|
215
228
|
TARGET_PLATFORM = "target_platform"
|
@@ -239,6 +252,7 @@ interface NumericBuildInfraConfigPayloadType {
|
|
239
252
|
}
|
240
253
|
export declare enum BuildInfraProfileInputActionType {
|
241
254
|
ADD_TARGET_PLATFORM = "add_target_platform",
|
255
|
+
TOGGLE_USE_K8S_DRIVER = "toggle_use_k8s_driver",
|
242
256
|
REMOVE_TARGET_PLATFORM = "remove_target_platform",
|
243
257
|
RENAME_TARGET_PLATFORM = "rename_target_platform",
|
244
258
|
RESTORE_PROFILE_CONFIG_SNAPSHOT = "restore_profile_config_snapshot",
|
@@ -250,6 +264,9 @@ export declare enum BuildInfraProfileInputActionType {
|
|
250
264
|
EDIT_TOLERANCE_ITEM = "edit_tolerance_item"
|
251
265
|
}
|
252
266
|
export type HandleProfileInputChangeType = {
|
267
|
+
action: BuildInfraProfileInputActionType.TOGGLE_USE_K8S_DRIVER;
|
268
|
+
data?: never;
|
269
|
+
} | {
|
253
270
|
action: NumericBuildInfraConfigTypes;
|
254
271
|
data: ProfileInputDispatchDataType & NumericBuildInfraConfigPayloadType;
|
255
272
|
} | {
|
@@ -300,7 +317,7 @@ export interface UseBuildInfraFormResponseType {
|
|
300
317
|
profileInputErrors: ProfileInputErrorType;
|
301
318
|
handleProfileInputChange: ({ action, data }: HandleProfileInputChangeType) => void;
|
302
319
|
loadingActionRequest: boolean;
|
303
|
-
handleSubmit: (e
|
320
|
+
handleSubmit: (e?: FormEvent<HTMLFormElement>) => Promise<void>;
|
304
321
|
}
|
305
322
|
export interface BuildInfraConfigFormProps extends Pick<UseBuildInfraFormResponseType, 'profileInput' | 'profileInputErrors' | 'handleProfileInputChange'> {
|
306
323
|
isGlobalProfile?: boolean;
|
@@ -360,8 +377,11 @@ export interface FooterProps {
|
|
360
377
|
editProfile?: boolean;
|
361
378
|
loading?: boolean;
|
362
379
|
}
|
363
|
-
export interface
|
364
|
-
|
380
|
+
export interface UpsertBuildInfraProfileServiceParamsType extends Pick<UseBuildInfraFormResponseType, 'profileInput'>, Pick<UseBuildInfraFormProps, 'canConfigureUseK8sDriver'> {
|
381
|
+
/**
|
382
|
+
* If not given would consider as create view
|
383
|
+
*/
|
384
|
+
name?: string;
|
365
385
|
}
|
366
386
|
export interface CreateBuildInfraProfileType extends Pick<UseBuildInfraFormResponseType, 'profileInput'> {
|
367
387
|
}
|
@@ -392,7 +412,7 @@ export interface BuildInfraListResponseType extends BaseBuildInfraProfileDTO {
|
|
392
412
|
export interface BuildInfraProfileDTO extends BaseBuildInfraProfileDTO {
|
393
413
|
profile: BuildInfraProfileInfoDTO;
|
394
414
|
}
|
395
|
-
export interface BuildInfraProfileTransformerParamsType extends BuildInfraProfileDTO, Pick<GetBuildInfraProfileType, 'fromCreateView'> {
|
415
|
+
export interface BuildInfraProfileTransformerParamsType extends BuildInfraProfileDTO, Pick<GetBuildInfraProfileType, 'fromCreateView'>, Pick<GetBuildInfraProfileType, 'canConfigureUseK8sDriver'> {
|
396
416
|
}
|
397
417
|
export interface GetPlatformConfigurationsWithDefaultValuesParamsType {
|
398
418
|
profileConfigurationsMap: BuildInfraConfigurationMapTypeWithoutDefaultFallback;
|
@@ -407,4 +427,6 @@ export interface ValidateNodeSelectorParamsType extends Pick<ReturnType<typeof u
|
|
407
427
|
selector: BuildInfraNodeSelectorValueType;
|
408
428
|
existingKeys: string[];
|
409
429
|
}
|
430
|
+
export interface GetBaseProfileObjectParamsType extends Pick<BuildInfraProfileTransformerParamsType, 'canConfigureUseK8sDriver' | 'fromCreateView' | 'profile'> {
|
431
|
+
}
|
410
432
|
export {};
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { BuildInfraConfigValuesType, BuildInfraInheritActions, BuildInfraLocators, BuildInfraProfileInfoDTO, BuildInfraProfileResponseType, BuildInfraProfileTransformerParamsType, CreateBuildInfraProfileType } from './types';
|
1
|
+
import { BuildInfraConfigValuesType, BuildInfraInheritActions, BuildInfraLocators, BuildInfraProfileInfoDTO, BuildInfraProfileResponseType, BuildInfraProfileTransformerParamsType, BuildXDriverType, CreateBuildInfraProfileType } from './types';
|
2
2
|
export declare const parsePlatformConfigIntoValue: (configuration: BuildInfraConfigValuesType, addUniqueId?: boolean) => BuildInfraConfigValuesType;
|
3
|
-
export declare const
|
4
|
-
export declare const
|
3
|
+
export declare const getParsedValueForUseK8sDriver: (buildxDriverType: BuildXDriverType) => boolean;
|
4
|
+
export declare const getTransformedBuildInfraProfileResponse: ({ configurationUnits, defaultConfigurations, profile, fromCreateView, canConfigureUseK8sDriver, }: BuildInfraProfileTransformerParamsType) => BuildInfraProfileResponseType;
|
5
|
+
export declare const getBuildInfraProfilePayload: (profileInput: CreateBuildInfraProfileType["profileInput"], canConfigureUseK8sDriver: boolean) => BuildInfraProfileInfoDTO;
|
5
6
|
export declare const getBuildInfraProfileEndpoint: () => string;
|
6
7
|
export declare const getBuildInfraInheritActionFromLocator: (locator: BuildInfraLocators, activateLocator: boolean) => BuildInfraInheritActions;
|
@@ -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,6 +1,8 @@
|
|
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
|
import { ClusterDetail } from './types';
|
4
4
|
export declare const getK8sResourceList: (resourceListPayload: K8sResourceListPayloadType, signal?: AbortSignal) => Promise<ResponseType<K8sResourceDetailType>>;
|
5
5
|
export declare const createNewResource: (resourceListPayload: CreateResourcePayload) => Promise<ResponseType<CreateResourceDTO[]>>;
|
6
|
+
export declare const deleteResource: (resourceListPayload: ResourceListPayloadType, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType<ResourceType[]>>;
|
7
|
+
export declare const deleteNodeCapacity: (requestPayload: NodeActionRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
|
6
8
|
export declare const getClusterListRaw: () => Promise<ResponseType<ClusterDetail[]>>;
|
package/dist/Pages/index.d.ts
CHANGED
@@ -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,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
|
-
|
10
|
-
onClick: (
|
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<
|
17
|
-
primaryButtonConfig:
|
18
|
-
secondaryButtonConfig:
|
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:
|
20
|
+
primaryButtonConfig: Pick<ButtonProps, 'isLoading'> & CommonButtonProps<isConfig, isCustomVariant>;
|
21
21
|
secondaryButtonConfig?: never;
|
22
22
|
} | {
|
23
23
|
primaryButtonConfig?: never;
|
24
|
-
secondaryButtonConfig?:
|
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<
|
39
|
+
buttonConfig: ButtonConfig<isConfig, false>;
|
40
40
|
} | {
|
41
41
|
variant: ConfirmationModalVariantType.custom;
|
42
42
|
Icon: FunctionComponent<SVGProps<SVGSVGElement>>;
|
43
|
-
buttonConfig: ButtonConfig<
|
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
|
-
}
|
51
|
+
} : {});
|
51
52
|
export type ConfirmationModalBodyProps = Omit<ConfirmationModalProps, 'showConfirmationModal'>;
|
52
53
|
export {};
|
@@ -1,7 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
|
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
|
+
}
|
@@ -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.";
|
package/dist/Shared/types.d.ts
CHANGED
@@ -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
|
}
|