@devtron-labs/devtron-fe-common-lib 0.0.58-beta-6 → 0.0.58-beta-8

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 (83) hide show
  1. package/dist/Common/Constants.d.ts +1 -14
  2. package/dist/Common/Hooks/index.d.ts +0 -1
  3. package/dist/Common/Types.d.ts +3 -2
  4. package/dist/Common/index.d.ts +0 -1
  5. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.d.ts +4 -0
  6. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +4 -0
  7. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.d.ts +7 -0
  8. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.d.ts +4 -0
  9. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +4 -0
  10. package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +4 -0
  11. package/dist/Pages/GlobalConfigurations/BuildInfra/Footer.d.ts +4 -0
  12. package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +47 -0
  13. package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +7 -0
  14. package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +13 -0
  15. package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +281 -0
  16. package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +12 -0
  17. package/dist/Pages/GlobalConfigurations/index.d.ts +1 -0
  18. package/dist/Pages/index.d.ts +1 -0
  19. package/dist/Shared/Components/APIResponseHandler/APIResponseHandler.d.ts +4 -0
  20. package/dist/Shared/Components/APIResponseHandler/index.d.ts +2 -0
  21. package/dist/Shared/Components/APIResponseHandler/types.d.ts +37 -0
  22. package/dist/Shared/Components/ReactSelect/index.d.ts +1 -0
  23. package/dist/Shared/Components/ReactSelect/utils.d.ts +12 -0
  24. package/dist/Shared/Components/index.d.ts +2 -0
  25. package/dist/Shared/index.d.ts +2 -0
  26. package/dist/Shared/validations.d.ts +7 -0
  27. package/dist/index.d.ts +3 -1
  28. package/dist/index.js +1121 -339
  29. package/package.json +1 -1
  30. package/src/Assets/Icon/ic-cpu.svg +4 -0
  31. package/src/Assets/Icon/ic-memory.svg +3 -0
  32. package/src/Assets/Icon/ic-timer.svg +3 -0
  33. package/src/Common/BreadCrumb/Types.ts +0 -1
  34. package/src/Common/Checkbox.tsx +1 -0
  35. package/src/Common/Constants.ts +3 -18
  36. package/src/Common/CustomInput/CustomInput.tsx +2 -1
  37. package/src/Common/DraggableWrapper/DraggableWrapper.tsx +3 -1
  38. package/src/Common/Hooks/index.ts +0 -1
  39. package/src/Common/RJSF/utils.ts +3 -0
  40. package/src/Common/SearchBar/SearchBar.component.tsx +26 -13
  41. package/src/Common/SearchBar/searchBar.scss +1 -1
  42. package/src/Common/Types.ts +2 -1
  43. package/src/Common/index.ts +0 -1
  44. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx +121 -0
  45. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx +44 -0
  46. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx +106 -0
  47. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx +55 -0
  48. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx +32 -0
  49. package/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx +38 -0
  50. package/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx +45 -0
  51. package/src/Pages/GlobalConfigurations/BuildInfra/Readme.md +4 -0
  52. package/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx +136 -0
  53. package/src/Pages/GlobalConfigurations/BuildInfra/index.ts +7 -0
  54. package/src/Pages/GlobalConfigurations/BuildInfra/services.tsx +183 -0
  55. package/src/Pages/GlobalConfigurations/BuildInfra/types.tsx +334 -0
  56. package/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx +494 -0
  57. package/src/Pages/GlobalConfigurations/index.ts +1 -0
  58. package/src/Pages/index.ts +1 -0
  59. package/src/Shared/Components/APIResponseHandler/APIResponseHandler.tsx +39 -0
  60. package/src/Shared/Components/APIResponseHandler/index.ts +2 -0
  61. package/src/Shared/Components/APIResponseHandler/types.tsx +39 -0
  62. package/src/Shared/Components/ReactSelect/index.ts +1 -0
  63. package/src/Shared/Components/ReactSelect/utils.tsx +97 -0
  64. package/src/Shared/Components/index.ts +2 -0
  65. package/src/Shared/index.ts +2 -0
  66. package/src/Shared/validations.tsx +72 -0
  67. package/src/index.ts +3 -1
  68. package/dist/Common/Hooks/useUrlFilters/constants.d.ts +0 -8
  69. package/dist/Common/Hooks/useUrlFilters/index.d.ts +0 -2
  70. package/dist/Common/Hooks/useUrlFilters/types.d.ts +0 -6
  71. package/dist/Common/Hooks/useUrlFilters/useUrlFilters.d.ts +0 -32
  72. package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +0 -18
  73. package/dist/Common/SortableTableHeaderCell/index.d.ts +0 -2
  74. package/dist/Common/SortableTableHeaderCell/types.d.ts +0 -8
  75. package/src/Assets/Icon/ic-arrow-up-down.svg +0 -3
  76. package/src/Assets/Icon/ic-sort-arrow-down.svg +0 -3
  77. package/src/Common/Hooks/useUrlFilters/constants.ts +0 -9
  78. package/src/Common/Hooks/useUrlFilters/index.ts +0 -2
  79. package/src/Common/Hooks/useUrlFilters/types.ts +0 -6
  80. package/src/Common/Hooks/useUrlFilters/useUrlFilters.ts +0 -120
  81. package/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx +0 -44
  82. package/src/Common/SortableTableHeaderCell/index.ts +0 -2
  83. package/src/Common/SortableTableHeaderCell/types.ts +0 -9
@@ -21,6 +21,7 @@ export declare const ROUTES: {
21
21
  IMAGE_TAGGING: string;
22
22
  CD_MATERIAL_GET: string;
23
23
  DEPLOYMENT_TEMPLATE_LIST: string;
24
+ INFRA_CONFIG_PROFILE: string;
24
25
  };
25
26
  export declare enum KEY_VALUE {
26
27
  KEY = "key",
@@ -73,17 +74,3 @@ export declare const SELECTED_APPROVAL_TAB_STATE: {
73
74
  APPROVAL: string;
74
75
  PENDING: string;
75
76
  };
76
- export declare enum SortingOrder {
77
- /**
78
- * Ascending order
79
- */
80
- ASC = "ASC",
81
- /**
82
- * Descending order
83
- */
84
- DESC = "DESC"
85
- }
86
- /**
87
- * Base page size for pagination
88
- */
89
- export declare const DEFAULT_BASE_PAGE_SIZE = 20;
@@ -1,4 +1,3 @@
1
1
  export { useSuperAdmin } from './UseSuperAdmin/UseSuperAdmin';
2
2
  export { useClickOutside } from './UseClickOutside/UseClickOutside';
3
3
  export { useWindowSize } from './UseWindowSize/UseWindowSize';
4
- export * from './useUrlFilters';
@@ -44,12 +44,13 @@ export interface Teams {
44
44
  }
45
45
  export declare enum CHECKBOX_VALUE {
46
46
  CHECKED = "CHECKED",
47
- INTERMEDIATE = "INTERMEDIATE"
47
+ INTERMEDIATE = "INTERMEDIATE",
48
+ BULK_CHECKED = "BULK_CHECKED"
48
49
  }
49
50
  export interface CheckboxProps {
50
51
  onChange: (event: any) => void;
51
52
  isChecked: boolean;
52
- value: 'CHECKED' | 'INTERMEDIATE';
53
+ value: 'CHECKED' | 'INTERMEDIATE' | 'BULK_CHECKED';
53
54
  disabled?: boolean;
54
55
  tabIndex?: number;
55
56
  rootClassName?: string;
@@ -27,7 +27,6 @@ export * from './Checkbox';
27
27
  export { default as EmptyState } from './EmptyState/EmptyState';
28
28
  export { default as GenericEmptyState } from './EmptyState/GenericEmptyState';
29
29
  export * from './SearchBar';
30
- export * from './SortableTableHeaderCell';
31
30
  export { default as Toggle } from './Toggle/Toggle';
32
31
  export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
33
32
  export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BuildInfraConfigFormProps } from './types';
3
+ declare const BuildInfraConfigForm: FunctionComponent<BuildInfraConfigFormProps>;
4
+ export default BuildInfraConfigForm;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BuildInfraInputFieldComponentProps } from './types';
3
+ declare const BuildInfraProfileDescriptionField: FunctionComponent<BuildInfraInputFieldComponentProps>;
4
+ export default BuildInfraProfileDescriptionField;
@@ -0,0 +1,7 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BuildInfraFormActionProps } from './types';
3
+ /**
4
+ * In case need arise for variants break this CustomInput and Select as a separate component
5
+ */
6
+ declare const BuildInfraFormAction: FunctionComponent<BuildInfraFormActionProps>;
7
+ export default BuildInfraFormAction;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BuildInfraFormItemProps } from './types';
3
+ declare const BuildInfraFormItem: FunctionComponent<BuildInfraFormItemProps>;
4
+ export default BuildInfraFormItem;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BuildInfraInputFieldComponentProps } from './types';
3
+ declare const BuildInfraProfileNameField: FunctionComponent<BuildInfraInputFieldComponentProps>;
4
+ export default BuildInfraProfileNameField;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { DescriptorProps } from './types';
3
+ declare const Descriptor: ({ additionalContainerClasses, breadCrumbs, children }: DescriptorProps) => JSX.Element;
4
+ export default Descriptor;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { FooterProps } from './types';
3
+ declare const Footer: FunctionComponent<FooterProps>;
4
+ export default Footer;
@@ -0,0 +1,47 @@
1
+ import { UseBreadcrumbProps } from '../../../Common/BreadCrumb/Types';
2
+ import { BuildInfraFormFieldType, ProfileInputErrorType, BuildInfraProfileBase, HandleProfileInputChangeType } from './types';
3
+ export declare const BUILD_INFRA_TEXT: {
4
+ HEADING: string;
5
+ EDIT_SUBMIT: string;
6
+ SAVE_SUBMIT: string;
7
+ EDIT_CANCEL: string;
8
+ EDIT_DEFAULT_TOOLTIP: string;
9
+ DESCRIPTION_LABEL: string;
10
+ DESCRIPTION_PLACEHOLDER: string;
11
+ PROFILE_LABEL: string;
12
+ PROFILE_PLACEHOLDER: string;
13
+ INHERITING_HEADING_DESCRIPTION: string;
14
+ SUBMIT_BUTTON_TIPPY: {
15
+ INVALID_INPUT: string;
16
+ REQUEST_IN_PROGRESS: string;
17
+ };
18
+ VALIDATE_REQUEST_LIMIT: {
19
+ NEGATIVE_REQUEST: string;
20
+ NEGATIVE_LIMIT: string;
21
+ REQUEST_LESS_THAN_LIMIT: string;
22
+ CAN_NOT_COMPUTE: string;
23
+ REQUEST_DECIMAL_PLACES: string;
24
+ LIMIT_DECIMAL_PLACES: string;
25
+ };
26
+ getInvalidActionMessage: (action: HandleProfileInputChangeType['action']) => string;
27
+ getSubmitSuccessMessage: (profileName: string, isEdited: boolean) => string;
28
+ PROFILE_NOT_FOUND: {
29
+ title: string;
30
+ subTitle: string;
31
+ };
32
+ };
33
+ export declare const BUILD_INFRA_BREADCRUMB: UseBreadcrumbProps;
34
+ export declare const BUILD_INFRA_FORM_FIELDS: BuildInfraFormFieldType[];
35
+ export declare const PROFILE_INPUT_ERROR_FIELDS: ProfileInputErrorType;
36
+ export declare const REQUIRED_INPUT_FIELDS: string[];
37
+ export declare const DEFAULT_PROFILE_NAME = "default";
38
+ export declare const CREATE_PROFILE_BASE_VALUE: BuildInfraProfileBase;
39
+ export declare const CREATE_VIEW_CHECKED_CONFIGS: {
40
+ cpu_request: boolean;
41
+ cpu_limit: boolean;
42
+ };
43
+ export declare const BUILD_INFRA_INPUT_CONSTRAINTS: {
44
+ STEP: number;
45
+ MIN: number;
46
+ DECIMAL_PLACES: number;
47
+ };
@@ -0,0 +1,7 @@
1
+ export { default as BuildInfraDescriptor } from './Descriptor';
2
+ export { default as BuildInfraFooter } from './Footer';
3
+ export { default as BuildInfraConfigForm } from './BuildInfraConfigForm';
4
+ export * from './services';
5
+ export * from './utils';
6
+ export * from './types';
7
+ export * from './constants';
@@ -0,0 +1,13 @@
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;
4
+ 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<{
7
+ code: number;
8
+ result: import("./types").BuildInfraProfileData;
9
+ }>;
10
+ export declare const deleteBuildInfraProfileByName: (name: string) => Promise<{
11
+ code: number;
12
+ result: any;
13
+ }>;
@@ -0,0 +1,281 @@
1
+ import { FormEvent, FunctionComponent, ReactNode } from 'react';
2
+ import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
3
+ import { ValidationResponseType } from '../../../Shared';
4
+ import { ServerErrors } from '../../../Common';
5
+ /**
6
+ * Unique actions that will be dispatched and,
7
+ * Keeping some values (cpu_limit, etc) in sync with backend
8
+ */
9
+ export declare enum BuildInfraConfigTypes {
10
+ CPU_LIMIT = "cpu_limit",
11
+ CPU_REQUEST = "cpu_request",
12
+ MEMORY_LIMIT = "memory_limit",
13
+ MEMORY_REQUEST = "memory_request",
14
+ BUILD_TIMEOUT = "timeout"
15
+ }
16
+ /**
17
+ * Combination of BuildInfraConfigTypes and BuildInfraMetaConfigTypes is going to derive error state and actions(actions will also be derived with BuildInfraInheritActions)
18
+ */
19
+ export declare enum BuildInfraMetaConfigTypes {
20
+ NAME = "name",
21
+ DESCRIPTION = "description"
22
+ }
23
+ /**
24
+ * Would be used as key for few components and would be appending activate and de_activate actions to it
25
+ */
26
+ export declare enum BuildInfraLocators {
27
+ CPU = "cpu",
28
+ 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_build_timeout",
37
+ DE_ACTIVATE_BUILD_TIMEOUT = "de_activate_build_timeout"
38
+ }
39
+ export declare const BuildInfraLocatorsActionMap: {
40
+ timeout: BuildInfraLocators;
41
+ cpu_limit: BuildInfraLocators;
42
+ cpu_request: BuildInfraLocators;
43
+ memory_limit: BuildInfraLocators;
44
+ memory_request: BuildInfraLocators;
45
+ };
46
+ export declare enum BuildInfraProfileVariants {
47
+ DEFAULT = "DEFAULT",
48
+ NORMAL = "NORMAL",
49
+ CUSTOM = "CUSTOM"
50
+ }
51
+ export interface DescriptorProps {
52
+ /**
53
+ * In case we want to restrict the max-width
54
+ */
55
+ additionalContainerClasses?: string;
56
+ breadCrumbs: Breadcrumb[];
57
+ /**
58
+ * Would stick at right of div
59
+ */
60
+ children?: ReactNode;
61
+ }
62
+ export interface BuildInfraActionType {
63
+ /**
64
+ * Type of action to be dispatched, would be suffixed with type of change
65
+ */
66
+ actionType: BuildInfraConfigTypes;
67
+ /**
68
+ * Label to be shown above input
69
+ */
70
+ label: string;
71
+ /**
72
+ * Placeholder for input, can be optional
73
+ */
74
+ placeholder?: string;
75
+ }
76
+ export interface BuildInfraConfigurationMarkerProps {
77
+ className?: string;
78
+ }
79
+ export interface BuildInfraFormFieldType {
80
+ /**
81
+ * Heading of the form item
82
+ */
83
+ heading: ReactNode;
84
+ /**
85
+ * Icon/Checkbox to be shown in front of heading
86
+ */
87
+ marker: FunctionComponent<BuildInfraConfigurationMarkerProps>;
88
+ /**
89
+ * Actions to be shown in the form item
90
+ */
91
+ actions: BuildInfraActionType[];
92
+ /**
93
+ * Unique identifier for the form item used for key
94
+ */
95
+ locator: BuildInfraLocators;
96
+ }
97
+ export interface ConfigurationUnitType {
98
+ name: string;
99
+ conversionFactor: number;
100
+ }
101
+ export type ConfigurationUnitMapType = {
102
+ [key: ConfigurationUnitType['name']]: ConfigurationUnitType;
103
+ };
104
+ export type BuildInfraUnitsMapType = {
105
+ [key in BuildInfraConfigTypes]: ConfigurationUnitMapType;
106
+ };
107
+ export interface BuildInfraConfigValuesType {
108
+ value: string;
109
+ unit?: ConfigurationUnitType['name'];
110
+ }
111
+ interface BuildInfraProfileConfigBase {
112
+ id?: number;
113
+ key: BuildInfraConfigTypes;
114
+ profileName: string;
115
+ active: boolean;
116
+ }
117
+ export interface BuildInfraProfileConfigResponseDataType extends BuildInfraConfigValuesType, BuildInfraProfileConfigBase {
118
+ }
119
+ export interface BuildInfraConfigurationType extends BuildInfraConfigValuesType, BuildInfraProfileConfigBase {
120
+ defaultValue: BuildInfraConfigValuesType;
121
+ }
122
+ export type BuildInfraConfigurationMapType = {
123
+ [key in BuildInfraConfigTypes]: BuildInfraConfigurationType;
124
+ };
125
+ export interface BuildInfraProfileBase {
126
+ id?: number;
127
+ name: string;
128
+ description: string;
129
+ type: BuildInfraProfileVariants;
130
+ appCount: number;
131
+ }
132
+ export interface BuildInfraProfileResponseDataType extends BuildInfraProfileBase {
133
+ configurations: BuildInfraProfileConfigResponseDataType[];
134
+ }
135
+ export interface BuildInfraProfileData extends BuildInfraProfileBase {
136
+ configurations: BuildInfraConfigurationMapType;
137
+ }
138
+ export interface GetBuildInfraProfileType {
139
+ name: string;
140
+ fromCreateView?: boolean;
141
+ }
142
+ export interface BuildInfraProfileResponseType {
143
+ configurationUnits: BuildInfraUnitsMapType | null;
144
+ profile: BuildInfraProfileData | null;
145
+ }
146
+ export interface UseBuildInfraFormProps {
147
+ /**
148
+ * Name of the profile, if not provided assumption would be for create view
149
+ */
150
+ name?: string;
151
+ /**
152
+ * If true, would send put request else would create profile via post
153
+ */
154
+ editProfile?: boolean;
155
+ /**
156
+ * If true, call this on form submission success
157
+ */
158
+ handleSuccessRedirection?: () => void;
159
+ }
160
+ export type ProfileInputErrorType = {
161
+ [key in BuildInfraConfigTypes | BuildInfraMetaConfigTypes]: string;
162
+ };
163
+ export interface ProfileInputDispatchDataType {
164
+ value: string;
165
+ unit?: string;
166
+ }
167
+ export interface HandleProfileInputChangeType {
168
+ action: BuildInfraConfigTypes | BuildInfraInheritActions | BuildInfraMetaConfigTypes;
169
+ data?: ProfileInputDispatchDataType;
170
+ }
171
+ export interface UseBuildInfraFormResponseType {
172
+ isLoading: boolean;
173
+ profileResponse: BuildInfraProfileResponseType | null;
174
+ responseError: ServerErrors | null;
175
+ reloadRequest: () => void;
176
+ profileInput: BuildInfraProfileData;
177
+ profileInputErrors: ProfileInputErrorType;
178
+ handleProfileInputChange: ({ action, data }: HandleProfileInputChangeType) => void;
179
+ loadingActionRequest: boolean;
180
+ handleSubmit: (e: FormEvent<HTMLFormElement>) => Promise<void>;
181
+ }
182
+ export interface BuildInfraFormItemProps extends Pick<BuildInfraFormFieldType, 'marker' | 'heading'> {
183
+ children?: ReactNode;
184
+ /**
185
+ * If true, means profile is inheriting values from other profile (e.g, default)
186
+ */
187
+ isInheriting?: boolean;
188
+ /**
189
+ * Would be false for last item
190
+ */
191
+ showDivider?: boolean;
192
+ /**
193
+ * Would be used to dispatch inherit actions (activate_cpu, de_activate_cpu, etc)
194
+ */
195
+ handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
196
+ locator: BuildInfraFormFieldType['locator'];
197
+ isDefaultProfile: boolean;
198
+ }
199
+ export interface ValidateRequestLimitType {
200
+ request: BuildInfraConfigValuesType;
201
+ limit: BuildInfraConfigValuesType;
202
+ unitsMap: ConfigurationUnitMapType;
203
+ }
204
+ export interface ValidateRequestLimitResponseType {
205
+ request: ValidationResponseType;
206
+ limit: ValidationResponseType;
207
+ }
208
+ export interface BuildInfraConfigFormProps extends Pick<UseBuildInfraFormResponseType, 'profileInput' | 'profileInputErrors' | 'handleProfileInputChange'> {
209
+ isDefaultProfile?: boolean;
210
+ unitsMap?: BuildInfraProfileResponseType['configurationUnits'];
211
+ configurationContainerLabel?: ReactNode;
212
+ }
213
+ export interface BuildInfraFormActionProps extends BuildInfraActionType {
214
+ handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
215
+ currentValue: BuildInfraConfigValuesType['value'];
216
+ error?: string;
217
+ isRequired?: boolean;
218
+ profileUnitsMap?: ConfigurationUnitMapType;
219
+ currentUnitName?: BuildInfraConfigValuesType['unit'];
220
+ }
221
+ export interface FooterProps {
222
+ /**
223
+ * If true, means form contains errors
224
+ */
225
+ disabled?: boolean;
226
+ hideCancelButton?: boolean;
227
+ /**
228
+ * If true would show save changes else would show save for submit button
229
+ */
230
+ editProfile?: boolean;
231
+ loading?: boolean;
232
+ }
233
+ export interface UpdateBuildInfraProfileType extends Pick<UseBuildInfraFormResponseType, 'profileInput'> {
234
+ name: string;
235
+ }
236
+ export interface CreateBuildInfraProfileType extends Pick<UseBuildInfraFormResponseType, 'profileInput'> {
237
+ }
238
+ export interface CreateBuildInfraServiceConfigurationType {
239
+ key: BuildInfraConfigTypes;
240
+ value: string | number;
241
+ active: boolean;
242
+ unit?: string;
243
+ /**
244
+ * Would send for those that are available in profileInput
245
+ */
246
+ id?: number;
247
+ }
248
+ export interface CreateBuildInfraServicePayloadType {
249
+ name: string;
250
+ description: string;
251
+ type: BuildInfraProfileVariants;
252
+ configurations: CreateBuildInfraServiceConfigurationType[];
253
+ }
254
+ export interface BuildInfraInputFieldComponentProps {
255
+ handleProfileInputChange: UseBuildInfraFormResponseType['handleProfileInputChange'];
256
+ currentValue: BuildInfraConfigValuesType['value'];
257
+ error?: string;
258
+ }
259
+ export interface InheritingHeaderProps {
260
+ defaultHeading: BuildInfraFormFieldType['heading'];
261
+ inheritingData: BuildInfraConfigValuesType[];
262
+ isInheriting: boolean;
263
+ isDefaultProfile: boolean;
264
+ }
265
+ export interface BuildInfraConfigResponseDataType {
266
+ name: BuildInfraConfigTypes;
267
+ units: ConfigurationUnitType[];
268
+ }
269
+ interface BaseBuildInfraProfileResponseType {
270
+ defaultConfigurations: BuildInfraProfileConfigResponseDataType[];
271
+ configurationUnits: BuildInfraUnitsMapType;
272
+ }
273
+ export interface BuildInfraListResponseType extends BaseBuildInfraProfileResponseType {
274
+ profiles: BuildInfraProfileResponseDataType[];
275
+ }
276
+ export interface BuildInfraProfileAPIResponseType extends BaseBuildInfraProfileResponseType {
277
+ profile: BuildInfraProfileResponseDataType;
278
+ }
279
+ export interface BuildInfraProfileTransformerType extends BuildInfraProfileAPIResponseType, Pick<GetBuildInfraProfileType, 'fromCreateView'> {
280
+ }
281
+ export {};
@@ -0,0 +1,12 @@
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
+ menuList: (base: any) => any;
6
+ control: (base: any, state: any) => any;
7
+ option: (base: any, state: any) => any;
8
+ dropdownIndicator: (base: any, state: any) => any;
9
+ valueContainer: (base: any) => any;
10
+ loadingMessage: (base: any) => any;
11
+ noOptionsMessage: (base: any) => any;
12
+ };
@@ -0,0 +1 @@
1
+ export * from './BuildInfra';
@@ -0,0 +1 @@
1
+ export * from './GlobalConfigurations';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { APIResponseHandlerProps } from './types';
3
+ declare const APIResponseHandler: ({ isLoading, progressingProps, error, notAuthorized, notFoundText, reloadProps, children, }: APIResponseHandlerProps) => JSX.Element;
4
+ export default APIResponseHandler;
@@ -0,0 +1,2 @@
1
+ export { default as APIResponseHandler } from './APIResponseHandler';
2
+ export * from './types';
@@ -0,0 +1,37 @@
1
+ import { ReactNode } from 'react';
2
+ import { ProgressingProps, ReloadType, ServerErrors } from '../../../Common';
3
+ export interface EmptyPageTextType {
4
+ title?: string;
5
+ subTitle?: string;
6
+ }
7
+ export interface APIResponseHandlerProps {
8
+ /**
9
+ * If true, would show Progressing component
10
+ */
11
+ isLoading?: boolean;
12
+ /**
13
+ * If loading is true, would load send these props to Progressing component
14
+ */
15
+ progressingProps?: ProgressingProps;
16
+ /**
17
+ * If true and isLoading is false would show default Reload component
18
+ * In case error code is 404 show default 404 page using GenericEmptyState
19
+ */
20
+ error?: ServerErrors;
21
+ /**
22
+ * Page text for 404 page
23
+ */
24
+ notFoundText?: EmptyPageTextType;
25
+ /**
26
+ * If true would show Not Authorized page
27
+ */
28
+ notAuthorized?: boolean;
29
+ /**
30
+ * If given, on Error, would load these props
31
+ */
32
+ reloadProps?: ReloadType;
33
+ /**
34
+ * If no Error and no Loading, would load this component
35
+ */
36
+ children: ReactNode;
37
+ }
@@ -0,0 +1 @@
1
+ export * from './utils';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export declare const getCommonSelectStyle: (styleOverrides?: {}) => {
3
+ menuList: (base: any) => any;
4
+ control: (base: any, state: any) => any;
5
+ option: (base: any, state: any) => any;
6
+ dropdownIndicator: (base: any, state: any) => any;
7
+ valueContainer: (base: any) => any;
8
+ loadingMessage: (base: any) => any;
9
+ noOptionsMessage: (base: any) => any;
10
+ };
11
+ export declare const getCustomOptionSelectionStyle: (styleOverrides?: {}) => (base: any, state: any) => any;
12
+ export declare const SelectOption: (props: any) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './APIResponseHandler';
2
+ export * from './ReactSelect';
@@ -0,0 +1,2 @@
1
+ export * from './Components';
2
+ export * from './validations';
@@ -0,0 +1,7 @@
1
+ export interface ValidationResponseType {
2
+ isValid: boolean;
3
+ message?: string;
4
+ }
5
+ export declare const validateName: (name: string) => ValidationResponseType;
6
+ export declare const validateDescription: (description: string) => ValidationResponseType;
7
+ export declare const validateRequiredPositiveNumber: (value: string | Number) => ValidationResponseType;
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export * from "./Common";
1
+ export * from './Common';
2
+ export * from './Pages';
3
+ export * from './Shared';