@devtron-labs/devtron-fe-common-lib 1.3.0-beta-1 → 1.3.0-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{@code-editor-DthSJqWH.js → @code-editor-CyrbR7OU.js} +6381 -6479
  2. package/dist/{@common-rjsf-BERijs2B.js → @common-rjsf-7t0xRouC.js} +2 -2
  3. package/dist/{@framer-motion-CFzS2_A_.js → @framer-motion-DHzxZlAx.js} +1 -1
  4. package/dist/{@monaco-editor-CVagbUeH.js → @monaco-editor-DukJFc0i.js} +27951 -28153
  5. package/dist/{@react-dates-C-VeMZT9.js → @react-dates-BZU5RIqe.js} +1 -1
  6. package/dist/{@react-select-S88iwOBa.js → @react-select-Dx53b3Wk.js} +1 -1
  7. package/dist/{@vendor-RA_nL1Ml.js → @vendor-BG3OpQCq.js} +133 -135
  8. package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +1 -1
  9. package/dist/Common/BreadCrumb/Types.d.ts +0 -4
  10. package/dist/Common/CIPipeline.Types.d.ts +0 -5
  11. package/dist/Common/Constants.d.ts +1 -0
  12. package/dist/Common/CustomTagSelector/Types.d.ts +12 -14
  13. package/dist/Common/CustomTagSelector/ValidationRules.d.ts +4 -2
  14. package/dist/Common/CustomTagSelector/index.d.ts +1 -1
  15. package/dist/Common/CustomTagSelector/tags.utils.d.ts +13 -0
  16. package/dist/Common/Helper.d.ts +2 -1
  17. package/dist/Common/Types.d.ts +20 -4
  18. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +2 -2
  19. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +2 -2
  20. package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +1 -1
  21. package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +9 -20
  22. package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +0 -4
  23. package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +5 -3
  24. package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +88 -208
  25. package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +16 -6
  26. package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
  27. package/dist/Shared/Components/Button/types.d.ts +0 -6
  28. package/dist/Shared/Components/DynamicDataTable/types.d.ts +2 -0
  29. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
  30. package/dist/Shared/Components/SelectPicker/type.d.ts +1 -1
  31. package/dist/Shared/Components/TagsKeyValueTable/TagsContainer.d.ts +3 -0
  32. package/dist/Shared/Components/TagsKeyValueTable/constants.d.ts +4 -0
  33. package/dist/Shared/Components/TagsKeyValueTable/index.d.ts +4 -0
  34. package/dist/Shared/Components/TagsKeyValueTable/types.d.ts +12 -0
  35. package/dist/Shared/Components/TagsKeyValueTable/utils.d.ts +3 -0
  36. package/dist/Shared/Components/index.d.ts +1 -0
  37. package/dist/Shared/Helpers.d.ts +0 -11
  38. package/dist/Shared/constants.d.ts +0 -2
  39. package/dist/Shared/types.d.ts +19 -1
  40. package/dist/Shared/validations.d.ts +0 -5
  41. package/dist/assets/@code-editor.css +1 -1
  42. package/dist/index.js +652 -672
  43. package/package.json +5 -5
  44. package/dist/Common/CustomTagSelector/TagLabelSelect.d.ts +0 -2
  45. package/dist/Common/CustomTagSelector/TagSelector.utils.d.ts +0 -12
  46. package/dist/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.d.ts +0 -3
  47. package/dist/assets/ic-spray-can.44e87582.svg +0 -3
@@ -1,6 +1,6 @@
1
1
  import { default as React, SyntheticEvent } from 'react';
2
2
  import { JSONPathOptions } from 'jsonpath-plus';
3
- import { AsyncOptions, UseSearchString } from './Types';
3
+ import { AsyncOptions, DeploymentNodeType, UseSearchString } from './Types';
4
4
  import { scrollableInterface } from '../Shared';
5
5
  import * as Sentry from '@sentry/browser';
6
6
  export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
@@ -135,5 +135,6 @@ export declare const getSanitizedIframe: (iframeString: string) => string;
135
135
  * This method adds default attributes to iframe - title, loading ="lazy", width="100%", height="100%"
136
136
  */
137
137
  export declare const getIframeWithDefaultAttributes: (iframeString: string, defaultName?: string) => string;
138
+ export declare const getStageTitle: (stageType: DeploymentNodeType) => string;
138
139
  export declare const getGoLangFormattedDateWithTimezone: (dateFormat: string) => string;
139
140
  export {};
@@ -3,7 +3,7 @@ import { TippyProps } from '@tippyjs/react';
3
3
  import { Placement } from 'tippy.js';
4
4
  import { UserGroupDTO } from '../Pages/GlobalConfigurations';
5
5
  import { ImageComment, ReleaseTag } from './ImageTags.Types';
6
- import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity } from '../Shared';
6
+ import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity, PolicyBlockInfo } from '../Shared';
7
7
  import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, RefVariableType, SortingOrder, TaskErrorObj, VariableTypeFormat } from '.';
8
8
  /**
9
9
  * Generic response type object with support for overriding the result type
@@ -433,6 +433,10 @@ export interface CDMaterialType {
433
433
  * Would currently only be received in case of release
434
434
  */
435
435
  appWorkflowId: number;
436
+ /**
437
+ * Denotes trigger blocking due to mandatory tags, (might be used for plugins and other features in future)
438
+ */
439
+ deploymentBlockedState?: PolicyBlockInfo;
436
440
  }
437
441
  export declare enum CDMaterialServiceEnum {
438
442
  ROLLBACK = "rollback",
@@ -469,6 +473,15 @@ export interface DownstreamNodesEnvironmentsType {
469
473
  environmentId: number;
470
474
  environmentName: string;
471
475
  }
476
+ export declare enum TriggerBlockType {
477
+ MANDATORY_TAG = "mandatory-tags",
478
+ MANDATORY_PLUGIN = "mandatory-plugins",
479
+ SECURITY_SCAN = "security-scan"
480
+ }
481
+ export interface TriggerBlockedInfo {
482
+ blockedBy: TriggerBlockType;
483
+ blockedReason?: string;
484
+ }
472
485
  export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
473
486
  connectingCiPipelineId?: number;
474
487
  parents: string | number[] | string[];
@@ -531,6 +544,7 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
531
544
  downstreamEnvironments?: DownstreamNodesEnvironmentsType[];
532
545
  cipipelineId?: number;
533
546
  isDeploymentBlocked?: boolean;
547
+ triggerBlockedInfo?: TriggerBlockedInfo;
534
548
  }
535
549
  export declare enum DeploymentAppTypes {
536
550
  HELM = "helm",
@@ -593,6 +607,7 @@ export interface CDMaterialsMetaInfo {
593
607
  * This is the ID of user that has request the material
594
608
  */
595
609
  requestedUserId: number;
610
+ deploymentBlockedState?: PolicyBlockInfo;
596
611
  runtimeParams: RuntimePluginVariables[];
597
612
  }
598
613
  export interface ImagePromotionMaterialInfo {
@@ -671,7 +686,7 @@ export interface Strategy {
671
686
  config: any;
672
687
  default?: boolean;
673
688
  }
674
- export interface CDStage {
689
+ export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
675
690
  status: string;
676
691
  name: string;
677
692
  triggerType: 'AUTOMATIC' | 'MANUAL';
@@ -681,14 +696,14 @@ export interface CDStageConfigMapSecretNames {
681
696
  configMaps: any[];
682
697
  secrets: any[];
683
698
  }
684
- export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
699
+ export interface PrePostDeployStageType extends MandatoryPluginBaseStateType, Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
685
700
  isValid: boolean;
686
701
  steps: TaskErrorObj[];
687
702
  triggerType: string;
688
703
  name: string;
689
704
  status: string;
690
705
  }
691
- export interface CdPipeline {
706
+ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
692
707
  id: number;
693
708
  environmentId: number;
694
709
  environmentName?: string;
@@ -720,6 +735,7 @@ export interface CdPipeline {
720
735
  isProdEnv?: boolean;
721
736
  isGitOpsRepoNotConfigured?: boolean;
722
737
  isDeploymentBlocked?: boolean;
738
+ isTriggerBlocked?: boolean;
723
739
  }
724
740
  export interface ExternalCiConfig {
725
741
  id: number;
@@ -1,4 +1,4 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { BuildInfraProfileMetaFieldProps } from './types';
3
- declare const BuildInfraProfileDescriptionField: FunctionComponent<BuildInfraProfileMetaFieldProps>;
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 { BuildInfraProfileMetaFieldProps } from './types';
3
- declare const BuildInfraProfileNameField: FunctionComponent<BuildInfraProfileMetaFieldProps>;
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, tooltipNode, }: BuildInfraDescriptorProps) => JSX.Element;
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 '@Common/BreadCrumb/Types';
2
- import { BuildInfraConfigTypes, BuildInfraFormFieldType, BuildInfraLocators, BuildInfraMetaConfigTypes, ProfileInputErrorType, BuildInfraProfileBase, HandleProfileInputChangeType, BuildInfraAPIVersionType, TargetPlatformErrorFields, ValidateRequestLimitType, RequestLimitConfigType, BuildInfraToleranceEffectType, BuildInfraToleranceOperatorType } from './types';
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 global";
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,25 +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 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>>;
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 = "default";
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;
@@ -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 { BuildInfraProfileResponseType, CreateBuildInfraProfileType, GetBuildInfraProfileType, UpdateBuildInfraProfileType } from './types';
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<import('../../../Common').ResponseType<Promise<import('../../../Common').ResponseType<unknown>>>>;
4
- export declare const createBuildInfraProfile: ({ profileInput }: CreateBuildInfraProfileType) => Promise<import('../../../Common').ResponseType<Promise<import('../../../Common').ResponseType<unknown>>>>;
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 } 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
- NODE_SELECTOR = "node selector",
34
- TOLERANCE = "tolerance"
35
- }
36
- export type BuildInfraInheritActions = keyof typeof BUILD_INFRA_INHERIT_ACTIONS;
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
- GLOBAL = "GLOBAL",
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: NumericBuildInfraConfigTypes;
68
+ actionType: BuildInfraConfigTypes;
62
69
  /**
63
70
  * Label to be shown above input
64
71
  */
65
- label?: string;
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 = Record<NumericBuildInfraConfigTypes, ConfigurationUnitMapType>;
100
- export interface BuildInfraNodeSelectorValueType {
101
- key: string;
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
- * This key holds value when we are inheriting values from other profiles in case of listing
148
- */
149
- profileName?: string;
115
+ key: BuildInfraConfigTypes;
116
+ profileName: string;
150
117
  active: boolean;
151
- targetPlatform: string;
152
118
  }
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
- */
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 BuildInfraConfigurationMapTypeWithoutDefaultFallback = {
166
- [key in BuildInfraConfigTypes]?: BuildInfraConfigInfoType;
127
+ export type BuildInfraConfigurationMapType = {
128
+ [key in BuildInfraConfigTypes]: BuildInfraConfigurationType;
167
129
  };
168
- export type BuildInfraConfigurationMapType = Record<BuildInfraConfigTypes, BuildInfraConfigurationType>;
169
- interface BuildInfraProfileBaseDTO {
130
+ export interface BuildInfraProfileBase {
170
131
  id?: number;
171
- name?: string;
132
+ name: string;
172
133
  description: string;
173
134
  type: BuildInfraProfileVariants;
174
- appCount?: number;
175
- active?: boolean;
135
+ appCount: number;
176
136
  }
177
- export interface BuildInfraProfileBase extends BuildInfraProfileBaseDTO {
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 declare enum BuildInfraProfileAdditionalErrorKeysType {
215
- TARGET_PLATFORM = "target_platform"
216
- }
217
- export declare enum NodeSelectorHeaderType {
218
- KEY = "KEY",
219
- VALUE = "VALUE"
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 declare enum ToleranceHeaderType {
222
- KEY = "KEY",
223
- OPERATOR = "OPERATOR",
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 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'> {
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: NumericBuildInfraConfigPayloadType;
328
- limit: NumericBuildInfraConfigPayloadType;
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 BuildInfraFormActionProps extends BuildInfraActionType, Pick<BuildInfraFormItemProps, 'targetPlatform'> {
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: number;
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,42 +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 BuildInfraProfileMetaFieldProps extends Pick<BuildInfraInputFieldComponentProps, 'error' | 'handleProfileInputChange'> {
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 BaseBuildInfraProfileDTO {
386
- defaultConfigurations: BuildInfraPlatformConfigurationMapDTO;
274
+ interface BaseBuildInfraProfileResponseType {
275
+ defaultConfigurations: BuildInfraProfileConfigResponseDataType[];
387
276
  configurationUnits: BuildInfraUnitsMapType;
388
277
  }
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'> {
278
+ export interface BuildInfraListResponseType extends BaseBuildInfraProfileResponseType {
279
+ profiles: BuildInfraProfileResponseDataType[];
396
280
  }
397
- export interface GetPlatformConfigurationsWithDefaultValuesParamsType {
398
- profileConfigurationsMap: BuildInfraConfigurationMapTypeWithoutDefaultFallback;
399
- defaultConfigurationsMap: BuildInfraConfigurationMapTypeWithoutDefaultFallback;
400
- platformName: string;
281
+ export interface BuildInfraProfileAPIResponseType extends BaseBuildInfraProfileResponseType {
282
+ profile: BuildInfraProfileResponseDataType;
401
283
  }
402
- export declare enum BuildInfraAPIVersionType {
403
- ALPHA1 = "alpha1"
284
+ export interface BuildInfraProfileTransformerType extends BuildInfraProfileAPIResponseType, Pick<GetBuildInfraProfileType, 'fromCreateView'> {
404
285
  }
405
- export type RequestLimitConfigType = Extract<BuildInfraConfigTypes, BuildInfraConfigTypes.CPU_LIMIT | BuildInfraConfigTypes.CPU_REQUEST | BuildInfraConfigTypes.MEMORY_LIMIT | BuildInfraConfigTypes.MEMORY_REQUEST>;
406
286
  export {};
@@ -1,6 +1,16 @@
1
- import { BuildInfraConfigInfoType, BuildInfraConfigValuesType, BuildInfraInheritActions, BuildInfraLocators, BuildInfraProfileInfoDTO, BuildInfraProfileResponseType, BuildInfraProfileTransformerParamsType, CreateBuildInfraProfileType } from './types';
2
- export declare const parsePlatformConfigIntoValue: (configuration: BuildInfraConfigInfoType, 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;
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, isOpacityHoverChild, ...props }: ButtonProps) => JSX.Element;
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;