@devtron-labs/devtron-fe-common-lib 1.3.5 → 1.3.7
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-BDxmatp-.js → @code-editor-C3MBFLv8.js} +6582 -6320
- package/dist/{@common-rjsf-B6zYxyaW.js → @common-rjsf-CliHDEO9.js} +63 -63
- package/dist/{@framer-motion-DHzxZlAx.js → @framer-motion-CFzS2_A_.js} +1 -1
- package/dist/{@react-dates-BZU5RIqe.js → @react-dates-C-VeMZT9.js} +1 -1
- package/dist/{@react-select-Dx53b3Wk.js → @react-select-S88iwOBa.js} +1 -1
- package/dist/{@vendor-BG3OpQCq.js → @vendor-RA_nL1Ml.js} +135 -133
- package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +1 -1
- package/dist/Common/BreadCrumb/Types.d.ts +4 -0
- package/dist/Common/CustomTagSelector/ValidationRules.d.ts +2 -4
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
- package/dist/Common/Types.d.ts +29 -8
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +2 -2
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +2 -2
- package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.d.ts +3 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +21 -9
- package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +3 -5
- package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +212 -88
- package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +6 -16
- package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
- package/dist/Shared/Components/Button/types.d.ts +6 -0
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
- package/dist/Shared/Helpers.d.ts +11 -0
- package/dist/Shared/constants.d.ts +2 -0
- package/dist/Shared/validations.d.ts +5 -0
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-spray-can.44e87582.svg +3 -0
- package/dist/index.js +684 -657
- package/package.json +5 -5
@@ -1,10 +1,12 @@
|
|
1
|
-
import { UseBreadcrumbProps } from '
|
2
|
-
import { BuildInfraFormFieldType, BuildInfraMetaConfigTypes, ProfileInputErrorType, BuildInfraProfileBase, HandleProfileInputChangeType } from './types';
|
1
|
+
import { UseBreadcrumbProps } from '@Common/BreadCrumb/Types';
|
2
|
+
import { BuildInfraConfigTypes, BuildInfraFormFieldType, BuildInfraLocators, BuildInfraMetaConfigTypes, ProfileInputErrorType, BuildInfraProfileBase, 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;
|
6
6
|
readonly DECIMAL_PLACES: 2;
|
7
|
+
readonly MAX_LABEL_VALUE_LENGTH: 63;
|
7
8
|
};
|
9
|
+
export declare const DEFAULT_PROFILE_NAME = "global";
|
8
10
|
export declare const BUILD_INFRA_TEXT: {
|
9
11
|
readonly HEADING: "Build Infra Configuration";
|
10
12
|
readonly EDIT_SUBMIT: "Save changes";
|
@@ -15,7 +17,7 @@ export declare const BUILD_INFRA_TEXT: {
|
|
15
17
|
readonly DESCRIPTION_PLACEHOLDER: "Enter a description here";
|
16
18
|
readonly PROFILE_LABEL: "Profile name";
|
17
19
|
readonly PROFILE_PLACEHOLDER: "Enter a name eg. java/node/small/medium/large";
|
18
|
-
readonly INHERITING_HEADING_DESCRIPTION: "Inheriting from
|
20
|
+
readonly INHERITING_HEADING_DESCRIPTION: "Inheriting from global";
|
19
21
|
readonly SUBMIT_BUTTON_TIPPY: {
|
20
22
|
readonly INVALID_INPUT: "Valid input is required for all mandatory fields.";
|
21
23
|
readonly REQUEST_IN_PROGRESS: "Request in progress.";
|
@@ -35,16 +37,26 @@ export declare const BUILD_INFRA_TEXT: {
|
|
35
37
|
readonly INVALID_FORM_MESSAGE: "Valid input is required for all mandatory fields.";
|
36
38
|
};
|
37
39
|
export declare const BUILD_INFRA_BREADCRUMB: UseBreadcrumbProps;
|
38
|
-
export declare const
|
40
|
+
export declare const BUILD_INFRA_LOCATOR_MARKER_MAP: Readonly<Record<BuildInfraLocators, BuildInfraFormFieldType['marker']>>;
|
41
|
+
export declare const BUILD_INFRA_LOCATOR_LABEL_MAP: Readonly<Record<BuildInfraLocators, string>>;
|
42
|
+
export declare const BUILD_INFRA_FORM_FIELDS: Readonly<BuildInfraFormFieldType[]>;
|
43
|
+
export declare const NUMERIC_BUILD_INFRA_FORM_FIELD_CONFIGURATION_MAP: Readonly<Record<BuildInfraLocators, BuildInfraFormFieldType>>;
|
39
44
|
export declare const PROFILE_INPUT_ERROR_FIELDS: ProfileInputErrorType;
|
40
45
|
export declare const CREATE_MODE_REQUIRED_INPUT_FIELDS: BuildInfraMetaConfigTypes[];
|
41
|
-
export declare const DEFAULT_PROFILE_NAME: "default";
|
42
46
|
export declare const CREATE_PROFILE_BASE_VALUE: BuildInfraProfileBase;
|
43
|
-
export declare const CREATE_VIEW_CHECKED_CONFIGS: {
|
44
|
-
readonly cpu_request: true;
|
45
|
-
readonly cpu_limit: true;
|
46
|
-
};
|
47
47
|
export declare const BUILD_INFRA_TEST_IDS: {
|
48
48
|
readonly SUBMIT_BUTTON: "build-infra-submit-button";
|
49
49
|
readonly CANCEL_BUTTON: "build-infra-cancel-button";
|
50
50
|
};
|
51
|
+
export declare const BUILD_INFRA_DEFAULT_PLATFORM_NAME = "runner";
|
52
|
+
export declare const BUILD_INFRA_LATEST_API_VERSION: BuildInfraAPIVersionType;
|
53
|
+
export declare const TARGET_PLATFORM_ERROR_FIELDS_MAP: Record<TargetPlatformErrorFields, true>;
|
54
|
+
export declare const BUILD_INFRA_INHERIT_ACTIONS: Record<`activate_${BuildInfraLocators}` | `de_activate_${BuildInfraLocators}`, BuildInfraLocators>;
|
55
|
+
export declare const BUILD_INFRA_LOCATOR_CONFIG_TYPES_MAP: Record<BuildInfraLocators, BuildInfraConfigTypes[]>;
|
56
|
+
export declare const ACTION_TO_PERSISTED_VALUE_MAP: Readonly<Record<RequestLimitConfigType, {
|
57
|
+
keyToPersist: keyof Pick<ValidateRequestLimitType, 'limit' | 'request'>;
|
58
|
+
keyToPersistConfigType: RequestLimitConfigType;
|
59
|
+
}>>;
|
60
|
+
export declare const DEFAULT_TOLERANCE_EFFECT = BuildInfraToleranceEffectType.NO_SCHEDULE;
|
61
|
+
export declare const DEFAULT_TOLERANCE_OPERATOR = BuildInfraToleranceOperatorType.EQUALS;
|
62
|
+
export declare const INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X: Partial<Record<BuildInfraConfigTypes, true>>;
|
@@ -1,6 +1,10 @@
|
|
1
1
|
export { default as BuildInfraDescriptor } from './Descriptor';
|
2
2
|
export { default as BuildInfraFooter } from './Footer';
|
3
3
|
export { default as BuildInfraConfigForm } from './BuildInfraConfigForm';
|
4
|
+
export { default as BuildInfraProfileNameField } from './BuildInfraProfileNameField';
|
5
|
+
export { default as BuildInfraProfileDescriptionField } from './BuildInfraDescriptionField';
|
6
|
+
export { default as BuildInfraFormAction } from './BuildInfraFormAction';
|
7
|
+
export { default as useBuildInfraForm } from './UseBuildInfraForm';
|
4
8
|
export * from './services';
|
5
9
|
export * from './utils';
|
6
10
|
export * from './types';
|
@@ -1,6 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { BuildInfraProfileResponseType, BuildInfraProfileTransformerType, CreateBuildInfraProfileType, GetBuildInfraProfileType, UpdateBuildInfraProfileType } from './types';
|
3
|
-
export declare const getTransformedBuildInfraProfileResponse: ({ configurationUnits, defaultConfigurations, profile, fromCreateView, }: BuildInfraProfileTransformerType) => BuildInfraProfileResponseType;
|
1
|
+
import { BuildInfraProfileResponseType, CreateBuildInfraProfileType, GetBuildInfraProfileType, UpdateBuildInfraProfileType } from './types';
|
4
2
|
export declare const getBuildInfraProfileByName: ({ name, fromCreateView, }: GetBuildInfraProfileType) => Promise<BuildInfraProfileResponseType>;
|
5
|
-
export declare const updateBuildInfraProfile: ({ name, profileInput }: UpdateBuildInfraProfileType) => Promise<ResponseType<
|
6
|
-
export declare const createBuildInfraProfile: ({ profileInput }: CreateBuildInfraProfileType) => Promise<ResponseType<
|
3
|
+
export declare const updateBuildInfraProfile: ({ name, profileInput }: UpdateBuildInfraProfileType) => Promise<import('../../../Common').ResponseType<Promise<import('../../../Common').ResponseType<unknown>>>>;
|
4
|
+
export declare const createBuildInfraProfile: ({ profileInput }: CreateBuildInfraProfileType) => Promise<import('../../../Common').ResponseType<Promise<import('../../../Common').ResponseType<unknown>>>>;
|
@@ -1,17 +1,20 @@
|
|
1
1
|
import { FormEvent, FunctionComponent, ReactNode } from 'react';
|
2
|
+
import { BUILD_INFRA_INHERIT_ACTIONS, useBuildInfraForm } from '../../index';
|
2
3
|
import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
|
3
4
|
import { ValidationResponseType } from '../../../Shared';
|
4
5
|
import { ServerErrors } from '../../../Common';
|
5
6
|
/**
|
6
7
|
* Unique actions that will be dispatched and,
|
7
|
-
* Keeping
|
8
|
+
* Keeping values (cpu_limit, etc) in sync with backend
|
8
9
|
*/
|
9
10
|
export declare enum BuildInfraConfigTypes {
|
10
11
|
CPU_LIMIT = "cpu_limit",
|
11
12
|
CPU_REQUEST = "cpu_request",
|
12
13
|
MEMORY_LIMIT = "memory_limit",
|
13
14
|
MEMORY_REQUEST = "memory_request",
|
14
|
-
BUILD_TIMEOUT = "timeout"
|
15
|
+
BUILD_TIMEOUT = "timeout",
|
16
|
+
NODE_SELECTOR = "node_selector",
|
17
|
+
TOLERANCE = "tolerations"
|
15
18
|
}
|
16
19
|
/**
|
17
20
|
* Combination of BuildInfraConfigTypes and BuildInfraMetaConfigTypes is going to derive error state and actions(actions will also be derived with BuildInfraInheritActions)
|
@@ -26,25 +29,13 @@ export declare enum BuildInfraMetaConfigTypes {
|
|
26
29
|
export declare enum BuildInfraLocators {
|
27
30
|
CPU = "cpu",
|
28
31
|
MEMORY = "memory",
|
29
|
-
BUILD_TIMEOUT = "timeout"
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
ACTIVATE_MEMORY = "activate_memory",
|
35
|
-
DE_ACTIVATE_MEMORY = "de_activate_memory",
|
36
|
-
ACTIVATE_BUILD_TIMEOUT = "activate_timeout",
|
37
|
-
DE_ACTIVATE_BUILD_TIMEOUT = "de_activate_timeout"
|
38
|
-
}
|
39
|
-
export declare const BuildInfraConfigActionMap: {
|
40
|
-
timeout: BuildInfraLocators;
|
41
|
-
cpu_limit: BuildInfraLocators;
|
42
|
-
cpu_request: BuildInfraLocators;
|
43
|
-
memory_limit: BuildInfraLocators;
|
44
|
-
memory_request: BuildInfraLocators;
|
45
|
-
};
|
32
|
+
BUILD_TIMEOUT = "timeout",
|
33
|
+
NODE_SELECTOR = "node selector",
|
34
|
+
TOLERANCE = "tolerance"
|
35
|
+
}
|
36
|
+
export type BuildInfraInheritActions = keyof typeof BUILD_INFRA_INHERIT_ACTIONS;
|
46
37
|
export declare enum BuildInfraProfileVariants {
|
47
|
-
|
38
|
+
GLOBAL = "GLOBAL",
|
48
39
|
NORMAL = "NORMAL",
|
49
40
|
CUSTOM = "CUSTOM"
|
50
41
|
}
|
@@ -60,16 +51,18 @@ export interface BuildInfraDescriptorProps {
|
|
60
51
|
children?: ReactNode;
|
61
52
|
tippyInfoText?: string;
|
62
53
|
tippyAdditionalContent?: ReactNode;
|
54
|
+
tooltipNode?: ReactNode;
|
63
55
|
}
|
56
|
+
export type NumericBuildInfraConfigTypes = Extract<BuildInfraConfigTypes, BuildInfraConfigTypes.BUILD_TIMEOUT | BuildInfraConfigTypes.CPU_LIMIT | BuildInfraConfigTypes.CPU_REQUEST | BuildInfraConfigTypes.MEMORY_LIMIT | BuildInfraConfigTypes.MEMORY_REQUEST>;
|
64
57
|
export interface BuildInfraActionType {
|
65
58
|
/**
|
66
59
|
* Type of action to be dispatched, would be suffixed with type of change
|
67
60
|
*/
|
68
|
-
actionType:
|
61
|
+
actionType: NumericBuildInfraConfigTypes;
|
69
62
|
/**
|
70
63
|
* Label to be shown above input
|
71
64
|
*/
|
72
|
-
label
|
65
|
+
label?: string;
|
73
66
|
/**
|
74
67
|
* Placeholder for input, can be optional
|
75
68
|
*/
|
@@ -103,42 +96,94 @@ export interface ConfigurationUnitType {
|
|
103
96
|
export type ConfigurationUnitMapType = {
|
104
97
|
[key: ConfigurationUnitType['name']]: ConfigurationUnitType;
|
105
98
|
};
|
106
|
-
export type BuildInfraUnitsMapType =
|
107
|
-
|
108
|
-
|
109
|
-
export interface BuildInfraConfigValuesType {
|
99
|
+
export type BuildInfraUnitsMapType = Record<NumericBuildInfraConfigTypes, ConfigurationUnitMapType>;
|
100
|
+
export interface BuildInfraNodeSelectorValueType {
|
101
|
+
key: string;
|
110
102
|
value: string;
|
111
|
-
|
103
|
+
/**
|
104
|
+
* Generated at UI, if consuming in service please ensure to add this in response
|
105
|
+
*/
|
106
|
+
id: string;
|
107
|
+
}
|
108
|
+
export declare enum BuildInfraToleranceOperatorType {
|
109
|
+
EXISTS = "Exists",
|
110
|
+
EQUALS = "Equal"
|
112
111
|
}
|
112
|
+
export declare enum BuildInfraToleranceEffectType {
|
113
|
+
NO_EXECUTE = "NoExecute",
|
114
|
+
NO_SCHEDULE = "NoSchedule",
|
115
|
+
PREFER_NO_SCHEDULE = "PreferNoSchedule"
|
116
|
+
}
|
117
|
+
export type BuildInfraToleranceValueType = {
|
118
|
+
key: string;
|
119
|
+
effect: BuildInfraToleranceEffectType;
|
120
|
+
/**
|
121
|
+
* Generated at UI
|
122
|
+
*/
|
123
|
+
id: string;
|
124
|
+
} & ({
|
125
|
+
operator: BuildInfraToleranceOperatorType.EQUALS;
|
126
|
+
value: string;
|
127
|
+
} | {
|
128
|
+
operator: BuildInfraToleranceOperatorType.EXISTS;
|
129
|
+
value?: never;
|
130
|
+
});
|
131
|
+
export type BuildInfraConfigValuesType = {
|
132
|
+
key: NumericBuildInfraConfigTypes;
|
133
|
+
value: number;
|
134
|
+
unit: ConfigurationUnitType['name'];
|
135
|
+
} | {
|
136
|
+
key: BuildInfraConfigTypes.NODE_SELECTOR;
|
137
|
+
value: BuildInfraNodeSelectorValueType[];
|
138
|
+
unit?: never;
|
139
|
+
} | {
|
140
|
+
key: BuildInfraConfigTypes.TOLERANCE;
|
141
|
+
value: BuildInfraToleranceValueType[];
|
142
|
+
unit?: never;
|
143
|
+
};
|
113
144
|
interface BuildInfraProfileConfigBase {
|
114
145
|
id?: number;
|
115
|
-
|
116
|
-
|
146
|
+
/**
|
147
|
+
* This key holds value when we are inheriting values from other profiles in case of listing
|
148
|
+
*/
|
149
|
+
profileName?: string;
|
117
150
|
active: boolean;
|
151
|
+
targetPlatform: string;
|
118
152
|
}
|
119
|
-
export
|
120
|
-
|
121
|
-
|
153
|
+
export type BuildInfraConfigInfoType = BuildInfraConfigValuesType & BuildInfraProfileConfigBase;
|
154
|
+
export type BuildInfraConfigurationDTO = BuildInfraConfigValuesType & Omit<BuildInfraProfileConfigBase, 'targetPlatform'>;
|
155
|
+
/**
|
156
|
+
* Maps target platform to its configuration values
|
157
|
+
*/
|
158
|
+
export type BuildInfraPlatformConfigurationMapDTO = Record<string, BuildInfraConfigurationDTO[]>;
|
159
|
+
export type BuildInfraConfigurationType = BuildInfraConfigInfoType & {
|
160
|
+
/**
|
161
|
+
* Used to display values in case of inheriting data
|
162
|
+
*/
|
122
163
|
defaultValue: BuildInfraConfigValuesType;
|
123
|
-
}
|
124
|
-
export type BuildInfraConfigurationMapWithoutDefaultType = {
|
125
|
-
[key in BuildInfraConfigTypes]: BuildInfraConfigValuesType & BuildInfraProfileConfigBase;
|
126
164
|
};
|
127
|
-
export type
|
128
|
-
[key in BuildInfraConfigTypes]
|
165
|
+
export type BuildInfraConfigurationMapTypeWithoutDefaultFallback = {
|
166
|
+
[key in BuildInfraConfigTypes]?: BuildInfraConfigInfoType;
|
129
167
|
};
|
130
|
-
export
|
168
|
+
export type BuildInfraConfigurationMapType = Record<BuildInfraConfigTypes, BuildInfraConfigurationType>;
|
169
|
+
interface BuildInfraProfileBaseDTO {
|
131
170
|
id?: number;
|
132
|
-
name
|
171
|
+
name?: string;
|
133
172
|
description: string;
|
134
173
|
type: BuildInfraProfileVariants;
|
135
|
-
appCount
|
174
|
+
appCount?: number;
|
175
|
+
active?: boolean;
|
136
176
|
}
|
137
|
-
export interface
|
138
|
-
|
177
|
+
export interface BuildInfraProfileBase extends BuildInfraProfileBaseDTO {
|
178
|
+
}
|
179
|
+
export interface BuildInfraProfileInfoDTO extends BuildInfraProfileBaseDTO {
|
180
|
+
configurations: BuildInfraPlatformConfigurationMapDTO;
|
139
181
|
}
|
140
182
|
export interface BuildInfraProfileData extends BuildInfraProfileBase {
|
141
|
-
|
183
|
+
/**
|
184
|
+
* Maps platformName to its configuration values
|
185
|
+
*/
|
186
|
+
configurations: Record<string, BuildInfraConfigurationMapType>;
|
142
187
|
}
|
143
188
|
export interface GetBuildInfraProfileType {
|
144
189
|
name: string;
|
@@ -147,6 +192,10 @@ export interface GetBuildInfraProfileType {
|
|
147
192
|
export interface BuildInfraProfileResponseType {
|
148
193
|
configurationUnits: BuildInfraUnitsMapType | null;
|
149
194
|
profile: BuildInfraProfileData | null;
|
195
|
+
/**
|
196
|
+
* To be used in case user is creating configuration for new platform
|
197
|
+
*/
|
198
|
+
fallbackPlatformConfigurationMap: BuildInfraProfileData['configurations'];
|
150
199
|
}
|
151
200
|
export interface UseBuildInfraFormProps {
|
152
201
|
/**
|
@@ -162,17 +211,86 @@ export interface UseBuildInfraFormProps {
|
|
162
211
|
*/
|
163
212
|
handleSuccessRedirection?: () => void;
|
164
213
|
}
|
165
|
-
export
|
166
|
-
|
167
|
-
}
|
168
|
-
export
|
169
|
-
|
170
|
-
|
214
|
+
export declare enum BuildInfraProfileAdditionalErrorKeysType {
|
215
|
+
TARGET_PLATFORM = "target_platform"
|
216
|
+
}
|
217
|
+
export declare enum NodeSelectorHeaderType {
|
218
|
+
KEY = "KEY",
|
219
|
+
VALUE = "VALUE"
|
171
220
|
}
|
172
|
-
export
|
173
|
-
|
174
|
-
|
221
|
+
export declare enum ToleranceHeaderType {
|
222
|
+
KEY = "KEY",
|
223
|
+
OPERATOR = "OPERATOR",
|
224
|
+
VALUE = "VALUE",
|
225
|
+
EFFECT = "EFFECT"
|
175
226
|
}
|
227
|
+
/**
|
228
|
+
* Would be maintaining error state for name and description irrespective of platform
|
229
|
+
* For error states related to platform, we would not be letting user to switch platform if there are errors
|
230
|
+
*/
|
231
|
+
export type ProfileInputErrorType = Record<NumericBuildInfraConfigTypes | BuildInfraMetaConfigTypes | BuildInfraProfileAdditionalErrorKeysType.TARGET_PLATFORM, string> & Record<BuildInfraConfigTypes.NODE_SELECTOR, Record<BuildInfraNodeSelectorValueType['id'], Partial<Record<NodeSelectorHeaderType, string[]>>>> & Record<BuildInfraConfigTypes.TOLERANCE, Record<BuildInfraNodeSelectorValueType['id'], Partial<Record<ToleranceHeaderType, string[]>>>>;
|
232
|
+
export type TargetPlatformErrorFields = BuildInfraConfigTypes | BuildInfraProfileAdditionalErrorKeysType;
|
233
|
+
export interface ProfileInputDispatchDataType {
|
234
|
+
targetPlatform: string;
|
235
|
+
}
|
236
|
+
interface NumericBuildInfraConfigPayloadType {
|
237
|
+
value: number;
|
238
|
+
unit: string;
|
239
|
+
}
|
240
|
+
export declare enum BuildInfraProfileInputActionType {
|
241
|
+
ADD_TARGET_PLATFORM = "add_target_platform",
|
242
|
+
REMOVE_TARGET_PLATFORM = "remove_target_platform",
|
243
|
+
RENAME_TARGET_PLATFORM = "rename_target_platform",
|
244
|
+
RESTORE_PROFILE_CONFIG_SNAPSHOT = "restore_profile_config_snapshot",
|
245
|
+
DELETE_NODE_SELECTOR_ITEM = "delete_node_selector_item",
|
246
|
+
ADD_NODE_SELECTOR_ITEM = "add_node_selector_item",
|
247
|
+
EDIT_NODE_SELECTOR_ITEM = "edit_node_selector_item",
|
248
|
+
DELETE_TOLERANCE_ITEM = "delete_tolerance_item",
|
249
|
+
ADD_TOLERANCE_ITEM = "add_tolerance_item",
|
250
|
+
EDIT_TOLERANCE_ITEM = "edit_tolerance_item"
|
251
|
+
}
|
252
|
+
export type HandleProfileInputChangeType = {
|
253
|
+
action: NumericBuildInfraConfigTypes;
|
254
|
+
data: ProfileInputDispatchDataType & NumericBuildInfraConfigPayloadType;
|
255
|
+
} | {
|
256
|
+
action: BuildInfraMetaConfigTypes;
|
257
|
+
data: {
|
258
|
+
value: string;
|
259
|
+
};
|
260
|
+
} | {
|
261
|
+
action: BuildInfraInheritActions | BuildInfraProfileInputActionType.ADD_TARGET_PLATFORM | BuildInfraProfileInputActionType.REMOVE_TARGET_PLATFORM;
|
262
|
+
data: ProfileInputDispatchDataType;
|
263
|
+
} | {
|
264
|
+
action: BuildInfraProfileInputActionType.RENAME_TARGET_PLATFORM;
|
265
|
+
data: {
|
266
|
+
originalPlatformName: string;
|
267
|
+
newPlatformName: string;
|
268
|
+
configSnapshot: BuildInfraProfileData['configurations'];
|
269
|
+
};
|
270
|
+
} | {
|
271
|
+
action: BuildInfraProfileInputActionType.RESTORE_PROFILE_CONFIG_SNAPSHOT;
|
272
|
+
data: {
|
273
|
+
configSnapshot: BuildInfraProfileData['configurations'];
|
274
|
+
};
|
275
|
+
} | {
|
276
|
+
action: BuildInfraProfileInputActionType.DELETE_NODE_SELECTOR_ITEM;
|
277
|
+
data: ProfileInputDispatchDataType & Pick<BuildInfraNodeSelectorValueType, 'id'>;
|
278
|
+
} | {
|
279
|
+
action: BuildInfraProfileInputActionType.ADD_NODE_SELECTOR_ITEM;
|
280
|
+
data: ProfileInputDispatchDataType;
|
281
|
+
} | {
|
282
|
+
action: BuildInfraProfileInputActionType.EDIT_NODE_SELECTOR_ITEM;
|
283
|
+
data: ProfileInputDispatchDataType & Pick<BuildInfraNodeSelectorValueType, 'id' | 'key' | 'value'>;
|
284
|
+
} | {
|
285
|
+
action: BuildInfraProfileInputActionType.DELETE_TOLERANCE_ITEM;
|
286
|
+
data: ProfileInputDispatchDataType & Pick<BuildInfraToleranceValueType, 'id'>;
|
287
|
+
} | {
|
288
|
+
action: BuildInfraProfileInputActionType.ADD_TOLERANCE_ITEM;
|
289
|
+
data: ProfileInputDispatchDataType;
|
290
|
+
} | {
|
291
|
+
action: BuildInfraProfileInputActionType.EDIT_TOLERANCE_ITEM;
|
292
|
+
data: ProfileInputDispatchDataType & Pick<BuildInfraToleranceValueType, 'id' | 'key' | 'value' | 'effect' | 'operator'>;
|
293
|
+
};
|
176
294
|
export interface UseBuildInfraFormResponseType {
|
177
295
|
isLoading: boolean;
|
178
296
|
profileResponse: BuildInfraProfileResponseType | null;
|
@@ -184,7 +302,12 @@ export interface UseBuildInfraFormResponseType {
|
|
184
302
|
loadingActionRequest: boolean;
|
185
303
|
handleSubmit: (e: FormEvent<HTMLFormElement>) => Promise<void>;
|
186
304
|
}
|
187
|
-
export interface
|
305
|
+
export interface BuildInfraConfigFormProps extends Pick<UseBuildInfraFormResponseType, 'profileInput' | 'profileInputErrors' | 'handleProfileInputChange'> {
|
306
|
+
isGlobalProfile?: boolean;
|
307
|
+
unitsMap?: BuildInfraProfileResponseType['configurationUnits'];
|
308
|
+
configurationContainerLabel?: ReactNode;
|
309
|
+
}
|
310
|
+
export interface BuildInfraFormItemProps extends Pick<BuildInfraFormFieldType, 'marker' | 'heading'>, Partial<Pick<BuildInfraProfileConfigBase, 'targetPlatform'>>, Pick<BuildInfraConfigFormProps, 'isGlobalProfile'> {
|
188
311
|
children?: ReactNode;
|
189
312
|
/**
|
190
313
|
* If true, means profile is inheriting values from other profile (e.g, default)
|
@@ -199,29 +322,31 @@ export interface BuildInfraFormItemProps extends Pick<BuildInfraFormFieldType, '
|
|
199
322
|
*/
|
200
323
|
handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
|
201
324
|
locator: BuildInfraFormFieldType['locator'];
|
202
|
-
isDefaultProfile: boolean;
|
203
325
|
}
|
204
326
|
export interface ValidateRequestLimitType {
|
205
|
-
request:
|
206
|
-
limit:
|
327
|
+
request: NumericBuildInfraConfigPayloadType;
|
328
|
+
limit: NumericBuildInfraConfigPayloadType;
|
207
329
|
unitsMap: ConfigurationUnitMapType;
|
208
330
|
}
|
209
331
|
export interface ValidateRequestLimitResponseType {
|
210
332
|
request: ValidationResponseType;
|
211
333
|
limit: ValidationResponseType;
|
212
334
|
}
|
213
|
-
export interface
|
214
|
-
isDefaultProfile?: boolean;
|
215
|
-
unitsMap?: BuildInfraProfileResponseType['configurationUnits'];
|
216
|
-
configurationContainerLabel?: ReactNode;
|
217
|
-
}
|
218
|
-
export interface BuildInfraFormActionProps extends BuildInfraActionType {
|
335
|
+
export interface BuildInfraFormActionProps extends BuildInfraActionType, Pick<BuildInfraFormItemProps, 'targetPlatform'> {
|
219
336
|
handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
|
220
|
-
currentValue:
|
337
|
+
currentValue: number;
|
221
338
|
error?: string;
|
222
339
|
isRequired?: boolean;
|
223
340
|
profileUnitsMap?: ConfigurationUnitMapType;
|
224
341
|
currentUnitName?: BuildInfraConfigValuesType['unit'];
|
342
|
+
/**
|
343
|
+
* @default false
|
344
|
+
*/
|
345
|
+
isDisabled?: boolean;
|
346
|
+
/**
|
347
|
+
* @default false
|
348
|
+
*/
|
349
|
+
autoFocus?: boolean;
|
225
350
|
}
|
226
351
|
export interface FooterProps {
|
227
352
|
/**
|
@@ -240,47 +365,46 @@ export interface UpdateBuildInfraProfileType extends Pick<UseBuildInfraFormRespo
|
|
240
365
|
}
|
241
366
|
export interface CreateBuildInfraProfileType extends Pick<UseBuildInfraFormResponseType, 'profileInput'> {
|
242
367
|
}
|
243
|
-
export interface CreateBuildInfraServiceConfigurationType {
|
244
|
-
key: BuildInfraConfigTypes;
|
245
|
-
value: string | number;
|
246
|
-
active: boolean;
|
247
|
-
unit?: string;
|
248
|
-
/**
|
249
|
-
* Would send for those that are available in profileInput
|
250
|
-
*/
|
251
|
-
id?: number;
|
252
|
-
}
|
253
|
-
export interface CreateBuildInfraServicePayloadType {
|
254
|
-
name: string;
|
255
|
-
description: string;
|
256
|
-
type: BuildInfraProfileVariants;
|
257
|
-
configurations: CreateBuildInfraServiceConfigurationType[];
|
258
|
-
}
|
259
368
|
export interface BuildInfraInputFieldComponentProps {
|
260
369
|
handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
|
261
370
|
currentValue: BuildInfraConfigValuesType['value'];
|
262
371
|
error?: string;
|
263
372
|
}
|
264
|
-
export interface
|
373
|
+
export interface BuildInfraProfileMetaFieldProps extends Pick<BuildInfraInputFieldComponentProps, 'error' | 'handleProfileInputChange'> {
|
374
|
+
currentValue: string;
|
375
|
+
}
|
376
|
+
export interface InheritingHeaderProps extends Pick<BuildInfraConfigFormProps, 'isGlobalProfile'> {
|
265
377
|
defaultHeading: BuildInfraFormFieldType['heading'];
|
266
378
|
inheritingData: BuildInfraConfigValuesType[];
|
267
379
|
isInheriting: boolean;
|
268
|
-
isDefaultProfile: boolean;
|
269
380
|
}
|
270
381
|
export interface BuildInfraConfigResponseDataType {
|
271
382
|
name: BuildInfraConfigTypes;
|
272
383
|
units: ConfigurationUnitType[];
|
273
384
|
}
|
274
|
-
interface
|
275
|
-
defaultConfigurations:
|
385
|
+
interface BaseBuildInfraProfileDTO {
|
386
|
+
defaultConfigurations: BuildInfraPlatformConfigurationMapDTO;
|
276
387
|
configurationUnits: BuildInfraUnitsMapType;
|
277
388
|
}
|
278
|
-
export interface BuildInfraListResponseType extends
|
279
|
-
profiles:
|
389
|
+
export interface BuildInfraListResponseType extends BaseBuildInfraProfileDTO {
|
390
|
+
profiles: BuildInfraProfileInfoDTO[];
|
391
|
+
}
|
392
|
+
export interface BuildInfraProfileDTO extends BaseBuildInfraProfileDTO {
|
393
|
+
profile: BuildInfraProfileInfoDTO;
|
394
|
+
}
|
395
|
+
export interface BuildInfraProfileTransformerParamsType extends BuildInfraProfileDTO, Pick<GetBuildInfraProfileType, 'fromCreateView'> {
|
396
|
+
}
|
397
|
+
export interface GetPlatformConfigurationsWithDefaultValuesParamsType {
|
398
|
+
profileConfigurationsMap: BuildInfraConfigurationMapTypeWithoutDefaultFallback;
|
399
|
+
defaultConfigurationsMap: BuildInfraConfigurationMapTypeWithoutDefaultFallback;
|
400
|
+
platformName: string;
|
280
401
|
}
|
281
|
-
export
|
282
|
-
|
402
|
+
export declare enum BuildInfraAPIVersionType {
|
403
|
+
ALPHA1 = "alpha1"
|
283
404
|
}
|
284
|
-
export
|
405
|
+
export type RequestLimitConfigType = Extract<BuildInfraConfigTypes, BuildInfraConfigTypes.CPU_LIMIT | BuildInfraConfigTypes.CPU_REQUEST | BuildInfraConfigTypes.MEMORY_LIMIT | BuildInfraConfigTypes.MEMORY_REQUEST>;
|
406
|
+
export interface ValidateNodeSelectorParamsType extends Pick<ReturnType<typeof useBuildInfraForm>, 'profileInputErrors'> {
|
407
|
+
selector: BuildInfraNodeSelectorValueType;
|
408
|
+
existingKeys: string[];
|
285
409
|
}
|
286
410
|
export {};
|
@@ -1,16 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
export declare const
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
|
6
|
-
|
7
|
-
control: (base: any, state: any) => any;
|
8
|
-
option: (base: any, state: any) => any;
|
9
|
-
dropdownIndicator: (base: any, state: any) => any;
|
10
|
-
valueContainer: (base: any) => any;
|
11
|
-
loadingMessage: (base: any) => any;
|
12
|
-
noOptionsMessage: (base: any) => any;
|
13
|
-
placeholder: (base: any) => any;
|
14
|
-
group: (base: any) => any;
|
15
|
-
groupHeading: (base: any) => any;
|
16
|
-
};
|
1
|
+
import { BuildInfraConfigValuesType, BuildInfraInheritActions, BuildInfraLocators, BuildInfraProfileInfoDTO, BuildInfraProfileResponseType, BuildInfraProfileTransformerParamsType, CreateBuildInfraProfileType } from './types';
|
2
|
+
export declare const parsePlatformConfigIntoValue: (configuration: BuildInfraConfigValuesType, addUniqueId?: boolean) => BuildInfraConfigValuesType;
|
3
|
+
export declare const getTransformedBuildInfraProfileResponse: ({ configurationUnits, defaultConfigurations, profile, fromCreateView, }: BuildInfraProfileTransformerParamsType) => BuildInfraProfileResponseType;
|
4
|
+
export declare const getBuildInfraProfilePayload: (profileInput: CreateBuildInfraProfileType["profileInput"]) => BuildInfraProfileInfoDTO;
|
5
|
+
export declare const getBuildInfraProfileEndpoint: () => string;
|
6
|
+
export declare const getBuildInfraInheritActionFromLocator: (locator: BuildInfraLocators, activateLocator: boolean) => BuildInfraInheritActions;
|
@@ -63,5 +63,5 @@ import { ButtonProps } from './types';
|
|
63
63
|
* <Button icon={<ICCube />} ariaLabel="Label" />
|
64
64
|
* ```
|
65
65
|
*/
|
66
|
-
declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, showAriaLabelInTippy, fullWidth, ...props }: ButtonProps) => JSX.Element;
|
66
|
+
declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, showAriaLabelInTippy, fullWidth, isOpacityHoverChild, ...props }: ButtonProps) => JSX.Element;
|
67
67
|
export default Button;
|
@@ -80,6 +80,12 @@ export type ButtonProps = ({
|
|
80
80
|
* @default false
|
81
81
|
*/
|
82
82
|
fullWidth?: boolean;
|
83
|
+
/**
|
84
|
+
* If true, the opacity is turned as 1 on hover of class with dc__opacity-hover--parent
|
85
|
+
*
|
86
|
+
* @default false
|
87
|
+
*/
|
88
|
+
isOpacityHoverChild?: boolean;
|
83
89
|
} & ({
|
84
90
|
/**
|
85
91
|
* If true, the tooltip is shown for the button
|
@@ -2,7 +2,7 @@ import { ApiResponseResultType, SeveritiesDTO, GetResourceScanDetailsResponseTyp
|
|
2
2
|
import { SEVERITIES } from './constants';
|
3
3
|
export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => {
|
4
4
|
color: "#B1B7BC" | "#B21212" | "#F33E3E" | "#FF7E5B" | "#FFB549" | "#1DAD70";
|
5
|
-
label: "
|
5
|
+
label: "Critical" | "High" | "Medium" | "Low" | "Unknown" | "Failures" | "Successes" | "Exceptions";
|
6
6
|
value: number;
|
7
7
|
}[];
|
8
8
|
export declare const stringifySeverities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => string;
|
package/dist/Shared/Helpers.d.ts
CHANGED
@@ -2,6 +2,7 @@ import { ReactElement } from 'react';
|
|
2
2
|
import { Pair } from 'yaml';
|
3
3
|
import { StrictRJSFSchema } from '@rjsf/utils';
|
4
4
|
import { MaterialHistoryType } from '@Shared/Services/app.types';
|
5
|
+
import { PromptProps } from 'react-router-dom';
|
5
6
|
import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
|
6
7
|
import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
|
7
8
|
import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
|
@@ -80,4 +81,14 @@ export declare const getLowerCaseObject: (input: any) => Record<string, any>;
|
|
80
81
|
* @returns - Formatted webhook date if available, otherwise an empty string
|
81
82
|
*/
|
82
83
|
export declare const getWebhookDate: (materialSourceType: string, history: MaterialHistoryType) => string;
|
84
|
+
export declare const getUniqueId: (size?: number) => string;
|
85
|
+
/**
|
86
|
+
* Checks if the provided pathname matches the current path.
|
87
|
+
* If the paths do not match, returns a custom message or a default unsaved changes prompt.
|
88
|
+
*
|
89
|
+
* @param currentPathName - The current path to compare against.
|
90
|
+
* @param customMessage - Optional custom message to display when the path does not match.
|
91
|
+
* @returns A function that takes an object with a `pathname` property and performs the path match check.
|
92
|
+
*/
|
93
|
+
export declare const checkIfPathIsMatching: (currentPathName: string, customMessage?: string) => PromptProps["message"];
|
83
94
|
export {};
|
@@ -418,3 +418,5 @@ export declare const OPEN_NEW_TICKET = "https://enterprise.devtron.ai/portal/en/
|
|
418
418
|
export declare const VIEW_ALL_TICKETS = "https://enterprise.devtron.ai/portal/en/myarea";
|
419
419
|
export declare const RAISE_ISSUE = "https://github.com/devtron-labs/devtron/issues/new/choose";
|
420
420
|
export declare const DEVTRON_BASE_MAIN_ID = "devtron-base-main-identifier";
|
421
|
+
export declare const SKIP_LABEL_KEY_VALIDATION_PREFIX = "devtron.ai/";
|
422
|
+
export declare const UNSAVED_CHANGES_PROMPT_MESSAGE = "You have unsaved changes. Are you sure you want to leave?";
|
@@ -17,6 +17,11 @@ export declare const MESSAGES: {
|
|
17
17
|
INVALID_DATE: string;
|
18
18
|
DATE_BEFORE_CURRENT_TIME: string;
|
19
19
|
};
|
20
|
+
export declare const validateLabelValue: (value: string) => string[];
|
21
|
+
export declare const validateLabelKey: (key: string, skipValidationIfSpecialPrefix?: boolean) => {
|
22
|
+
isValid: boolean;
|
23
|
+
messages: string[];
|
24
|
+
};
|
20
25
|
export declare const requiredField: (value: string) => ValidationResponseType;
|
21
26
|
export declare const validateName: (name: string) => ValidationResponseType;
|
22
27
|
export declare const validateDescription: (description: string) => ValidationResponseType;
|