@flightctl/ui-components 0.5.1 → 0.6.0-rc2

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 (456) hide show
  1. package/dist/src/components/DetailsPage/DetailsPage.d.ts +3 -2
  2. package/dist/src/components/DetailsPage/DetailsPage.d.ts.map +1 -1
  3. package/dist/src/components/DetailsPage/DetailsPage.js +2 -2
  4. package/dist/src/components/DetailsPage/DetailsPage.js.map +1 -1
  5. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
  6. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +5 -3
  7. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
  8. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.d.ts.map +1 -1
  9. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js +4 -5
  10. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -1
  11. package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.d.ts +10 -0
  12. package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.d.ts.map +1 -0
  13. package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.js +110 -0
  14. package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.js.map +1 -0
  15. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
  16. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +7 -1
  17. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -1
  18. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
  19. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +9 -6
  20. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
  21. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
  22. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +1 -1
  23. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
  24. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts.map +1 -1
  25. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js +3 -3
  26. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js.map +1 -1
  27. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +3 -3
  28. package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
  29. package/dist/src/components/Device/DeviceDetails/TerminalTab.js +34 -3
  30. package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
  31. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -1
  32. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +1 -1
  33. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -1
  34. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
  35. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +35 -30
  36. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
  37. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
  38. package/dist/src/components/Device/DevicesPage/DevicesPage.js +11 -2
  39. package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
  40. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -1
  41. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +14 -11
  42. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -1
  43. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
  44. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +9 -2
  45. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
  46. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.d.ts.map +1 -1
  47. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js +21 -6
  48. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js.map +1 -1
  49. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.d.ts.map +1 -1
  50. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +11 -4
  51. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -1
  52. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +6 -5
  53. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
  54. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +123 -10
  55. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
  56. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts +8 -0
  57. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts.map +1 -0
  58. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js +19 -0
  59. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js.map +1 -0
  60. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts +8 -0
  61. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts.map +1 -0
  62. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js +49 -0
  63. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js.map +1 -0
  64. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
  65. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +52 -19
  66. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
  67. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
  68. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +13 -16
  69. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
  70. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.d.ts.map +1 -1
  71. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js.map +1 -1
  72. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
  73. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -5
  74. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -1
  75. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -1
  76. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js +2 -2
  77. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
  78. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts +1 -1
  79. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
  80. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +16 -16
  81. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
  82. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.d.ts +8 -0
  83. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.d.ts.map +1 -0
  84. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.js +58 -0
  85. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.js.map +1 -0
  86. package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts +1 -1
  87. package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts.map +1 -1
  88. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts +2 -2
  89. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts.map +1 -1
  90. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js +17 -12
  91. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js.map +1 -1
  92. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +1 -1
  93. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +2 -4
  94. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -1
  95. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -1
  96. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts +1 -1
  97. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts.map +1 -1
  98. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js.map +1 -1
  99. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +29 -3
  100. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
  101. package/dist/src/components/Device/EditDeviceWizard/utils.js +8 -7
  102. package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
  103. package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -1
  104. package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -1
  105. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +1 -4
  106. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -1
  107. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -1
  108. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
  109. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +5 -5
  110. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
  111. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +2 -1
  112. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -1
  113. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +19 -11
  114. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
  115. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
  116. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +5 -1
  117. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
  118. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +2 -1
  119. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -1
  120. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +8 -4
  121. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -1
  122. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
  123. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +2 -2
  124. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
  125. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.d.ts.map +1 -1
  126. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js +8 -1
  127. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -1
  128. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts +19 -2
  129. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts.map +1 -1
  130. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js +53 -18
  131. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js.map +1 -1
  132. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +1 -1
  133. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
  134. package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts +1 -1
  135. package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts.map +1 -1
  136. package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js +1 -2
  137. package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js.map +1 -1
  138. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +1 -1
  139. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts +1 -1
  140. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts.map +1 -1
  141. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js +9 -0
  142. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js.map +1 -1
  143. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts +1 -1
  144. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts.map +1 -1
  145. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js +22 -9
  146. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js.map +1 -1
  147. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts.map +1 -1
  148. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js +4 -4
  149. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js.map +1 -1
  150. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts.map +1 -1
  151. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js +5 -5
  152. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js.map +1 -1
  153. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.css +3 -0
  154. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.d.ts +9 -0
  155. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.d.ts.map +1 -0
  156. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.js +127 -0
  157. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.js.map +1 -0
  158. package/dist/src/components/Fleet/CreateFleet/utils.d.ts +1 -1
  159. package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
  160. package/dist/src/components/Fleet/CreateFleet/utils.js +13 -4
  161. package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
  162. package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
  163. package/dist/src/components/Fleet/FleetsPage.js +8 -12
  164. package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
  165. package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js +1 -1
  166. package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js.map +1 -1
  167. package/dist/src/components/ListPage/ListPage.d.ts +1 -0
  168. package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
  169. package/dist/src/components/ListPage/ListPage.js +3 -3
  170. package/dist/src/components/ListPage/ListPage.js.map +1 -1
  171. package/dist/src/components/Masthead/CommandLineToolsPage.d.ts +4 -0
  172. package/dist/src/components/Masthead/CommandLineToolsPage.d.ts.map +1 -0
  173. package/dist/src/components/Masthead/CommandLineToolsPage.js +90 -0
  174. package/dist/src/components/Masthead/CommandLineToolsPage.js.map +1 -0
  175. package/dist/src/components/Masthead/UserPreferencesModal.d.ts.map +1 -0
  176. package/dist/src/components/Masthead/UserPreferencesModal.js.map +1 -0
  177. package/dist/src/components/Masthead/UserPreferencesProvider.d.ts.map +1 -0
  178. package/dist/src/components/Masthead/UserPreferencesProvider.js.map +1 -0
  179. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +3 -3
  180. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
  181. package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.d.ts +4 -0
  182. package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.d.ts.map +1 -0
  183. package/dist/src/components/OverviewPage/Cards/{ToDo/ToDoCard.js → Tasks/TasksCard.js} +4 -4
  184. package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.js.map +1 -0
  185. package/dist/src/components/OverviewPage/Overview.js +2 -2
  186. package/dist/src/components/OverviewPage/Overview.js.map +1 -1
  187. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
  188. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +6 -5
  189. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
  190. package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.d.ts.map +1 -1
  191. package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js +3 -3
  192. package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js.map +1 -1
  193. package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
  194. package/dist/src/components/Repository/CreateRepository/utils.js +4 -1
  195. package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
  196. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.d.ts.map +1 -1
  197. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js +1 -1
  198. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js.map +1 -1
  199. package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
  200. package/dist/src/components/Repository/RepositoryList.js +3 -11
  201. package/dist/src/components/Repository/RepositoryList.js.map +1 -1
  202. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
  203. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +3 -6
  204. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
  205. package/dist/src/components/Status/DeviceResourceStatus.js +3 -3
  206. package/dist/src/components/Status/utils.d.ts.map +1 -1
  207. package/dist/src/components/Status/utils.js +3 -3
  208. package/dist/src/components/Status/utils.js.map +1 -1
  209. package/dist/src/components/Table/Table.d.ts +2 -1
  210. package/dist/src/components/Table/Table.d.ts.map +1 -1
  211. package/dist/src/components/Table/Table.js +9 -5
  212. package/dist/src/components/Table/Table.js.map +1 -1
  213. package/dist/src/components/Table/TablePagination.d.ts.map +1 -1
  214. package/dist/src/components/Table/TablePagination.js +1 -1
  215. package/dist/src/components/Table/TablePagination.js.map +1 -1
  216. package/dist/src/components/Terminal/Terminal.d.ts +1 -1
  217. package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
  218. package/dist/src/components/Terminal/Terminal.js +10 -3
  219. package/dist/src/components/Terminal/Terminal.js.map +1 -1
  220. package/dist/src/components/charts/DonutChart.js +1 -1
  221. package/dist/src/components/charts/DonutChart.js.map +1 -1
  222. package/dist/src/components/common/LeaveFormConfirmation.js +1 -1
  223. package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -1
  224. package/dist/src/components/common/WithHelperText.d.ts +10 -5
  225. package/dist/src/components/common/WithHelperText.d.ts.map +1 -1
  226. package/dist/src/components/common/WithHelperText.js +13 -8
  227. package/dist/src/components/common/WithHelperText.js.map +1 -1
  228. package/dist/src/components/form/CheckboxField.d.ts +6 -3
  229. package/dist/src/components/form/CheckboxField.d.ts.map +1 -1
  230. package/dist/src/components/form/CheckboxField.js +20 -1
  231. package/dist/src/components/form/CheckboxField.js.map +1 -1
  232. package/dist/src/components/form/FormSelectTypeahead.d.ts +3 -3
  233. package/dist/src/components/form/FormSelectTypeahead.d.ts.map +1 -1
  234. package/dist/src/components/form/FormSelectTypeahead.js +43 -53
  235. package/dist/src/components/form/FormSelectTypeahead.js.map +1 -1
  236. package/dist/src/components/form/RichValidationTextField.d.ts +1 -1
  237. package/dist/src/components/form/RichValidationTextField.d.ts.map +1 -1
  238. package/dist/src/components/form/RichValidationTextField.js +8 -4
  239. package/dist/src/components/form/RichValidationTextField.js.map +1 -1
  240. package/dist/src/components/form/validations.d.ts +44 -4
  241. package/dist/src/components/form/validations.d.ts.map +1 -1
  242. package/dist/src/components/form/validations.js +148 -25
  243. package/dist/src/components/form/validations.js.map +1 -1
  244. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js +5 -3
  245. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js.map +1 -1
  246. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
  247. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +3 -2
  248. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
  249. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
  250. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +7 -12
  251. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
  252. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js +4 -4
  253. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js.map +1 -1
  254. package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js +4 -4
  255. package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js.map +1 -1
  256. package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js +2 -2
  257. package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js.map +1 -1
  258. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +2 -2
  259. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
  260. package/dist/src/hooks/timeZones.d.ts +3 -0
  261. package/dist/src/hooks/timeZones.d.ts.map +1 -0
  262. package/dist/src/hooks/timeZones.js +607 -0
  263. package/dist/src/hooks/timeZones.js.map +1 -0
  264. package/dist/src/hooks/useAppContext.d.ts +14 -8
  265. package/dist/src/hooks/useAppContext.d.ts.map +1 -1
  266. package/dist/src/hooks/useAppContext.js +13 -6
  267. package/dist/src/hooks/useAppContext.js.map +1 -1
  268. package/dist/src/hooks/useFetch.d.ts +3 -5
  269. package/dist/src/hooks/useFetch.d.ts.map +1 -1
  270. package/dist/src/hooks/useFetch.js +3 -2
  271. package/dist/src/hooks/useFetch.js.map +1 -1
  272. package/dist/src/hooks/useNavigate.d.ts +2 -1
  273. package/dist/src/hooks/useNavigate.d.ts.map +1 -1
  274. package/dist/src/hooks/useNavigate.js +1 -0
  275. package/dist/src/hooks/useNavigate.js.map +1 -1
  276. package/dist/src/hooks/useTimeZones.d.ts +4 -0
  277. package/dist/src/hooks/useTimeZones.d.ts.map +1 -0
  278. package/dist/src/hooks/useTimeZones.js +22 -0
  279. package/dist/src/hooks/useTimeZones.js.map +1 -0
  280. package/dist/src/hooks/useWebSocket.d.ts +6 -2
  281. package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
  282. package/dist/src/hooks/useWebSocket.js +22 -7
  283. package/dist/src/hooks/useWebSocket.js.map +1 -1
  284. package/dist/src/links.d.ts +3 -0
  285. package/dist/src/links.d.ts.map +1 -1
  286. package/dist/src/links.js +10 -3
  287. package/dist/src/links.js.map +1 -1
  288. package/dist/src/types/deviceSpec.d.ts +93 -5
  289. package/dist/src/types/deviceSpec.d.ts.map +1 -1
  290. package/dist/src/types/deviceSpec.js +28 -2
  291. package/dist/src/types/deviceSpec.js.map +1 -1
  292. package/dist/src/types/extraTypes.d.ts +19 -1
  293. package/dist/src/types/extraTypes.d.ts.map +1 -1
  294. package/dist/src/types/extraTypes.js.map +1 -1
  295. package/dist/src/utils/labels.d.ts +1 -0
  296. package/dist/src/utils/labels.d.ts.map +1 -1
  297. package/dist/src/utils/labels.js +9 -2
  298. package/dist/src/utils/labels.js.map +1 -1
  299. package/dist/src/utils/patch.d.ts +13 -5
  300. package/dist/src/utils/patch.d.ts.map +1 -1
  301. package/dist/src/utils/patch.js +115 -71
  302. package/dist/src/utils/patch.js.map +1 -1
  303. package/dist/src/utils/query.d.ts +1 -0
  304. package/dist/src/utils/query.d.ts.map +1 -1
  305. package/dist/src/utils/query.js +10 -3
  306. package/dist/src/utils/query.js.map +1 -1
  307. package/dist/src/utils/search.d.ts +6 -0
  308. package/dist/src/utils/search.d.ts.map +1 -1
  309. package/dist/src/utils/search.js +9 -1
  310. package/dist/src/utils/search.js.map +1 -1
  311. package/dist/src/utils/time.d.ts +31 -0
  312. package/dist/src/utils/time.d.ts.map +1 -0
  313. package/dist/src/utils/time.js +134 -0
  314. package/dist/src/utils/time.js.map +1 -0
  315. package/package.json +1 -4
  316. package/src/components/DetailsPage/DetailsPage.tsx +6 -4
  317. package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +6 -3
  318. package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +4 -13
  319. package/src/components/Device/DeviceDetails/DeviceAliasEdit.tsx +180 -0
  320. package/src/components/Device/DeviceDetails/DeviceApplications.tsx +8 -1
  321. package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +21 -5
  322. package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +3 -4
  323. package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx +7 -10
  324. package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +3 -3
  325. package/src/components/Device/DeviceDetails/TerminalTab.tsx +43 -5
  326. package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +2 -1
  327. package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +66 -38
  328. package/src/components/Device/DevicesPage/DevicesPage.tsx +11 -2
  329. package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +16 -11
  330. package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +11 -2
  331. package/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.tsx +22 -6
  332. package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +15 -2
  333. package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +147 -14
  334. package/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.tsx +28 -0
  335. package/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.tsx +94 -0
  336. package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +81 -50
  337. package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +23 -28
  338. package/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.tsx +1 -2
  339. package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +18 -39
  340. package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +8 -14
  341. package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +26 -39
  342. package/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.tsx +88 -0
  343. package/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.tsx +1 -1
  344. package/src/components/Device/EditDeviceWizard/steps/ReviewApplications.tsx +18 -19
  345. package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +3 -3
  346. package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +2 -2
  347. package/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.tsx +2 -1
  348. package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +1 -1
  349. package/src/components/Device/EditDeviceWizard/utils.ts +16 -9
  350. package/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.tsx +7 -6
  351. package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +1 -5
  352. package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +7 -9
  353. package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +30 -17
  354. package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +5 -1
  355. package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +12 -4
  356. package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +4 -3
  357. package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +9 -2
  358. package/src/components/Fleet/CreateFleet/fleetSpecUtils.ts +51 -17
  359. package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +1 -1
  360. package/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.tsx +2 -13
  361. package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +3 -3
  362. package/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.tsx +10 -1
  363. package/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.tsx +49 -16
  364. package/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.tsx +18 -33
  365. package/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.tsx +14 -24
  366. package/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.css +3 -0
  367. package/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.tsx +246 -0
  368. package/src/components/Fleet/CreateFleet/utils.ts +23 -7
  369. package/src/components/Fleet/FleetsPage.tsx +15 -17
  370. package/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.tsx +1 -1
  371. package/src/components/ListPage/ListPage.tsx +7 -4
  372. package/src/components/Masthead/CommandLineToolsPage.tsx +179 -0
  373. package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +6 -6
  374. package/src/components/OverviewPage/Cards/{ToDo/ToDoCard.tsx → Tasks/TasksCard.tsx} +3 -3
  375. package/src/components/OverviewPage/Overview.tsx +2 -2
  376. package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +11 -26
  377. package/src/components/Repository/CreateRepository/CreateResourceSyncsForm.tsx +8 -17
  378. package/src/components/Repository/CreateRepository/utils.ts +4 -1
  379. package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +3 -4
  380. package/src/components/Repository/RepositoryList.tsx +9 -16
  381. package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +7 -11
  382. package/src/components/Status/DeviceResourceStatus.tsx +4 -4
  383. package/src/components/Status/utils.ts +3 -5
  384. package/src/components/Table/Table.tsx +32 -9
  385. package/src/components/Table/TablePagination.tsx +0 -1
  386. package/src/components/Terminal/Terminal.tsx +10 -4
  387. package/src/components/charts/DonutChart.tsx +2 -2
  388. package/src/components/common/LeaveFormConfirmation.tsx +2 -2
  389. package/src/components/common/WithHelperText.tsx +53 -21
  390. package/src/components/form/CheckboxField.tsx +28 -3
  391. package/src/components/form/FormSelectTypeahead.tsx +53 -80
  392. package/src/components/form/RichValidationTextField.tsx +73 -62
  393. package/src/components/form/validations.ts +207 -28
  394. package/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.tsx +5 -5
  395. package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +3 -2
  396. package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -20
  397. package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx +2 -2
  398. package/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.tsx +2 -2
  399. package/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.tsx +2 -2
  400. package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +2 -2
  401. package/src/hooks/timeZones.ts +606 -0
  402. package/src/hooks/useAppContext.tsx +20 -10
  403. package/src/hooks/useFetch.ts +3 -2
  404. package/src/hooks/useNavigate.tsx +1 -0
  405. package/src/hooks/useTimeZones.ts +26 -0
  406. package/src/hooks/useWebSocket.ts +29 -7
  407. package/src/links.ts +13 -4
  408. package/src/types/deviceSpec.ts +118 -2
  409. package/src/types/extraTypes.ts +33 -1
  410. package/src/utils/labels.ts +7 -1
  411. package/src/utils/patch.ts +126 -72
  412. package/src/utils/query.ts +13 -4
  413. package/src/utils/search.ts +8 -0
  414. package/src/utils/time.ts +147 -0
  415. package/dist/jest.config.d.ts +0 -12
  416. package/dist/jest.config.d.ts.map +0 -1
  417. package/dist/jest.config.js +0 -24
  418. package/dist/jest.config.js.map +0 -1
  419. package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts +0 -2
  420. package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts.map +0 -1
  421. package/dist/src/components/DetailsPage/DetailsPage.spec.js +0 -81
  422. package/dist/src/components/DetailsPage/DetailsPage.spec.js.map +0 -1
  423. package/dist/src/components/Device/EditDeviceWizard/types.d.ts +0 -23
  424. package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +0 -1
  425. package/dist/src/components/Device/EditDeviceWizard/types.js +0 -3
  426. package/dist/src/components/Device/EditDeviceWizard/types.js.map +0 -1
  427. package/dist/src/components/Fleet/CreateFleet/types.d.ts +0 -29
  428. package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +0 -1
  429. package/dist/src/components/Fleet/CreateFleet/types.js +0 -9
  430. package/dist/src/components/Fleet/CreateFleet/types.js.map +0 -1
  431. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts +0 -4
  432. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts.map +0 -1
  433. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +0 -1
  434. package/dist/src/components/UserPreferences/UserPreferencesModal.d.ts.map +0 -1
  435. package/dist/src/components/UserPreferences/UserPreferencesModal.js.map +0 -1
  436. package/dist/src/components/UserPreferences/UserPreferencesProvider.d.ts.map +0 -1
  437. package/dist/src/components/UserPreferences/UserPreferencesProvider.js.map +0 -1
  438. package/dist/src/setupTests.d.ts +0 -2
  439. package/dist/src/setupTests.d.ts.map +0 -1
  440. package/dist/src/setupTests.js +0 -24
  441. package/dist/src/setupTests.js.map +0 -1
  442. package/dist/src/tests/test-utils.d.ts +0 -7
  443. package/dist/src/tests/test-utils.d.ts.map +0 -1
  444. package/dist/src/tests/test-utils.js +0 -21
  445. package/dist/src/tests/test-utils.js.map +0 -1
  446. package/src/components/DetailsPage/DetailsPage.spec.tsx +0 -128
  447. package/src/components/Device/EditDeviceWizard/types.ts +0 -22
  448. package/src/components/Fleet/CreateFleet/types.ts +0 -33
  449. package/src/setupTests.ts +0 -21
  450. package/src/tests/test-utils.tsx +0 -21
  451. /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesModal.d.ts +0 -0
  452. /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesModal.js +0 -0
  453. /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.d.ts +0 -0
  454. /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.js +0 -0
  455. /package/src/components/{UserPreferences → Masthead}/UserPreferencesModal.tsx +0 -0
  456. /package/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.tsx +0 -0
@@ -17,7 +17,7 @@ const terminalOptions: ITerminalOptions & ITerminalInitOnlyOptions = {
17
17
  };
18
18
 
19
19
  type TerminalProps = {
20
- onData: (data: string) => void;
20
+ onData: (data: string, resize?: boolean) => void;
21
21
  };
22
22
 
23
23
  export type ImperativeTerminalType = {
@@ -41,7 +41,13 @@ const Terminal = React.forwardRef<ImperativeTerminalType, TerminalProps>(({ onDa
41
41
  term.focus();
42
42
 
43
43
  const resizeObserver: ResizeObserver = new ResizeObserver(() => {
44
- window.requestAnimationFrame(() => fitAddon.fit());
44
+ window.requestAnimationFrame(() => {
45
+ fitAddon.fit();
46
+ if (terminal.current) {
47
+ const size = JSON.stringify({ Height: terminal.current?.rows, Width: terminal.current?.cols });
48
+ onData(size, true);
49
+ }
50
+ });
45
51
  });
46
52
 
47
53
  terminalRef.current && resizeObserver.observe(terminalRef.current);
@@ -55,11 +61,11 @@ const Terminal = React.forwardRef<ImperativeTerminalType, TerminalProps>(({ onDa
55
61
  term.dispose();
56
62
  resizeObserver.disconnect();
57
63
  };
58
- }, []);
64
+ }, [onData]);
59
65
 
60
66
  React.useEffect(() => {
61
67
  const term = terminal.current;
62
- const data = term?.onData(onData);
68
+ const data = term?.onData((data) => onData(data, false));
63
69
  return () => {
64
70
  data?.dispose();
65
71
  };
@@ -2,7 +2,7 @@ import { ChartContainer, ChartDonut } from '@patternfly/react-charts';
2
2
  import { Flex, FlexItem, Stack, StackItem, Text, TextContent, TextVariants } from '@patternfly/react-core';
3
3
  import * as React from 'react';
4
4
  import { Link, LinkProps } from '../../hooks/useNavigate';
5
- import WithHelperText from '../common/WithHelperText';
5
+ import LabelWithHelperText from '../common/WithHelperText';
6
6
  import { useTranslation } from '../../hooks/useTranslation';
7
7
  import { getDefaultStatusColor } from '../../utils/status/common';
8
8
 
@@ -83,7 +83,7 @@ const DonutChart = ({ data, title, helperText }: { data: Data[]; title: string;
83
83
  alignContent={{ default: 'alignContentCenter' }}
84
84
  className="fctl-charts__title"
85
85
  >
86
- {helperText ? <WithHelperText showLabel ariaLabel={title} content={helperText} /> : title}
86
+ {helperText ? <LabelWithHelperText label={title} content={helperText} /> : title}
87
87
  </Flex>
88
88
  </foreignObject>
89
89
  <ChartDonut
@@ -4,7 +4,7 @@ import { Blocker, BlockerFunction } from 'react-router-dom';
4
4
  import { useFormikContext } from 'formik';
5
5
 
6
6
  import { useTranslation } from '../../hooks/useTranslation';
7
- import { useAppContext } from '../../hooks/useAppContext';
7
+ import { FlightCtlApp, useAppContext } from '../../hooks/useAppContext';
8
8
 
9
9
  const ConfirmNavigationDialog = ({ blocker }: { blocker: Blocker }) => {
10
10
  const { t } = useTranslation();
@@ -85,7 +85,7 @@ const LeaveFormConfirmation = () => {
85
85
 
86
86
  const lock = !isSubmitting && dirty;
87
87
 
88
- if (appType === 'aap') {
88
+ if (appType === FlightCtlApp.AAP) {
89
89
  return null;
90
90
  }
91
91
 
@@ -1,34 +1,66 @@
1
1
  import * as React from 'react';
2
- import { Button, Popover } from '@patternfly/react-core';
2
+ import { Button, FormGroup, Popover } from '@patternfly/react-core';
3
3
  import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons/dist/js/icons/outlined-question-circle-icon';
4
4
 
5
5
  import './WithHelperText.css';
6
6
 
7
- type WithHelperTextProps = {
8
- ariaLabel: string;
9
- showLabel?: boolean;
7
+ type HelperTextPopoverProps = {
8
+ label: string;
10
9
  triggerAction?: 'click' | 'hover';
11
10
  content: React.ReactNode;
12
11
  };
13
12
 
14
- const WithHelperText = ({ ariaLabel, showLabel, content, triggerAction }: WithHelperTextProps) => (
13
+ type FormGroupWithHelperTextProps = HelperTextPopoverProps & {
14
+ isRequired?: boolean;
15
+ };
16
+
17
+ const HelperTextPopover = ({
18
+ ariaLabel,
19
+ content,
20
+ triggerAction,
21
+ }: Omit<HelperTextPopoverProps, 'label'> & { ariaLabel: string }) => (
22
+ <Popover aria-label={ariaLabel} bodyContent={content} withFocusTrap triggerAction={triggerAction}>
23
+ <Button
24
+ component="a"
25
+ className="fctl-helper-text__icon"
26
+ isInline
27
+ variant="plain"
28
+ onClick={(ev) => {
29
+ ev.preventDefault();
30
+ ev.stopPropagation();
31
+ }}
32
+ aria-label={`${ariaLabel} help text`}
33
+ >
34
+ <OutlinedQuestionCircleIcon />
35
+ </Button>
36
+ </Popover>
37
+ );
38
+
39
+ const LabelWithHelperText = ({
40
+ label,
41
+ hideLabel,
42
+ content,
43
+ triggerAction,
44
+ }: HelperTextPopoverProps & { hideLabel?: boolean }) => (
15
45
  <>
16
- {showLabel && ariaLabel}
17
- <Popover aria-label={ariaLabel} bodyContent={content} withFocusTrap triggerAction={triggerAction}>
18
- <Button
19
- component="a"
20
- className="fctl-helper-text__icon"
21
- isInline
22
- variant="plain"
23
- onClick={(ev) => {
24
- ev.preventDefault();
25
- ev.stopPropagation();
26
- }}
27
- aria-label={`${ariaLabel} help text`}
28
- icon={<OutlinedQuestionCircleIcon />}
29
- />
30
- </Popover>
46
+ {!hideLabel && label}
47
+ <HelperTextPopover ariaLabel={label} content={content} triggerAction={triggerAction} />
31
48
  </>
32
49
  );
33
50
 
34
- export default WithHelperText;
51
+ export const FormGroupWithHelperText = ({
52
+ label,
53
+ isRequired,
54
+ content,
55
+ children,
56
+ }: React.PropsWithChildren<FormGroupWithHelperTextProps>) => (
57
+ <FormGroup
58
+ label={label}
59
+ labelIcon={<HelperTextPopover ariaLabel={label} content={content} />}
60
+ isRequired={isRequired}
61
+ >
62
+ {children}
63
+ </FormGroup>
64
+ );
65
+
66
+ export default LabelWithHelperText;
@@ -3,13 +3,38 @@ import { useField } from 'formik';
3
3
  import { Checkbox, CheckboxProps, FormGroup } from '@patternfly/react-core';
4
4
  import ErrorHelperText, { DefaultHelperText } from './FieldHelperText';
5
5
 
6
- export interface CheckboxFieldProps extends Omit<CheckboxProps, 'onChange' | 'id' | 'ref'> {
6
+ interface BaseCheckboxProps extends Omit<CheckboxProps, 'onChange' | 'id' | 'ref'> {
7
7
  name: string;
8
- helperText?: React.ReactNode;
9
8
  onChangeCustom?: (value: boolean) => void;
10
9
  }
11
10
 
12
- const CheckboxField = ({ helperText, onChangeCustom, children, ...props }: CheckboxFieldProps) => {
11
+ export interface CheckboxFieldProps extends BaseCheckboxProps {
12
+ helperText?: React.ReactNode;
13
+ }
14
+
15
+ // Checkboxes that are validated as a group rather than individually
16
+ export const CheckboxFieldGroupValidation = ({ onChangeCustom, ...props }: BaseCheckboxProps) => {
17
+ const [{ value, ...rest }, , { setValue, setTouched }] = useField<boolean>({
18
+ name: props.name,
19
+ });
20
+
21
+ const onChange: CheckboxProps['onChange'] = async (_, value) => {
22
+ await setValue(value);
23
+ if (onChangeCustom) {
24
+ onChangeCustom(value);
25
+ }
26
+ await setTouched(true);
27
+ };
28
+
29
+ const fieldId = `checkboxfield-${props.name}`;
30
+ return (
31
+ <FormGroup id={`form-control__${fieldId}`} fieldId={fieldId}>
32
+ <Checkbox {...rest} {...props} isChecked={value} id={fieldId} onChange={onChange} body={value && props.body} />
33
+ </FormGroup>
34
+ );
35
+ };
36
+
37
+ const CheckboxField = ({ onChangeCustom, helperText, children, ...props }: CheckboxFieldProps) => {
13
38
  const [{ value, ...rest }, meta, { setValue, setTouched }] = useField<boolean>({
14
39
  name: props.name,
15
40
  });
@@ -11,7 +11,6 @@ import {
11
11
  } from '@patternfly/react-core';
12
12
  import { useField } from 'formik';
13
13
  import ErrorHelperText, { DefaultHelperText } from './FieldHelperText';
14
- import { useTranslation } from '../../hooks/useTranslation';
15
14
 
16
15
  import './FormSelect.css';
17
16
 
@@ -24,35 +23,31 @@ type FormSelectProps = {
24
23
  helperText?: React.ReactNode;
25
24
  children?: React.ReactNode;
26
25
  placeholderText?: string;
27
- validateNewItem?: (value: string) => string | undefined;
28
- transformNewItem?: (value: string) => string;
26
+ isValidTypedItem?: (value: string) => boolean;
27
+ transformTypedItem?: (value: string) => string;
29
28
  };
30
29
 
31
30
  const isItemObject = (item: string | SelectItem): item is SelectItem => typeof item === 'object';
32
31
 
33
32
  const getItemLabel = (item: string | SelectItem) => (isItemObject(item) ? item.label : item);
34
33
 
35
- const CREATE_NEW = 'create';
36
-
37
- const FormSelectTypeahead: React.FC<FormSelectProps> = ({
34
+ const FormSelectTypeahead = ({
38
35
  name,
39
36
  items,
40
37
  defaultId,
41
38
  helperText,
42
39
  placeholderText,
40
+ isValidTypedItem,
41
+ transformTypedItem,
43
42
  children,
44
- validateNewItem,
45
- transformNewItem,
46
- }) => {
47
- const { t } = useTranslation();
43
+ }: FormSelectProps) => {
48
44
  const [field, meta, { setValue, setTouched }] = useField<string>({
49
45
  name: name,
50
46
  });
51
47
  const [isOpen, setIsOpen] = React.useState(false);
52
48
  const [inputValue, setInputValue] = React.useState<string | undefined>(undefined);
53
- const [addedItems, setAddedItems] = React.useState<string[]>(
54
- !field.value || Object.keys(items).some((k) => k === field.value) ? [] : [field.value],
55
- );
49
+
50
+ const currentValue = field.value;
56
51
 
57
52
  const fieldId = `selectfield-${name}`;
58
53
  const itemKeys = Object.keys(items);
@@ -65,71 +60,34 @@ const FormSelectTypeahead: React.FC<FormSelectProps> = ({
65
60
 
66
61
  React.useEffect(() => {
67
62
  const hasOneItem = itemKeys.length === 1;
68
- if (hasOneItem && !field.value) {
63
+ if (hasOneItem && !currentValue) {
69
64
  setValue(itemKeys[0], true);
70
65
  }
71
- }, [itemKeys, field.value, setValue]);
72
-
73
- const selectedText = isOpen
74
- ? inputValue
75
- : field.value
76
- ? getItemLabel(items[field.value]) || field.value
77
- : defaultValue;
78
-
79
- const itemValidation = inputValue ? validateNewItem?.(inputValue) : undefined;
66
+ }, [itemKeys, currentValue, setValue]);
80
67
 
81
- let alreadyAdded = false;
82
- const inputTransformed = inputValue && transformNewItem ? transformNewItem(inputValue) : inputValue;
83
- const addedItemsFiltered = addedItems.filter((item) => {
84
- if (!inputValue) {
85
- return true;
86
- }
87
- if (!alreadyAdded) {
88
- alreadyAdded = item === inputTransformed;
89
- }
90
- return item.includes(inputValue);
91
- });
68
+ let selectedText = defaultValue;
69
+ if (inputValue) {
70
+ selectedText = inputValue;
71
+ } else if (currentValue) {
72
+ selectedText = getItemLabel(items[currentValue]) || currentValue;
73
+ }
92
74
 
93
75
  const itemKeysFiltered = itemKeys.filter((key) => {
94
76
  if (!inputValue) {
95
77
  return true;
96
78
  }
97
- if (!alreadyAdded) {
98
- alreadyAdded = key === inputTransformed;
99
- }
100
- return getItemLabel(items[key]).includes(inputValue);
79
+ return getItemLabel(items[key]).toLowerCase().includes(inputValue.toLowerCase());
101
80
  });
102
81
 
103
- const selectOptions = [
104
- ...addedItemsFiltered.map((item) => (
105
- <SelectOption className="fctl-form-select__item" key={item} value={item}>
106
- {item}
107
- </SelectOption>
108
- )),
109
- ...itemKeysFiltered.map((key) => {
110
- const item = items[key];
111
- const desc = isItemObject(item) ? item.description : undefined;
112
- return (
113
- <SelectOption className="fctl-form-select__item" key={key} value={key} description={desc}>
114
- {getItemLabel(item)}
115
- </SelectOption>
116
- );
117
- }),
118
- ];
119
-
120
82
  return (
121
83
  <FormGroup id={`form-control__${fieldId}`} fieldId={fieldId}>
122
84
  <Select
123
85
  id={fieldId}
124
86
  className="fctl-form-select"
125
- selected={field.value || defaultId}
87
+ selected={currentValue || defaultId}
126
88
  onSelect={(_, value) => {
127
- let newValue: string = value as string;
128
- if (value === CREATE_NEW && inputTransformed) {
129
- setAddedItems([...addedItems, inputTransformed]);
130
- newValue = inputTransformed;
131
- }
132
- setValue(newValue, true);
89
+ setTouched(true);
90
+ setValue(value as string, true);
133
91
  setInputValue(undefined);
134
92
  setIsOpen(false);
135
93
  }}
@@ -157,12 +115,34 @@ const FormSelectTypeahead: React.FC<FormSelectProps> = ({
157
115
  setIsOpen(!isOpen);
158
116
  }}
159
117
  onChange={(_, value) => {
160
- setInputValue(value);
118
+ setInputValue(value || undefined);
161
119
  if (!isOpen) {
162
120
  setIsOpen(true);
163
121
  }
164
122
  }}
165
- id="create-typeahead-select-input"
123
+ onBlur={() => {
124
+ if (!inputValue) {
125
+ return;
126
+ }
127
+
128
+ // If there is no "isValidTypedItem", it means selection must always be done by selecting from the list
129
+ const skipSetValue = isValidTypedItem ? !isValidTypedItem(inputValue) : true;
130
+ if (skipSetValue) {
131
+ if (itemKeysFiltered.length === 0) {
132
+ setInputValue(undefined);
133
+ setIsOpen(false);
134
+ } else {
135
+ // The typed text has no matches from the list. We clear the value to use the default/empty
136
+ setValue('');
137
+ }
138
+ return;
139
+ }
140
+ const transformedValue = transformTypedItem?.(inputValue) || inputValue;
141
+ setInputValue(undefined);
142
+ void setValue(transformedValue);
143
+ setIsOpen(false);
144
+ }}
145
+ id={`create-typeahead-select-input-${name}`}
166
146
  autoComplete="off"
167
147
  role="combobox"
168
148
  isExpanded={isOpen}
@@ -175,9 +155,6 @@ const FormSelectTypeahead: React.FC<FormSelectProps> = ({
175
155
  isOpen={isOpen}
176
156
  onOpenChange={(open) => {
177
157
  if (!open) {
178
- if (inputValue !== undefined) {
179
- setInputValue(undefined);
180
- }
181
158
  if (!meta.touched) {
182
159
  setTouched(true);
183
160
  }
@@ -186,19 +163,15 @@ const FormSelectTypeahead: React.FC<FormSelectProps> = ({
186
163
  }}
187
164
  >
188
165
  <SelectList className="fctl-form-select__menu">
189
- {inputValue && !alreadyAdded && (
190
- <SelectOption
191
- className="fctl-form-select__item"
192
- isDisabled={!!itemValidation}
193
- description={itemValidation}
194
- value={CREATE_NEW}
195
- >
196
- {t(`Create new option '{{ value }}'`, {
197
- value: itemValidation ? inputValue : inputTransformed,
198
- })}
199
- </SelectOption>
200
- )}
201
- {selectOptions}
166
+ {itemKeysFiltered.map((key) => {
167
+ const item = items[key];
168
+ const desc = isItemObject(item) ? item.description : undefined;
169
+ return (
170
+ <SelectOption className="fctl-form-select__item" key={key} value={key} description={desc}>
171
+ {getItemLabel(item)}
172
+ </SelectOption>
173
+ );
174
+ })}
202
175
  </SelectList>
203
176
  {children}
204
177
  </Select>
@@ -72,71 +72,82 @@ export interface RichValidationTextFieldProps extends TextInputProps {
72
72
  }[];
73
73
  }
74
74
 
75
- const RichValidationTextField = ({ fieldName, validations, isRequired, ...rest }: RichValidationTextFieldProps) => {
76
- const [popoverOpen, setPopoverOpen] = React.useState(false);
75
+ const RichValidationTextField = React.forwardRef(
76
+ (
77
+ { fieldName, validations, isRequired, onBlur, ...rest }: RichValidationTextFieldProps,
78
+ ref: React.Ref<HTMLInputElement>,
79
+ ) => {
80
+ const [popoverOpen, setPopoverOpen] = React.useState(false);
77
81
 
78
- const [field, meta, { setTouched }] = useField({
79
- name: fieldName,
80
- });
82
+ const [field, meta, { setTouched }] = useField({
83
+ name: fieldName,
84
+ });
81
85
 
82
- const fieldId = `rich-validation-field-${fieldName}`;
83
- const hasValue = !!field.value;
86
+ const fieldId = `rich-validation-field-${fieldName}`;
87
+ const hasValue = !!field.value;
84
88
 
85
- return (
86
- <FormGroup label={rest?.['aria-label']} id={`form-control__${fieldId}`} fieldId={fieldId} isRequired={isRequired}>
87
- <InputGroup>
88
- <InputGroupItem isFill>
89
- <TextInput
90
- {...field}
91
- {...rest}
92
- id={fieldId}
93
- isRequired={isRequired}
94
- aria-describedby={`${fieldId}-helper`}
95
- onChange={async (event, val) => {
96
- !popoverOpen && setPopoverOpen(true);
97
- field.onChange(event);
98
- // TODO does not work well for the first character
99
- if (!meta.touched && val?.length) {
100
- await setTouched(true, true);
89
+ return (
90
+ <FormGroup label={rest?.['aria-label']} id={`form-control__${fieldId}`} fieldId={fieldId} isRequired={isRequired}>
91
+ <InputGroup>
92
+ <InputGroupItem isFill>
93
+ <TextInput
94
+ {...field}
95
+ {...rest}
96
+ id={fieldId}
97
+ ref={ref}
98
+ isRequired={isRequired}
99
+ aria-describedby={`${fieldId}-helper`}
100
+ onChange={async (event, val) => {
101
+ !popoverOpen && setPopoverOpen(true);
102
+ field.onChange(event);
103
+ // TODO does not work well for the first character
104
+ if (!meta.touched && val?.length) {
105
+ await setTouched(true, true);
106
+ }
107
+ }}
108
+ onBlur={() => {
109
+ setPopoverOpen(false);
110
+ void setTouched(true, true);
111
+ if (onBlur) {
112
+ onBlur();
113
+ }
114
+ }}
115
+ />
116
+ </InputGroupItem>
117
+ <InputGroupItem>
118
+ <Popover
119
+ isVisible={popoverOpen}
120
+ shouldClose={() => setPopoverOpen(false)}
121
+ shouldOpen={() => setPopoverOpen(true)}
122
+ aria-label="validation popover"
123
+ position={PopoverPosition.top}
124
+ bodyContent={
125
+ <RichValidationStatus
126
+ hasValue={hasValue}
127
+ isRequired={isRequired || false}
128
+ validations={validations}
129
+ metaError={meta.error}
130
+ />
101
131
  }
102
- }}
103
- onBlur={() => {
104
- setPopoverOpen(false);
105
- void setTouched(true, true);
106
- }}
107
- />
108
- </InputGroupItem>
109
- <InputGroupItem>
110
- <Popover
111
- isVisible={popoverOpen}
112
- shouldClose={() => setPopoverOpen(false)}
113
- shouldOpen={() => setPopoverOpen(true)}
114
- aria-label="validation popover"
115
- position={PopoverPosition.top}
116
- bodyContent={
117
- <RichValidationStatus
118
- hasValue={hasValue}
119
- isRequired={isRequired || false}
120
- validations={validations}
121
- metaError={meta.error}
122
- />
123
- }
124
- withFocusTrap={false}
125
- >
126
- <Button variant="plain" aria-label="Validation">
127
- {!hasValue ? (
128
- <InfoCircleIcon color={infoColor.value} />
129
- ) : !!meta.error ? (
130
- <ExclamationCircleIcon color={dangerColor.value} />
131
- ) : (
132
- <CheckCircleIcon color={successColor.value} />
133
- )}
134
- </Button>
135
- </Popover>
136
- </InputGroupItem>
137
- </InputGroup>
138
- </FormGroup>
139
- );
140
- };
132
+ withFocusTrap={false}
133
+ >
134
+ <Button variant="plain" aria-label="Validation">
135
+ {!hasValue ? (
136
+ <InfoCircleIcon color={infoColor.value} />
137
+ ) : !!meta.error ? (
138
+ <ExclamationCircleIcon color={dangerColor.value} />
139
+ ) : (
140
+ <CheckCircleIcon color={successColor.value} />
141
+ )}
142
+ </Button>
143
+ </Popover>
144
+ </InputGroupItem>
145
+ </InputGroup>
146
+ </FormGroup>
147
+ );
148
+ },
149
+ );
150
+
151
+ RichValidationTextField.displayName = 'RichValidationTextField';
141
152
 
142
153
  export default RichValidationTextField;