@devtron-labs/devtron-fe-common-lib 0.0.58-beta-7 → 0.0.58-beta-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Common/Api.d.ts +9 -0
- package/dist/Common/Constants.d.ts +14 -1
- package/dist/Common/Hooks/index.d.ts +1 -0
- package/dist/Common/Hooks/useUrlFilters/constants.d.ts +8 -0
- package/dist/Common/Hooks/useUrlFilters/index.d.ts +2 -0
- package/dist/Common/Hooks/useUrlFilters/types.d.ts +6 -0
- package/dist/Common/Hooks/useUrlFilters/useUrlFilters.d.ts +32 -0
- package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +18 -0
- package/dist/Common/SortableTableHeaderCell/index.d.ts +2 -0
- package/dist/Common/SortableTableHeaderCell/types.d.ts +25 -0
- package/dist/Common/Types.d.ts +15 -4
- package/dist/Common/index.d.ts +1 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +357 -1123
- package/package.json +1 -1
- package/src/Assets/Icon/ic-arrow-up-down.svg +3 -0
- package/src/Assets/Icon/ic-sort-arrow-down.svg +3 -0
- package/src/Common/Api.ts +21 -0
- package/src/Common/BreadCrumb/Types.ts +1 -0
- package/src/Common/Checkbox.tsx +0 -1
- package/src/Common/Constants.ts +18 -3
- package/src/Common/CustomInput/CustomInput.tsx +1 -2
- package/src/Common/DraggableWrapper/DraggableWrapper.tsx +1 -3
- package/src/Common/Hooks/index.ts +1 -0
- package/src/Common/Hooks/useUrlFilters/constants.ts +9 -0
- package/src/Common/Hooks/useUrlFilters/index.ts +2 -0
- package/src/Common/Hooks/useUrlFilters/types.ts +6 -0
- package/src/Common/Hooks/useUrlFilters/useUrlFilters.ts +120 -0
- package/src/Common/RJSF/utils.ts +0 -3
- package/src/Common/SearchBar/SearchBar.component.tsx +13 -26
- package/src/Common/SearchBar/searchBar.scss +1 -1
- package/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx +44 -0
- package/src/Common/SortableTableHeaderCell/index.ts +2 -0
- package/src/Common/SortableTableHeaderCell/types.ts +26 -0
- package/src/Common/Types.ts +14 -3
- package/src/Common/index.ts +1 -0
- package/src/index.ts +1 -3
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.d.ts +0 -7
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/Footer.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +0 -47
- package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +0 -7
- package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +0 -13
- package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +0 -282
- package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +0 -12
- package/dist/Pages/GlobalConfigurations/index.d.ts +0 -1
- package/dist/Pages/index.d.ts +0 -1
- package/dist/Shared/Components/APIResponseHandler/APIResponseHandler.d.ts +0 -4
- package/dist/Shared/Components/APIResponseHandler/index.d.ts +0 -2
- package/dist/Shared/Components/APIResponseHandler/types.d.ts +0 -37
- package/dist/Shared/Components/ReactSelect/index.d.ts +0 -1
- package/dist/Shared/Components/ReactSelect/utils.d.ts +0 -12
- package/dist/Shared/Components/index.d.ts +0 -2
- package/dist/Shared/index.d.ts +0 -2
- package/dist/Shared/validations.d.ts +0 -7
- package/src/Assets/Icon/ic-cpu.svg +0 -4
- package/src/Assets/Icon/ic-memory.svg +0 -3
- package/src/Assets/Icon/ic-timer.svg +0 -3
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx +0 -121
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx +0 -44
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx +0 -104
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx +0 -55
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx +0 -32
- package/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx +0 -38
- package/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx +0 -45
- package/src/Pages/GlobalConfigurations/BuildInfra/Readme.md +0 -4
- package/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx +0 -136
- package/src/Pages/GlobalConfigurations/BuildInfra/index.ts +0 -7
- package/src/Pages/GlobalConfigurations/BuildInfra/services.tsx +0 -184
- package/src/Pages/GlobalConfigurations/BuildInfra/types.tsx +0 -335
- package/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx +0 -494
- package/src/Pages/GlobalConfigurations/index.ts +0 -1
- package/src/Pages/index.ts +0 -1
- package/src/Shared/Components/APIResponseHandler/APIResponseHandler.tsx +0 -39
- package/src/Shared/Components/APIResponseHandler/index.ts +0 -2
- package/src/Shared/Components/APIResponseHandler/types.tsx +0 -39
- package/src/Shared/Components/ReactSelect/index.ts +0 -1
- package/src/Shared/Components/ReactSelect/utils.tsx +0 -97
- package/src/Shared/Components/index.ts +0 -2
- package/src/Shared/index.ts +0 -2
- package/src/Shared/validations.tsx +0 -72
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export interface ValidationResponseType {
|
|
2
|
-
isValid: boolean
|
|
3
|
-
message?: string
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const validateName = (name: string): ValidationResponseType => {
|
|
7
|
-
if (!/^.{3,50}$/.test(name)) {
|
|
8
|
-
return {
|
|
9
|
-
isValid: false,
|
|
10
|
-
message: 'Minimum 3 and maximum 50 characters allowed',
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (!/^[a-z0-9-._]+$/.test(name)) {
|
|
15
|
-
return {
|
|
16
|
-
isValid: false,
|
|
17
|
-
message: 'Only lowercase alphanumeric characters, -, _ or . allowed',
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (!/^(?![-._]).*[^-._]$/.test(name)) {
|
|
22
|
-
return {
|
|
23
|
-
isValid: false,
|
|
24
|
-
message: 'Cannot start/end with -, _ or .',
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
isValid: true,
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const validateDescription = (description: string): ValidationResponseType => {
|
|
34
|
-
if (description?.length > 300) {
|
|
35
|
-
return {
|
|
36
|
-
isValid: false,
|
|
37
|
-
message: 'Maximum 300 characters are allowed',
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
isValid: true,
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const validateRequiredPositiveNumber = (value: string | Number): ValidationResponseType => {
|
|
47
|
-
if (!value) {
|
|
48
|
-
return {
|
|
49
|
-
isValid: false,
|
|
50
|
-
message: 'This field is required',
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// TODO: Look if regex is available for this, since 0002 is not a valid number
|
|
55
|
-
if (!/^\d+(\.\d+)?$/.test(value.toString())) {
|
|
56
|
-
return {
|
|
57
|
-
isValid: false,
|
|
58
|
-
message: 'This field should be a valid positive number',
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (Number(value) <= 0) {
|
|
63
|
-
return {
|
|
64
|
-
isValid: false,
|
|
65
|
-
message: 'Only positive numbers are allowed',
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
isValid: true,
|
|
71
|
-
}
|
|
72
|
-
}
|