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

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