@devtron-labs/devtron-fe-common-lib 1.3.2-beta-2 → 1.3.2-beta-3
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-dMe3D53I.js → @code-editor-PAKCpAq2.js} +6538 -6788
- package/dist/{@common-rjsf-BK4XR0h9.js → @common-rjsf-CMOebaxG.js} +2 -2
- package/dist/{@framer-motion-CFzS2_A_.js → @framer-motion-DHzxZlAx.js} +1 -1
- package/dist/{@react-dates-C-VeMZT9.js → @react-dates-BZU5RIqe.js} +1 -1
- package/dist/{@react-select-S88iwOBa.js → @react-select-Dx53b3Wk.js} +1 -1
- package/dist/{@vendor-RA_nL1Ml.js → @vendor-BG3OpQCq.js} +133 -135
- package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +1 -1
- package/dist/Common/BreadCrumb/Types.d.ts +0 -4
- package/dist/Common/CIPipeline.Types.d.ts +9 -0
- package/dist/Common/CustomTagSelector/ValidationRules.d.ts +4 -2
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
- package/dist/Common/Types.d.ts +8 -29
- 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/constants.d.ts +9 -21
- package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +5 -3
- package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +88 -212
- package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +16 -6
- package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
- package/dist/Shared/Components/Button/types.d.ts +0 -6
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
- package/dist/Shared/Helpers.d.ts +0 -11
- package/dist/Shared/constants.d.ts +0 -2
- package/dist/Shared/validations.d.ts +0 -5
- package/dist/assets/@code-editor.css +1 -1
- package/dist/index.js +654 -680
- package/package.json +5 -5
- package/dist/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.d.ts +0 -3
- package/dist/assets/ic-spray-can.44e87582.svg +0 -3
package/dist/Common/Types.d.ts
CHANGED
@@ -150,39 +150,18 @@ export declare enum ImageType {
|
|
150
150
|
Medium = "medium",
|
151
151
|
SMALL = "small"
|
152
152
|
}
|
153
|
-
interface
|
154
|
-
|
155
|
-
* If given would be shown above the description, in bold
|
156
|
-
*/
|
157
|
-
heading?: string;
|
158
|
-
/**
|
159
|
-
* If given would be shown below the heading (if given)
|
160
|
-
*/
|
161
|
-
description: string;
|
162
|
-
}
|
163
|
-
type InfoColourBarMessageProp = {
|
164
|
-
message: ReactNode;
|
165
|
-
linkText?: ReactNode;
|
166
|
-
redirectLink?: string;
|
167
|
-
linkOnClick?: () => void;
|
168
|
-
linkClass?: string;
|
169
|
-
internalLink?: boolean;
|
170
|
-
textConfig?: never;
|
171
|
-
} | {
|
172
|
-
textConfig: InfoColourBarTextConfigType;
|
173
|
-
message?: never;
|
174
|
-
linkText?: never;
|
175
|
-
redirectLink?: never;
|
176
|
-
linkOnClick?: () => never;
|
177
|
-
linkClass?: never;
|
178
|
-
internalLink?: never;
|
179
|
-
};
|
180
|
-
export type InfoColourBarType = InfoColourBarMessageProp & {
|
153
|
+
export interface InfoColourBarType {
|
154
|
+
message: React.ReactNode;
|
181
155
|
classname: string;
|
182
156
|
Icon: any;
|
183
157
|
iconClass?: string;
|
184
158
|
iconSize?: number;
|
185
159
|
renderActionButton?: () => JSX.Element;
|
160
|
+
linkText?: React.ReactNode;
|
161
|
+
redirectLink?: string;
|
162
|
+
linkOnClick?: () => void;
|
163
|
+
linkClass?: string;
|
164
|
+
internalLink?: boolean;
|
186
165
|
styles?: CSSProperties;
|
187
166
|
/**
|
188
167
|
* If true, the icon is not shown
|
@@ -190,7 +169,7 @@ export type InfoColourBarType = InfoColourBarMessageProp & {
|
|
190
169
|
* @default false
|
191
170
|
*/
|
192
171
|
hideIcon?: boolean;
|
193
|
-
}
|
172
|
+
}
|
194
173
|
export interface ReloadType {
|
195
174
|
reload?: (event?: any) => void;
|
196
175
|
className?: string;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { FunctionComponent } from 'react';
|
2
|
-
import {
|
3
|
-
declare const BuildInfraProfileDescriptionField: FunctionComponent<
|
2
|
+
import { BuildInfraInputFieldComponentProps } from './types';
|
3
|
+
declare const BuildInfraProfileDescriptionField: FunctionComponent<BuildInfraInputFieldComponentProps>;
|
4
4
|
export default BuildInfraProfileDescriptionField;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { FunctionComponent } from 'react';
|
2
|
-
import {
|
3
|
-
declare const BuildInfraProfileNameField: FunctionComponent<
|
2
|
+
import { BuildInfraInputFieldComponentProps } from './types';
|
3
|
+
declare const BuildInfraProfileNameField: FunctionComponent<BuildInfraInputFieldComponentProps>;
|
4
4
|
export default BuildInfraProfileNameField;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { BuildInfraDescriptorProps } from './types';
|
2
|
-
declare const Descriptor: ({ additionalContainerClasses, breadCrumbs, children, tippyInfoText, tippyAdditionalContent,
|
2
|
+
declare const Descriptor: ({ additionalContainerClasses, breadCrumbs, children, tippyInfoText, tippyAdditionalContent, }: BuildInfraDescriptorProps) => JSX.Element;
|
3
3
|
export default Descriptor;
|
@@ -1,12 +1,10 @@
|
|
1
|
-
import { UseBreadcrumbProps } from '
|
2
|
-
import {
|
1
|
+
import { UseBreadcrumbProps } from '../../../Common/BreadCrumb/Types';
|
2
|
+
import { BuildInfraFormFieldType, BuildInfraMetaConfigTypes, ProfileInputErrorType, BuildInfraProfileBase, HandleProfileInputChangeType } 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;
|
8
7
|
};
|
9
|
-
export declare const DEFAULT_PROFILE_NAME = "global";
|
10
8
|
export declare const BUILD_INFRA_TEXT: {
|
11
9
|
readonly HEADING: "Build Infra Configuration";
|
12
10
|
readonly EDIT_SUBMIT: "Save changes";
|
@@ -17,7 +15,7 @@ export declare const BUILD_INFRA_TEXT: {
|
|
17
15
|
readonly DESCRIPTION_PLACEHOLDER: "Enter a description here";
|
18
16
|
readonly PROFILE_LABEL: "Profile name";
|
19
17
|
readonly PROFILE_PLACEHOLDER: "Enter a name eg. java/node/small/medium/large";
|
20
|
-
readonly INHERITING_HEADING_DESCRIPTION: "Inheriting from
|
18
|
+
readonly INHERITING_HEADING_DESCRIPTION: "Inheriting from default";
|
21
19
|
readonly SUBMIT_BUTTON_TIPPY: {
|
22
20
|
readonly INVALID_INPUT: "Valid input is required for all mandatory fields.";
|
23
21
|
readonly REQUEST_IN_PROGRESS: "Request in progress.";
|
@@ -37,26 +35,16 @@ export declare const BUILD_INFRA_TEXT: {
|
|
37
35
|
readonly INVALID_FORM_MESSAGE: "Valid input is required for all mandatory fields.";
|
38
36
|
};
|
39
37
|
export declare const BUILD_INFRA_BREADCRUMB: UseBreadcrumbProps;
|
40
|
-
export declare const
|
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>>;
|
38
|
+
export declare const BUILD_INFRA_FORM_FIELDS: BuildInfraFormFieldType[];
|
44
39
|
export declare const PROFILE_INPUT_ERROR_FIELDS: ProfileInputErrorType;
|
45
40
|
export declare const CREATE_MODE_REQUIRED_INPUT_FIELDS: BuildInfraMetaConfigTypes[];
|
41
|
+
export declare const DEFAULT_PROFILE_NAME: "default";
|
46
42
|
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,10 +1,6 @@
|
|
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';
|
8
4
|
export * from './services';
|
9
5
|
export * from './utils';
|
10
6
|
export * from './types';
|
@@ -1,4 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { ResponseType } from '../../../Common';
|
2
|
+
import { BuildInfraProfileResponseType, BuildInfraProfileTransformerType, CreateBuildInfraProfileType, GetBuildInfraProfileType, UpdateBuildInfraProfileType } from './types';
|
3
|
+
export declare const getTransformedBuildInfraProfileResponse: ({ configurationUnits, defaultConfigurations, profile, fromCreateView, }: BuildInfraProfileTransformerType) => BuildInfraProfileResponseType;
|
2
4
|
export declare const getBuildInfraProfileByName: ({ name, fromCreateView, }: GetBuildInfraProfileType) => Promise<BuildInfraProfileResponseType>;
|
3
|
-
export declare const updateBuildInfraProfile: ({ name, profileInput }: UpdateBuildInfraProfileType) => Promise<
|
4
|
-
export declare const createBuildInfraProfile: ({ profileInput }: CreateBuildInfraProfileType) => Promise<
|
5
|
+
export declare const updateBuildInfraProfile: ({ name, profileInput }: UpdateBuildInfraProfileType) => Promise<ResponseType<any>>;
|
6
|
+
export declare const createBuildInfraProfile: ({ profileInput }: CreateBuildInfraProfileType) => Promise<ResponseType<any>>;
|
@@ -1,20 +1,17 @@
|
|
1
1
|
import { FormEvent, FunctionComponent, ReactNode } from 'react';
|
2
|
-
import { BUILD_INFRA_INHERIT_ACTIONS, useBuildInfraForm } from '../../index';
|
3
2
|
import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
|
4
3
|
import { ValidationResponseType } from '../../../Shared';
|
5
4
|
import { ServerErrors } from '../../../Common';
|
6
5
|
/**
|
7
6
|
* Unique actions that will be dispatched and,
|
8
|
-
* Keeping values (cpu_limit, etc) in sync with backend
|
7
|
+
* Keeping some values (cpu_limit, etc) in sync with backend
|
9
8
|
*/
|
10
9
|
export declare enum BuildInfraConfigTypes {
|
11
10
|
CPU_LIMIT = "cpu_limit",
|
12
11
|
CPU_REQUEST = "cpu_request",
|
13
12
|
MEMORY_LIMIT = "memory_limit",
|
14
13
|
MEMORY_REQUEST = "memory_request",
|
15
|
-
BUILD_TIMEOUT = "timeout"
|
16
|
-
NODE_SELECTOR = "node_selector",
|
17
|
-
TOLERANCE = "tolerations"
|
14
|
+
BUILD_TIMEOUT = "timeout"
|
18
15
|
}
|
19
16
|
/**
|
20
17
|
* Combination of BuildInfraConfigTypes and BuildInfraMetaConfigTypes is going to derive error state and actions(actions will also be derived with BuildInfraInheritActions)
|
@@ -29,13 +26,25 @@ export declare enum BuildInfraMetaConfigTypes {
|
|
29
26
|
export declare enum BuildInfraLocators {
|
30
27
|
CPU = "cpu",
|
31
28
|
MEMORY = "memory",
|
32
|
-
BUILD_TIMEOUT = "timeout"
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
29
|
+
BUILD_TIMEOUT = "timeout"
|
30
|
+
}
|
31
|
+
export declare enum BuildInfraInheritActions {
|
32
|
+
ACTIVATE_CPU = "activate_cpu",
|
33
|
+
DE_ACTIVATE_CPU = "de_activate_cpu",
|
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
|
+
};
|
37
46
|
export declare enum BuildInfraProfileVariants {
|
38
|
-
|
47
|
+
DEFAULT = "DEFAULT",
|
39
48
|
NORMAL = "NORMAL",
|
40
49
|
CUSTOM = "CUSTOM"
|
41
50
|
}
|
@@ -51,18 +60,16 @@ export interface BuildInfraDescriptorProps {
|
|
51
60
|
children?: ReactNode;
|
52
61
|
tippyInfoText?: string;
|
53
62
|
tippyAdditionalContent?: ReactNode;
|
54
|
-
tooltipNode?: ReactNode;
|
55
63
|
}
|
56
|
-
export type NumericBuildInfraConfigTypes = Extract<BuildInfraConfigTypes, BuildInfraConfigTypes.BUILD_TIMEOUT | BuildInfraConfigTypes.CPU_LIMIT | BuildInfraConfigTypes.CPU_REQUEST | BuildInfraConfigTypes.MEMORY_LIMIT | BuildInfraConfigTypes.MEMORY_REQUEST>;
|
57
64
|
export interface BuildInfraActionType {
|
58
65
|
/**
|
59
66
|
* Type of action to be dispatched, would be suffixed with type of change
|
60
67
|
*/
|
61
|
-
actionType:
|
68
|
+
actionType: BuildInfraConfigTypes;
|
62
69
|
/**
|
63
70
|
* Label to be shown above input
|
64
71
|
*/
|
65
|
-
label
|
72
|
+
label: string;
|
66
73
|
/**
|
67
74
|
* Placeholder for input, can be optional
|
68
75
|
*/
|
@@ -96,94 +103,42 @@ export interface ConfigurationUnitType {
|
|
96
103
|
export type ConfigurationUnitMapType = {
|
97
104
|
[key: ConfigurationUnitType['name']]: ConfigurationUnitType;
|
98
105
|
};
|
99
|
-
export type BuildInfraUnitsMapType =
|
100
|
-
|
101
|
-
|
106
|
+
export type BuildInfraUnitsMapType = {
|
107
|
+
[key in BuildInfraConfigTypes]: ConfigurationUnitMapType;
|
108
|
+
};
|
109
|
+
export interface BuildInfraConfigValuesType {
|
102
110
|
value: string;
|
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"
|
111
|
+
unit?: ConfigurationUnitType['name'];
|
111
112
|
}
|
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
|
-
};
|
144
113
|
interface BuildInfraProfileConfigBase {
|
145
114
|
id?: number;
|
146
|
-
|
147
|
-
|
148
|
-
*/
|
149
|
-
profileName?: string;
|
115
|
+
key: BuildInfraConfigTypes;
|
116
|
+
profileName: string;
|
150
117
|
active: boolean;
|
151
|
-
targetPlatform: string;
|
152
118
|
}
|
153
|
-
export
|
154
|
-
|
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
|
-
*/
|
119
|
+
export interface BuildInfraProfileConfigResponseDataType extends BuildInfraConfigValuesType, BuildInfraProfileConfigBase {
|
120
|
+
}
|
121
|
+
export interface BuildInfraConfigurationType extends BuildInfraConfigValuesType, BuildInfraProfileConfigBase {
|
163
122
|
defaultValue: BuildInfraConfigValuesType;
|
123
|
+
}
|
124
|
+
export type BuildInfraConfigurationMapWithoutDefaultType = {
|
125
|
+
[key in BuildInfraConfigTypes]: BuildInfraConfigValuesType & BuildInfraProfileConfigBase;
|
164
126
|
};
|
165
|
-
export type
|
166
|
-
[key in BuildInfraConfigTypes]
|
127
|
+
export type BuildInfraConfigurationMapType = {
|
128
|
+
[key in BuildInfraConfigTypes]: BuildInfraConfigurationType;
|
167
129
|
};
|
168
|
-
export
|
169
|
-
interface BuildInfraProfileBaseDTO {
|
130
|
+
export interface BuildInfraProfileBase {
|
170
131
|
id?: number;
|
171
|
-
name
|
132
|
+
name: string;
|
172
133
|
description: string;
|
173
134
|
type: BuildInfraProfileVariants;
|
174
|
-
appCount
|
175
|
-
active?: boolean;
|
135
|
+
appCount: number;
|
176
136
|
}
|
177
|
-
export interface
|
178
|
-
|
179
|
-
export interface BuildInfraProfileInfoDTO extends BuildInfraProfileBaseDTO {
|
180
|
-
configurations: BuildInfraPlatformConfigurationMapDTO;
|
137
|
+
export interface BuildInfraProfileResponseDataType extends BuildInfraProfileBase {
|
138
|
+
configurations: BuildInfraProfileConfigResponseDataType[];
|
181
139
|
}
|
182
140
|
export interface BuildInfraProfileData extends BuildInfraProfileBase {
|
183
|
-
|
184
|
-
* Maps platformName to its configuration values
|
185
|
-
*/
|
186
|
-
configurations: Record<string, BuildInfraConfigurationMapType>;
|
141
|
+
configurations: BuildInfraConfigurationMapType;
|
187
142
|
}
|
188
143
|
export interface GetBuildInfraProfileType {
|
189
144
|
name: string;
|
@@ -192,10 +147,6 @@ export interface GetBuildInfraProfileType {
|
|
192
147
|
export interface BuildInfraProfileResponseType {
|
193
148
|
configurationUnits: BuildInfraUnitsMapType | null;
|
194
149
|
profile: BuildInfraProfileData | null;
|
195
|
-
/**
|
196
|
-
* To be used in case user is creating configuration for new platform
|
197
|
-
*/
|
198
|
-
fallbackPlatformConfigurationMap: BuildInfraProfileData['configurations'];
|
199
150
|
}
|
200
151
|
export interface UseBuildInfraFormProps {
|
201
152
|
/**
|
@@ -211,86 +162,17 @@ export interface UseBuildInfraFormProps {
|
|
211
162
|
*/
|
212
163
|
handleSuccessRedirection?: () => void;
|
213
164
|
}
|
214
|
-
export
|
215
|
-
|
216
|
-
}
|
217
|
-
export
|
218
|
-
|
219
|
-
|
165
|
+
export type ProfileInputErrorType = {
|
166
|
+
[key in BuildInfraConfigTypes | BuildInfraMetaConfigTypes]: string;
|
167
|
+
};
|
168
|
+
export interface ProfileInputDispatchDataType {
|
169
|
+
value: string;
|
170
|
+
unit?: string;
|
220
171
|
}
|
221
|
-
export
|
222
|
-
|
223
|
-
|
224
|
-
VALUE = "VALUE",
|
225
|
-
EFFECT = "EFFECT"
|
172
|
+
export interface HandleProfileInputChangeType {
|
173
|
+
action: BuildInfraConfigTypes | BuildInfraInheritActions | BuildInfraMetaConfigTypes;
|
174
|
+
data?: ProfileInputDispatchDataType;
|
226
175
|
}
|
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
|
-
};
|
294
176
|
export interface UseBuildInfraFormResponseType {
|
295
177
|
isLoading: boolean;
|
296
178
|
profileResponse: BuildInfraProfileResponseType | null;
|
@@ -302,12 +184,7 @@ export interface UseBuildInfraFormResponseType {
|
|
302
184
|
loadingActionRequest: boolean;
|
303
185
|
handleSubmit: (e: FormEvent<HTMLFormElement>) => Promise<void>;
|
304
186
|
}
|
305
|
-
export interface
|
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'> {
|
187
|
+
export interface BuildInfraFormItemProps extends Pick<BuildInfraFormFieldType, 'marker' | 'heading'> {
|
311
188
|
children?: ReactNode;
|
312
189
|
/**
|
313
190
|
* If true, means profile is inheriting values from other profile (e.g, default)
|
@@ -322,31 +199,29 @@ export interface BuildInfraFormItemProps extends Pick<BuildInfraFormFieldType, '
|
|
322
199
|
*/
|
323
200
|
handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
|
324
201
|
locator: BuildInfraFormFieldType['locator'];
|
202
|
+
isDefaultProfile: boolean;
|
325
203
|
}
|
326
204
|
export interface ValidateRequestLimitType {
|
327
|
-
request:
|
328
|
-
limit:
|
205
|
+
request: BuildInfraConfigValuesType;
|
206
|
+
limit: BuildInfraConfigValuesType;
|
329
207
|
unitsMap: ConfigurationUnitMapType;
|
330
208
|
}
|
331
209
|
export interface ValidateRequestLimitResponseType {
|
332
210
|
request: ValidationResponseType;
|
333
211
|
limit: ValidationResponseType;
|
334
212
|
}
|
335
|
-
export interface
|
213
|
+
export interface BuildInfraConfigFormProps extends Pick<UseBuildInfraFormResponseType, 'profileInput' | 'profileInputErrors' | 'handleProfileInputChange'> {
|
214
|
+
isDefaultProfile?: boolean;
|
215
|
+
unitsMap?: BuildInfraProfileResponseType['configurationUnits'];
|
216
|
+
configurationContainerLabel?: ReactNode;
|
217
|
+
}
|
218
|
+
export interface BuildInfraFormActionProps extends BuildInfraActionType {
|
336
219
|
handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
|
337
|
-
currentValue:
|
220
|
+
currentValue: BuildInfraConfigValuesType['value'];
|
338
221
|
error?: string;
|
339
222
|
isRequired?: boolean;
|
340
223
|
profileUnitsMap?: ConfigurationUnitMapType;
|
341
224
|
currentUnitName?: BuildInfraConfigValuesType['unit'];
|
342
|
-
/**
|
343
|
-
* @default false
|
344
|
-
*/
|
345
|
-
isDisabled?: boolean;
|
346
|
-
/**
|
347
|
-
* @default false
|
348
|
-
*/
|
349
|
-
autoFocus?: boolean;
|
350
225
|
}
|
351
226
|
export interface FooterProps {
|
352
227
|
/**
|
@@ -365,46 +240,47 @@ export interface UpdateBuildInfraProfileType extends Pick<UseBuildInfraFormRespo
|
|
365
240
|
}
|
366
241
|
export interface CreateBuildInfraProfileType extends Pick<UseBuildInfraFormResponseType, 'profileInput'> {
|
367
242
|
}
|
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
|
+
}
|
368
259
|
export interface BuildInfraInputFieldComponentProps {
|
369
260
|
handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
|
370
261
|
currentValue: BuildInfraConfigValuesType['value'];
|
371
262
|
error?: string;
|
372
263
|
}
|
373
|
-
export interface
|
374
|
-
currentValue: string;
|
375
|
-
}
|
376
|
-
export interface InheritingHeaderProps extends Pick<BuildInfraConfigFormProps, 'isGlobalProfile'> {
|
264
|
+
export interface InheritingHeaderProps {
|
377
265
|
defaultHeading: BuildInfraFormFieldType['heading'];
|
378
266
|
inheritingData: BuildInfraConfigValuesType[];
|
379
267
|
isInheriting: boolean;
|
268
|
+
isDefaultProfile: boolean;
|
380
269
|
}
|
381
270
|
export interface BuildInfraConfigResponseDataType {
|
382
271
|
name: BuildInfraConfigTypes;
|
383
272
|
units: ConfigurationUnitType[];
|
384
273
|
}
|
385
|
-
interface
|
386
|
-
defaultConfigurations:
|
274
|
+
interface BaseBuildInfraProfileResponseType {
|
275
|
+
defaultConfigurations: BuildInfraProfileConfigResponseDataType[];
|
387
276
|
configurationUnits: BuildInfraUnitsMapType;
|
388
277
|
}
|
389
|
-
export interface BuildInfraListResponseType extends
|
390
|
-
profiles:
|
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;
|
278
|
+
export interface BuildInfraListResponseType extends BaseBuildInfraProfileResponseType {
|
279
|
+
profiles: BuildInfraProfileResponseDataType[];
|
401
280
|
}
|
402
|
-
export
|
403
|
-
|
281
|
+
export interface BuildInfraProfileAPIResponseType extends BaseBuildInfraProfileResponseType {
|
282
|
+
profile: BuildInfraProfileResponseDataType;
|
404
283
|
}
|
405
|
-
export
|
406
|
-
export interface ValidateNodeSelectorParamsType extends Pick<ReturnType<typeof useBuildInfraForm>, 'profileInputErrors'> {
|
407
|
-
selector: BuildInfraNodeSelectorValueType;
|
408
|
-
existingKeys: string[];
|
284
|
+
export interface BuildInfraProfileTransformerType extends BuildInfraProfileAPIResponseType, Pick<GetBuildInfraProfileType, 'fromCreateView'> {
|
409
285
|
}
|
410
286
|
export {};
|
@@ -1,6 +1,16 @@
|
|
1
|
-
import {
|
2
|
-
export declare const
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
|
6
|
-
|
1
|
+
import { UseBuildInfraFormProps, UseBuildInfraFormResponseType, ValidateRequestLimitResponseType, ValidateRequestLimitType } from './types';
|
2
|
+
export declare const validateRequestLimit: ({ request, limit, unitsMap, }: ValidateRequestLimitType) => ValidateRequestLimitResponseType;
|
3
|
+
export declare const useBuildInfraForm: ({ name, editProfile, handleSuccessRedirection, }: UseBuildInfraFormProps) => UseBuildInfraFormResponseType;
|
4
|
+
export declare const unitSelectorStyles: () => {
|
5
|
+
container: (base: any, state: any) => any;
|
6
|
+
menuList: (base: any) => any;
|
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
|
+
};
|
@@ -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,
|
66
|
+
declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, showAriaLabelInTippy, fullWidth, ...props }: ButtonProps) => JSX.Element;
|
67
67
|
export default Button;
|
@@ -80,12 +80,6 @@ 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;
|
89
83
|
} & ({
|
90
84
|
/**
|
91
85
|
* 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: "Unknown" | "Critical" | "High" | "Medium" | "Low" | "Failures" | "Successes" | "Exceptions";
|
6
6
|
value: number;
|
7
7
|
}[];
|
8
8
|
export declare const stringifySeverities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => string;
|