@devtron-labs/devtron-fe-common-lib 1.3.6 → 1.3.8-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/{@code-editor-BDuz5Vut.js → @code-editor-BTdeB8Tp.js} +7639 -7428
  2. package/dist/{@common-rjsf-Dw35m5zB.js → @common-rjsf-Cc6HRMyo.js} +2 -2
  3. package/dist/{@framer-motion-DHzxZlAx.js → @framer-motion-CFzS2_A_.js} +1 -1
  4. package/dist/{@react-dates-BZU5RIqe.js → @react-dates-C-VeMZT9.js} +1 -1
  5. package/dist/{@react-select-Dx53b3Wk.js → @react-select-S88iwOBa.js} +1 -1
  6. package/dist/{@vendor-BG3OpQCq.js → @vendor-RA_nL1Ml.js} +135 -133
  7. package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +1 -1
  8. package/dist/Common/BreadCrumb/Types.d.ts +4 -0
  9. package/dist/Common/Constants.d.ts +1 -1
  10. package/dist/Common/CustomTagSelector/ValidationRules.d.ts +2 -4
  11. package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
  12. package/dist/Common/Types.d.ts +29 -8
  13. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +2 -2
  14. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +2 -2
  15. package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +1 -1
  16. package/dist/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.d.ts +3 -0
  17. package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +21 -9
  18. package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +4 -0
  19. package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +3 -5
  20. package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +212 -88
  21. package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +6 -16
  22. package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
  23. package/dist/Shared/Components/Button/types.d.ts +6 -0
  24. package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
  25. package/dist/Shared/Components/ImageCardAccordion/types.d.ts +2 -3
  26. package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +2 -2
  27. package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +2 -2
  28. package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +2 -2
  29. package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +2 -2
  30. package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +2 -2
  31. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +2 -2
  32. package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +2 -2
  33. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +1 -1
  34. package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +5 -5
  35. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +4 -4
  36. package/dist/Shared/Components/Security/SecurityModal/service.d.ts +2 -2
  37. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +12 -19
  38. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +4 -5
  39. package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +1 -1
  40. package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +2 -4
  41. package/dist/Shared/Components/Security/Vulnerabilities/Vulnerabilities.d.ts +1 -1
  42. package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +1 -17
  43. package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +0 -5
  44. package/dist/Shared/Components/Security/utils.d.ts +6 -3
  45. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
  46. package/dist/Shared/Components/SelectPicker/common.d.ts +3 -1
  47. package/dist/Shared/Components/SelectPicker/type.d.ts +13 -1
  48. package/dist/Shared/Helpers.d.ts +11 -0
  49. package/dist/Shared/Providers/types.d.ts +1 -0
  50. package/dist/Shared/constants.d.ts +2 -0
  51. package/dist/Shared/types.d.ts +1 -3
  52. package/dist/Shared/validations.d.ts +5 -0
  53. package/dist/assets/@code-editor.css +1 -1
  54. package/dist/assets/ic-spray-can.44e87582.svg +3 -0
  55. package/dist/index.d.ts +0 -2
  56. package/dist/index.js +678 -656
  57. package/package.json +5 -5
@@ -150,18 +150,39 @@ export declare enum ImageType {
150
150
  Medium = "medium",
151
151
  SMALL = "small"
152
152
  }
153
- export interface InfoColourBarType {
154
- message: React.ReactNode;
153
+ interface InfoColourBarTextConfigType {
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 & {
155
181
  classname: string;
156
182
  Icon: any;
157
183
  iconClass?: string;
158
184
  iconSize?: number;
159
185
  renderActionButton?: () => JSX.Element;
160
- linkText?: React.ReactNode;
161
- redirectLink?: string;
162
- linkOnClick?: () => void;
163
- linkClass?: string;
164
- internalLink?: boolean;
165
186
  styles?: CSSProperties;
166
187
  /**
167
188
  * If true, the icon is not shown
@@ -169,7 +190,7 @@ export interface InfoColourBarType {
169
190
  * @default false
170
191
  */
171
192
  hideIcon?: boolean;
172
- }
193
+ };
173
194
  export interface ReloadType {
174
195
  reload?: (event?: any) => void;
175
196
  className?: string;
@@ -1,4 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { BuildInfraInputFieldComponentProps } from './types';
3
- declare const BuildInfraProfileDescriptionField: FunctionComponent<BuildInfraInputFieldComponentProps>;
2
+ import { BuildInfraProfileMetaFieldProps } from './types';
3
+ declare const BuildInfraProfileDescriptionField: FunctionComponent<BuildInfraProfileMetaFieldProps>;
4
4
  export default BuildInfraProfileDescriptionField;
@@ -1,4 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { BuildInfraInputFieldComponentProps } from './types';
3
- declare const BuildInfraProfileNameField: FunctionComponent<BuildInfraInputFieldComponentProps>;
2
+ import { BuildInfraProfileMetaFieldProps } from './types';
3
+ declare const BuildInfraProfileNameField: FunctionComponent<BuildInfraProfileMetaFieldProps>;
4
4
  export default BuildInfraProfileNameField;
@@ -1,3 +1,3 @@
1
1
  import { BuildInfraDescriptorProps } from './types';
2
- declare const Descriptor: ({ additionalContainerClasses, breadCrumbs, children, tippyInfoText, tippyAdditionalContent, }: BuildInfraDescriptorProps) => JSX.Element;
2
+ declare const Descriptor: ({ additionalContainerClasses, breadCrumbs, children, tippyInfoText, tippyAdditionalContent, tooltipNode, }: BuildInfraDescriptorProps) => JSX.Element;
3
3
  export default Descriptor;
@@ -0,0 +1,3 @@
1
+ import { UseBuildInfraFormProps, UseBuildInfraFormResponseType } from '../../index';
2
+ declare const useBuildInfraForm: ({ name, editProfile, handleSuccessRedirection, }: UseBuildInfraFormProps) => UseBuildInfraFormResponseType;
3
+ export default useBuildInfraForm;
@@ -1,10 +1,12 @@
1
- import { UseBreadcrumbProps } from '../../../Common/BreadCrumb/Types';
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 default";
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 BUILD_INFRA_FORM_FIELDS: BuildInfraFormFieldType[];
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 { ResponseType } from '../../../Common';
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<any>>;
6
- export declare const createBuildInfraProfile: ({ profileInput }: CreateBuildInfraProfileType) => Promise<ResponseType<any>>;
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 some values (cpu_limit, etc) in sync with backend
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
- 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
- };
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
- DEFAULT = "DEFAULT",
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: BuildInfraConfigTypes;
61
+ actionType: NumericBuildInfraConfigTypes;
69
62
  /**
70
63
  * Label to be shown above input
71
64
  */
72
- label: string;
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
- [key in BuildInfraConfigTypes]: ConfigurationUnitMapType;
108
- };
109
- export interface BuildInfraConfigValuesType {
99
+ export type BuildInfraUnitsMapType = Record<NumericBuildInfraConfigTypes, ConfigurationUnitMapType>;
100
+ export interface BuildInfraNodeSelectorValueType {
101
+ key: string;
110
102
  value: string;
111
- unit?: ConfigurationUnitType['name'];
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
- key: BuildInfraConfigTypes;
116
- profileName: string;
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 interface BuildInfraProfileConfigResponseDataType extends BuildInfraConfigValuesType, BuildInfraProfileConfigBase {
120
- }
121
- export interface BuildInfraConfigurationType extends BuildInfraConfigValuesType, BuildInfraProfileConfigBase {
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 BuildInfraConfigurationMapType = {
128
- [key in BuildInfraConfigTypes]: BuildInfraConfigurationType;
165
+ export type BuildInfraConfigurationMapTypeWithoutDefaultFallback = {
166
+ [key in BuildInfraConfigTypes]?: BuildInfraConfigInfoType;
129
167
  };
130
- export interface BuildInfraProfileBase {
168
+ export type BuildInfraConfigurationMapType = Record<BuildInfraConfigTypes, BuildInfraConfigurationType>;
169
+ interface BuildInfraProfileBaseDTO {
131
170
  id?: number;
132
- name: string;
171
+ name?: string;
133
172
  description: string;
134
173
  type: BuildInfraProfileVariants;
135
- appCount: number;
174
+ appCount?: number;
175
+ active?: boolean;
136
176
  }
137
- export interface BuildInfraProfileResponseDataType extends BuildInfraProfileBase {
138
- configurations: BuildInfraProfileConfigResponseDataType[];
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
- configurations: BuildInfraConfigurationMapType;
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 type ProfileInputErrorType = {
166
- [key in BuildInfraConfigTypes | BuildInfraMetaConfigTypes]: string;
167
- };
168
- export interface ProfileInputDispatchDataType {
169
- value: string;
170
- unit?: string;
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 interface HandleProfileInputChangeType {
173
- action: BuildInfraConfigTypes | BuildInfraInheritActions | BuildInfraMetaConfigTypes;
174
- data?: ProfileInputDispatchDataType;
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 BuildInfraFormItemProps extends Pick<BuildInfraFormFieldType, 'marker' | 'heading'> {
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: BuildInfraConfigValuesType;
206
- limit: BuildInfraConfigValuesType;
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 BuildInfraConfigFormProps extends Pick<UseBuildInfraFormResponseType, 'profileInput' | 'profileInputErrors' | 'handleProfileInputChange'> {
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: BuildInfraConfigValuesType['value'];
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 InheritingHeaderProps {
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 BaseBuildInfraProfileResponseType {
275
- defaultConfigurations: BuildInfraProfileConfigResponseDataType[];
385
+ interface BaseBuildInfraProfileDTO {
386
+ defaultConfigurations: BuildInfraPlatformConfigurationMapDTO;
276
387
  configurationUnits: BuildInfraUnitsMapType;
277
388
  }
278
- export interface BuildInfraListResponseType extends BaseBuildInfraProfileResponseType {
279
- profiles: BuildInfraProfileResponseDataType[];
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 interface BuildInfraProfileAPIResponseType extends BaseBuildInfraProfileResponseType {
282
- profile: BuildInfraProfileResponseDataType;
402
+ export declare enum BuildInfraAPIVersionType {
403
+ ALPHA1 = "alpha1"
283
404
  }
284
- export interface BuildInfraProfileTransformerType extends BuildInfraProfileAPIResponseType, Pick<GetBuildInfraProfileType, 'fromCreateView'> {
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 { 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
- };
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
@@ -1,3 +1,3 @@
1
1
  import { ImageCardAccordionProps } from './types';
2
- declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, SecurityModalSidebar, getSecurityScan, }: ImageCardAccordionProps) => JSX.Element;
2
+ declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, SecurityModalSidebar, }: ImageCardAccordionProps) => JSX.Element;
3
3
  export default ImageCardAccordion;