@devtron-labs/devtron-fe-common-lib 0.0.48-beta-6 → 0.0.48-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 (133) hide show
  1. package/.eslintignore +75 -0
  2. package/.eslintrc.js +84 -16
  3. package/.github/pull_request_template.md +25 -0
  4. package/.github/workflows/ci.yml +31 -0
  5. package/.github/workflows/release-package.yml +2 -3
  6. package/.husky/pre-commit +5 -0
  7. package/.lintstagedrc +3 -0
  8. package/.nvmrc +1 -0
  9. package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
  10. package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +2 -2
  11. package/dist/Common/Common.service.d.ts +0 -1
  12. package/dist/Common/Constants.d.ts +1 -2
  13. package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
  14. package/dist/Common/CustomInput/Types.d.ts +2 -1
  15. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  16. package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +1 -1
  17. package/dist/Common/DevtronProgressing/DevtronProgressing.d.ts +1 -1
  18. package/dist/Common/Dialogs/ConfirmationDialog.d.ts +6 -6
  19. package/dist/Common/Dialogs/DeleteDialog.d.ts +1 -1
  20. package/dist/Common/Dialogs/ForceDeleteDialog.d.ts +1 -1
  21. package/dist/Common/Dialogs/Types.d.ts +1 -1
  22. package/dist/Common/EmptyState/EmptyState.d.ts +20 -17
  23. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  24. package/dist/Common/Error.d.ts +2 -1
  25. package/dist/Common/ErrorScreenNotFound.d.ts +1 -1
  26. package/dist/Common/Helper.d.ts +1 -10
  27. package/dist/Common/ImageTags.d.ts +1 -1
  28. package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
  29. package/dist/Common/Modals/Modal.d.ts +2 -2
  30. package/dist/Common/Modals/OpaqueModal.d.ts +3 -3
  31. package/dist/Common/Modals/VisibleModal.d.ts +3 -3
  32. package/dist/Common/Modals/VisibleModal2.d.ts +3 -3
  33. package/dist/Common/MultiSelectCustomization.d.ts +1 -1
  34. package/dist/Common/Policy.Types.d.ts +2 -2
  35. package/dist/Common/PopupMenu.d.ts +5 -5
  36. package/dist/Common/Progressing.d.ts +2 -2
  37. package/dist/Common/RadioGroup/RadioGroup.d.ts +1 -1
  38. package/dist/Common/ResizableTextarea.d.ts +1 -1
  39. package/dist/Common/TippyCustomized.d.ts +1 -1
  40. package/dist/Common/ToastBody.d.ts +5 -5
  41. package/dist/Common/Types.d.ts +0 -64
  42. package/dist/Common/index.d.ts +0 -1
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.js +380 -2083
  45. package/package.json +19 -4
  46. package/src/Common/AddCDButton/AddCDButton.tsx +1 -2
  47. package/src/Common/Api.ts +21 -26
  48. package/src/Common/AppStatus/AppStatus.tsx +12 -12
  49. package/src/Common/AppStatus/utils.ts +6 -5
  50. package/src/Common/BreadCrumb/BreadCrumb.tsx +32 -28
  51. package/src/Common/BreadCrumb/BreadcrumbStore.tsx +2 -2
  52. package/src/Common/BreadCrumb/Types.ts +11 -12
  53. package/src/Common/Checkbox.tsx +17 -19
  54. package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
  55. package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +0 -1
  56. package/src/Common/Common.service.ts +59 -68
  57. package/src/Common/Constants.ts +9 -10
  58. package/src/Common/CustomInput/CustomInput.tsx +22 -28
  59. package/src/Common/CustomInput/Types.ts +4 -3
  60. package/src/Common/CustomInput/index.ts +1 -1
  61. package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +15 -18
  62. package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
  63. package/src/Common/CustomTagSelector/TagDetails.tsx +9 -3
  64. package/src/Common/CustomTagSelector/TagLabelSelect.tsx +7 -9
  65. package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +31 -35
  66. package/src/Common/CustomTagSelector/TagSelector.utils.ts +2 -3
  67. package/src/Common/CustomTagSelector/Types.ts +1 -1
  68. package/src/Common/CustomTagSelector/ValidationRules.ts +18 -22
  69. package/src/Common/CustomTagSelector/index.ts +2 -2
  70. package/src/Common/DebouncedSearch/DebouncedSearch.tsx +2 -1
  71. package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +0 -1
  72. package/src/Common/DeleteComponentModal/DeleteComponent.tsx +27 -32
  73. package/src/Common/DeleteComponentModal/types.ts +1 -1
  74. package/src/Common/DevtronProgressing/DevtronProgressing.tsx +5 -8
  75. package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
  76. package/src/Common/Dialogs/DeleteDialog.tsx +3 -5
  77. package/src/Common/Dialogs/DialogForm.tsx +31 -35
  78. package/src/Common/Dialogs/ForceDeleteDialog.tsx +13 -7
  79. package/src/Common/Dialogs/Types.ts +12 -12
  80. package/src/Common/Dialogs/index.ts +1 -1
  81. package/src/Common/Drawer/Drawer.tsx +1 -1
  82. package/src/Common/EmptyState/EmptyState.tsx +13 -17
  83. package/src/Common/EmptyState/GenericEmptyState.tsx +25 -15
  84. package/src/Common/Error.tsx +5 -5
  85. package/src/Common/ErrorScreenNotFound.tsx +9 -12
  86. package/src/Common/Grid/Grid.tsx +1 -2
  87. package/src/Common/Helper.tsx +23 -125
  88. package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
  89. package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
  90. package/src/Common/ImageTags.Types.ts +2 -3
  91. package/src/Common/ImageTags.tsx +61 -66
  92. package/src/Common/InfoColorBar/InfoColourbar.tsx +10 -5
  93. package/src/Common/Modals/Modal.tsx +3 -3
  94. package/src/Common/Modals/OpaqueModal.tsx +25 -18
  95. package/src/Common/Modals/VisibleModal.tsx +7 -3
  96. package/src/Common/Modals/VisibleModal2.tsx +20 -15
  97. package/src/Common/MultiSelectCustomization.tsx +9 -13
  98. package/src/Common/Policy.Types.ts +38 -38
  99. package/src/Common/PopupMenu.tsx +10 -9
  100. package/src/Common/Progressing.tsx +15 -18
  101. package/src/Common/RJSF/Form.tsx +0 -1
  102. package/src/Common/RJSF/common/FieldRow.tsx +0 -1
  103. package/src/Common/RJSF/config.ts +0 -1
  104. package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
  105. package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +0 -1
  106. package/src/Common/RJSF/templates/BaseInput.tsx +0 -1
  107. package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +0 -1
  108. package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +0 -1
  109. package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +1 -6
  110. package/src/Common/RJSF/templates/Description.tsx +0 -1
  111. package/src/Common/RJSF/templates/Field.tsx +14 -3
  112. package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +6 -9
  113. package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +5 -7
  114. package/src/Common/RJSF/templates/TitleField.tsx +0 -1
  115. package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +0 -1
  116. package/src/Common/RJSF/utils.ts +53 -57
  117. package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
  118. package/src/Common/RJSF/widgets/Select.tsx +0 -1
  119. package/src/Common/RadioGroup/RadioGroup.tsx +18 -23
  120. package/src/Common/RadioGroup.tsx +24 -23
  121. package/src/Common/Reload.tsx +0 -1
  122. package/src/Common/ResizableTextarea.tsx +18 -17
  123. package/src/Common/Security/ScanVulnerabilitiesTable.tsx +29 -34
  124. package/src/Common/ServerError.ts +5 -1
  125. package/src/Common/TippyCustomized.tsx +41 -38
  126. package/src/Common/ToastBody.tsx +6 -7
  127. package/src/Common/Toggle/Toggle.tsx +3 -3
  128. package/src/Common/Types.ts +12 -81
  129. package/src/Common/index.ts +0 -1
  130. package/src/custom.d.ts +7 -7
  131. package/src/index.ts +1 -1
  132. package/dist/Common/ChartVersionAndTypeSelector.d.ts +0 -4
  133. package/src/Common/ChartVersionAndTypeSelector.tsx +0 -78
@@ -1,78 +0,0 @@
1
- import React, { useEffect, useState } from 'react'
2
- import { fetchChartTemplateVersions } from './Common.service'
3
- import { ChartVersionAndTypeSelectorProps, DeploymentChartVersionType } from './Types'
4
- import ReactSelect from 'react-select'
5
- import { customStyles, getFilteredChartVersions, showError } from './Helper'
6
-
7
- // @TODO: Generalize this component to be used in CodeEditor as Chart selector toolbar
8
- // when the Code Editor is moved to the fe-common-lib
9
- const ChartVersionAndTypeSelector = ({ setSelectedChartRefId }: ChartVersionAndTypeSelectorProps) => {
10
- const [charts, setCharts] = useState<DeploymentChartVersionType[]>([])
11
- const [selectedChartType, setSelectedChartType] = useState(null)
12
- const [chartVersionOptions, setChartVersionOptions] = useState([])
13
- const [chartTypeOptions, setChartTypeOptions] = useState([])
14
- const [selectedChartVersion, setSelectedChartVersion] = useState(null)
15
-
16
- useEffect(() => {
17
- fetchChartTemplateVersions()
18
- .then((res) => {
19
- const charts = res?.result || []
20
- setCharts(charts)
21
- // Extract unique chart types from the data
22
- const chartTypeOptions = [...new Set(charts.map((item) => item.chartType))].map((type) => ({
23
- value: type,
24
- label: type,
25
- }))
26
- setChartTypeOptions(chartTypeOptions)
27
- const filteredVersions = getFilteredChartVersions(charts, chartTypeOptions[0])
28
- selectFirstChartVersion(filteredVersions)
29
- })
30
- .catch((err) => {
31
- showError(err)
32
- })
33
- }, [])
34
-
35
- const selectFirstChartVersion = (filteredVersions) => {
36
- setChartVersionOptions(filteredVersions)
37
- setSelectedChartVersion(filteredVersions[0]) // Select the first chart version by default
38
- setSelectedChartRefId(filteredVersions[0]?.chartRefId)
39
- }
40
-
41
- // Function to update chart version options based on selected chart type
42
- const handleChartTypeChange = (selectedOption) => {
43
- setSelectedChartType(selectedOption)
44
- const filteredVersions = getFilteredChartVersions(charts, selectedOption)
45
- selectFirstChartVersion(filteredVersions)
46
- }
47
-
48
- // Function to handle the change of the selected chart version
49
- const handleChartVersionChange = (selectedOption) => {
50
- setSelectedChartVersion(selectedOption)
51
- setSelectedChartRefId(selectedOption.chartRefId)
52
- }
53
-
54
- return (
55
- <div className="flex">
56
- <div className="chart-type-options flex" data-testid="chart-type-options">
57
- <span className="chart-type-options-label mr-4">Chart Type</span>
58
- <ReactSelect
59
- value={selectedChartType ?? chartTypeOptions[0]}
60
- options={chartTypeOptions}
61
- onChange={handleChartTypeChange}
62
- styles={customStyles}
63
- />
64
- </div>
65
- <div className="chart-version-options flex" data-testid="chart-version-options">
66
- <span className="chart-version-options-label mr-4">Chart Version</span>
67
- <ReactSelect
68
- value={selectedChartVersion ?? chartVersionOptions[0]}
69
- options={chartVersionOptions}
70
- onChange={handleChartVersionChange}
71
- styles={customStyles}
72
- />
73
- </div>
74
- </div>
75
- )
76
- }
77
-
78
- export default ChartVersionAndTypeSelector