@flightctl/ui-components 0.0.5 → 0.4.0-rc1

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 (506) hide show
  1. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
  2. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts +8 -1
  3. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
  4. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +91 -9
  5. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
  6. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.d.ts.map +1 -1
  7. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js +15 -51
  8. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -1
  9. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +10 -0
  10. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -0
  11. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +65 -0
  12. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -0
  13. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts +5 -2
  14. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
  15. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +19 -10
  16. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
  17. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts +3 -4
  18. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
  19. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +6 -18
  20. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
  21. package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts +4 -3
  22. package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
  23. package/dist/src/components/Device/DeviceDetails/TerminalTab.js +13 -4
  24. package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
  25. package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.d.ts.map +1 -1
  26. package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js +4 -14
  27. package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js.map +1 -1
  28. package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +2 -0
  29. package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +1 -1
  30. package/dist/src/components/Device/DevicesPage/DeviceTableRow.js +14 -6
  31. package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +1 -1
  32. package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts +2 -5
  33. package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts.map +1 -1
  34. package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js +8 -8
  35. package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js.map +1 -1
  36. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts +3 -6
  37. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
  38. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +91 -17
  39. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
  40. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +10 -6
  41. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
  42. package/dist/src/components/Device/DevicesPage/DevicesPage.js +46 -42
  43. package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
  44. package/dist/src/components/Device/DevicesPage/types.d.ts +1 -10
  45. package/dist/src/components/Device/DevicesPage/types.d.ts.map +1 -1
  46. package/dist/src/components/Device/DevicesPage/types.js.map +1 -1
  47. package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts +2 -0
  48. package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts.map +1 -1
  49. package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.js +10 -3
  50. package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.js.map +1 -1
  51. package/dist/src/components/Device/DevicesPage/useDevices.d.ts +8 -3
  52. package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
  53. package/dist/src/components/Device/DevicesPage/useDevices.js +26 -47
  54. package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
  55. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts +2 -2
  56. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
  57. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +19 -4
  58. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
  59. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +7 -2
  60. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
  61. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +99 -7
  62. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
  63. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts +5 -0
  64. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -0
  65. package/dist/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.js → ApplicationTemplates.js} +31 -24
  66. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -0
  67. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
  68. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +9 -10
  69. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
  70. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts +2 -1
  71. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
  72. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -6
  73. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -1
  74. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts +4 -0
  75. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -0
  76. package/dist/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.js → ConfigurationTemplates.js} +42 -28
  77. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -0
  78. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
  79. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +53 -12
  80. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
  81. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +7 -0
  82. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -0
  83. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js +13 -0
  84. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -0
  85. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts +4 -0
  86. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -0
  87. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +38 -0
  88. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -0
  89. package/dist/src/components/Device/EditDeviceWizard/types.d.ts +3 -0
  90. package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +1 -1
  91. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -0
  92. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
  93. package/dist/src/components/Device/EditDeviceWizard/utils.js +5 -2
  94. package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
  95. package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.d.ts → SystemdUnitsModal/SystemdUnitsModal.d.ts} +6 -6
  96. package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -0
  97. package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.js → SystemdUnitsModal/SystemdUnitsModal.js} +28 -15
  98. package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -0
  99. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +15 -0
  100. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -0
  101. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js +57 -0
  102. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -0
  103. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts +2 -2
  104. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
  105. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +14 -4
  106. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
  107. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +9 -0
  108. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -0
  109. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +97 -0
  110. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -0
  111. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -0
  112. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
  113. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +15 -11
  114. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
  115. package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.d.ts +1 -1
  116. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.d.ts.map +1 -0
  117. package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.js +2 -2
  118. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.js.map +1 -0
  119. package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.css +10 -0
  120. package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.d.ts +5 -0
  121. package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.d.ts.map +1 -0
  122. package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.js +22 -0
  123. package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.js.map +1 -0
  124. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +9 -0
  125. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -0
  126. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +42 -0
  127. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -0
  128. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts +2 -2
  129. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
  130. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +19 -2
  131. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
  132. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.d.ts.map +1 -1
  133. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +2 -4
  134. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
  135. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
  136. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +6 -1
  137. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
  138. package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
  139. package/dist/src/components/Fleet/CreateFleet/utils.js +61 -35
  140. package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
  141. package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts +2 -2
  142. package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts.map +1 -1
  143. package/dist/src/components/Fleet/FleetDetails/FleetDetails.js +16 -6
  144. package/dist/src/components/Fleet/FleetDetails/FleetDetails.js.map +1 -1
  145. package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +1 -1
  146. package/dist/src/components/Fleet/FleetDetails/FleetDevices.js +7 -7
  147. package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +1 -1
  148. package/dist/src/components/Fleet/FleetResourceSyncs.d.ts +2 -5
  149. package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -1
  150. package/dist/src/components/Fleet/FleetResourceSyncs.js +38 -24
  151. package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
  152. package/dist/src/components/Fleet/FleetRow.d.ts +2 -0
  153. package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
  154. package/dist/src/components/Fleet/FleetRow.js +16 -14
  155. package/dist/src/components/Fleet/FleetRow.js.map +1 -1
  156. package/dist/src/components/Fleet/FleetsPage.d.ts +2 -2
  157. package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
  158. package/dist/src/components/Fleet/FleetsPage.js +37 -33
  159. package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
  160. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts +2 -2
  161. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -1
  162. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +11 -2
  163. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -1
  164. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
  165. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +5 -2
  166. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
  167. package/dist/src/components/Fleet/useFleets.d.ts +26 -0
  168. package/dist/src/components/Fleet/useFleets.d.ts.map +1 -0
  169. package/dist/src/components/Fleet/useFleets.js +71 -0
  170. package/dist/src/components/Fleet/useFleets.js.map +1 -0
  171. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts.map +1 -1
  172. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +6 -14
  173. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
  174. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts +0 -3
  175. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts.map +1 -1
  176. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +2 -2
  177. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -1
  178. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts.map +1 -1
  179. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js +5 -9
  180. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +1 -1
  181. package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -1
  182. package/dist/src/components/OverviewPage/Overview.js +11 -5
  183. package/dist/src/components/OverviewPage/Overview.js.map +1 -1
  184. package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts +2 -2
  185. package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -1
  186. package/dist/src/components/Repository/CreateRepository/CreateRepository.js +15 -6
  187. package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -1
  188. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
  189. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +4 -1
  190. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
  191. package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
  192. package/dist/src/components/Repository/CreateRepository/utils.js +22 -6
  193. package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
  194. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.d.ts.map +1 -1
  195. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js +3 -2
  196. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js.map +1 -1
  197. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts +2 -2
  198. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -1
  199. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +16 -5
  200. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
  201. package/dist/src/components/Repository/RepositoryList.d.ts +0 -1
  202. package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
  203. package/dist/src/components/Repository/RepositoryList.js +55 -46
  204. package/dist/src/components/Repository/RepositoryList.js.map +1 -1
  205. package/dist/src/components/Repository/useRepositories.d.ts +16 -0
  206. package/dist/src/components/Repository/useRepositories.d.ts.map +1 -0
  207. package/dist/src/components/Repository/useRepositories.js +40 -0
  208. package/dist/src/components/Repository/useRepositories.js.map +1 -0
  209. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
  210. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +21 -23
  211. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
  212. package/dist/src/components/Table/Table.d.ts +12 -3
  213. package/dist/src/components/Table/Table.d.ts.map +1 -1
  214. package/dist/src/components/Table/Table.js +4 -4
  215. package/dist/src/components/Table/Table.js.map +1 -1
  216. package/dist/src/components/Table/TablePagination.d.ts +8 -0
  217. package/dist/src/components/Table/TablePagination.d.ts.map +1 -0
  218. package/dist/src/components/Table/TablePagination.js +38 -0
  219. package/dist/src/components/Table/TablePagination.js.map +1 -0
  220. package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
  221. package/dist/src/components/Terminal/Terminal.js +1 -0
  222. package/dist/src/components/Terminal/Terminal.js.map +1 -1
  223. package/dist/src/components/charts/DonutChart.css +5 -0
  224. package/dist/src/components/charts/DonutChart.js +1 -1
  225. package/dist/src/components/charts/DonutChart.js.map +1 -1
  226. package/dist/src/components/common/AccessDenied.d.ts +4 -0
  227. package/dist/src/components/common/AccessDenied.d.ts.map +1 -0
  228. package/dist/src/components/common/AccessDenied.js +15 -0
  229. package/dist/src/components/common/AccessDenied.js.map +1 -0
  230. package/dist/src/components/common/ButtonWithPermissions.d.ts +8 -0
  231. package/dist/src/components/common/ButtonWithPermissions.d.ts.map +1 -0
  232. package/dist/src/components/common/ButtonWithPermissions.js +12 -0
  233. package/dist/src/components/common/ButtonWithPermissions.js.map +1 -0
  234. package/dist/src/components/common/LearnMoreLink.d.ts +7 -0
  235. package/dist/src/components/common/LearnMoreLink.d.ts.map +1 -0
  236. package/dist/src/components/common/LearnMoreLink.js +13 -0
  237. package/dist/src/components/common/LearnMoreLink.js.map +1 -0
  238. package/dist/src/components/common/LeaveFormConfirmation.js +1 -1
  239. package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -1
  240. package/dist/src/components/common/PageWithPermissions.d.ts +7 -0
  241. package/dist/src/components/common/PageWithPermissions.d.ts.map +1 -0
  242. package/dist/src/components/common/PageWithPermissions.js +17 -0
  243. package/dist/src/components/common/PageWithPermissions.js.map +1 -0
  244. package/dist/src/components/form/FilterSelect.d.ts +2 -4
  245. package/dist/src/components/form/FilterSelect.d.ts.map +1 -1
  246. package/dist/src/components/form/FilterSelect.js.map +1 -1
  247. package/dist/src/components/form/FlightCtlForm.css +3 -0
  248. package/dist/src/components/form/FlightCtlForm.d.ts +1 -0
  249. package/dist/src/components/form/FlightCtlForm.d.ts.map +1 -1
  250. package/dist/src/components/form/FlightCtlForm.js +2 -1
  251. package/dist/src/components/form/FlightCtlForm.js.map +1 -1
  252. package/dist/src/components/form/FormSelect.d.ts +1 -0
  253. package/dist/src/components/form/FormSelect.d.ts.map +1 -1
  254. package/dist/src/components/form/FormSelect.js +14 -2
  255. package/dist/src/components/form/FormSelect.js.map +1 -1
  256. package/dist/src/components/form/LabelsField.d.ts +2 -1
  257. package/dist/src/components/form/LabelsField.d.ts.map +1 -1
  258. package/dist/src/components/form/LabelsField.js +6 -6
  259. package/dist/src/components/form/LabelsField.js.map +1 -1
  260. package/dist/src/components/form/validations.d.ts +13 -2
  261. package/dist/src/components/form/validations.d.ts.map +1 -1
  262. package/dist/src/components/form/validations.js +39 -24
  263. package/dist/src/components/form/validations.js.map +1 -1
  264. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
  265. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +2 -5
  266. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
  267. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +2 -1
  268. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
  269. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +4 -4
  270. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
  271. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.d.ts.map +1 -1
  272. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +2 -3
  273. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -1
  274. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts +1 -1
  275. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts.map +1 -1
  276. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +6 -5
  277. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
  278. package/dist/src/constants.d.ts +2 -1
  279. package/dist/src/constants.d.ts.map +1 -1
  280. package/dist/src/constants.js +3 -1
  281. package/dist/src/constants.js.map +1 -1
  282. package/dist/src/hooks/useAccessReview.d.ts +4 -0
  283. package/dist/src/hooks/useAccessReview.d.ts.map +1 -0
  284. package/dist/src/hooks/useAccessReview.js +33 -0
  285. package/dist/src/hooks/useAccessReview.js.map +1 -0
  286. package/dist/src/hooks/useAppContext.d.ts +8 -7
  287. package/dist/src/hooks/useAppContext.d.ts.map +1 -1
  288. package/dist/src/hooks/useAppContext.js +2 -2
  289. package/dist/src/hooks/useAppContext.js.map +1 -1
  290. package/dist/src/hooks/useFetch.d.ts +4 -2
  291. package/dist/src/hooks/useFetch.d.ts.map +1 -1
  292. package/dist/src/hooks/useFetchPeriodically.d.ts +1 -1
  293. package/dist/src/hooks/useFetchPeriodically.d.ts.map +1 -1
  294. package/dist/src/hooks/useFetchPeriodically.js +4 -1
  295. package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
  296. package/dist/src/hooks/useFleetImportAccessReview.d.ts +3 -0
  297. package/dist/src/hooks/useFleetImportAccessReview.d.ts.map +1 -0
  298. package/dist/src/hooks/useFleetImportAccessReview.js +12 -0
  299. package/dist/src/hooks/useFleetImportAccessReview.js.map +1 -0
  300. package/dist/src/hooks/useNavigate.d.ts +3 -3
  301. package/dist/src/hooks/useNavigate.d.ts.map +1 -1
  302. package/dist/src/hooks/useNavigate.js +3 -3
  303. package/dist/src/hooks/useNavigate.js.map +1 -1
  304. package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts +2 -0
  305. package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts.map +1 -0
  306. package/dist/src/hooks/usePendingEnrollmentRequestsCount.js +13 -0
  307. package/dist/src/hooks/usePendingEnrollmentRequestsCount.js.map +1 -0
  308. package/dist/src/hooks/useTablePagination.d.ts +10 -0
  309. package/dist/src/hooks/useTablePagination.d.ts.map +1 -0
  310. package/dist/src/hooks/useTablePagination.js +33 -0
  311. package/dist/src/hooks/useTablePagination.js.map +1 -0
  312. package/dist/src/hooks/useWebSocket.d.ts +2 -2
  313. package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
  314. package/dist/src/hooks/useWebSocket.js.map +1 -1
  315. package/dist/src/links.d.ts +3 -0
  316. package/dist/src/links.d.ts.map +1 -0
  317. package/dist/src/links.js +6 -0
  318. package/dist/src/links.js.map +1 -0
  319. package/dist/src/types/rbac.d.ts +18 -0
  320. package/dist/src/types/rbac.d.ts.map +1 -0
  321. package/dist/src/types/rbac.js +23 -0
  322. package/dist/src/types/rbac.js.map +1 -0
  323. package/dist/src/utils/api.d.ts +3 -3
  324. package/dist/src/utils/api.d.ts.map +1 -1
  325. package/dist/src/utils/api.js.map +1 -1
  326. package/dist/src/utils/labels.d.ts +1 -1
  327. package/dist/src/utils/labels.d.ts.map +1 -1
  328. package/dist/src/utils/labels.js +4 -8
  329. package/dist/src/utils/labels.js.map +1 -1
  330. package/dist/src/utils/query.d.ts +15 -0
  331. package/dist/src/utils/query.d.ts.map +1 -0
  332. package/dist/src/utils/query.js +64 -0
  333. package/dist/src/utils/query.js.map +1 -0
  334. package/dist/src/utils/search.d.ts +1 -0
  335. package/dist/src/utils/search.d.ts.map +1 -1
  336. package/dist/src/utils/search.js +7 -7
  337. package/dist/src/utils/search.js.map +1 -1
  338. package/dist/src/utils/status/devices.d.ts +2 -1
  339. package/dist/src/utils/status/devices.d.ts.map +1 -1
  340. package/dist/src/utils/status/devices.js +1 -0
  341. package/dist/src/utils/status/devices.js.map +1 -1
  342. package/package.json +10 -10
  343. package/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
  344. package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +150 -13
  345. package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +31 -132
  346. package/src/components/Device/DeviceDetails/DeviceApplications.tsx +102 -0
  347. package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +33 -16
  348. package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +8 -38
  349. package/src/components/Device/DeviceDetails/TerminalTab.tsx +21 -4
  350. package/src/components/Device/DevicesPage/DeviceFilterSelect.tsx +13 -34
  351. package/src/components/Device/DevicesPage/DeviceTableRow.tsx +21 -9
  352. package/src/components/Device/DevicesPage/DeviceTableToolbar.tsx +13 -20
  353. package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +128 -48
  354. package/src/components/Device/DevicesPage/DevicesPage.tsx +86 -66
  355. package/src/components/Device/DevicesPage/types.ts +1 -13
  356. package/src/components/Device/DevicesPage/useDeviceBackendFilters.ts +14 -3
  357. package/src/components/Device/DevicesPage/useDevices.ts +49 -57
  358. package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +24 -4
  359. package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +156 -47
  360. package/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.tsx → ApplicationTemplates.tsx} +89 -53
  361. package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +22 -26
  362. package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +17 -12
  363. package/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.tsx → ConfigurationTemplates.tsx} +110 -52
  364. package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +108 -11
  365. package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +19 -0
  366. package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +75 -0
  367. package/src/components/Device/EditDeviceWizard/types.ts +3 -0
  368. package/src/components/Device/EditDeviceWizard/utils.ts +14 -4
  369. package/src/components/Device/{MatchPatternsModal/MatchPatternsModal.tsx → SystemdUnitsModal/SystemdUnitsModal.tsx} +36 -19
  370. package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +114 -0
  371. package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +28 -9
  372. package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +167 -0
  373. package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +28 -17
  374. package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.tsx +3 -2
  375. package/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.css +10 -0
  376. package/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.tsx +27 -0
  377. package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +63 -0
  378. package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +28 -2
  379. package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +2 -5
  380. package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +7 -0
  381. package/src/components/Fleet/CreateFleet/utils.ts +101 -49
  382. package/src/components/Fleet/FleetDetails/FleetDetails.tsx +57 -36
  383. package/src/components/Fleet/FleetDetails/FleetDevices.tsx +12 -18
  384. package/src/components/Fleet/FleetResourceSyncs.tsx +53 -41
  385. package/src/components/Fleet/FleetRow.tsx +28 -16
  386. package/src/components/Fleet/FleetsPage.tsx +70 -49
  387. package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +16 -3
  388. package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +25 -19
  389. package/src/components/Fleet/useFleets.ts +104 -0
  390. package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +6 -18
  391. package/src/components/OverviewPage/Cards/Status/StatusCardFilters.tsx +0 -7
  392. package/src/components/OverviewPage/Cards/ToDo/ToDoCard.tsx +6 -10
  393. package/src/components/OverviewPage/Overview.tsx +20 -8
  394. package/src/components/Repository/CreateRepository/CreateRepository.tsx +25 -9
  395. package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +5 -2
  396. package/src/components/Repository/CreateRepository/utils.ts +23 -7
  397. package/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.tsx +5 -3
  398. package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +32 -10
  399. package/src/components/Repository/RepositoryList.tsx +113 -70
  400. package/src/components/Repository/useRepositories.ts +59 -0
  401. package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +42 -40
  402. package/src/components/Table/Table.tsx +22 -9
  403. package/src/components/Table/TablePagination.tsx +74 -0
  404. package/src/components/Terminal/Terminal.tsx +1 -0
  405. package/src/components/charts/DonutChart.css +5 -0
  406. package/src/components/charts/DonutChart.tsx +1 -1
  407. package/src/components/common/AccessDenied.tsx +17 -0
  408. package/src/components/common/ButtonWithPermissions.tsx +14 -0
  409. package/src/components/common/LearnMoreLink.tsx +26 -0
  410. package/src/components/common/PageWithPermissions.tsx +19 -0
  411. package/src/components/form/FilterSelect.tsx +2 -4
  412. package/src/components/form/FlightCtlForm.css +3 -0
  413. package/src/components/form/FlightCtlForm.tsx +3 -1
  414. package/src/components/form/FormSelect.tsx +22 -2
  415. package/src/components/form/LabelsField.tsx +17 -13
  416. package/src/components/form/validations.ts +53 -25
  417. package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +2 -5
  418. package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -4
  419. package/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.tsx +2 -4
  420. package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +10 -5
  421. package/src/constants.ts +2 -1
  422. package/src/hooks/useAccessReview.ts +33 -0
  423. package/src/hooks/useAppContext.tsx +6 -5
  424. package/src/hooks/useFetchPeriodically.ts +4 -0
  425. package/src/hooks/useFleetImportAccessReview.ts +8 -0
  426. package/src/hooks/useNavigate.tsx +3 -3
  427. package/src/hooks/usePendingEnrollmentRequestsCount.ts +12 -0
  428. package/src/hooks/useTablePagination.tsx +44 -0
  429. package/src/hooks/useWebSocket.ts +4 -4
  430. package/src/links.ts +5 -0
  431. package/src/types/rbac.ts +18 -0
  432. package/src/utils/api.ts +3 -3
  433. package/src/utils/labels.ts +3 -7
  434. package/src/utils/query.ts +70 -0
  435. package/src/utils/search.ts +1 -1
  436. package/src/utils/status/devices.ts +1 -0
  437. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts +0 -12
  438. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts.map +0 -1
  439. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js +0 -40
  440. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js.map +0 -1
  441. package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts +0 -10
  442. package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts.map +0 -1
  443. package/dist/src/components/Device/DeviceDetails/SystemdTable.js +0 -38
  444. package/dist/src/components/Device/DeviceDetails/SystemdTable.js.map +0 -1
  445. package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts +0 -13
  446. package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts.map +0 -1
  447. package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js +0 -104
  448. package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js.map +0 -1
  449. package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.d.ts.map +0 -1
  450. package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.js.map +0 -1
  451. package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts +0 -8
  452. package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts.map +0 -1
  453. package/dist/src/components/Device/DevicesPage/useDeviceFilters.js +0 -16
  454. package/dist/src/components/Device/DevicesPage/useDeviceFilters.js.map +0 -1
  455. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts +0 -5
  456. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts.map +0 -1
  457. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.js.map +0 -1
  458. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts +0 -4
  459. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts.map +0 -1
  460. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +0 -1
  461. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts +0 -11
  462. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts.map +0 -1
  463. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js +0 -39
  464. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js.map +0 -1
  465. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.d.ts.map +0 -1
  466. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js.map +0 -1
  467. package/dist/src/components/common/HelperTextItems.d.ts +0 -3
  468. package/dist/src/components/common/HelperTextItems.d.ts.map +0 -1
  469. package/dist/src/components/common/HelperTextItems.js +0 -17
  470. package/dist/src/components/common/HelperTextItems.js.map +0 -1
  471. package/dist/src/hooks/useTableSort.d.ts +0 -7
  472. package/dist/src/hooks/useTableSort.d.ts.map +0 -1
  473. package/dist/src/hooks/useTableSort.js +0 -38
  474. package/dist/src/hooks/useTableSort.js.map +0 -1
  475. package/dist/src/utils/sort/device.d.ts +0 -4
  476. package/dist/src/utils/sort/device.d.ts.map +0 -1
  477. package/dist/src/utils/sort/device.js +0 -49
  478. package/dist/src/utils/sort/device.js.map +0 -1
  479. package/dist/src/utils/sort/fleet.d.ts +0 -4
  480. package/dist/src/utils/sort/fleet.d.ts.map +0 -1
  481. package/dist/src/utils/sort/fleet.js +0 -18
  482. package/dist/src/utils/sort/fleet.js.map +0 -1
  483. package/dist/src/utils/sort/generic.d.ts +0 -8
  484. package/dist/src/utils/sort/generic.d.ts.map +0 -1
  485. package/dist/src/utils/sort/generic.js +0 -37
  486. package/dist/src/utils/sort/generic.js.map +0 -1
  487. package/dist/src/utils/sort/repository.d.ts +0 -6
  488. package/dist/src/utils/sort/repository.d.ts.map +0 -1
  489. package/dist/src/utils/sort/repository.js +0 -28
  490. package/dist/src/utils/sort/repository.js.map +0 -1
  491. package/dist/src/utils/sort/resourceSync.d.ts +0 -6
  492. package/dist/src/utils/sort/resourceSync.d.ts.map +0 -1
  493. package/dist/src/utils/sort/resourceSync.js +0 -29
  494. package/dist/src/utils/sort/resourceSync.js.map +0 -1
  495. package/src/components/DetailsPage/Tables/SystemdDetailsTable.tsx +0 -63
  496. package/src/components/Device/DeviceDetails/SystemdTable.tsx +0 -65
  497. package/src/components/Device/DevicesPage/EnrollmentRequestList.tsx +0 -183
  498. package/src/components/Device/DevicesPage/useDeviceFilters.ts +0 -15
  499. package/src/components/Device/MatchPatternsModal/MatchPatternsForm.tsx +0 -92
  500. package/src/components/common/HelperTextItems.tsx +0 -25
  501. package/src/hooks/useTableSort.ts +0 -42
  502. package/src/utils/sort/device.ts +0 -60
  503. package/src/utils/sort/fleet.ts +0 -16
  504. package/src/utils/sort/generic.ts +0 -37
  505. package/src/utils/sort/repository.ts +0 -28
  506. package/src/utils/sort/resourceSync.ts +0 -30
@@ -1,38 +1,28 @@
1
1
  import * as React from 'react';
2
- import {
3
- Button,
4
- EmptyStateActions,
5
- EmptyStateBody,
6
- EmptyStateFooter,
7
- PageSection,
8
- PageSectionVariants,
9
- ToolbarItem,
10
- } from '@patternfly/react-core';
2
+ import { Button, EmptyStateActions, EmptyStateBody, EmptyStateFooter, ToolbarItem } from '@patternfly/react-core';
11
3
  import { Tbody } from '@patternfly/react-table';
12
4
  import { MicrochipIcon } from '@patternfly/react-icons/dist/js/icons/microchip-icon';
13
5
  import { Trans } from 'react-i18next';
14
6
  import { TFunction } from 'i18next';
15
7
 
16
8
  import { useFetch } from '../../../hooks/useFetch';
17
- import { Device, Fleet, FleetList } from '@flightctl/types';
9
+ import { Device } from '@flightctl/types';
18
10
 
19
11
  import ListPage from '../../ListPage/ListPage';
20
12
  import ListPageBody from '../../ListPage/ListPageBody';
21
13
  import { useDeleteListAction } from '../../ListPage/ListPageActions';
14
+ import TablePagination from '../../Table/TablePagination';
22
15
  import AddDeviceModal from '../AddDeviceModal/AddDeviceModal';
23
- import { sortByAlias, sortByLastSeenDate, sortByName } from '../../../utils/sort/generic';
24
- import { sortDeviceStatus, sortDevicesByFleet } from '../../../utils/sort/device';
25
- import Table, { TableColumn } from '../../Table/Table';
16
+ import Table, { ApiSortTableColumn } from '../../Table/Table';
26
17
  import DeviceTableToolbar from './DeviceTableToolbar';
27
- import { useDeviceFilters } from './useDeviceFilters';
28
18
  import DeviceTableRow from './DeviceTableRow';
29
19
  import { FlightCtlLabel } from '../../../types/extraTypes';
30
20
  import MassDeleteDeviceModal from '../../modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal';
31
21
  import ResourceListEmptyState from '../../common/ResourceListEmptyState';
32
- import { useTableSort } from '../../../hooks/useTableSort';
33
22
  import { useTableSelect } from '../../../hooks/useTableSelect';
34
23
  import { useTranslation } from '../../../hooks/useTranslation';
35
24
  import { Link, ROUTE } from '../../../hooks/useNavigate';
25
+ import { PaginationDetails, useTablePagination } from '../../../hooks/useTablePagination';
36
26
  import { useDevices } from './useDevices';
37
27
  import { useDeviceBackendFilters } from './useDeviceBackendFilters';
38
28
  import {
@@ -40,9 +30,11 @@ import {
40
30
  getDeviceStatusHelperText,
41
31
  getUpdateStatusHelperText,
42
32
  } from '../../Status/utils';
33
+ import EnrollmentRequestList from '../../EnrollmentRequest/EnrollmentRequestList';
43
34
  import { FilterStatusMap } from './types';
44
- import { useFetchPeriodically } from '../../../hooks/useFetchPeriodically';
45
- import EnrollmentRequestList from './EnrollmentRequestList';
35
+ import PageWithPermissions from '../../common/PageWithPermissions';
36
+ import { RESOURCE, VERB } from '../../../types/rbac';
37
+ import { useAccessReview } from '../../../hooks/useAccessReview';
46
38
 
47
39
  type DeviceEmptyStateProps = {
48
40
  onAddDevice: VoidFunction;
@@ -50,13 +42,18 @@ type DeviceEmptyStateProps = {
50
42
 
51
43
  const DeviceEmptyState: React.FC<DeviceEmptyStateProps> = ({ onAddDevice }) => {
52
44
  const { t } = useTranslation();
45
+ const [canCreateFleet] = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
53
46
  return (
54
47
  <ResourceListEmptyState icon={MicrochipIcon} titleText={t('No devices here!')}>
55
48
  <EmptyStateBody>
56
- <Trans t={t}>
57
- You can add devices and label them to match fleets, or your can{' '}
58
- <Link to={ROUTE.FLEET_CREATE}>start with a fleet</Link> and add devices into it.
59
- </Trans>
49
+ {canCreateFleet ? (
50
+ <Trans t={t}>
51
+ You can add devices and label them to match fleets, or you can{' '}
52
+ <Link to={ROUTE.FLEET_CREATE}>start with a fleet</Link> and add devices into it.
53
+ </Trans>
54
+ ) : (
55
+ t('You can add devices and label them to match fleets')
56
+ )}
60
57
  </EmptyStateBody>
61
58
  <EmptyStateFooter>
62
59
  <EmptyStateActions>
@@ -67,38 +64,30 @@ const DeviceEmptyState: React.FC<DeviceEmptyStateProps> = ({ onAddDevice }) => {
67
64
  );
68
65
  };
69
66
 
70
- const getDeviceColumns = (t: TFunction): TableColumn<Device>[] => [
67
+ const getDeviceColumns = (t: TFunction): ApiSortTableColumn[] => [
71
68
  {
72
69
  name: t('Alias'),
73
- onSort: sortByAlias,
74
70
  },
75
71
  {
76
72
  name: t('Name'),
77
- onSort: sortByName,
78
73
  },
79
74
  {
80
75
  name: t('Fleet'),
81
- onSort: sortDevicesByFleet,
82
76
  },
83
77
  {
84
78
  name: t('Application status'),
85
79
  helperText: getApplicationStatusHelperText(t),
86
- onSort: (devices: Array<Device>) => sortDeviceStatus(devices, 'ApplicationStatus'),
87
80
  },
88
81
  {
89
82
  name: t('Device status'),
90
83
  helperText: getDeviceStatusHelperText(t),
91
- onSort: (devices: Array<Device>) => sortDeviceStatus(devices, 'DeviceStatus'),
92
- defaultSort: true,
93
84
  },
94
85
  {
95
86
  name: t('Update status'),
96
87
  helperText: getUpdateStatusHelperText(t),
97
- onSort: (devices: Array<Device>) => sortDeviceStatus(devices, 'SystemUpdateStatus'),
98
88
  },
99
89
  {
100
90
  name: t('Last seen'),
101
- onSort: sortByLastSeenDate,
102
91
  },
103
92
  ];
104
93
 
@@ -108,39 +97,39 @@ interface DeviceTableProps {
108
97
  ownerFleets: string[];
109
98
  activeStatuses: FilterStatusMap;
110
99
  hasFiltersEnabled: boolean;
100
+ nameOrAlias: string | undefined;
101
+ setNameOrAlias: (text: string) => void;
111
102
  setOwnerFleets: (ownerFleets: string[]) => void;
112
103
  setActiveStatuses: (activeStatuses: FilterStatusMap) => void;
113
- allLabels: FlightCtlLabel[];
114
104
  selectedLabels: FlightCtlLabel[];
115
105
  setSelectedLabels: (labels: FlightCtlLabel[]) => void;
116
- fleets: Fleet[];
117
106
  isFilterUpdating: boolean;
107
+ deviceColumns: ApiSortTableColumn[];
108
+ pagination: Pick<PaginationDetails, 'currentPage' | 'setCurrentPage' | 'itemCount'>;
109
+ // getSortParams: (columnIndex: number) => ThProps['sort'];
118
110
  }
119
111
 
120
112
  export const DeviceTable = ({
121
113
  devices,
122
114
  refetch,
115
+ nameOrAlias,
116
+ setNameOrAlias,
123
117
  ownerFleets,
124
118
  setOwnerFleets,
125
119
  activeStatuses,
126
120
  setActiveStatuses,
127
- allLabels,
128
121
  selectedLabels,
129
122
  setSelectedLabels,
130
123
  hasFiltersEnabled,
131
- fleets,
132
124
  isFilterUpdating,
125
+ deviceColumns,
126
+ pagination,
133
127
  }: DeviceTableProps) => {
134
128
  const { t } = useTranslation();
135
129
  const [addDeviceModal, setAddDeviceModal] = React.useState(false);
136
130
  const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
137
131
  const { remove } = useFetch();
138
132
 
139
- const deviceColumns = React.useMemo(() => getDeviceColumns(t), [t]);
140
-
141
- const { filteredData, hasFiltersEnabled: hasUIFiltersEnabled, ...rest } = useDeviceFilters(devices);
142
- const { getSortParams, sortedData } = useTableSort(filteredData, deviceColumns);
143
-
144
133
  const { onRowSelect, hasSelectedRows, isAllSelected, isRowSelected, setAllSelected } = useTableSelect();
145
134
 
146
135
  const { deleteAction: deleteDeviceAction, deleteModal: deleteDeviceModal } = useDeleteListAction({
@@ -151,40 +140,44 @@ export const DeviceTable = ({
151
140
  },
152
141
  });
153
142
 
143
+ const [canDelete] = useAccessReview(RESOURCE.DEVICE, VERB.DELETE);
144
+ const [canEdit] = useAccessReview(RESOURCE.DEVICE, VERB.PATCH);
145
+
154
146
  return (
155
147
  <>
156
148
  <DeviceTableToolbar
157
- {...rest}
149
+ nameOrAlias={nameOrAlias}
150
+ setNameOrAlias={setNameOrAlias}
158
151
  ownerFleets={ownerFleets}
159
152
  setOwnerFleets={setOwnerFleets}
160
153
  activeStatuses={activeStatuses}
161
154
  setActiveStatuses={setActiveStatuses}
162
- allLabels={allLabels}
163
155
  selectedLabels={selectedLabels}
164
156
  setSelectedLabels={setSelectedLabels}
165
- fleets={fleets}
166
157
  isFilterUpdating={isFilterUpdating}
167
158
  >
168
159
  <ToolbarItem>
169
160
  <Button onClick={() => setAddDeviceModal(true)}>{t('Add devices')}</Button>
170
161
  </ToolbarItem>
171
- <ToolbarItem>
172
- <Button isDisabled={!hasSelectedRows} onClick={() => setIsMassDeleteModalOpen(true)} variant="secondary">
173
- {t('Delete devices')}
174
- </Button>
175
- </ToolbarItem>
162
+ {canDelete && (
163
+ <ToolbarItem>
164
+ <Button isDisabled={!hasSelectedRows} onClick={() => setIsMassDeleteModalOpen(true)} variant="secondary">
165
+ {t('Delete devices')}
166
+ </Button>
167
+ </ToolbarItem>
168
+ )}
176
169
  </DeviceTableToolbar>
177
170
  <Table
178
171
  aria-label={t('Devices table')}
172
+ loading={isFilterUpdating}
179
173
  columns={deviceColumns}
180
- emptyFilters={filteredData.length === 0 && (hasFiltersEnabled || hasUIFiltersEnabled)}
174
+ emptyFilters={!hasFiltersEnabled}
181
175
  emptyData={devices.length === 0}
182
- getSortParams={getSortParams}
183
176
  isAllSelected={isAllSelected}
184
177
  onSelectAll={setAllSelected}
185
178
  >
186
179
  <Tbody>
187
- {sortedData.map((device, index) => (
180
+ {devices.map((device, index) => (
188
181
  <DeviceTableRow
189
182
  key={device.metadata.name || ''}
190
183
  device={device}
@@ -192,19 +185,20 @@ export const DeviceTable = ({
192
185
  onRowSelect={onRowSelect}
193
186
  isRowSelected={isRowSelected}
194
187
  rowIndex={index}
188
+ canDelete={canDelete}
189
+ canEdit={canEdit}
195
190
  />
196
191
  ))}
197
192
  </Tbody>
198
193
  </Table>
199
- {!hasFiltersEnabled && !hasUIFiltersEnabled && devices.length === 0 && (
200
- <DeviceEmptyState onAddDevice={() => setAddDeviceModal(true)} />
201
- )}
194
+ <TablePagination isUpdating={isFilterUpdating} pagination={pagination} />
195
+ {!hasFiltersEnabled && devices.length === 0 && <DeviceEmptyState onAddDevice={() => setAddDeviceModal(true)} />}
202
196
  {deleteDeviceModal}
203
197
  {addDeviceModal && <AddDeviceModal onClose={() => setAddDeviceModal(false)} />}
204
198
  {isMassDeleteModalOpen && (
205
199
  <MassDeleteDeviceModal
206
200
  onClose={() => setIsMassDeleteModalOpen(false)}
207
- resources={sortedData.filter(isRowSelected)}
201
+ resources={devices.filter(isRowSelected)}
208
202
  onDeleteSuccess={() => {
209
203
  setIsMassDeleteModalOpen(false);
210
204
  refetch();
@@ -215,9 +209,13 @@ export const DeviceTable = ({
215
209
  );
216
210
  };
217
211
 
218
- const DevicesPage = () => {
212
+ const DevicesPage = ({ canListER }: { canListER: boolean }) => {
219
213
  const { t } = useTranslation();
214
+ const deviceColumns = React.useMemo(() => getDeviceColumns(t), [t]);
215
+
220
216
  const {
217
+ nameOrAlias,
218
+ setNameOrAlias,
221
219
  ownerFleets,
222
220
  activeStatuses,
223
221
  hasFiltersEnabled,
@@ -226,26 +224,36 @@ const DevicesPage = () => {
226
224
  selectedLabels,
227
225
  setSelectedLabels,
228
226
  } = useDeviceBackendFilters();
229
- const [data, loading, error, updating, refetch, allLabels] = useDevices({
227
+ const { currentPage, setCurrentPage, onPageFetched, nextContinue, itemCount } = useTablePagination();
228
+ const [data, loading, error, updating, refetch] = useDevices({
229
+ nameOrAlias,
230
230
  ownerFleets,
231
231
  activeStatuses,
232
232
  labels: selectedLabels,
233
+ nextContinue,
234
+ onPageFetched,
233
235
  });
234
236
 
235
- const [fleetsList, flLoading, flError] = useFetchPeriodically<FleetList>({
236
- endpoint: 'fleets',
237
- });
237
+ const pagination = React.useMemo(
238
+ () => ({
239
+ currentPage,
240
+ setCurrentPage,
241
+ itemCount,
242
+ }),
243
+ [currentPage, setCurrentPage, itemCount],
244
+ );
238
245
 
239
246
  return (
240
- <PageSection variant={PageSectionVariants.light}>
241
- <EnrollmentRequestList refetchDevices={refetch} />
247
+ <>
248
+ {canListER && <EnrollmentRequestList refetchDevices={refetch} />}
242
249
 
243
250
  <ListPage title={t('Devices')}>
244
- <ListPageBody error={error || flError} loading={loading || flLoading}>
251
+ <ListPageBody error={error} loading={loading}>
245
252
  <DeviceTable
246
253
  devices={data}
247
- allLabels={allLabels}
248
254
  refetch={refetch}
255
+ nameOrAlias={nameOrAlias}
256
+ setNameOrAlias={setNameOrAlias}
249
257
  hasFiltersEnabled={hasFiltersEnabled || updating}
250
258
  ownerFleets={ownerFleets}
251
259
  activeStatuses={activeStatuses}
@@ -253,13 +261,25 @@ const DevicesPage = () => {
253
261
  setActiveStatuses={setActiveStatuses}
254
262
  selectedLabels={selectedLabels}
255
263
  setSelectedLabels={setSelectedLabels}
256
- fleets={fleetsList?.items || []}
257
264
  isFilterUpdating={updating}
265
+ deviceColumns={deviceColumns}
266
+ pagination={pagination}
258
267
  />
259
268
  </ListPageBody>
260
269
  </ListPage>
261
- </PageSection>
270
+ </>
271
+ );
272
+ };
273
+
274
+ const DevicesPageWithPermissions = () => {
275
+ const [canListDevice, deviceLoading] = useAccessReview(RESOURCE.DEVICE, VERB.LIST);
276
+ const [canListER, erLoading] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.LIST);
277
+
278
+ return (
279
+ <PageWithPermissions loading={deviceLoading || erLoading} allowed={canListDevice || canListER}>
280
+ {canListDevice ? <DevicesPage canListER={canListER} /> : <EnrollmentRequestList isStandalone />}
281
+ </PageWithPermissions>
262
282
  );
263
283
  };
264
284
 
265
- export default DevicesPage;
285
+ export default DevicesPageWithPermissions;
@@ -1,18 +1,6 @@
1
- import { DeviceSummaryStatus, FilterSearchParams } from '../../../utils/status/devices';
2
- import { StatusItem } from '../../../utils/status/common';
1
+ import { FilterSearchParams } from '../../../utils/status/devices';
3
2
  import { ApplicationsSummaryStatusType, DeviceSummaryStatusType, DeviceUpdatedStatusType } from '@flightctl/types';
4
3
 
5
- type FilterOptionsProps<T extends DeviceSummaryStatus> = {
6
- filter: string;
7
- items: Array<StatusItem<T>>;
8
- selectedFilters: Array<T>;
9
- onClick: (value: string) => void;
10
- };
11
-
12
- export type FilterOptionsFC = <T extends DeviceSummaryStatus>(
13
- props: FilterOptionsProps<T>,
14
- ) => JSX.Element | JSX.Element[];
15
-
16
4
  export type FilterStatusMap = {
17
5
  [FilterSearchParams.AppStatus]: ApplicationsSummaryStatusType[];
18
6
  [FilterSearchParams.DeviceStatus]: DeviceSummaryStatusType[];
@@ -3,7 +3,6 @@ import { ApplicationsSummaryStatusType, DeviceSummaryStatusType, DeviceUpdatedSt
3
3
 
4
4
  import { FilterSearchParams } from '../../../utils/status/devices';
5
5
  import { useAppContext } from '../../../hooks/useAppContext';
6
- import { EnrollmentRequestStatus } from '../../../utils/status/enrollmentRequest';
7
6
  import { FilterStatusMap } from './types';
8
7
  import { FlightCtlLabel } from '../../../types/extraTypes';
9
8
  import { labelToString } from '../../../utils/labels';
@@ -11,7 +10,6 @@ import { labelToString } from '../../../utils/labels';
11
10
  const validAppStatuses = Object.values(ApplicationsSummaryStatusType) as string[];
12
11
  const validUpdatedStatuses = Object.values(DeviceUpdatedStatusType) as string[];
13
12
  const validDeviceStatuses = Object.values(DeviceSummaryStatusType) as string[];
14
- validDeviceStatuses.push(EnrollmentRequestStatus.Pending);
15
13
 
16
14
  const getNewParams = (currentParams: URLSearchParams, newValues: { [key: string]: string[] }) => {
17
15
  let newParams = [...currentParams.entries()];
@@ -30,6 +28,7 @@ export const useDeviceBackendFilters = () => {
30
28
  const [searchParams, setSearchParams] = useSearchParams();
31
29
  const paramsRef = React.useRef(searchParams);
32
30
  const ownerFleets = searchParams.getAll(FilterSearchParams.Fleet) || undefined;
31
+ const nameOrAlias = searchParams.get(FilterSearchParams.NameOrAlias) || undefined;
33
32
 
34
33
  const updateSearchParams = React.useCallback(
35
34
  (params: [string, string][]) => {
@@ -104,10 +103,22 @@ export const useDeviceBackendFilters = () => {
104
103
  [updateSearchParams],
105
104
  );
106
105
 
106
+ const setNameOrAlias = React.useCallback(
107
+ (nameOrAlias: string) => {
108
+ updateSearchParams(getNewParams(paramsRef.current, { [FilterSearchParams.NameOrAlias]: [nameOrAlias] }));
109
+ },
110
+ [updateSearchParams],
111
+ );
112
+
107
113
  const hasFiltersEnabled =
108
- !!selectedLabels.length || !!ownerFleets.length || Object.values(activeStatuses).some((s) => !!s.length);
114
+ !!nameOrAlias ||
115
+ !!selectedLabels.length ||
116
+ !!ownerFleets.length ||
117
+ Object.values(activeStatuses).some((s) => !!s.length);
109
118
 
110
119
  return {
120
+ nameOrAlias,
121
+ setNameOrAlias,
111
122
  activeStatuses,
112
123
  setActiveStatuses,
113
124
  ownerFleets,
@@ -1,53 +1,64 @@
1
- import React from 'react';
2
1
  import { useDebounce } from 'use-debounce';
3
2
 
4
3
  import { Device, DeviceList, DevicesSummary } from '@flightctl/types';
5
4
  import { FilterSearchParams } from '../../../utils/status/devices';
5
+ import * as queryUtils from '../../../utils/query';
6
6
  import { useFetchPeriodically } from '../../../hooks/useFetchPeriodically';
7
7
  import { FlightCtlLabel } from '../../../types/extraTypes';
8
8
  import { FilterStatusMap } from './types';
9
-
10
- import { fromAPILabel } from '../../../utils/labels';
11
-
12
- const setLabelParams = (params: URLSearchParams, labels?: FlightCtlLabel[]) => {
13
- if (labels?.length) {
14
- const labelSelector = labels.reduce((acc, curr) => {
15
- if (!acc) {
16
- acc = `${curr.key}=${curr.value || ''}`;
17
- } else {
18
- acc += `,${curr.key}=${curr.value || ''}`;
19
- }
20
- return acc;
21
- }, '');
22
- params.append('labelSelector', labelSelector);
23
- }
24
- };
9
+ import { PAGE_SIZE } from '../../../constants';
25
10
 
26
11
  type DevicesEndpointArgs = {
12
+ nameOrAlias?: string;
27
13
  ownerFleets?: string[];
28
14
  activeStatuses?: FilterStatusMap;
29
15
  labels?: FlightCtlLabel[];
30
16
  summaryOnly?: boolean;
17
+ nextContinue?: string;
31
18
  };
32
19
 
33
- const getDevicesEndpoint = ({ ownerFleets, activeStatuses, labels, summaryOnly }: DevicesEndpointArgs) => {
20
+ const getDevicesEndpoint = ({
21
+ nameOrAlias,
22
+ ownerFleets,
23
+ activeStatuses,
24
+ labels,
25
+ nextContinue,
26
+ summaryOnly,
27
+ }: DevicesEndpointArgs) => {
34
28
  const filterByAppStatus = activeStatuses?.[FilterSearchParams.AppStatus];
35
29
  const filterByDevStatus = activeStatuses?.[FilterSearchParams.DeviceStatus];
36
30
  const filterByUpdateStatus = activeStatuses?.[FilterSearchParams.UpdatedStatus];
37
31
 
38
- const params = new URLSearchParams();
32
+ const fieldSelectors: string[] = [];
33
+ queryUtils.addQueryConditions(fieldSelectors, 'status.applicationsSummary.status', filterByAppStatus);
34
+ queryUtils.addQueryConditions(fieldSelectors, 'status.summary.status', filterByDevStatus);
35
+ queryUtils.addQueryConditions(fieldSelectors, 'status.updated.status', filterByUpdateStatus);
36
+
37
+ if (nameOrAlias) {
38
+ queryUtils.addTextContainsCondition(fieldSelectors, 'metadata.nameoralias', nameOrAlias);
39
+ }
39
40
  if (ownerFleets?.length) {
40
- params.set('owner', ownerFleets.map((fleet) => `Fleet/${fleet}`).join(','));
41
+ queryUtils.addQueryConditions(
42
+ fieldSelectors,
43
+ 'metadata.owner',
44
+ ownerFleets.map((fleet) => `Fleet/${fleet}`),
45
+ );
41
46
  }
42
- filterByAppStatus?.forEach((appSt) => params.append('statusFilter', `applications.summary.status=${appSt}`));
43
- filterByDevStatus?.forEach((devSt) => params.append('statusFilter', `summary.status=${devSt}`));
44
- filterByUpdateStatus?.forEach((updSt) => params.append('statusFilter', `updated.status=${updSt}`));
45
-
46
- setLabelParams(params, labels);
47
47
 
48
+ const params = new URLSearchParams();
49
+ if (fieldSelectors.length > 0) {
50
+ params.set('fieldSelector', fieldSelectors.join(','));
51
+ }
52
+ queryUtils.setLabelParams(params, labels);
48
53
  if (summaryOnly) {
49
54
  params.set('summaryOnly', 'true');
50
55
  }
56
+ if (nextContinue !== undefined) {
57
+ params.set('limit', `${PAGE_SIZE}`);
58
+ }
59
+ if (nextContinue) {
60
+ params.set('continue', nextContinue);
61
+ }
51
62
  return params.size ? `devices?${params.toString()}` : 'devices';
52
63
  };
53
64
 
@@ -72,41 +83,22 @@ export const useDevicesSummary = ({
72
83
  return [deviceList?.summary, listLoading];
73
84
  };
74
85
 
75
- export const useDevices = ({
76
- ownerFleets,
77
- activeStatuses,
78
- labels,
79
- }: {
86
+ export const useDevices = (args: {
87
+ nameOrAlias?: string;
80
88
  ownerFleets?: string[];
81
89
  activeStatuses?: FilterStatusMap;
82
90
  labels?: FlightCtlLabel[];
83
- }): [Device[], boolean, unknown, boolean, VoidFunction, FlightCtlLabel[]] => {
84
- const [deviceLabelList] = useFetchPeriodically<DeviceList>({
85
- endpoint: 'devices',
86
- });
87
- const [devicesEndpoint, devicesDebouncing] = useDevicesEndpoint({ ownerFleets, activeStatuses, labels });
88
- const [devicesList, devicesLoading, devicesError, devicesRefetch, updating] = useFetchPeriodically<DeviceList>({
89
- endpoint: devicesEndpoint,
90
- });
91
-
92
- const allLabels = React.useMemo(() => {
93
- const labelsSet = new Set<FlightCtlLabel>();
91
+ nextContinue?: string;
92
+ onPageFetched?: (data: DeviceList) => void;
93
+ }): [Device[], boolean, unknown, boolean, VoidFunction] => {
94
+ const [devicesEndpoint, devicesDebouncing] = useDevicesEndpoint(args);
94
95
 
95
- deviceLabelList?.items.forEach((device) => {
96
- const deviceLabels = fromAPILabel(device.metadata.labels || {}).filter((label) => label.key !== 'alias');
97
- deviceLabels.forEach((label) => {
98
- labelsSet.add(label);
99
- });
100
- });
101
- return Array.from(labelsSet);
102
- }, [deviceLabelList]);
96
+ const [devicesList, devicesLoading, devicesError, devicesRefetch, updating] = useFetchPeriodically<DeviceList>(
97
+ {
98
+ endpoint: devicesEndpoint,
99
+ },
100
+ args.onPageFetched,
101
+ );
103
102
 
104
- return [
105
- devicesList?.items || [],
106
- devicesLoading,
107
- devicesError,
108
- updating || devicesDebouncing,
109
- devicesRefetch,
110
- allLabels || [],
111
- ];
103
+ return [devicesList?.items || [], devicesLoading, devicesError, updating || devicesDebouncing, devicesRefetch];
112
104
  };
@@ -25,11 +25,14 @@ import GeneralInfoStep, { generalInfoStepId, isGeneralInfoStepValid } from './st
25
25
  import DeviceTemplateStep, { deviceTemplateStepId, isDeviceTemplateStepValid } from './steps/DeviceTemplateStep';
26
26
  import ReviewDeviceStep, { reviewDeviceStepId } from './steps/ReviewDeviceStep';
27
27
  import { getDevicePatches, getValidationSchema } from './utils';
28
- import { getApplicationValues, getConfigTemplatesValues } from './deviceSpecUtils';
28
+ import { getApplicationValues, getConfigTemplatesValues, hasMicroshiftRegistrationConfig } from './deviceSpecUtils';
29
29
  import { useFetch } from '../../../hooks/useFetch';
30
30
  import { useEditDevice } from './useEditDevice';
31
31
  import EditDeviceWizardNav from './EditDeviceWizardNav';
32
32
  import EditDeviceWizardFooter from './EditDeviceWizardFooter';
33
+ import PageWithPermissions from '../../common/PageWithPermissions';
34
+ import { RESOURCE, VERB } from '../../../types/rbac';
35
+ import { useAccessReview } from '../../../hooks/useAccessReview';
33
36
 
34
37
  import './EditDeviceWizard.css';
35
38
 
@@ -64,15 +67,18 @@ const EditDeviceWizard = () => {
64
67
  </Alert>
65
68
  );
66
69
  } else if (device) {
70
+ const registerMicroShift = hasMicroshiftRegistrationConfig(device.spec);
67
71
  body = (
68
72
  <Formik<EditDeviceFormValues>
69
73
  initialValues={{
70
74
  deviceAlias,
71
- osImage: device.spec?.os?.image,
75
+ osImage: device.spec?.os?.image || '',
72
76
  labels: fromAPILabel(device.metadata.labels || {}).filter((label) => label.key !== 'alias'),
73
- configTemplates: getConfigTemplatesValues(device.spec),
77
+ configTemplates: getConfigTemplatesValues(device.spec, registerMicroShift),
74
78
  fleetMatch: '', // Initially this is always a fleetless device
75
79
  applications: getApplicationValues(device.spec),
80
+ systemdUnits: [],
81
+ registerMicroShift,
76
82
  }}
77
83
  validationSchema={getValidationSchema(t)}
78
84
  validateOnMount
@@ -102,6 +108,11 @@ const EditDeviceWizard = () => {
102
108
  className="fctl-edit-device__wizard"
103
109
  footer={<EditDeviceWizardFooter />}
104
110
  nav={<EditDeviceWizardNav />}
111
+ onStepChange={() => {
112
+ if (submitError) {
113
+ setSubmitError(undefined);
114
+ }
115
+ }}
105
116
  >
106
117
  <WizardStep name={t('General info')} id={generalInfoStepId}>
107
118
  <GeneralInfoStep />
@@ -147,4 +158,13 @@ const EditDeviceWizard = () => {
147
158
  );
148
159
  };
149
160
 
150
- export default EditDeviceWizard;
161
+ const EditDeviceWizardWithPermissions = () => {
162
+ const [allowed, loading] = useAccessReview(RESOURCE.DEVICE, VERB.PATCH);
163
+ return (
164
+ <PageWithPermissions allowed={allowed} loading={loading}>
165
+ <EditDeviceWizard />
166
+ </PageWithPermissions>
167
+ );
168
+ };
169
+
170
+ export default EditDeviceWizardWithPermissions;