@devtron-labs/devtron-fe-common-lib 0.0.58-beta-8 → 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.
Files changed (85) hide show
  1. package/dist/Common/Api.d.ts +9 -0
  2. package/dist/Common/Constants.d.ts +14 -1
  3. package/dist/Common/Hooks/index.d.ts +1 -0
  4. package/dist/Common/Hooks/useUrlFilters/constants.d.ts +8 -0
  5. package/dist/Common/Hooks/useUrlFilters/index.d.ts +2 -0
  6. package/dist/Common/Hooks/useUrlFilters/types.d.ts +6 -0
  7. package/dist/Common/Hooks/useUrlFilters/useUrlFilters.d.ts +32 -0
  8. package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +18 -0
  9. package/dist/Common/SortableTableHeaderCell/index.d.ts +2 -0
  10. package/dist/Common/SortableTableHeaderCell/types.d.ts +25 -0
  11. package/dist/Common/Types.d.ts +15 -4
  12. package/dist/Common/index.d.ts +1 -0
  13. package/dist/index.d.ts +1 -3
  14. package/dist/index.js +357 -1121
  15. package/package.json +1 -1
  16. package/src/Assets/Icon/ic-arrow-up-down.svg +3 -0
  17. package/src/Assets/Icon/ic-sort-arrow-down.svg +3 -0
  18. package/src/Common/Api.ts +21 -0
  19. package/src/Common/BreadCrumb/Types.ts +1 -0
  20. package/src/Common/Checkbox.tsx +0 -1
  21. package/src/Common/Constants.ts +18 -3
  22. package/src/Common/CustomInput/CustomInput.tsx +1 -2
  23. package/src/Common/DraggableWrapper/DraggableWrapper.tsx +1 -3
  24. package/src/Common/Hooks/index.ts +1 -0
  25. package/src/Common/Hooks/useUrlFilters/constants.ts +9 -0
  26. package/src/Common/Hooks/useUrlFilters/index.ts +2 -0
  27. package/src/Common/Hooks/useUrlFilters/types.ts +6 -0
  28. package/src/Common/Hooks/useUrlFilters/useUrlFilters.ts +120 -0
  29. package/src/Common/RJSF/utils.ts +0 -3
  30. package/src/Common/SearchBar/SearchBar.component.tsx +13 -26
  31. package/src/Common/SearchBar/searchBar.scss +1 -1
  32. package/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx +44 -0
  33. package/src/Common/SortableTableHeaderCell/index.ts +2 -0
  34. package/src/Common/SortableTableHeaderCell/types.ts +26 -0
  35. package/src/Common/Types.ts +14 -3
  36. package/src/Common/index.ts +1 -0
  37. package/src/index.ts +1 -3
  38. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.d.ts +0 -4
  39. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +0 -4
  40. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.d.ts +0 -7
  41. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.d.ts +0 -4
  42. package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +0 -4
  43. package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +0 -4
  44. package/dist/Pages/GlobalConfigurations/BuildInfra/Footer.d.ts +0 -4
  45. package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +0 -47
  46. package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +0 -7
  47. package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +0 -13
  48. package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +0 -281
  49. package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +0 -12
  50. package/dist/Pages/GlobalConfigurations/index.d.ts +0 -1
  51. package/dist/Pages/index.d.ts +0 -1
  52. package/dist/Shared/Components/APIResponseHandler/APIResponseHandler.d.ts +0 -4
  53. package/dist/Shared/Components/APIResponseHandler/index.d.ts +0 -2
  54. package/dist/Shared/Components/APIResponseHandler/types.d.ts +0 -37
  55. package/dist/Shared/Components/ReactSelect/index.d.ts +0 -1
  56. package/dist/Shared/Components/ReactSelect/utils.d.ts +0 -12
  57. package/dist/Shared/Components/index.d.ts +0 -2
  58. package/dist/Shared/index.d.ts +0 -2
  59. package/dist/Shared/validations.d.ts +0 -7
  60. package/src/Assets/Icon/ic-cpu.svg +0 -4
  61. package/src/Assets/Icon/ic-memory.svg +0 -3
  62. package/src/Assets/Icon/ic-timer.svg +0 -3
  63. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx +0 -121
  64. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx +0 -44
  65. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx +0 -106
  66. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx +0 -55
  67. package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx +0 -32
  68. package/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx +0 -38
  69. package/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx +0 -45
  70. package/src/Pages/GlobalConfigurations/BuildInfra/Readme.md +0 -4
  71. package/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx +0 -136
  72. package/src/Pages/GlobalConfigurations/BuildInfra/index.ts +0 -7
  73. package/src/Pages/GlobalConfigurations/BuildInfra/services.tsx +0 -183
  74. package/src/Pages/GlobalConfigurations/BuildInfra/types.tsx +0 -334
  75. package/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx +0 -494
  76. package/src/Pages/GlobalConfigurations/index.ts +0 -1
  77. package/src/Pages/index.ts +0 -1
  78. package/src/Shared/Components/APIResponseHandler/APIResponseHandler.tsx +0 -39
  79. package/src/Shared/Components/APIResponseHandler/index.ts +0 -2
  80. package/src/Shared/Components/APIResponseHandler/types.tsx +0 -39
  81. package/src/Shared/Components/ReactSelect/index.ts +0 -1
  82. package/src/Shared/Components/ReactSelect/utils.tsx +0 -97
  83. package/src/Shared/Components/index.ts +0 -2
  84. package/src/Shared/index.ts +0 -2
  85. 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
- }