@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
@@ -13,6 +13,7 @@ import {
13
13
  useSearchParams,
14
14
  } from 'react-router-dom';
15
15
  import { PatchRequest } from '@flightctl/types';
16
+ import { CliArtifactsResponse } from '@flightctl/ui-components/src/types/extraTypes';
16
17
  import { ROUTE } from './useNavigate';
17
18
  import { RESOURCE, VERB } from '../types/rbac';
18
19
 
@@ -33,17 +34,26 @@ export const appRoutes = {
33
34
  [ROUTE.RESOURCE_SYNC_DETAILS]: '/devicemanagement/resourcesyncs',
34
35
  [ROUTE.ENROLLMENT_REQUESTS]: '/devicemanagement/enrollmentrequests',
35
36
  [ROUTE.ENROLLMENT_REQUEST_DETAILS]: '/devicemanagement/enrollmentrequests',
37
+ [ROUTE.COMMAND_LINE_TOOLS]: '/command-line-tools',
36
38
  };
37
39
 
38
40
  export type NavLinkFC = React.FC<{ to: string; children: (props: { isActive: boolean }) => React.ReactNode }>;
39
41
  export type PromptFC = React.FC<{ message: string }>;
42
+ export enum FlightCtlApp {
43
+ STANDALONE = 'standalone',
44
+ OCP = 'ocp',
45
+ AAP = 'aap',
46
+ }
40
47
 
41
48
  export type AppContextProps = {
42
- appType: 'standalone' | 'ocp' | 'aap';
49
+ appType: FlightCtlApp;
43
50
  user?: string; // auth?.user?.profile.preferred_username
44
51
  i18n: {
45
52
  transNamespace?: string;
46
53
  };
54
+ settings: {
55
+ isRHEM?: boolean;
56
+ };
47
57
  router: {
48
58
  useNavigate: () => RouterNavigateFunction;
49
59
  Link: typeof Link;
@@ -59,7 +69,7 @@ export type AppContextProps = {
59
69
  Prompt?: PromptFC;
60
70
  };
61
71
  fetch: {
62
- getWsEndpoint: (deviceId: string) => { wsEndpoint: string; protocols: string[] };
72
+ getWsEndpoint: (deviceId: string) => string;
63
73
  get: <R>(kind: string, abortSignal?: AbortSignal) => Promise<R>;
64
74
  post: <R>(kind: string, data: R, abortSignal?: AbortSignal) => Promise<R>;
65
75
  put: <R>(kind: string, data: R, abortSignal?: AbortSignal) => Promise<R>;
@@ -67,13 +77,16 @@ export type AppContextProps = {
67
77
  patch: <R>(kind: string, patches: PatchRequest, abortSignal?: AbortSignal) => Promise<R>;
68
78
  checkPermissions: (resource: RESOURCE, verb: VERB) => Promise<boolean>;
69
79
  };
70
- metrics: {
71
- get: <R>(query: string, abortSignal?: AbortSignal) => Promise<R>;
72
- };
80
+ // Extra fetch functions
81
+ getMetrics?: <R>(query: string, abortSignal?: AbortSignal) => Promise<R>;
82
+ getCliArtifacts?: (abortSignal?: AbortSignal) => Promise<CliArtifactsResponse>;
73
83
  };
74
84
 
75
85
  export const AppContext = React.createContext<AppContextProps>({
76
- appType: 'standalone',
86
+ appType: FlightCtlApp.STANDALONE,
87
+ settings: {
88
+ isRHEM: false,
89
+ },
77
90
  router: {
78
91
  useNavigate,
79
92
  Link,
@@ -92,7 +105,7 @@ export const AppContext = React.createContext<AppContextProps>({
92
105
  },
93
106
  /* eslint-disable */
94
107
  fetch: {
95
- getWsEndpoint: () => ({ wsEndpoint: '', protocols: [''] }),
108
+ getWsEndpoint: () => '',
96
109
  get: async () => ({}) as any,
97
110
  post: async () => ({}) as any,
98
111
  put: async () => ({}) as any,
@@ -100,9 +113,6 @@ export const AppContext = React.createContext<AppContextProps>({
100
113
  patch: async () => ({}) as any,
101
114
  checkPermissions: async () => true,
102
115
  },
103
- metrics: {
104
- get: async () => ({}) as any,
105
- },
106
116
  /* eslint-enable */
107
117
  });
108
118
 
@@ -1,10 +1,11 @@
1
1
  import { useAppContext } from './useAppContext';
2
2
 
3
3
  export const useFetch = () => {
4
- const { fetch, metrics } = useAppContext();
4
+ const { fetch, getCliArtifacts, getMetrics } = useAppContext();
5
5
 
6
6
  return {
7
7
  ...fetch,
8
- getMetrics: metrics.get,
8
+ getCliArtifacts,
9
+ getMetrics,
9
10
  };
10
11
  };
@@ -24,6 +24,7 @@ export enum ROUTE {
24
24
  RESOURCE_SYNC_DETAILS = 'RESOURCE_SYNC_DETAILS',
25
25
  ENROLLMENT_REQUESTS = 'ENROLLMENT_REQUESTS',
26
26
  ENROLLMENT_REQUEST_DETAILS = 'ENROLLMENT_REQUEST_DETAILS',
27
+ COMMAND_LINE_TOOLS = 'COMMAND_LINE_TOOLS',
27
28
  }
28
29
 
29
30
  export type RouteWithPostfix =
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+
3
+ type TimeZoneMap = Record<string, string>;
4
+
5
+ // Hook allows us to only load the timeZones when they are being used
6
+ const useTimeZones = () => {
7
+ const [zones, setZones] = React.useState<TimeZoneMap>({});
8
+
9
+ React.useEffect(() => {
10
+ const loadZones = async () => {
11
+ const timeZones = (await import('./timeZones')).default;
12
+
13
+ const filledZones = Object.entries(timeZones).reduce((finalMap, [name, offset]) => {
14
+ finalMap[name] = `(GMT ${offset}) ${name}`;
15
+ return finalMap;
16
+ }, {} as TimeZoneMap);
17
+
18
+ setZones(filledZones);
19
+ };
20
+ void loadZones();
21
+ }, []);
22
+
23
+ return zones;
24
+ };
25
+
26
+ export default useTimeZones;
@@ -2,11 +2,26 @@ import * as React from 'react';
2
2
  import { useTranslation } from './useTranslation';
3
3
  import { useAppContext } from './useAppContext';
4
4
 
5
+ const msgToBytes = (msg: string, resize?: boolean) => {
6
+ const encoder = new TextEncoder();
7
+ const encodedData = encoder.encode(msg);
8
+ const result = new Uint8Array(encodedData.length + 1);
9
+ result[0] = resize ? 0x4 : 0x00;
10
+ result.set(encodedData, 1);
11
+ return result;
12
+ };
13
+
14
+ export type WsMetadata = {
15
+ tty: boolean;
16
+ term: string;
17
+ };
18
+
5
19
  export const useWebSocket = <T>(
6
20
  deviceId: string,
7
21
  onMsgReceived: (msg: T) => Promise<void>,
22
+ wsMetadata: WsMetadata,
8
23
  ): {
9
- sendMessage: (msg: string) => void;
24
+ sendMessage: (msg: string, resize?: boolean) => void;
10
25
  isConnecting: boolean;
11
26
  isClosed: boolean;
12
27
  error: unknown;
@@ -22,18 +37,25 @@ export const useWebSocket = <T>(
22
37
  const [error, setError] = React.useState<unknown>();
23
38
  const [reset, setReset] = React.useState<number>(0);
24
39
 
25
- const sendMessage = React.useCallback((data: string) => {
26
- wsRef.current?.send(data);
40
+ const sendMessage = React.useCallback((data: string, resize?: boolean) => {
41
+ wsRef.current?.send(msgToBytes(data, resize));
27
42
  }, []);
28
43
 
29
44
  React.useEffect(() => {
30
45
  try {
31
46
  setIsConnecting(true);
32
47
  setIsClosed(false);
33
- const { wsEndpoint, protocols } = getWsEndpoint(deviceId);
34
- const ws = new WebSocket(wsEndpoint, protocols);
48
+ const wsEndpoint = getWsEndpoint(deviceId);
49
+ const wsMeta = JSON.stringify(wsMetadata);
50
+ const params = new URLSearchParams({
51
+ metadata: wsMeta,
52
+ });
53
+ const ws = new WebSocket(`${wsEndpoint}?${params.toString()}`, 'v5.channel.k8s.io');
35
54
  ws.addEventListener('open', () => setIsConnecting(false));
36
- ws.addEventListener('close', () => setIsClosed(true));
55
+ ws.addEventListener('close', () => {
56
+ setIsClosed(true);
57
+ wsRef.current = undefined;
58
+ });
37
59
  ws.addEventListener('error', (evt) => {
38
60
  // eslint-disable-next-line no-console
39
61
  console.error('Error creating websocket:', evt);
@@ -48,7 +70,7 @@ export const useWebSocket = <T>(
48
70
  wsRef.current?.close();
49
71
  wsRef.current = undefined;
50
72
  };
51
- }, [deviceId, t, getWsEndpoint, reset]);
73
+ }, [deviceId, t, getWsEndpoint, reset, wsMetadata]);
52
74
 
53
75
  const reconnect = React.useCallback(() => {
54
76
  wsRef.current?.close();
package/src/links.ts CHANGED
@@ -1,7 +1,16 @@
1
- export const CREATING_APPLICATIONS_LINK =
2
- 'https://github.com/flightctl/flightctl/blob/main/docs/user/managing-devices.md#creating-applications';
1
+ const baseDocsRepoUrl = 'https://github.com/flightctl/flightctl/blob/main/docs';
3
2
 
4
- export const USING_TEMPLATE_VARIABLES_LINK =
5
- 'https://github.com/flightctl/flightctl/blob/main/docs/user/managing-fleets.md#defining-device-templates';
3
+ // Links to the fLightctl upstream docs
4
+ export const CREATING_APPLICATIONS_LINK = `${baseDocsRepoUrl}/user/managing-devices.md#creating-applications`;
6
5
 
6
+ export const USING_TEMPLATE_VARIABLES_LINK = `${baseDocsRepoUrl}/user/managing-fleets.md#defining-device-templates`;
7
+
8
+ export const ADDING_NEW_DEVICES_LINK = `${baseDocsRepoUrl}/user/getting-started.md#building-a-bootable-container-image-including-the-flight-control-agent`;
9
+
10
+ export const CREATE_ACM_REPOSITORY = `${baseDocsRepoUrl}/user/registering-microshift-devices-acm.md#creating-the-acm-registration-repository`;
11
+
12
+ // Links to other flightctl upstream resources
13
+ export const DEMO_REPOSITORY_URL = 'https://github.com/flightctl/flightctl-demos';
14
+
15
+ // Links to general Red Hat docs
7
16
  export const TECH_PREVIEW_LEVEL_LINK = 'https://access.redhat.com/support/offerings/techpreview';
@@ -1,10 +1,16 @@
1
1
  import {
2
2
  ConfigProviderSpec,
3
+ DisruptionBudget,
3
4
  GitConfigProviderSpec,
4
5
  HttpConfigProviderSpec,
6
+ ImageApplicationProviderSpec,
7
+ InlineApplicationProviderSpec,
5
8
  InlineConfigProviderSpec,
6
9
  KubernetesSecretProviderSpec,
7
10
  } from '@flightctl/types';
11
+ import { FlightCtlLabel } from './extraTypes';
12
+ import { UpdateScheduleMode } from '../utils/time';
13
+ import { ApplicationProviderSpecFixed } from './extraTypes';
8
14
 
9
15
  export enum ConfigType {
10
16
  GIT = 'git',
@@ -26,6 +32,33 @@ export type GitConfigTemplate = ConfigTemplate & {
26
32
  mountPath?: string;
27
33
  };
28
34
 
35
+ export enum AppSpecType {
36
+ OCI_IMAGE = 'image',
37
+ INLINE = 'inline',
38
+ }
39
+
40
+ type InlineContent = {
41
+ content?: string;
42
+ path: string;
43
+ base64?: boolean;
44
+ };
45
+
46
+ type AppBase = {
47
+ specType: AppSpecType;
48
+ // appType: AppType - commented out for now, since it only accepts one value ("compose")
49
+ name?: string;
50
+ variables: { name: string; value: string }[];
51
+ };
52
+
53
+ export type InlineAppForm = AppBase & {
54
+ name: string; // name can only be optional for image applications
55
+ files: InlineContent[];
56
+ };
57
+
58
+ export type ImageAppForm = AppBase & {
59
+ image: string;
60
+ };
61
+
29
62
  export const isGitConfigTemplate = (configTemplate: ConfigTemplate): configTemplate is GitConfigTemplate =>
30
63
  configTemplate.type === ConfigType.GIT;
31
64
 
@@ -43,7 +76,25 @@ export type RepoConfig = GitConfigProviderSpec | HttpConfigProviderSpec;
43
76
  export const isRepoConfig = (config: ConfigSourceProvider): config is RepoConfig =>
44
77
  isGitProviderSpec(config) || isHttpProviderSpec(config);
45
78
 
46
- const hasTemplateVariables = (str: string) => /device.metadata/.test(str);
79
+ export type AppForm = ImageAppForm | InlineAppForm;
80
+
81
+ export const isInlineAppProvider = (app: ApplicationProviderSpecFixed): app is InlineApplicationProviderSpec =>
82
+ 'inline' in app;
83
+ export const isImageAppProvider = (app: ApplicationProviderSpecFixed): app is ImageApplicationProviderSpec =>
84
+ 'image' in app;
85
+
86
+ export const isImageAppForm = (app: AppBase): app is ImageAppForm => app.specType === AppSpecType.OCI_IMAGE;
87
+ export const isInlineAppForm = (app: AppBase): app is InlineAppForm => app.specType === AppSpecType.INLINE;
88
+
89
+ const hasTemplateVariables = (str: string) => /{{.+?}}/.test(str);
90
+
91
+ export const getAppIdentifier = (app: AppForm) => {
92
+ if (isImageAppForm(app)) {
93
+ return app.name || app.image;
94
+ }
95
+ // Name is mandatory for inline applications
96
+ return app.name;
97
+ };
47
98
 
48
99
  export const getConfigFullRepoUrl = (config: RepoConfig, repositoryUrl: string) => {
49
100
  let relativePath: string = '';
@@ -84,7 +135,7 @@ export const isKubeProviderSpec = (providerSpec: ConfigProviderSpec): providerSp
84
135
 
85
136
  export type InlineConfigTemplate = ConfigTemplate & {
86
137
  type: ConfigType.INLINE;
87
- files: Array<{ path: string; content: string; base64: boolean; permissions?: string; user?: string; group?: string }>;
138
+ files: Array<InlineContent & { permissions?: string; user?: string; group?: string }>;
88
139
  };
89
140
 
90
141
  export const isInlineConfigTemplate = (configTemplate: ConfigTemplate): configTemplate is InlineConfigTemplate =>
@@ -108,3 +159,68 @@ export const isHttpProviderSpec = (providerSpec: ConfigProviderSpec): providerSp
108
159
  'httpRef' in providerSpec;
109
160
 
110
161
  export type SpecConfigTemplate = GitConfigTemplate | HttpConfigTemplate | KubeSecretTemplate | InlineConfigTemplate;
162
+ export type SystemdUnitFormValue = {
163
+ pattern: string;
164
+ exists: boolean;
165
+ };
166
+
167
+ export type DeviceSpecConfigFormValues = {
168
+ osImage?: string;
169
+ configTemplates: SpecConfigTemplate[];
170
+ applications: AppForm[];
171
+ systemdUnits: SystemdUnitFormValue[];
172
+ updatePolicy: UpdatePolicyForm;
173
+ registerMicroShift: boolean;
174
+ };
175
+
176
+ export type EditDeviceFormValues = DeviceSpecConfigFormValues & {
177
+ deviceAlias: string;
178
+ labels: FlightCtlLabel[];
179
+ fleetMatch: string;
180
+ };
181
+
182
+ export type FleetFormValues = DeviceSpecConfigFormValues & {
183
+ name: string;
184
+ fleetLabels: FlightCtlLabel[];
185
+ labels: FlightCtlLabel[];
186
+ rolloutPolicy: RolloutPolicyForm;
187
+ disruptionBudget: DisruptionBudgetForm;
188
+ updatePolicy: UpdatePolicyForm;
189
+ };
190
+
191
+ export enum BatchLimitType {
192
+ BatchLimitPercent = 'percent',
193
+ BatchLimitAbsoluteNumber = 'value',
194
+ }
195
+
196
+ export type BatchForm = {
197
+ selector: FlightCtlLabel[];
198
+ limit?: number;
199
+ limitType: BatchLimitType;
200
+ successThreshold?: number;
201
+ };
202
+
203
+ export type RolloutPolicyForm = {
204
+ isAdvanced: boolean;
205
+ updateTimeout: number;
206
+ batches: BatchForm[];
207
+ };
208
+
209
+ export type DisruptionBudgetForm = DisruptionBudget & {
210
+ isAdvanced: boolean;
211
+ };
212
+
213
+ export type UpdatePolicyForm = {
214
+ isAdvanced: boolean;
215
+ downloadAndInstallDiffer: boolean;
216
+ downloadStartsAt?: string;
217
+ downloadEndsAt?: string;
218
+ downloadScheduleMode: UpdateScheduleMode;
219
+ downloadWeekDays: boolean[];
220
+ downloadTimeZone: string;
221
+ installStartsAt?: string;
222
+ installEndsAt?: string;
223
+ installScheduleMode: UpdateScheduleMode;
224
+ installWeekDays: boolean[];
225
+ installTimeZone: string;
226
+ };
@@ -1,4 +1,15 @@
1
- import { ConditionType, Device, EnrollmentRequest, Fleet, ResourceSync } from '@flightctl/types';
1
+ import {
2
+ AppType,
3
+ ApplicationEnvVars,
4
+ ConditionType,
5
+ Device,
6
+ EnrollmentRequest,
7
+ FileContent,
8
+ Fleet,
9
+ ImageApplicationProviderSpec,
10
+ RelativePath,
11
+ ResourceSync,
12
+ } from '@flightctl/types';
2
13
 
3
14
  export enum FlightControlMetrics {
4
15
  ACTIVE_AGENT_COUNT_METRIC = 'flightctl_devicesimulator_active_agent_count',
@@ -50,3 +61,24 @@ export const isEnrollmentRequest = (resource: Device | EnrollmentRequest): resou
50
61
  export type AnnotationType = DeviceAnnotation; // Add more types when they are added to the API
51
62
 
52
63
  export const isFleet = (resource: ResourceSync | Fleet): resource is Fleet => resource.kind === 'Fleet';
64
+
65
+ // ApplicationProviderSpec's definition for inline files adds a Record<string, any>. We use the fixed types to get full Typescript checks for the field
66
+ export type InlineApplicationFileFixed = FileContent & RelativePath;
67
+
68
+ // "FixedApplicationProviderSpec" will need to be manually adjusted whenever the API definition changes
69
+ export type ApplicationProviderSpecFixed = ApplicationEnvVars & {
70
+ name?: string;
71
+ appType?: AppType;
72
+ } & (ImageApplicationProviderSpec | { inline: InlineApplicationFileFixed[] });
73
+
74
+ type CliArtifact = {
75
+ os: string;
76
+ arch: string;
77
+ filename: string;
78
+ sha256: string;
79
+ };
80
+
81
+ export type CliArtifactsResponse = {
82
+ baseUrl: string;
83
+ artifacts: CliArtifact[];
84
+ };
@@ -22,8 +22,14 @@ export const toAPILabel = (labels: FlightCtlLabel[]): Record<string, string> =>
22
22
  {} as Record<string, string>,
23
23
  );
24
24
 
25
- // Used to force the API to perform an exact match check for labels
26
25
  export const labelToExactApiMatchString = (label: FlightCtlLabel) => `${label.key}=${label.value || ''}`;
26
+ export const textToPartialApiMatchString = (text: string) => {
27
+ if (text.includes('=')) {
28
+ const [key, value] = text.split('=');
29
+ return value ? `metadata.labels.key=${key},metadata.labels.value contains ${value}` : `metadata.label.key=${key}`;
30
+ }
31
+ return `metadata.labels.keyOrValue contains ${text}`;
32
+ };
27
33
 
28
34
  export const labelToString = (label: FlightCtlLabel) => `${label.key}${label.value ? `=${label.value}` : ''}`;
29
35
 
@@ -1,16 +1,24 @@
1
- import { ApplicationSpec, BatchSequence, DisruptionBudget, PatchRequest, RolloutPolicy } from '@flightctl/types';
1
+ import {
2
+ BatchSequence,
3
+ DeviceUpdatePolicySpec,
4
+ DisruptionBudget,
5
+ PatchRequest,
6
+ RolloutPolicy,
7
+ UpdateSchedule,
8
+ } from '@flightctl/types';
2
9
  import isNil from 'lodash/isNil';
3
10
 
4
11
  import { FlightCtlLabel } from '../types/extraTypes';
5
12
  import { toAPILabel } from './labels';
6
- import { ApplicationFormSpec } from '../components/Device/EditDeviceWizard/types';
7
13
  import {
8
14
  BatchForm,
9
15
  BatchLimitType,
10
16
  DisruptionBudgetForm,
11
17
  FleetFormValues,
12
18
  RolloutPolicyForm,
13
- } from '../components/Fleet/CreateFleet/types';
19
+ UpdatePolicyForm,
20
+ } from '../types/deviceSpec';
21
+ import { getStartGraceDuration, getUpdateCronExpression, localDeviceTimezone } from './time';
14
22
 
15
23
  export const appendJSONPatch = <V = unknown>({
16
24
  patches,
@@ -127,6 +135,112 @@ const toApiDisruptionBudget = (disruptionValues: DisruptionBudgetForm) => {
127
135
  return data;
128
136
  };
129
137
 
138
+ export const schedulesAreEqual = (a: UpdateSchedule | undefined, b: UpdateSchedule | undefined) => {
139
+ if (!a && !b) {
140
+ return true;
141
+ }
142
+ if (!a || !b) {
143
+ return false;
144
+ }
145
+ if (a.at !== b.at) {
146
+ return false;
147
+ }
148
+ if ((a.timeZone || localDeviceTimezone) !== (b.timeZone || localDeviceTimezone)) {
149
+ return false;
150
+ }
151
+ return (a.startGraceDuration || '0s') === (b.startGraceDuration || '0s');
152
+ };
153
+
154
+ export const updatePolicyFormToApi = (form: Required<UpdatePolicyForm>) => {
155
+ const downloadSchedule = {
156
+ at: getUpdateCronExpression(form.downloadStartsAt, form.downloadScheduleMode, form.downloadWeekDays),
157
+ startGraceDuration: getStartGraceDuration(form.downloadStartsAt, form.downloadEndsAt),
158
+ timeZone: form.downloadTimeZone === localDeviceTimezone ? undefined : form.downloadTimeZone,
159
+ };
160
+ let updateSchedule: UpdateSchedule;
161
+ if (form.downloadAndInstallDiffer) {
162
+ updateSchedule = {
163
+ at: getUpdateCronExpression(form.installStartsAt, form.installScheduleMode, form.installWeekDays),
164
+ startGraceDuration: getStartGraceDuration(form.installStartsAt, form.installEndsAt),
165
+ timeZone: form.installTimeZone === localDeviceTimezone ? undefined : form.installTimeZone,
166
+ };
167
+ } else {
168
+ updateSchedule = { ...downloadSchedule };
169
+ }
170
+ return {
171
+ downloadSchedule,
172
+ updateSchedule,
173
+ };
174
+ };
175
+
176
+ export const getUpdatePolicyPatches = (
177
+ basePath: string,
178
+ currentPolicy: DeviceUpdatePolicySpec | undefined,
179
+ form: Required<UpdatePolicyForm>,
180
+ ): PatchRequest => {
181
+ // Switching from basic mode to advanced or viceversa
182
+ if (!currentPolicy) {
183
+ return form.isAdvanced
184
+ ? ([
185
+ {
186
+ op: 'add',
187
+ path: basePath,
188
+ value: updatePolicyFormToApi(form),
189
+ },
190
+ ] as PatchRequest)
191
+ : [];
192
+ } else if (!form.isAdvanced) {
193
+ return [
194
+ {
195
+ op: 'remove',
196
+ path: basePath,
197
+ },
198
+ ] as PatchRequest;
199
+ }
200
+
201
+ // Making changes to existing advaced settings
202
+ const updatePatches: PatchRequest = [];
203
+ const { downloadSchedule: newDownloadSched, updateSchedule: newInstallSched } = updatePolicyFormToApi(form);
204
+ if (!schedulesAreEqual(currentPolicy.downloadSchedule, newDownloadSched)) {
205
+ if (form.downloadAndInstallDiffer) {
206
+ updatePatches.push({
207
+ op: currentPolicy.downloadSchedule ? 'replace' : 'add',
208
+ path: `${basePath}/downloadSchedule`,
209
+ value: newDownloadSched,
210
+ });
211
+ } else {
212
+ updatePatches.push({
213
+ op: 'replace',
214
+ path: basePath,
215
+ value: {
216
+ downloadSchedule: newDownloadSched,
217
+ updateSchedule: newInstallSched,
218
+ },
219
+ });
220
+ }
221
+ } else if (!form.downloadAndInstallDiffer) {
222
+ // DownloadSchedule did not change. Check if they just unchecked "useDifferent" and updateSchedule must be changed?
223
+ if (!schedulesAreEqual(currentPolicy.updateSchedule, newDownloadSched)) {
224
+ // Important: we are using downloadSchedule here since we don't copy settings from download to update when
225
+ // the checkbox for "useDifferent" is unchecked
226
+ updatePatches.push({
227
+ op: currentPolicy.updateSchedule ? 'replace' : 'add',
228
+ path: `${basePath}/updateSchedule`,
229
+ value: newDownloadSched,
230
+ });
231
+ }
232
+ }
233
+ if (form.downloadAndInstallDiffer && !schedulesAreEqual(currentPolicy.updateSchedule, newInstallSched)) {
234
+ updatePatches.push({
235
+ op: currentPolicy.updateSchedule ? 'replace' : 'add',
236
+ path: `${basePath}/updateSchedule`,
237
+ value: newInstallSched,
238
+ });
239
+ }
240
+
241
+ return updatePatches;
242
+ };
243
+
130
244
  export const getRolloutPolicyData = ({ rolloutPolicy, disruptionBudget }: FleetFormValues) => {
131
245
  const newRolloutPolicy: RolloutPolicy = {};
132
246
  if (rolloutPolicy.isAdvanced) {
@@ -301,76 +415,16 @@ export const getLabelPatches = (
301
415
  return patches;
302
416
  };
303
417
 
304
- export const toAPIApplication = (app: ApplicationFormSpec): ApplicationSpec => {
305
- const envVars = app.variables.reduce((acc, variable) => {
306
- acc[variable.name] = variable.value;
307
- return acc;
308
- }, {});
309
-
310
- return app.name
311
- ? {
312
- name: app.name,
313
- image: app.image,
314
- envVars,
315
- }
316
- : {
317
- // Name must not be sent, otherwise the API expects it to have a value
318
- image: app.image,
319
- envVars,
320
- };
321
- };
322
-
323
- export const getApplicationPatches = (
324
- basePath: string,
325
- currentApps: ApplicationSpec[],
326
- updatedApps: ApplicationFormSpec[],
418
+ export const getDeviceLabelPatches = (
419
+ currentLabels: Record<string, string>,
420
+ newLabels: FlightCtlLabel[],
421
+ newAlias?: string,
327
422
  ) => {
328
- const patches: PatchRequest = [];
423
+ let allNewLabels = newLabels;
329
424
 
330
- const currentLen = currentApps.length;
331
- const newLen = updatedApps.length;
332
- if (currentLen === 0 && newLen > 0) {
333
- // First apps(s) have been added
334
- patches.push({
335
- path: `${basePath}/applications`,
336
- op: 'add',
337
- value: updatedApps.map(toAPIApplication),
338
- });
339
- } else if (currentLen > 0 && newLen === 0) {
340
- // Last app(s) have been removed
341
- patches.push({
342
- path: `${basePath}/applications`,
343
- op: 'remove',
344
- });
345
- } else if (currentLen !== newLen) {
346
- patches.push({
347
- path: `${basePath}/applications`,
348
- op: 'replace',
349
- value: updatedApps.map(toAPIApplication),
350
- });
351
- } else {
352
- const needsPatch = currentApps.some((currentApp, index) => {
353
- const updatedApp = updatedApps[index];
354
- if (updatedApp.name !== currentApp.name || updatedApp.image !== currentApp.image) {
355
- return true;
356
- }
357
- const currentVars = Object.entries(currentApp.envVars || {});
358
- if (currentVars.length !== updatedApp.variables.length) {
359
- return true;
360
- }
361
- return updatedApp.variables.some((variable) => {
362
- const currentValue = currentApp.envVars ? currentApp.envVars[variable.name] : undefined;
363
- return !currentValue || currentValue !== variable.value;
364
- });
365
- });
366
- if (needsPatch) {
367
- patches.push({
368
- path: `${basePath}/applications`,
369
- op: 'replace',
370
- value: updatedApps.map(toAPIApplication),
371
- });
372
- }
425
+ const currentAlias = newAlias || currentLabels['alias']; // The "alias" label is not allowed for devices, we need to add it back
426
+ if (currentAlias) {
427
+ allNewLabels = newLabels.concat([{ key: 'alias', value: currentAlias }]);
373
428
  }
374
-
375
- return patches;
429
+ return getLabelPatches('/metadata/labels', currentLabels, allNewLabels);
376
430
  };