@flightctl/ui-components 0.4.0 → 0.5.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 (384) hide show
  1. package/dist/src/components/DetailsPage/DetailsPageActions.d.ts +11 -4
  2. package/dist/src/components/DetailsPage/DetailsPageActions.d.ts.map +1 -1
  3. package/dist/src/components/DetailsPage/DetailsPageActions.js +15 -4
  4. package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -1
  5. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +1 -1
  6. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
  7. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +1 -1
  8. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
  9. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +2 -2
  10. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -1
  11. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
  12. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +22 -15
  13. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
  14. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
  15. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +42 -39
  16. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
  17. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts +7 -0
  18. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts.map +1 -0
  19. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js +41 -0
  20. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js.map +1 -0
  21. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts +7 -0
  22. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts.map +1 -0
  23. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +30 -0
  24. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js.map +1 -0
  25. package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
  26. package/dist/src/components/Device/DeviceDetails/TerminalTab.js +1 -1
  27. package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
  28. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts +16 -0
  29. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts.map +1 -0
  30. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js +57 -0
  31. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js.map +1 -0
  32. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts +16 -0
  33. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -0
  34. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +73 -0
  35. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -0
  36. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts +10 -0
  37. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts.map +1 -0
  38. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js +19 -0
  39. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js.map +1 -0
  40. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts +8 -0
  41. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts.map +1 -0
  42. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js +34 -0
  43. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js.map +1 -0
  44. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +0 -22
  45. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
  46. package/dist/src/components/Device/DevicesPage/DevicesPage.js +9 -92
  47. package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
  48. package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts +16 -0
  49. package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts.map +1 -0
  50. package/dist/src/components/Device/DevicesPage/{DeviceTableRow.js → EnrolledDeviceTableRow.js} +9 -13
  51. package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.js.map +1 -0
  52. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts +23 -0
  53. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -0
  54. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +99 -0
  55. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -0
  56. package/dist/src/components/Device/DevicesPage/useDevices.d.ts +2 -0
  57. package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
  58. package/dist/src/components/Device/DevicesPage/useDevices.js +16 -1
  59. package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
  60. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
  61. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +5 -3
  62. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
  63. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +1 -1
  64. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -1
  65. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
  66. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +2 -2
  67. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
  68. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
  69. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +1 -1
  70. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
  71. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -1
  72. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js +1 -1
  73. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
  74. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.d.ts.map +1 -1
  75. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +7 -7
  76. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js.map +1 -1
  77. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts +9 -0
  78. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts.map +1 -0
  79. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js +37 -0
  80. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js.map +1 -0
  81. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -1
  82. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +6 -4
  83. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -1
  84. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -1
  85. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
  86. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +4 -13
  87. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
  88. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +2 -2
  89. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
  90. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -2
  91. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
  92. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +2 -2
  93. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -1
  94. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -1
  95. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
  96. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +32 -3
  97. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
  98. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.d.ts.map +1 -1
  99. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js +4 -0
  100. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -1
  101. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts +26 -0
  102. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts.map +1 -0
  103. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js +63 -0
  104. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js.map +1 -0
  105. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
  106. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +19 -10
  107. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
  108. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts +9 -0
  109. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts.map +1 -0
  110. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js +52 -0
  111. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js.map +1 -0
  112. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts +8 -0
  113. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts.map +1 -0
  114. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js +95 -0
  115. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js.map +1 -0
  116. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts +4 -0
  117. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts.map +1 -0
  118. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js +31 -0
  119. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js.map +1 -0
  120. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts +4 -0
  121. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts.map +1 -0
  122. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js +78 -0
  123. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js.map +1 -0
  124. package/dist/src/components/Fleet/CreateFleet/types.d.ts +21 -0
  125. package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +1 -1
  126. package/dist/src/components/Fleet/CreateFleet/types.js +6 -0
  127. package/dist/src/components/Fleet/CreateFleet/types.js.map +1 -1
  128. package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
  129. package/dist/src/components/Fleet/CreateFleet/utils.js +15 -1
  130. package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
  131. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.d.ts.map +1 -1
  132. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js +9 -7
  133. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js.map +1 -1
  134. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts +9 -0
  135. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts.map +1 -0
  136. package/dist/src/components/Fleet/FleetDetails/{FleetDevices.js → FleetDevicesCharts.js} +4 -4
  137. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.js.map +1 -0
  138. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts +10 -0
  139. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts.map +1 -0
  140. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js +30 -0
  141. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js.map +1 -0
  142. package/dist/src/components/Fleet/FleetResourceSyncs.js +2 -2
  143. package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
  144. package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
  145. package/dist/src/components/Fleet/FleetRow.js +7 -5
  146. package/dist/src/components/Fleet/FleetRow.js.map +1 -1
  147. package/dist/src/components/Fleet/FleetsPage.js +2 -2
  148. package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
  149. package/dist/src/components/Fleet/useFleets.d.ts +3 -3
  150. package/dist/src/components/Fleet/useFleets.d.ts.map +1 -1
  151. package/dist/src/components/Fleet/useFleets.js +3 -3
  152. package/dist/src/components/Fleet/useFleets.js.map +1 -1
  153. package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
  154. package/dist/src/components/ListPage/ListPage.js +6 -1
  155. package/dist/src/components/ListPage/ListPage.js.map +1 -1
  156. package/dist/src/components/ListPage/ListPageActions.d.ts +8 -15
  157. package/dist/src/components/ListPage/ListPageActions.d.ts.map +1 -1
  158. package/dist/src/components/ListPage/ListPageActions.js +25 -5
  159. package/dist/src/components/ListPage/ListPageActions.js.map +1 -1
  160. package/dist/src/components/ListPage/types.d.ts +11 -11
  161. package/dist/src/components/ListPage/types.d.ts.map +1 -1
  162. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.d.ts.map +1 -1
  163. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js +0 -1
  164. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js.map +1 -1
  165. package/dist/src/components/OverviewPage/OverviewPage.d.ts.map +1 -1
  166. package/dist/src/components/OverviewPage/OverviewPage.js +6 -1
  167. package/dist/src/components/OverviewPage/OverviewPage.js.map +1 -1
  168. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js +1 -1
  169. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js.map +1 -1
  170. package/dist/src/components/Repository/useRepositories.d.ts +2 -2
  171. package/dist/src/components/Repository/useRepositories.d.ts.map +1 -1
  172. package/dist/src/components/Repository/useRepositories.js.map +1 -1
  173. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +2 -2
  174. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
  175. package/dist/src/components/Status/DeviceLifecycleStatus.d.ts +7 -0
  176. package/dist/src/components/Status/DeviceLifecycleStatus.d.ts.map +1 -0
  177. package/dist/src/components/Status/DeviceLifecycleStatus.js +25 -0
  178. package/dist/src/components/Status/DeviceLifecycleStatus.js.map +1 -0
  179. package/dist/src/components/Status/StatusDisplay.d.ts +1 -1
  180. package/dist/src/components/Status/StatusDisplay.d.ts.map +1 -1
  181. package/dist/src/components/Status/StatusDisplay.js +3 -3
  182. package/dist/src/components/Status/StatusDisplay.js.map +1 -1
  183. package/dist/src/components/Table/Table.d.ts.map +1 -1
  184. package/dist/src/components/Table/Table.js +2 -2
  185. package/dist/src/components/Table/Table.js.map +1 -1
  186. package/dist/src/components/Table/TablePagination.d.ts +4 -3
  187. package/dist/src/components/Table/TablePagination.d.ts.map +1 -1
  188. package/dist/src/components/Table/TablePagination.js +6 -5
  189. package/dist/src/components/Table/TablePagination.js.map +1 -1
  190. package/dist/src/components/common/EditableLabelControl.d.ts.map +1 -1
  191. package/dist/src/components/common/EditableLabelControl.js +5 -7
  192. package/dist/src/components/common/EditableLabelControl.js.map +1 -1
  193. package/dist/src/components/common/TechPreviewBadge.d.ts +4 -0
  194. package/dist/src/components/common/TechPreviewBadge.d.ts.map +1 -0
  195. package/dist/src/components/common/TechPreviewBadge.js +23 -0
  196. package/dist/src/components/common/TechPreviewBadge.js.map +1 -0
  197. package/dist/src/components/form/LabelsField.d.ts.map +1 -1
  198. package/dist/src/components/form/LabelsField.js +4 -1
  199. package/dist/src/components/form/LabelsField.js.map +1 -1
  200. package/dist/src/components/form/NumberField.d.ts +10 -0
  201. package/dist/src/components/form/NumberField.d.ts.map +1 -0
  202. package/dist/src/components/form/NumberField.js +51 -0
  203. package/dist/src/components/form/NumberField.js.map +1 -0
  204. package/dist/src/components/form/TextListField.d.ts +12 -0
  205. package/dist/src/components/form/TextListField.d.ts.map +1 -0
  206. package/dist/src/components/form/TextListField.js +46 -0
  207. package/dist/src/components/form/TextListField.js.map +1 -0
  208. package/dist/src/components/form/validations.d.ts +34 -6
  209. package/dist/src/components/form/validations.d.ts.map +1 -1
  210. package/dist/src/components/form/validations.js +78 -4
  211. package/dist/src/components/form/validations.js.map +1 -1
  212. package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts +9 -0
  213. package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts.map +1 -0
  214. package/dist/src/components/modals/DecommissionModal/DecommissionModal.js +51 -0
  215. package/dist/src/components/modals/DecommissionModal/DecommissionModal.js.map +1 -0
  216. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +4 -2
  217. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
  218. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +11 -4
  219. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
  220. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts +10 -0
  221. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts.map +1 -0
  222. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js +67 -0
  223. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js.map +1 -0
  224. package/dist/src/constants.d.ts +1 -1
  225. package/dist/src/constants.d.ts.map +1 -1
  226. package/dist/src/constants.js +1 -1
  227. package/dist/src/constants.js.map +1 -1
  228. package/dist/src/hooks/useAppContext.d.ts +1 -1
  229. package/dist/src/hooks/useAppContext.d.ts.map +1 -1
  230. package/dist/src/hooks/useFetch.d.ts +1 -1
  231. package/dist/src/hooks/useFetchPeriodically.js +10 -10
  232. package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
  233. package/dist/src/hooks/useTablePagination.d.ts +5 -3
  234. package/dist/src/hooks/useTablePagination.d.ts.map +1 -1
  235. package/dist/src/hooks/useTablePagination.js +9 -5
  236. package/dist/src/hooks/useTablePagination.js.map +1 -1
  237. package/dist/src/hooks/useWebSocket.d.ts +1 -1
  238. package/dist/src/hooks/useWebSocket.js +4 -4
  239. package/dist/src/hooks/useWebSocket.js.map +1 -1
  240. package/dist/src/links.d.ts +1 -0
  241. package/dist/src/links.d.ts.map +1 -1
  242. package/dist/src/links.js +2 -1
  243. package/dist/src/links.js.map +1 -1
  244. package/dist/src/types/rbac.d.ts +3 -1
  245. package/dist/src/types/rbac.d.ts.map +1 -1
  246. package/dist/src/types/rbac.js +2 -0
  247. package/dist/src/types/rbac.js.map +1 -1
  248. package/dist/src/utils/api.d.ts +3 -6
  249. package/dist/src/utils/api.d.ts.map +1 -1
  250. package/dist/src/utils/api.js.map +1 -1
  251. package/dist/src/utils/apiCalls.d.ts +2 -0
  252. package/dist/src/utils/apiCalls.d.ts.map +1 -0
  253. package/dist/src/utils/apiCalls.js +23 -0
  254. package/dist/src/utils/apiCalls.js.map +1 -0
  255. package/dist/src/utils/devices.d.ts +6 -3
  256. package/dist/src/utils/devices.d.ts.map +1 -1
  257. package/dist/src/utils/devices.js +20 -1
  258. package/dist/src/utils/devices.js.map +1 -1
  259. package/dist/src/utils/patch.d.ts +4 -1
  260. package/dist/src/utils/patch.d.ts.map +1 -1
  261. package/dist/src/utils/patch.js +166 -9
  262. package/dist/src/utils/patch.js.map +1 -1
  263. package/dist/src/utils/status/common.js +13 -12
  264. package/dist/src/utils/status/common.js.map +1 -1
  265. package/dist/src/utils/status/devices.d.ts +3 -3
  266. package/dist/src/utils/status/devices.d.ts.map +1 -1
  267. package/dist/src/utils/status/devices.js +40 -5
  268. package/dist/src/utils/status/devices.js.map +1 -1
  269. package/dist/src/utils/status/fleet.d.ts +4 -4
  270. package/dist/src/utils/status/fleet.d.ts.map +1 -1
  271. package/dist/src/utils/status/fleet.js +15 -2
  272. package/dist/src/utils/status/fleet.js.map +1 -1
  273. package/dist/src/utils/tooltip.d.ts +7 -0
  274. package/dist/src/utils/tooltip.d.ts.map +1 -0
  275. package/dist/src/utils/tooltip.js +6 -0
  276. package/dist/src/utils/tooltip.js.map +1 -0
  277. package/package.json +1 -1
  278. package/src/components/DetailsPage/DetailsPageActions.tsx +34 -6
  279. package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +1 -1
  280. package/src/components/Device/DeviceDetails/DeviceApplications.tsx +3 -3
  281. package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +53 -34
  282. package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +71 -54
  283. package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx +75 -0
  284. package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +47 -0
  285. package/src/components/Device/DeviceDetails/TerminalTab.tsx +1 -4
  286. package/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.tsx +89 -0
  287. package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +156 -0
  288. package/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.tsx +30 -0
  289. package/src/components/Device/DevicesPage/DevicesEmptyStates.tsx +46 -0
  290. package/src/components/Device/DevicesPage/DevicesPage.tsx +45 -215
  291. package/src/components/Device/DevicesPage/{DeviceTableRow.tsx → EnrolledDeviceTableRow.tsx} +16 -20
  292. package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +208 -0
  293. package/src/components/Device/DevicesPage/useDevices.ts +21 -1
  294. package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +6 -3
  295. package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +1 -1
  296. package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +2 -0
  297. package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +1 -0
  298. package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +1 -0
  299. package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +27 -19
  300. package/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.tsx +55 -0
  301. package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +9 -7
  302. package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +10 -36
  303. package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +2 -2
  304. package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +2 -2
  305. package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +3 -2
  306. package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +46 -5
  307. package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +4 -0
  308. package/src/components/Fleet/CreateFleet/fleetSpecUtils.ts +62 -0
  309. package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +65 -30
  310. package/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.tsx +87 -0
  311. package/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.tsx +155 -0
  312. package/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.tsx +87 -0
  313. package/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.tsx +190 -0
  314. package/src/components/Fleet/CreateFleet/types.ts +25 -0
  315. package/src/components/Fleet/CreateFleet/utils.ts +20 -1
  316. package/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx +10 -7
  317. package/src/components/Fleet/FleetDetails/{FleetDevices.tsx → FleetDevicesCharts.tsx} +4 -4
  318. package/src/components/Fleet/FleetDetails/FleetDevicesCount.tsx +53 -0
  319. package/src/components/Fleet/FleetResourceSyncs.tsx +2 -2
  320. package/src/components/Fleet/FleetRow.tsx +12 -4
  321. package/src/components/Fleet/FleetsPage.tsx +2 -2
  322. package/src/components/Fleet/useFleets.ts +7 -7
  323. package/src/components/ListPage/ListPage.tsx +12 -4
  324. package/src/components/ListPage/ListPageActions.tsx +50 -16
  325. package/src/components/ListPage/types.ts +8 -8
  326. package/src/components/OverviewPage/Cards/Status/DeviceStatusChart.tsx +0 -1
  327. package/src/components/OverviewPage/OverviewPage.tsx +12 -4
  328. package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +1 -1
  329. package/src/components/Repository/useRepositories.ts +2 -2
  330. package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +2 -2
  331. package/src/components/Status/DeviceLifecycleStatus.tsx +33 -0
  332. package/src/components/Status/StatusDisplay.tsx +4 -4
  333. package/src/components/Table/Table.tsx +2 -1
  334. package/src/components/Table/TablePagination.tsx +9 -7
  335. package/src/components/common/EditableLabelControl.tsx +7 -6
  336. package/src/components/common/TechPreviewBadge.tsx +43 -0
  337. package/src/components/form/LabelsField.tsx +4 -1
  338. package/src/components/form/NumberField.tsx +78 -0
  339. package/src/components/form/TextListField.tsx +82 -0
  340. package/src/components/form/validations.ts +103 -10
  341. package/src/components/modals/DecommissionModal/DecommissionModal.tsx +95 -0
  342. package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -8
  343. package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx +130 -0
  344. package/src/constants.ts +1 -1
  345. package/src/hooks/useAppContext.tsx +1 -1
  346. package/src/hooks/useFetchPeriodically.ts +11 -11
  347. package/src/hooks/{useTablePagination.tsx → useTablePagination.ts} +13 -7
  348. package/src/hooks/useWebSocket.ts +4 -4
  349. package/src/links.ts +2 -0
  350. package/src/types/rbac.ts +2 -0
  351. package/src/utils/api.ts +13 -6
  352. package/src/utils/apiCalls.ts +15 -0
  353. package/src/utils/devices.ts +21 -3
  354. package/src/utils/patch.ts +182 -8
  355. package/src/utils/status/common.ts +8 -8
  356. package/src/utils/status/devices.ts +39 -8
  357. package/src/utils/status/fleet.ts +21 -6
  358. package/src/utils/tooltip.ts +2 -0
  359. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts +0 -8
  360. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts.map +0 -1
  361. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js +0 -23
  362. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js.map +0 -1
  363. package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +0 -16
  364. package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +0 -1
  365. package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +0 -1
  366. package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts +0 -9
  367. package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +0 -1
  368. package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +0 -1
  369. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts +0 -7
  370. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts.map +0 -1
  371. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js +0 -13
  372. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js.map +0 -1
  373. package/dist/src/components/Status/IntegrityStatus.d.ts +0 -7
  374. package/dist/src/components/Status/IntegrityStatus.d.ts.map +0 -1
  375. package/dist/src/components/Status/IntegrityStatus.js +0 -17
  376. package/dist/src/components/Status/IntegrityStatus.js.map +0 -1
  377. package/dist/src/utils/status/integrity.d.ts +0 -5
  378. package/dist/src/utils/status/integrity.d.ts.map +0 -1
  379. package/dist/src/utils/status/integrity.js +0 -28
  380. package/dist/src/utils/status/integrity.js.map +0 -1
  381. package/src/components/DetailsPage/Tables/IntegrityDetails.tsx +0 -44
  382. package/src/components/Fleet/FleetDetails/FleetDevicesLink.tsx +0 -16
  383. package/src/components/Status/IntegrityStatus.tsx +0 -19
  384. package/src/utils/status/integrity.ts +0 -26
@@ -12,9 +12,9 @@ import {
12
12
  } from '../../Status/utils';
13
13
  import DonutChart from '../../charts/DonutChart';
14
14
  import { getApplicationSummaryStatusItems } from '../../../utils/status/applications';
15
- import { toChartData } from '../../../components/charts/utils';
15
+ import { toChartData } from '../../charts/utils';
16
16
 
17
- interface FleetDevicesProps {
17
+ interface FleetDevicesChartsProps {
18
18
  fleetId: string;
19
19
  devicesSummary: DevicesSummary;
20
20
  }
@@ -90,7 +90,7 @@ const DevicesByDeviceStatusChart = ({
90
90
  return <DonutChart title={t('Device status')} data={deviceStatusData} helperText={getDeviceStatusHelperText(t)} />;
91
91
  };
92
92
 
93
- const FleetDevices = ({ devicesSummary, fleetId }: FleetDevicesProps) => {
93
+ const FleetDevicesCharts = ({ devicesSummary, fleetId }: FleetDevicesChartsProps) => {
94
94
  return (
95
95
  <Flex justifyContent={{ default: 'justifyContentSpaceAround' }}>
96
96
  <FlexItem>
@@ -106,4 +106,4 @@ const FleetDevices = ({ devicesSummary, fleetId }: FleetDevicesProps) => {
106
106
  );
107
107
  };
108
108
 
109
- export default FleetDevices;
109
+ export default FleetDevicesCharts;
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { DevicesSummary } from '@flightctl/types';
3
+ import { Icon, Popover } from '@patternfly/react-core';
4
+ import { ExclamationCircleIcon } from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
5
+
6
+ import { Link, ROUTE } from '../../../hooks/useNavigate';
7
+ import { useTranslation } from '../../../hooks/useTranslation';
8
+
9
+ type FleetDevicesCountProps = {
10
+ fleetId: string;
11
+ devicesSummary: DevicesSummary | undefined;
12
+ error?: string;
13
+ };
14
+
15
+ const UpdatedFleetDevices = ({ error }: { error?: string }) => {
16
+ const { t } = useTranslation();
17
+ if (!error) {
18
+ return null;
19
+ }
20
+
21
+ return (
22
+ <Popover
23
+ aria-label={t('Fleet devices popover')}
24
+ headerContent={t('Rollout error')}
25
+ bodyContent={error}
26
+ hasAutoWidth={false}
27
+ >
28
+ <Icon status="danger" className="pf-v5-u-mr-sm">
29
+ <ExclamationCircleIcon />
30
+ </Icon>
31
+ </Popover>
32
+ );
33
+ };
34
+
35
+ const FleetDevicesCount = ({ fleetId, devicesSummary, error }: FleetDevicesCountProps) => {
36
+ if (!devicesSummary || !devicesSummary.total) {
37
+ return <>0/0</>;
38
+ }
39
+
40
+ const upToDate = devicesSummary.updateStatus['UpToDate'];
41
+ return (
42
+ <>
43
+ {/* Devices may continue updating even after a rollout failed. If all devices are up-to-date, do not show the rollout error */}
44
+ {upToDate !== devicesSummary.total && <UpdatedFleetDevices error={error} />}
45
+ {`${upToDate || 0}`}/
46
+ <Link to={ROUTE.DEVICES} query={`fleetId=${fleetId}`}>
47
+ {devicesSummary.total}
48
+ </Link>
49
+ </>
50
+ );
51
+ };
52
+
53
+ export default FleetDevicesCount;
@@ -146,14 +146,14 @@ const FleetResourceSyncs = () => {
146
146
  return (
147
147
  <PageSection variant={PageSectionVariants.light}>
148
148
  <Stack hasGutter>
149
- {errorRs.map((rs) => {
149
+ {pendingRs.map((rs) => {
150
150
  return (
151
151
  <StackItem key={rs.metadata.name as string}>
152
152
  <ResourceSyncInfoAlert rs={rs} />
153
153
  </StackItem>
154
154
  );
155
155
  })}
156
- {pendingRs.map((rs) => {
156
+ {errorRs.map((rs) => {
157
157
  return (
158
158
  <StackItem key={rs.metadata.name as string}>
159
159
  <ResourceSyncErrorAlert rs={rs} refetch={rsRefetch} />
@@ -3,11 +3,13 @@ import { ActionsColumn, IAction, OnSelect, Td, Tr } from '@patternfly/react-tabl
3
3
 
4
4
  import { Fleet } from '@flightctl/types';
5
5
  import { useTranslation } from '../../hooks/useTranslation';
6
- import { FleetOwnerLinkIcon, getOwnerName } from './FleetDetails/FleetOwnerLink';
7
6
  import { ROUTE, useNavigate } from '../../hooks/useNavigate';
7
+ import { getFleetRolloutStatusWarning } from '../../utils/status/fleet';
8
+
9
+ import { FleetOwnerLinkIcon, getOwnerName } from './FleetDetails/FleetOwnerLink';
8
10
  import FleetStatus from './FleetStatus';
9
11
  import ResourceLink from '../common/ResourceLink';
10
- import FleetDevicesLink from './FleetDetails/FleetDevicesLink';
12
+ import FleetDevicesCount from './FleetDetails/FleetDevicesCount';
11
13
 
12
14
  type FleetRowProps = {
13
15
  fleet: Fleet;
@@ -52,6 +54,8 @@ const FleetRow: React.FC<FleetRowProps> = ({
52
54
 
53
55
  const isManaged = !!fleet.metadata?.owner;
54
56
  const actions = useFleetActions(fleetName, isManaged, canEdit);
57
+ const fleetRolloutError = getFleetRolloutStatusWarning(fleet, t);
58
+
55
59
  if (canDelete) {
56
60
  actions.push({
57
61
  title: t('Delete fleet'),
@@ -82,8 +86,12 @@ const FleetRow: React.FC<FleetRowProps> = ({
82
86
  </FleetOwnerLinkIcon>
83
87
  </Td>
84
88
  <Td dataLabel={t('System image')}>{fleet.spec.template.spec.os?.image || '-'}</Td>
85
- <Td dataLabel={t('Devices')}>
86
- <FleetDevicesLink fleetId={fleetName} count={fleet.status?.devicesSummary?.total} />
89
+ <Td dataLabel={t('Up-to-date/devices')}>
90
+ <FleetDevicesCount
91
+ fleetId={fleetName}
92
+ devicesSummary={fleet.status?.devicesSummary}
93
+ error={fleetRolloutError}
94
+ />
87
95
  </Td>
88
96
  <Td dataLabel={t('Status')}>
89
97
  <FleetStatus fleet={fleet} />
@@ -97,7 +97,7 @@ const getColumns = (t: TFunction): ApiSortTableColumn[] => [
97
97
  name: t('System image'),
98
98
  },
99
99
  {
100
- name: t('Devices'),
100
+ name: t('Up-to-date/devices'),
101
101
  },
102
102
  {
103
103
  name: t('Status'),
@@ -110,7 +110,7 @@ const FleetTable = () => {
110
110
  const fleetColumns = React.useMemo(() => getColumns(t), [t]);
111
111
  const { name, setName, hasFiltersEnabled } = useFleetBackendFilters();
112
112
 
113
- const { fleets, isLoading, error, isUpdating, refetch, pagination } = useFleets({ name, addDevicesCount: true });
113
+ const { fleets, isLoading, error, isUpdating, refetch, pagination } = useFleets({ name, addDevicesSummary: true });
114
114
 
115
115
  const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
116
116
  const [fleetToDeleteId, setFleetToDeleteId] = React.useState<string>();
@@ -14,7 +14,7 @@ export enum FleetSearchParams {
14
14
  type FleetsEndpointArgs = {
15
15
  name?: string;
16
16
  nextContinue?: string;
17
- addDevicesCount?: boolean;
17
+ addDevicesSummary?: boolean;
18
18
  };
19
19
 
20
20
  export const useFleetBackendFilters = () => {
@@ -47,11 +47,11 @@ export const useFleetBackendFilters = () => {
47
47
 
48
48
  const getFleetsEndpoint = ({
49
49
  name,
50
- addDevicesCount,
50
+ addDevicesSummary,
51
51
  nextContinue,
52
52
  }: {
53
53
  name?: string;
54
- addDevicesCount?: boolean;
54
+ addDevicesSummary?: boolean;
55
55
  nextContinue?: string;
56
56
  }) => {
57
57
  const params = new URLSearchParams({
@@ -60,8 +60,8 @@ const getFleetsEndpoint = ({
60
60
  if (name) {
61
61
  params.set('fieldSelector', `metadata.name contains ${name}`);
62
62
  }
63
- if (addDevicesCount) {
64
- params.set('addDevicesCount', 'true');
63
+ if (addDevicesSummary) {
64
+ params.set('addDevicesSummary', 'true');
65
65
  }
66
66
  if (nextContinue) {
67
67
  params.set('continue', nextContinue);
@@ -81,11 +81,11 @@ export type FleetLoad = {
81
81
  error: unknown;
82
82
  isUpdating: boolean;
83
83
  refetch: VoidFunction;
84
- pagination: PaginationDetails;
84
+ pagination: PaginationDetails<FleetList>;
85
85
  };
86
86
 
87
87
  export const useFleets = (args: FleetsEndpointArgs): FleetLoad => {
88
- const pagination = useTablePagination();
88
+ const pagination = useTablePagination<FleetList>();
89
89
  const [fleetsEndpoint, fleetsDebouncing] = useFleetsEndpoint({ ...args, nextContinue: pagination.nextContinue });
90
90
  const [fleetsList, isLoading, error, refetch, updating] = useFetchPeriodically<FleetList>(
91
91
  {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { PageSection, PageSectionVariants, Title, TitleProps } from '@patternfly/react-core';
3
+ import { Flex, FlexItem, PageSection, PageSectionVariants, Title, TitleProps } from '@patternfly/react-core';
4
+ import TechPreviewBadge from '../common/TechPreviewBadge';
4
5
 
5
6
  type ListPageProps = {
6
7
  title: string;
@@ -11,9 +12,16 @@ type ListPageProps = {
11
12
  const ListPage: React.FC<ListPageProps> = ({ title, headingLevel = 'h1', children }) => {
12
13
  return (
13
14
  <PageSection variant={PageSectionVariants.light}>
14
- <Title headingLevel={headingLevel} size="3xl">
15
- {title}
16
- </Title>
15
+ <Flex gap={{ default: 'gapMd' }} alignItems={{ default: 'alignItemsCenter' }}>
16
+ <FlexItem>
17
+ <Title headingLevel={headingLevel} size="3xl">
18
+ {title}
19
+ </Title>
20
+ </FlexItem>
21
+ <FlexItem>
22
+ <TechPreviewBadge />
23
+ </FlexItem>
24
+ </Flex>
17
25
  {children}
18
26
  </PageSection>
19
27
  );
@@ -1,20 +1,18 @@
1
1
  import * as React from 'react';
2
- import DeleteModal from '../modals/DeleteModal/DeleteModal';
3
- import { IAction } from '@patternfly/react-table';
4
- import { useTranslation } from '../../hooks/useTranslation';
5
2
  import { TFunction } from 'react-i18next';
6
3
 
7
- export type DeleteListActionResult = {
8
- deleteAction: (params: { resourceId: string; resourceName?: string; disabledReason?: string | boolean }) => IAction;
9
- deleteModal: React.ReactNode;
10
- };
4
+ import { DeviceDecommissionTargetType } from '@flightctl/types';
5
+ import { ListAction, ListActionProps, ListActionResult } from './types';
11
6
 
12
- type ResourceType = 'Device' | 'EnrollmentRequest' | 'ResourceSync';
7
+ import { useTranslation } from '../../hooks/useTranslation';
8
+ import { getDisabledTooltipProps } from '../../utils/tooltip';
9
+ import DeleteModal from '../modals/DeleteModal/DeleteModal';
10
+ import DecommissionModal from '../modals/DecommissionModal/DecommissionModal';
13
11
 
14
- type DeleteListActionProps = {
15
- onDelete: (resourceId: string) => Promise<unknown>;
16
- resourceType: 'Device' | 'EnrollmentRequest' | 'ResourceSync';
17
- };
12
+ type DeleteResourceType = 'EnrollmentRequest' | 'ResourceSync' | 'Device';
13
+ type DecommissionResourceType = 'Device';
14
+
15
+ type ResourceType = 'Device' | 'EnrollmentRequest' | 'ResourceSync';
18
16
 
19
17
  const getResourceTypeLabel = (t: TFunction, resourceType: ResourceType) => {
20
18
  switch (resourceType) {
@@ -27,14 +25,17 @@ const getResourceTypeLabel = (t: TFunction, resourceType: ResourceType) => {
27
25
  }
28
26
  };
29
27
 
30
- export const useDeleteListAction = ({ resourceType, onDelete }: DeleteListActionProps): DeleteListActionResult => {
28
+ export const useDeleteListAction = ({
29
+ resourceType,
30
+ onConfirm,
31
+ }: ListActionProps<DeleteResourceType, never>): ListActionResult => {
31
32
  const { t } = useTranslation();
32
33
  const [deleteResourceId, setDeleteResourceId] = React.useState<string>();
33
34
  const [name, setName] = React.useState<string>();
34
35
 
35
36
  const resourceTypeLabel = getResourceTypeLabel(t, resourceType);
36
37
 
37
- const deleteAction: DeleteListActionResult['deleteAction'] = ({ resourceId, resourceName, disabledReason }) => {
38
+ const deleteAction: ListAction = ({ resourceId, resourceName, disabledReason }) => {
38
39
  const popperProps = disabledReason ? { tooltipProps: { content: disabledReason } } : undefined;
39
40
  return {
40
41
  title: t('Delete {{ resourceType }}', { resourceType: resourceTypeLabel }),
@@ -58,11 +59,44 @@ export const useDeleteListAction = ({ resourceType, onDelete }: DeleteListAction
58
59
  resourceName={name || deleteResourceId}
59
60
  onClose={onClose}
60
61
  onDelete={async () => {
61
- await onDelete(deleteResourceId);
62
+ await onConfirm(deleteResourceId);
62
63
  onClose();
63
64
  }}
64
65
  />
65
66
  );
66
67
 
67
- return { deleteAction, deleteModal };
68
+ return { action: deleteAction, modal: deleteModal };
69
+ };
70
+
71
+ export const useDecommissionListAction = ({
72
+ onConfirm,
73
+ }: ListActionProps<DecommissionResourceType, { target: DeviceDecommissionTargetType }>): ListActionResult => {
74
+ const { t } = useTranslation();
75
+ const [decommissionDeviceId, setDecommissionDeviceId] = React.useState<string>();
76
+
77
+ const decommissionAction: ListAction = ({ resourceId, disabledReason }) => {
78
+ const popperProps = getDisabledTooltipProps(disabledReason);
79
+ return {
80
+ title: t('Decommission device'),
81
+ ...popperProps,
82
+ onClick: () => {
83
+ setDecommissionDeviceId(resourceId);
84
+ },
85
+ };
86
+ };
87
+
88
+ const onClose = () => {
89
+ setDecommissionDeviceId(undefined);
90
+ };
91
+
92
+ const decommissionModal = decommissionDeviceId && (
93
+ <DecommissionModal
94
+ onClose={onClose}
95
+ onDecommission={async (target: DeviceDecommissionTargetType) => {
96
+ await onConfirm(decommissionDeviceId, { target });
97
+ }}
98
+ />
99
+ );
100
+
101
+ return { action: decommissionAction, modal: decommissionModal };
68
102
  };
@@ -1,13 +1,13 @@
1
1
  import { IAction } from '@patternfly/react-table';
2
2
 
3
- export type DeleteListActionResult = {
4
- deleteAction: (params: { resourceId: string; resourceName?: string; disabledReason?: string }) => IAction;
5
- deleteModal: React.ReactNode;
6
- };
3
+ export type ListAction = (params: { resourceId: string; resourceName?: string; disabledReason?: string }) => IAction;
7
4
 
8
- export type DeleteListActionProps = {
9
- onDelete: (resourceId: string) => Promise<unknown>;
10
- resourceType: string;
5
+ export type ListActionResult = {
6
+ action: ListAction;
7
+ modal: React.ReactNode;
11
8
  };
12
9
 
13
- export type DeleteListActionHook = (args: DeleteListActionProps) => DeleteListActionResult;
10
+ export type ListActionProps<T extends string, P> = {
11
+ onConfirm: (resourceId: string, params?: P) => Promise<unknown>;
12
+ resourceType: T;
13
+ };
@@ -23,7 +23,6 @@ const DeviceStatusChart = ({
23
23
 
24
24
  const statusItems = getDeviceStatusItems(t);
25
25
 
26
- // TODO should we add the "Pending" devices, now that the Device table does not contain ERs?
27
26
  const devStatusData = toOverviewChartData<DeviceSummaryStatusType>(
28
27
  deviceStatus,
29
28
  statusItems,
@@ -1,16 +1,24 @@
1
1
  import * as React from 'react';
2
2
  import Overview from './Overview';
3
3
  import { useTranslation } from '../../hooks/useTranslation';
4
- import { PageSection, PageSectionVariants, Title } from '@patternfly/react-core';
4
+ import { Flex, FlexItem, PageSection, PageSectionVariants, Title } from '@patternfly/react-core';
5
+ import TechPreviewBadge from '../common/TechPreviewBadge';
5
6
 
6
7
  const OverviewPage = () => {
7
8
  const { t } = useTranslation();
8
9
  return (
9
10
  <>
10
11
  <PageSection variant={PageSectionVariants.light}>
11
- <Title headingLevel="h1" size="3xl" role="heading">
12
- {t('Overview')}
13
- </Title>
12
+ <Flex gap={{ default: 'gapMd' }} alignItems={{ default: 'alignItemsCenter' }}>
13
+ <FlexItem>
14
+ <Title headingLevel="h1" size="3xl" role="heading">
15
+ {t('Overview')}
16
+ </Title>
17
+ </FlexItem>
18
+ <FlexItem>
19
+ <TechPreviewBadge />
20
+ </FlexItem>
21
+ </Flex>
14
22
  </PageSection>
15
23
  <PageSection variant={PageSectionVariants.light} isFilled>
16
24
  <Overview />
@@ -14,7 +14,7 @@ const ResourceSyncsTab = ({ repositoryId }: { repositoryId: string }) => {
14
14
  showLabel
15
15
  ariaLabel={t('Resource syncs')}
16
16
  content={t(
17
- 'Device management service will monitor the specified paths, import the defined fleets and synchronise devices',
17
+ 'Edge Manager will monitor the specified paths, import the defined fleets and synchronise devices',
18
18
  )}
19
19
  />
20
20
  </CardTitle>
@@ -35,9 +35,9 @@ export const useRepositories = (): [
35
35
  unknown,
36
36
  boolean,
37
37
  VoidFunction,
38
- Pick<PaginationDetails, 'currentPage' | 'setCurrentPage' | 'itemCount'>,
38
+ Pick<PaginationDetails<RepositoryList>, 'currentPage' | 'setCurrentPage' | 'itemCount'>,
39
39
  ] => {
40
- const { currentPage, setCurrentPage, itemCount, nextContinue, onPageFetched } = useTablePagination();
40
+ const { currentPage, setCurrentPage, itemCount, nextContinue, onPageFetched } = useTablePagination<RepositoryList>();
41
41
  const [repoEndpoint, isDebouncing] = useRepositoriesEndpoint({ nextContinue });
42
42
 
43
43
  const [repoList, isLoading, error, refetch] = useFetchPeriodically<RepositoryList>(
@@ -198,9 +198,9 @@ const RepositoryResourceSyncList = ({ repositoryId }: { repositoryId: string })
198
198
 
199
199
  const { onRowSelect, hasSelectedRows, isAllSelected, isRowSelected, setAllSelected } = useTableSelect();
200
200
 
201
- const { deleteAction, deleteModal } = useDeleteListAction({
201
+ const { action: deleteAction, modal: deleteModal } = useDeleteListAction({
202
202
  resourceType: 'ResourceSync',
203
- onDelete: async (resourceId: string) => {
203
+ onConfirm: async (resourceId: string) => {
204
204
  await remove(`resourcesyncs/${resourceId}`);
205
205
  refetch();
206
206
  },
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import disabledColor from '@patternfly/react-tokens/dist/js/global_disabled_color_100';
3
+
4
+ import { Device, DeviceLifecycleStatusType } from '@flightctl/types';
5
+ import { useTranslation } from '../../hooks/useTranslation';
6
+ import { getDeviceLifecycleStatus, getDeviceLifecycleStatusItems } from '../../utils/status/devices';
7
+ import StatusDisplay, { StatusDisplayContent } from './StatusDisplay';
8
+
9
+ const DeviceLifecycleStatus = ({ device }: { device: Device }) => {
10
+ const { t } = useTranslation();
11
+
12
+ const status = getDeviceLifecycleStatus(device);
13
+ const statusItems = getDeviceLifecycleStatusItems(t);
14
+
15
+ const item = statusItems.find((statusItem) => {
16
+ return statusItem.id === status;
17
+ });
18
+
19
+ if (item?.id === DeviceLifecycleStatusType.DeviceLifecycleStatusDecommissioned) {
20
+ // TODO The decommissioned status appears as disabled. Could there be a message associated to it? It would look weird (disabled with a link)
21
+ return (
22
+ <StatusDisplayContent
23
+ level={item.level}
24
+ customIcon={item.customIcon}
25
+ label={<span style={{ color: disabledColor.value }}>{item.label}</span>}
26
+ />
27
+ );
28
+ }
29
+
30
+ return <StatusDisplay item={item} message={device.status?.lifecycle.info} />;
31
+ };
32
+
33
+ export default DeviceLifecycleStatus;
@@ -9,7 +9,7 @@ import { useTranslation } from '../../hooks/useTranslation';
9
9
  import './StatusDisplay.css';
10
10
 
11
11
  type StatusLabelProps = {
12
- label: string;
12
+ label: React.ReactNode;
13
13
  message?: React.ReactNode;
14
14
  messageTitle?: string;
15
15
  level: StatusLevel;
@@ -17,7 +17,7 @@ type StatusLabelProps = {
17
17
  };
18
18
 
19
19
  export const StatusDisplayContent = ({ label, messageTitle, message, level, customIcon }: StatusLabelProps) => {
20
- const iconLevel = level === 'unknown' ? undefined : level;
20
+ const iconStatus = level === 'unknown' ? undefined : level;
21
21
  const IconComponent = customIcon || getDefaultStatusIcon(level);
22
22
 
23
23
  if (message) {
@@ -34,7 +34,7 @@ export const StatusDisplayContent = ({ label, messageTitle, message, level, cust
34
34
  isInline
35
35
  icon={
36
36
  <Icon
37
- status={iconLevel}
37
+ status={iconStatus}
38
38
  style={{ '--pf-v5-c-icon__content--Color': getDefaultStatusColor(level) } as React.CSSProperties}
39
39
  >
40
40
  <IconComponent />
@@ -51,7 +51,7 @@ export const StatusDisplayContent = ({ label, messageTitle, message, level, cust
51
51
  <Flex className="ftcl_status-label">
52
52
  <FlexItem>
53
53
  <Icon
54
- status={iconLevel}
54
+ status={iconStatus}
55
55
  style={{ '--pf-v5-c-icon__content--Color': getDefaultStatusColor(level) } as React.CSSProperties}
56
56
  >
57
57
  <IconComponent />
@@ -65,6 +65,7 @@ const Table: TableFC = ({
65
65
  <Tr>
66
66
  {!emptyData && onSelectAll && (
67
67
  <Th
68
+ aria-label={t('Select all rows')}
68
69
  select={{
69
70
  onSelect: (_event, isSelecting) => onSelectAll(isSelecting),
70
71
  isSelected: !!isAllSelected,
@@ -72,7 +73,7 @@ const Table: TableFC = ({
72
73
  />
73
74
  )}
74
75
  {columns.map((c) => (
75
- <Th key={c.name} {...c.thProps}>
76
+ <Th key={c.name} {...c.thProps} aria-label={c.name}>
76
77
  {c.helperText ? (
77
78
  <WithHelperText ariaLabel={c.name} showLabel content={c.helperText} triggerAction="hover" />
78
79
  ) : (
@@ -5,6 +5,7 @@ import { Pagination, PaginationVariant, Spinner } from '@patternfly/react-core';
5
5
  import { PAGE_SIZE } from '../../constants';
6
6
  import { PaginationDetails } from '../../hooks/useTablePagination';
7
7
  import { useTranslation } from '../../hooks/useTranslation';
8
+ import { ApiList } from '../../utils/api';
8
9
 
9
10
  const PaginationTemplate = ({
10
11
  currentPage,
@@ -16,26 +17,27 @@ const PaginationTemplate = ({
16
17
  isUpdating: boolean;
17
18
  }) => {
18
19
  const { t } = useTranslation();
19
- const totalPages = String(Math.ceil((itemCount || 0) / PAGE_SIZE));
20
+ const pagesCount = Math.ceil((itemCount || 0) / PAGE_SIZE);
20
21
 
21
- const pageNum = `${currentPage}`;
22
+ const page = String(currentPage <= pagesCount ? currentPage : 0);
23
+ const totalPages = String(pagesCount);
22
24
  return (
23
25
  <>
24
26
  {isUpdating && <Spinner size="sm" />}{' '}
25
27
  <Trans t={t}>
26
- {pageNum} of <strong>{totalPages}</strong>
28
+ {page} of <strong>{totalPages}</strong>
27
29
  </Trans>
28
30
  </>
29
31
  );
30
32
  };
31
33
 
32
- const TablePagination = ({
34
+ function TablePagination<T extends ApiList>({
33
35
  isUpdating,
34
36
  pagination,
35
37
  }: {
36
- pagination: Pick<PaginationDetails, 'currentPage' | 'setCurrentPage' | 'itemCount'>;
38
+ pagination: Pick<PaginationDetails<T>, 'currentPage' | 'setCurrentPage' | 'itemCount'>;
37
39
  isUpdating: boolean;
38
- }) => {
40
+ }) {
39
41
  const { t } = useTranslation();
40
42
  const { itemCount, currentPage, setCurrentPage } = pagination;
41
43
 
@@ -69,6 +71,6 @@ const TablePagination = ({
69
71
  onSetPage={onSetPage}
70
72
  />
71
73
  );
72
- };
74
+ }
73
75
 
74
76
  export default TablePagination;
@@ -16,16 +16,14 @@ const EditableLabelControl = ({
16
16
  onAddLabel,
17
17
  isEditable = true,
18
18
  }: EditableLabelControlProps) => {
19
- const [isEditing, setIsEditing] = React.useState<boolean>();
19
+ const [isEditing, setIsEditing] = React.useState<boolean>(false);
20
20
  const [label, setLabel] = React.useState<string>('');
21
21
  const { t } = useTranslation();
22
22
 
23
23
  const onConfirmAdd = () => {
24
- if (label) {
25
- onAddLabel(label);
26
- setIsEditing(false);
27
- setLabel('');
28
- }
24
+ onAddLabel(label);
25
+ setIsEditing(false);
26
+ setLabel('');
29
27
  };
30
28
 
31
29
  const onDiscardAdd = () => {
@@ -54,7 +52,10 @@ const EditableLabelControl = ({
54
52
  />
55
53
  ) : (
56
54
  <Button
55
+ aria-label={addButtonText || t('Add label')}
57
56
  variant="link"
57
+ className="pf-v5-u-ml-xs"
58
+ isInline
58
59
  isDisabled={!isEditable}
59
60
  onClick={() => {
60
61
  setIsEditing(true);
@@ -0,0 +1,43 @@
1
+ import * as React from 'react';
2
+ import { Label, Popover, Stack, StackItem } from '@patternfly/react-core';
3
+ import { InfoCircleIcon } from '@patternfly/react-icons/dist/js/icons';
4
+
5
+ import { useTranslation } from '../../hooks/useTranslation';
6
+ import LearnMoreLink from './LearnMoreLink';
7
+ import { TECH_PREVIEW_LEVEL_LINK } from '../../links';
8
+
9
+ const TechPreviewPopoverContent = () => {
10
+ const { t } = useTranslation();
11
+
12
+ return (
13
+ <Stack>
14
+ <StackItem>
15
+ {t(
16
+ 'Technology preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process.',
17
+ )}
18
+ </StackItem>
19
+ <StackItem>
20
+ <LearnMoreLink link={TECH_PREVIEW_LEVEL_LINK} />
21
+ </StackItem>
22
+ </Stack>
23
+ );
24
+ };
25
+
26
+ const TechPreviewBadge = () => {
27
+ const { t } = useTranslation();
28
+
29
+ return (
30
+ <Popover
31
+ aria-label={t('Technology preview description')}
32
+ bodyContent={<TechPreviewPopoverContent />}
33
+ withFocusTrap
34
+ triggerAction="click"
35
+ >
36
+ <Label color="orange" icon={<InfoCircleIcon />}>
37
+ {t('Technology preview')}
38
+ </Label>
39
+ </Popover>
40
+ );
41
+ };
42
+
43
+ export default TechPreviewBadge;