@flightctl/ui-components 0.0.10 → 0.4.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 (452) 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 -4
  14. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
  15. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +18 -9
  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 +0 -3
  33. package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts.map +1 -1
  34. package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js +2 -2
  35. package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js.map +1 -1
  36. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts +1 -4
  37. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
  38. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +70 -16
  39. package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
  40. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +6 -8
  41. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
  42. package/dist/src/components/Device/DevicesPage/DevicesPage.js +41 -37
  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/useDevices.d.ts +9 -10
  48. package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
  49. package/dist/src/components/Device/DevicesPage/useDevices.js +9 -29
  50. package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
  51. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts +2 -2
  52. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
  53. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +19 -4
  54. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
  55. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +7 -2
  56. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
  57. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +99 -7
  58. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
  59. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts +5 -0
  60. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -0
  61. package/dist/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.js → ApplicationTemplates.js} +31 -24
  62. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -0
  63. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
  64. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +9 -10
  65. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
  66. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts +2 -1
  67. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
  68. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -6
  69. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -1
  70. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts +4 -0
  71. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -0
  72. package/dist/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.js → ConfigurationTemplates.js} +42 -28
  73. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -0
  74. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
  75. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +53 -12
  76. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
  77. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +7 -0
  78. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -0
  79. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js +13 -0
  80. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -0
  81. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts +4 -0
  82. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -0
  83. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +38 -0
  84. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -0
  85. package/dist/src/components/Device/EditDeviceWizard/types.d.ts +3 -0
  86. package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +1 -1
  87. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -0
  88. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
  89. package/dist/src/components/Device/EditDeviceWizard/utils.js +5 -2
  90. package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
  91. package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.d.ts → SystemdUnitsModal/SystemdUnitsModal.d.ts} +6 -6
  92. package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -0
  93. package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.js → SystemdUnitsModal/SystemdUnitsModal.js} +28 -15
  94. package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -0
  95. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +15 -0
  96. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -0
  97. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js +57 -0
  98. package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -0
  99. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts +2 -2
  100. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
  101. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +14 -4
  102. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
  103. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +9 -0
  104. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -0
  105. package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestList.js +40 -38
  106. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -0
  107. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -0
  108. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
  109. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +15 -11
  110. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
  111. package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.d.ts +1 -1
  112. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.d.ts.map +1 -0
  113. package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.js +2 -2
  114. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.js.map +1 -0
  115. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +9 -0
  116. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -0
  117. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +42 -0
  118. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -0
  119. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts +2 -2
  120. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
  121. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +19 -2
  122. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
  123. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.d.ts.map +1 -1
  124. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +2 -4
  125. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
  126. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
  127. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +6 -1
  128. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
  129. package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
  130. package/dist/src/components/Fleet/CreateFleet/utils.js +61 -35
  131. package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
  132. package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts +2 -2
  133. package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts.map +1 -1
  134. package/dist/src/components/Fleet/FleetDetails/FleetDetails.js +16 -6
  135. package/dist/src/components/Fleet/FleetDetails/FleetDetails.js.map +1 -1
  136. package/dist/src/components/Fleet/FleetResourceSyncs.d.ts +2 -5
  137. package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -1
  138. package/dist/src/components/Fleet/FleetResourceSyncs.js +38 -24
  139. package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
  140. package/dist/src/components/Fleet/FleetRow.d.ts +2 -0
  141. package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
  142. package/dist/src/components/Fleet/FleetRow.js +16 -14
  143. package/dist/src/components/Fleet/FleetRow.js.map +1 -1
  144. package/dist/src/components/Fleet/FleetsPage.d.ts +2 -2
  145. package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
  146. package/dist/src/components/Fleet/FleetsPage.js +34 -24
  147. package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
  148. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts +2 -2
  149. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -1
  150. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +11 -2
  151. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -1
  152. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
  153. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +5 -2
  154. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
  155. package/dist/src/components/Fleet/useFleets.d.ts +11 -3
  156. package/dist/src/components/Fleet/useFleets.d.ts.map +1 -1
  157. package/dist/src/components/Fleet/useFleets.js +22 -12
  158. package/dist/src/components/Fleet/useFleets.js.map +1 -1
  159. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts.map +1 -1
  160. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +5 -14
  161. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
  162. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts +0 -3
  163. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts.map +1 -1
  164. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +2 -2
  165. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -1
  166. package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -1
  167. package/dist/src/components/OverviewPage/Overview.js +11 -5
  168. package/dist/src/components/OverviewPage/Overview.js.map +1 -1
  169. package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts +2 -2
  170. package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -1
  171. package/dist/src/components/Repository/CreateRepository/CreateRepository.js +15 -6
  172. package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -1
  173. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
  174. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +4 -1
  175. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
  176. package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
  177. package/dist/src/components/Repository/CreateRepository/utils.js +22 -6
  178. package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
  179. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.d.ts.map +1 -1
  180. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js +3 -2
  181. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js.map +1 -1
  182. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts +2 -2
  183. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -1
  184. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +16 -5
  185. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
  186. package/dist/src/components/Repository/RepositoryList.d.ts +0 -1
  187. package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
  188. package/dist/src/components/Repository/RepositoryList.js +55 -46
  189. package/dist/src/components/Repository/RepositoryList.js.map +1 -1
  190. package/dist/src/components/Repository/useRepositories.d.ts +16 -0
  191. package/dist/src/components/Repository/useRepositories.d.ts.map +1 -0
  192. package/dist/src/components/Repository/useRepositories.js +40 -0
  193. package/dist/src/components/Repository/useRepositories.js.map +1 -0
  194. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
  195. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +21 -23
  196. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
  197. package/dist/src/components/Table/Table.d.ts +0 -1
  198. package/dist/src/components/Table/Table.d.ts.map +1 -1
  199. package/dist/src/components/Table/Table.js +2 -2
  200. package/dist/src/components/Table/Table.js.map +1 -1
  201. package/dist/src/components/Table/TablePagination.d.ts +8 -0
  202. package/dist/src/components/Table/TablePagination.d.ts.map +1 -0
  203. package/dist/src/components/Table/TablePagination.js +38 -0
  204. package/dist/src/components/Table/TablePagination.js.map +1 -0
  205. package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
  206. package/dist/src/components/Terminal/Terminal.js +1 -0
  207. package/dist/src/components/Terminal/Terminal.js.map +1 -1
  208. package/dist/src/components/common/AccessDenied.d.ts +4 -0
  209. package/dist/src/components/common/AccessDenied.d.ts.map +1 -0
  210. package/dist/src/components/common/AccessDenied.js +15 -0
  211. package/dist/src/components/common/AccessDenied.js.map +1 -0
  212. package/dist/src/components/common/ButtonWithPermissions.d.ts +8 -0
  213. package/dist/src/components/common/ButtonWithPermissions.d.ts.map +1 -0
  214. package/dist/src/components/common/ButtonWithPermissions.js +12 -0
  215. package/dist/src/components/common/ButtonWithPermissions.js.map +1 -0
  216. package/dist/src/components/common/LearnMoreLink.d.ts +7 -0
  217. package/dist/src/components/common/LearnMoreLink.d.ts.map +1 -0
  218. package/dist/src/components/common/LearnMoreLink.js +13 -0
  219. package/dist/src/components/common/LearnMoreLink.js.map +1 -0
  220. package/dist/src/components/common/PageWithPermissions.d.ts +7 -0
  221. package/dist/src/components/common/PageWithPermissions.d.ts.map +1 -0
  222. package/dist/src/components/common/PageWithPermissions.js +17 -0
  223. package/dist/src/components/common/PageWithPermissions.js.map +1 -0
  224. package/dist/src/components/form/FilterSelect.d.ts +2 -4
  225. package/dist/src/components/form/FilterSelect.d.ts.map +1 -1
  226. package/dist/src/components/form/FilterSelect.js.map +1 -1
  227. package/dist/src/components/form/FlightCtlForm.css +3 -0
  228. package/dist/src/components/form/FlightCtlForm.d.ts +1 -0
  229. package/dist/src/components/form/FlightCtlForm.d.ts.map +1 -1
  230. package/dist/src/components/form/FlightCtlForm.js +2 -1
  231. package/dist/src/components/form/FlightCtlForm.js.map +1 -1
  232. package/dist/src/components/form/FormSelect.d.ts +1 -0
  233. package/dist/src/components/form/FormSelect.d.ts.map +1 -1
  234. package/dist/src/components/form/FormSelect.js +14 -2
  235. package/dist/src/components/form/FormSelect.js.map +1 -1
  236. package/dist/src/components/form/LabelsField.d.ts +2 -1
  237. package/dist/src/components/form/LabelsField.d.ts.map +1 -1
  238. package/dist/src/components/form/LabelsField.js +6 -6
  239. package/dist/src/components/form/LabelsField.js.map +1 -1
  240. package/dist/src/components/form/validations.d.ts +13 -2
  241. package/dist/src/components/form/validations.d.ts.map +1 -1
  242. package/dist/src/components/form/validations.js +39 -24
  243. package/dist/src/components/form/validations.js.map +1 -1
  244. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
  245. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +2 -5
  246. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
  247. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +2 -1
  248. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
  249. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +4 -4
  250. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
  251. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.d.ts.map +1 -1
  252. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +2 -3
  253. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -1
  254. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts +1 -1
  255. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts.map +1 -1
  256. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +6 -5
  257. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
  258. package/dist/src/constants.d.ts +2 -1
  259. package/dist/src/constants.d.ts.map +1 -1
  260. package/dist/src/constants.js +3 -1
  261. package/dist/src/constants.js.map +1 -1
  262. package/dist/src/hooks/useAccessReview.d.ts +4 -0
  263. package/dist/src/hooks/useAccessReview.d.ts.map +1 -0
  264. package/dist/src/hooks/useAccessReview.js +33 -0
  265. package/dist/src/hooks/useAccessReview.js.map +1 -0
  266. package/dist/src/hooks/useAppContext.d.ts +4 -3
  267. package/dist/src/hooks/useAppContext.d.ts.map +1 -1
  268. package/dist/src/hooks/useAppContext.js +2 -2
  269. package/dist/src/hooks/useAppContext.js.map +1 -1
  270. package/dist/src/hooks/useFetch.d.ts +4 -2
  271. package/dist/src/hooks/useFetch.d.ts.map +1 -1
  272. package/dist/src/hooks/useFetchPeriodically.d.ts +1 -1
  273. package/dist/src/hooks/useFetchPeriodically.d.ts.map +1 -1
  274. package/dist/src/hooks/useFetchPeriodically.js +4 -1
  275. package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
  276. package/dist/src/hooks/useFleetImportAccessReview.d.ts +3 -0
  277. package/dist/src/hooks/useFleetImportAccessReview.d.ts.map +1 -0
  278. package/dist/src/hooks/useFleetImportAccessReview.js +12 -0
  279. package/dist/src/hooks/useFleetImportAccessReview.js.map +1 -0
  280. package/dist/src/hooks/useTablePagination.d.ts +10 -0
  281. package/dist/src/hooks/useTablePagination.d.ts.map +1 -0
  282. package/dist/src/hooks/useTablePagination.js +33 -0
  283. package/dist/src/hooks/useTablePagination.js.map +1 -0
  284. package/dist/src/hooks/useWebSocket.d.ts +2 -2
  285. package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
  286. package/dist/src/hooks/useWebSocket.js.map +1 -1
  287. package/dist/src/links.d.ts +3 -0
  288. package/dist/src/links.d.ts.map +1 -0
  289. package/dist/src/links.js +6 -0
  290. package/dist/src/links.js.map +1 -0
  291. package/dist/src/types/rbac.d.ts +18 -0
  292. package/dist/src/types/rbac.d.ts.map +1 -0
  293. package/dist/src/types/rbac.js +23 -0
  294. package/dist/src/types/rbac.js.map +1 -0
  295. package/dist/src/utils/api.d.ts +3 -3
  296. package/dist/src/utils/api.d.ts.map +1 -1
  297. package/dist/src/utils/api.js.map +1 -1
  298. package/dist/src/utils/labels.d.ts +1 -1
  299. package/dist/src/utils/labels.d.ts.map +1 -1
  300. package/dist/src/utils/labels.js +4 -8
  301. package/dist/src/utils/labels.js.map +1 -1
  302. package/dist/src/utils/query.d.ts +9 -0
  303. package/dist/src/utils/query.d.ts.map +1 -1
  304. package/dist/src/utils/query.js +33 -1
  305. package/dist/src/utils/query.js.map +1 -1
  306. package/dist/src/utils/search.d.ts +1 -0
  307. package/dist/src/utils/search.d.ts.map +1 -1
  308. package/dist/src/utils/search.js +7 -7
  309. package/dist/src/utils/search.js.map +1 -1
  310. package/package.json +5 -5
  311. package/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
  312. package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +150 -13
  313. package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +31 -132
  314. package/src/components/Device/DeviceDetails/DeviceApplications.tsx +102 -0
  315. package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +33 -16
  316. package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +8 -38
  317. package/src/components/Device/DeviceDetails/TerminalTab.tsx +21 -4
  318. package/src/components/Device/DevicesPage/DeviceFilterSelect.tsx +13 -34
  319. package/src/components/Device/DevicesPage/DeviceTableRow.tsx +21 -9
  320. package/src/components/Device/DevicesPage/DeviceTableToolbar.tsx +0 -7
  321. package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +93 -40
  322. package/src/components/Device/DevicesPage/DevicesPage.tsx +64 -58
  323. package/src/components/Device/DevicesPage/types.ts +1 -13
  324. package/src/components/Device/DevicesPage/useDevices.ts +19 -38
  325. package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +24 -4
  326. package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +156 -47
  327. package/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.tsx → ApplicationTemplates.tsx} +89 -53
  328. package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +22 -26
  329. package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +17 -12
  330. package/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.tsx → ConfigurationTemplates.tsx} +110 -52
  331. package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +108 -11
  332. package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +19 -0
  333. package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +75 -0
  334. package/src/components/Device/EditDeviceWizard/types.ts +3 -0
  335. package/src/components/Device/EditDeviceWizard/utils.ts +14 -4
  336. package/src/components/Device/{MatchPatternsModal/MatchPatternsModal.tsx → SystemdUnitsModal/SystemdUnitsModal.tsx} +36 -19
  337. package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +114 -0
  338. package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +28 -9
  339. package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestList.tsx +57 -48
  340. package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +28 -17
  341. package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.tsx +3 -2
  342. package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +63 -0
  343. package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +28 -2
  344. package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +2 -5
  345. package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +7 -0
  346. package/src/components/Fleet/CreateFleet/utils.ts +101 -49
  347. package/src/components/Fleet/FleetDetails/FleetDetails.tsx +57 -36
  348. package/src/components/Fleet/FleetResourceSyncs.tsx +53 -41
  349. package/src/components/Fleet/FleetRow.tsx +28 -16
  350. package/src/components/Fleet/FleetsPage.tsx +63 -53
  351. package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +16 -3
  352. package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +25 -19
  353. package/src/components/Fleet/useFleets.ts +40 -22
  354. package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +5 -18
  355. package/src/components/OverviewPage/Cards/Status/StatusCardFilters.tsx +0 -7
  356. package/src/components/OverviewPage/Overview.tsx +20 -8
  357. package/src/components/Repository/CreateRepository/CreateRepository.tsx +25 -9
  358. package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +5 -2
  359. package/src/components/Repository/CreateRepository/utils.ts +23 -7
  360. package/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.tsx +5 -3
  361. package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +32 -10
  362. package/src/components/Repository/RepositoryList.tsx +113 -71
  363. package/src/components/Repository/useRepositories.ts +59 -0
  364. package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +41 -40
  365. package/src/components/Table/Table.tsx +3 -4
  366. package/src/components/Table/TablePagination.tsx +74 -0
  367. package/src/components/Terminal/Terminal.tsx +1 -0
  368. package/src/components/common/AccessDenied.tsx +17 -0
  369. package/src/components/common/ButtonWithPermissions.tsx +14 -0
  370. package/src/components/common/LearnMoreLink.tsx +26 -0
  371. package/src/components/common/PageWithPermissions.tsx +19 -0
  372. package/src/components/form/FilterSelect.tsx +2 -4
  373. package/src/components/form/FlightCtlForm.css +3 -0
  374. package/src/components/form/FlightCtlForm.tsx +3 -1
  375. package/src/components/form/FormSelect.tsx +22 -2
  376. package/src/components/form/LabelsField.tsx +17 -13
  377. package/src/components/form/validations.ts +53 -25
  378. package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +2 -5
  379. package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -4
  380. package/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.tsx +2 -4
  381. package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +8 -5
  382. package/src/constants.ts +2 -1
  383. package/src/hooks/useAccessReview.ts +33 -0
  384. package/src/hooks/useAppContext.tsx +6 -5
  385. package/src/hooks/useFetchPeriodically.ts +4 -0
  386. package/src/hooks/useFleetImportAccessReview.ts +8 -0
  387. package/src/hooks/useTablePagination.tsx +44 -0
  388. package/src/hooks/useWebSocket.ts +4 -4
  389. package/src/links.ts +5 -0
  390. package/src/types/rbac.ts +18 -0
  391. package/src/utils/api.ts +3 -3
  392. package/src/utils/labels.ts +3 -7
  393. package/src/utils/query.ts +41 -0
  394. package/src/utils/search.ts +1 -1
  395. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts +0 -12
  396. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts.map +0 -1
  397. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js +0 -40
  398. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js.map +0 -1
  399. package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts +0 -10
  400. package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts.map +0 -1
  401. package/dist/src/components/Device/DeviceDetails/SystemdTable.js +0 -38
  402. package/dist/src/components/Device/DeviceDetails/SystemdTable.js.map +0 -1
  403. package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts +0 -6
  404. package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts.map +0 -1
  405. package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js.map +0 -1
  406. package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.d.ts.map +0 -1
  407. package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.js.map +0 -1
  408. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts +0 -5
  409. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts.map +0 -1
  410. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.js.map +0 -1
  411. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts +0 -4
  412. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts.map +0 -1
  413. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +0 -1
  414. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts +0 -11
  415. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts.map +0 -1
  416. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js +0 -39
  417. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js.map +0 -1
  418. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.d.ts.map +0 -1
  419. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js.map +0 -1
  420. package/dist/src/components/common/HelperTextItems.d.ts +0 -3
  421. package/dist/src/components/common/HelperTextItems.d.ts.map +0 -1
  422. package/dist/src/components/common/HelperTextItems.js +0 -17
  423. package/dist/src/components/common/HelperTextItems.js.map +0 -1
  424. package/dist/src/hooks/useApiTableSort.d.ts +0 -8
  425. package/dist/src/hooks/useApiTableSort.d.ts.map +0 -1
  426. package/dist/src/hooks/useApiTableSort.js +0 -44
  427. package/dist/src/hooks/useApiTableSort.js.map +0 -1
  428. package/dist/src/hooks/useTableSort.d.ts +0 -7
  429. package/dist/src/hooks/useTableSort.d.ts.map +0 -1
  430. package/dist/src/hooks/useTableSort.js +0 -38
  431. package/dist/src/hooks/useTableSort.js.map +0 -1
  432. package/dist/src/utils/sort/generic.d.ts +0 -5
  433. package/dist/src/utils/sort/generic.d.ts.map +0 -1
  434. package/dist/src/utils/sort/generic.js +0 -10
  435. package/dist/src/utils/sort/generic.js.map +0 -1
  436. package/dist/src/utils/sort/repository.d.ts +0 -6
  437. package/dist/src/utils/sort/repository.d.ts.map +0 -1
  438. package/dist/src/utils/sort/repository.js +0 -28
  439. package/dist/src/utils/sort/repository.js.map +0 -1
  440. package/dist/src/utils/sort/resourceSync.d.ts +0 -6
  441. package/dist/src/utils/sort/resourceSync.d.ts.map +0 -1
  442. package/dist/src/utils/sort/resourceSync.js +0 -29
  443. package/dist/src/utils/sort/resourceSync.js.map +0 -1
  444. package/src/components/DetailsPage/Tables/SystemdDetailsTable.tsx +0 -63
  445. package/src/components/Device/DeviceDetails/SystemdTable.tsx +0 -65
  446. package/src/components/Device/MatchPatternsModal/MatchPatternsForm.tsx +0 -92
  447. package/src/components/common/HelperTextItems.tsx +0 -25
  448. package/src/hooks/useApiTableSort.ts +0 -49
  449. package/src/hooks/useTableSort.ts +0 -42
  450. package/src/utils/sort/generic.ts +0 -8
  451. package/src/utils/sort/repository.ts +0 -28
  452. package/src/utils/sort/resourceSync.ts +0 -30
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import {
3
- Button,
4
3
  EmptyStateActions,
5
4
  EmptyStateBody,
6
5
  EmptyStateFooter,
@@ -13,14 +12,14 @@ import {
13
12
  ToolbarGroup,
14
13
  ToolbarItem,
15
14
  } from '@patternfly/react-core';
16
- import { Tbody, ThProps } from '@patternfly/react-table';
15
+ import { Tbody } from '@patternfly/react-table';
17
16
  import { TopologyIcon } from '@patternfly/react-icons/dist/js/icons/topology-icon';
18
17
  import { Trans } from 'react-i18next';
19
18
  import { TFunction } from 'i18next';
20
19
 
21
- import { Fleet } from '@flightctl/types';
22
20
  import ListPage from '../ListPage/ListPage';
23
21
  import ListPageBody from '../ListPage/ListPageBody';
22
+ import TablePagination from '../Table/TablePagination';
24
23
  import TableTextSearch from '../Table/TableTextSearch';
25
24
  import Table, { ApiSortTableColumn } from '../Table/Table';
26
25
  import { useTableSelect } from '../../hooks/useTableSelect';
@@ -33,23 +32,38 @@ import { useTranslation } from '../../hooks/useTranslation';
33
32
  import { ROUTE, useNavigate } from '../../hooks/useNavigate';
34
33
  import DeleteFleetModal from './DeleteFleetModal/DeleteFleetModal';
35
34
  import FleetResourceSyncs from './FleetResourceSyncs';
36
- import { useApiTableSort } from '../../hooks/useApiTableSort';
37
35
  import { useFleetBackendFilters, useFleets } from './useFleets';
36
+ import { useAccessReview } from '../../hooks/useAccessReview';
37
+ import ButtonWithPermissions from '../common/ButtonWithPermissions';
38
+ import { RESOURCE, VERB } from '../../types/rbac';
39
+ import PageWithPermissions from '../common/PageWithPermissions';
40
+ import { useFleetImportAccessReview } from '../../hooks/useFleetImportAccessReview';
38
41
 
39
42
  const FleetPageActions = ({ createText }: { createText?: string }) => {
40
43
  const { t } = useTranslation();
41
44
  const navigate = useNavigate();
45
+ const canCreateFleet = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
46
+ const canImportFleet = useFleetImportAccessReview();
47
+
42
48
  return (
43
49
  <Split hasGutter>
44
50
  <SplitItem>
45
- <Button variant="primary" onClick={() => navigate(ROUTE.FLEET_CREATE)}>
51
+ <ButtonWithPermissions
52
+ permissions={canCreateFleet}
53
+ variant="primary"
54
+ onClick={() => navigate(ROUTE.FLEET_CREATE)}
55
+ >
46
56
  {createText || t('Create a fleet')}
47
- </Button>
57
+ </ButtonWithPermissions>
48
58
  </SplitItem>
49
59
  <SplitItem>
50
- <Button variant="secondary" onClick={() => navigate(ROUTE.FLEET_IMPORT)}>
60
+ <ButtonWithPermissions
61
+ permissions={canImportFleet}
62
+ variant="secondary"
63
+ onClick={() => navigate(ROUTE.FLEET_IMPORT)}
64
+ >
51
65
  {t('Import fleets')}
52
- </Button>
66
+ </ButtonWithPermissions>
53
67
  </SplitItem>
54
68
  </Split>
55
69
  );
@@ -78,12 +92,9 @@ const FleetEmptyState = () => {
78
92
  const getColumns = (t: TFunction): ApiSortTableColumn[] => [
79
93
  {
80
94
  name: t('Name'),
81
- sortableField: 'metadata.name',
82
- defaultSort: true,
83
95
  },
84
96
  {
85
97
  name: t('System image'),
86
- sortableField: 'spec.template.spec.os.image',
87
98
  },
88
99
  {
89
100
  name: t('Devices'),
@@ -93,26 +104,25 @@ const getColumns = (t: TFunction): ApiSortTableColumn[] => [
93
104
  },
94
105
  ];
95
106
 
96
- type FleetTableProps = {
97
- fleetColumns: ApiSortTableColumn[];
98
- fleetLoad: FleetLoad;
99
- getSortParams: (columnIndex: number) => ThProps['sort'];
100
- hasFiltersEnabled: boolean;
101
- name: string | undefined;
102
- setName: (name: string) => void;
103
- };
104
-
105
- const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColumns, fleetLoad }: FleetTableProps) => {
107
+ const FleetTable = () => {
106
108
  const { t } = useTranslation();
107
109
 
110
+ const fleetColumns = React.useMemo(() => getColumns(t), [t]);
111
+ const { name, setName, hasFiltersEnabled } = useFleetBackendFilters();
112
+
113
+ const { fleets, isLoading, error, isUpdating, refetch, pagination } = useFleets({ name, addDevicesCount: true });
114
+
108
115
  const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
109
116
  const [fleetToDeleteId, setFleetToDeleteId] = React.useState<string>();
110
- const [fleets, loading, error, isFilterUpdating, refetch] = fleetLoad;
111
117
 
112
118
  const { onRowSelect, isAllSelected, hasSelectedRows, isRowSelected, setAllSelected } = useTableSelect();
113
119
 
120
+ const [canDelete] = useAccessReview(RESOURCE.FLEET, VERB.DELETE);
121
+ const [canCreate] = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
122
+ const [canEdit] = useAccessReview(RESOURCE.FLEET, VERB.PATCH);
123
+
114
124
  return (
115
- <ListPageBody error={error} loading={loading}>
125
+ <ListPageBody error={error} loading={isLoading}>
116
126
  <Toolbar inset={{ default: 'insetNone' }}>
117
127
  <ToolbarContent>
118
128
  <ToolbarGroup>
@@ -120,25 +130,28 @@ const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColu
120
130
  <TableTextSearch value={name} setValue={setName} placeholder={t('Search by name')} />
121
131
  </ToolbarItem>
122
132
  </ToolbarGroup>
123
- <ToolbarItem>
124
- <FleetPageActions createText={t('Create fleet')} />
125
- </ToolbarItem>
126
- <ToolbarItem>
127
- <TableActions isDisabled={!hasSelectedRows}>
128
- <SelectList>
129
- <SelectOption onClick={() => setIsMassDeleteModalOpen(true)}>{t('Delete')}</SelectOption>
130
- </SelectList>
131
- </TableActions>
132
- </ToolbarItem>
133
+ {canCreate && (
134
+ <ToolbarItem>
135
+ <FleetPageActions createText={t('Create fleet')} />
136
+ </ToolbarItem>
137
+ )}
138
+ {canDelete && (
139
+ <ToolbarItem>
140
+ <TableActions isDisabled={!hasSelectedRows}>
141
+ <SelectList>
142
+ <SelectOption onClick={() => setIsMassDeleteModalOpen(true)}>{t('Delete')}</SelectOption>
143
+ </SelectList>
144
+ </TableActions>
145
+ </ToolbarItem>
146
+ )}
133
147
  </ToolbarContent>
134
148
  </Toolbar>
135
149
  <Table
136
150
  aria-label={t('Fleets table')}
137
- loading={isFilterUpdating}
151
+ loading={isUpdating}
138
152
  columns={fleetColumns}
139
153
  emptyFilters={!hasFiltersEnabled}
140
154
  emptyData={fleets.length === 0}
141
- getSortParams={getSortParams}
142
155
  isAllSelected={isAllSelected}
143
156
  onSelectAll={setAllSelected}
144
157
  >
@@ -148,15 +161,18 @@ const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColu
148
161
  key={getResourceId(fleet)}
149
162
  fleet={fleet}
150
163
  rowIndex={rowIndex}
164
+ canDelete={canDelete}
151
165
  onDeleteClick={() => {
152
166
  setFleetToDeleteId(fleet.metadata.name || '');
153
167
  }}
154
168
  isRowSelected={isRowSelected}
155
169
  onRowSelect={onRowSelect}
170
+ canEdit={canEdit}
156
171
  />
157
172
  ))}
158
173
  </Tbody>
159
174
  </Table>
175
+ <TablePagination pagination={pagination} isUpdating={isUpdating} />
160
176
  {fleets.length === 0 && <FleetEmptyState />}
161
177
  {fleetToDeleteId && (
162
178
  <DeleteFleetModal
@@ -183,33 +199,27 @@ const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColu
183
199
  );
184
200
  };
185
201
 
186
- type FleetLoad = [Fleet[], boolean, unknown, boolean, VoidFunction];
187
-
188
202
  const FleetsPage = () => {
189
203
  const { t } = useTranslation();
190
204
 
191
- // TODO move the fetch down to FleetTable when the API includes the filter for pending / errored resource syncs
192
- const columns = React.useMemo(() => getColumns(t), [t]);
193
- const { name, setName, hasFiltersEnabled } = useFleetBackendFilters();
194
- const { getSortParams, sortField, direction } = useApiTableSort(columns);
195
- const fleetLoad = useFleets({ name, addDevicesCount: true, sortField, direction });
196
-
197
205
  return (
198
206
  <>
199
- <FleetResourceSyncs fleets={fleetLoad[0] || []} />
207
+ <FleetResourceSyncs />
200
208
 
201
209
  <ListPage title={t('Fleets')}>
202
- <FleetTable
203
- name={name}
204
- setName={setName}
205
- hasFiltersEnabled={hasFiltersEnabled}
206
- getSortParams={getSortParams}
207
- fleetLoad={fleetLoad}
208
- fleetColumns={columns}
209
- />
210
+ <FleetTable />
210
211
  </ListPage>
211
212
  </>
212
213
  );
213
214
  };
214
215
 
215
- export default FleetsPage;
216
+ const FleetsPageWithPermissions = () => {
217
+ const [allowed, loading] = useAccessReview(RESOURCE.FLEET, VERB.LIST);
218
+ return (
219
+ <PageWithPermissions allowed={allowed} loading={loading}>
220
+ <FleetsPage />
221
+ </PageWithPermissions>
222
+ );
223
+ };
224
+
225
+ export default FleetsPageWithPermissions;
@@ -40,6 +40,8 @@ import { useTranslation } from '../../../hooks/useTranslation';
40
40
  import { Link, ROUTE, useNavigate } from '../../../hooks/useNavigate';
41
41
  import LeaveFormConfirmation from '../../common/LeaveFormConfirmation';
42
42
  import ErrorBoundary from '../../common/ErrorBoundary';
43
+ import PageWithPermissions from '../../common/PageWithPermissions';
44
+ import { useFleetImportAccessReview } from '../../../hooks/useFleetImportAccessReview';
43
45
 
44
46
  import './ImportFleetWizard.css';
45
47
 
@@ -97,11 +99,13 @@ const ImportFleetWizard = () => {
97
99
  const [errors, setErrors] = React.useState<string[]>();
98
100
  const navigate = useNavigate();
99
101
  const [currentStep, setCurrentStep] = React.useState<WizardStepType>();
100
- const [repoList, isLoading, error] = useFetchPeriodically<RepositoryList>({ endpoint: 'repositories' });
102
+ const [repoList, isLoading, error] = useFetchPeriodically<RepositoryList>({
103
+ endpoint: 'repositories',
104
+ });
101
105
 
102
106
  const gitRepositories = (repoList?.items || []).filter((repo) => repo.spec.type === RepoSpecType.GIT);
103
107
 
104
- let body;
108
+ let body: React.ReactNode;
105
109
 
106
110
  if (isLoading) {
107
111
  body = (
@@ -213,4 +217,13 @@ const ImportFleetWizard = () => {
213
217
  );
214
218
  };
215
219
 
216
- export default ImportFleetWizard;
220
+ const ImportFleetWizardWithPermissions = () => {
221
+ const [allowed, isLoading] = useFleetImportAccessReview();
222
+ return (
223
+ <PageWithPermissions allowed={allowed} loading={isLoading}>
224
+ <ImportFleetWizard />
225
+ </PageWithPermissions>
226
+ );
227
+ };
228
+
229
+ export default ImportFleetWizardWithPermissions;
@@ -12,6 +12,8 @@ import { getLastTransitionTimeText, getRepositorySyncStatus } from '../../../../
12
12
  import { useTranslation } from '../../../../hooks/useTranslation';
13
13
  import FormSelect from '../../../form/FormSelect';
14
14
  import FlightCtlForm from '../../../form/FlightCtlForm';
15
+ import { useAccessReview } from '../../../../hooks/useAccessReview';
16
+ import { RESOURCE, VERB } from '../../../../types/rbac';
15
17
 
16
18
  export const repositoryStepId = 'repository';
17
19
 
@@ -75,6 +77,8 @@ const RepositoryStep = ({ repositories, hasLoaded }: { repositories: Repository[
75
77
  const { t } = useTranslation();
76
78
  const { values, setFieldValue } = useFormikContext<ImportFleetFormValues>();
77
79
 
80
+ const [canCreateRepo] = useAccessReview(RESOURCE.REPOSITORY, VERB.CREATE);
81
+
78
82
  const noRepositoriesExist = hasLoaded && repositories.length === 0;
79
83
  React.useEffect(() => {
80
84
  if (values.useExistingRepo && noRepositoriesExist) {
@@ -85,25 +89,27 @@ const RepositoryStep = ({ repositories, hasLoaded }: { repositories: Repository[
85
89
  return (
86
90
  <FlightCtlForm>
87
91
  <Grid span={8}>
88
- <FormSection>
89
- <FormGroup isInline>
90
- <Radio
91
- isChecked={values.useExistingRepo}
92
- onChange={() => setFieldValue('useExistingRepo', true, true)}
93
- id="existing-repo"
94
- name="repo"
95
- label={t('Use an existing Git repository')}
96
- isDisabled={noRepositoriesExist}
97
- />
98
- <Radio
99
- isChecked={!values.useExistingRepo}
100
- onChange={() => setFieldValue('useExistingRepo', false, true)}
101
- id="new-repo"
102
- name="repo"
103
- label={t('Use a new Git repository')}
104
- />
105
- </FormGroup>
106
- </FormSection>
92
+ {canCreateRepo && (
93
+ <FormSection>
94
+ <FormGroup isInline>
95
+ <Radio
96
+ isChecked={values.useExistingRepo}
97
+ onChange={() => setFieldValue('useExistingRepo', true, true)}
98
+ id="existing-repo"
99
+ name="repo"
100
+ label={t('Use an existing Git repository')}
101
+ isDisabled={noRepositoriesExist}
102
+ />
103
+ <Radio
104
+ isChecked={!values.useExistingRepo}
105
+ onChange={() => setFieldValue('useExistingRepo', false, true)}
106
+ id="new-repo"
107
+ name="repo"
108
+ label={t('Use a new Git repository')}
109
+ />
110
+ </FormGroup>
111
+ </FormSection>
112
+ )}
107
113
  <FormSection>
108
114
  {values.useExistingRepo ? <ExistingRepoForm repositories={repositories} /> : <RepositoryForm />}
109
115
  </FormSection>
@@ -1,9 +1,11 @@
1
1
  import * as React from 'react';
2
+ import { useDebounce } from 'use-debounce';
2
3
 
4
+ import { Fleet, FleetList } from '@flightctl/types';
3
5
  import { useAppContext } from '../../hooks/useAppContext';
4
6
  import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
5
- import { Fleet, FleetList, SortOrder } from '@flightctl/types';
6
- import { useDebounce } from 'use-debounce';
7
+ import { PaginationDetails, useTablePagination } from '../../hooks/useTablePagination';
8
+ import { PAGE_SIZE } from '../../constants';
7
9
 
8
10
  export enum FleetSearchParams {
9
11
  Name = 'name',
@@ -11,9 +13,8 @@ export enum FleetSearchParams {
11
13
 
12
14
  type FleetsEndpointArgs = {
13
15
  name?: string;
16
+ nextContinue?: string;
14
17
  addDevicesCount?: boolean;
15
- sortField?: string;
16
- direction?: string;
17
18
  };
18
19
 
19
20
  export const useFleetBackendFilters = () => {
@@ -45,29 +46,27 @@ export const useFleetBackendFilters = () => {
45
46
  };
46
47
 
47
48
  const getFleetsEndpoint = ({
48
- addDevicesCount,
49
49
  name,
50
- sortField,
51
- direction,
50
+ addDevicesCount,
51
+ nextContinue,
52
52
  }: {
53
- addDevicesCount?: boolean;
54
53
  name?: string;
55
- sortField?: string;
56
- direction?: string;
54
+ addDevicesCount?: boolean;
55
+ nextContinue?: string;
57
56
  }) => {
58
- const params = new URLSearchParams();
57
+ const params = new URLSearchParams({
58
+ limit: `${PAGE_SIZE}`,
59
+ });
59
60
  if (name) {
60
61
  params.set('fieldSelector', `metadata.name contains ${name}`);
61
62
  }
62
63
  if (addDevicesCount) {
63
64
  params.set('addDevicesCount', 'true');
64
65
  }
65
-
66
- if (sortField) {
67
- params.set('sortBy', sortField);
68
- params.set('sortOrder', direction || SortOrder.ASC);
66
+ if (nextContinue) {
67
+ params.set('continue', nextContinue);
69
68
  }
70
- return params.size ? `fleets?${params.toString()}` : 'fleets';
69
+ return `fleets?${params.toString()}`;
71
70
  };
72
71
 
73
72
  const useFleetsEndpoint = (args: FleetsEndpointArgs): [string, boolean] => {
@@ -76,11 +75,30 @@ const useFleetsEndpoint = (args: FleetsEndpointArgs): [string, boolean] => {
76
75
  return [fleetsEndpointDebounced, endpoint !== fleetsEndpointDebounced];
77
76
  };
78
77
 
79
- export const useFleets = (args: FleetsEndpointArgs): [Fleet[], boolean, unknown, boolean, VoidFunction] => {
80
- const [fleetsEndpoint, fleetsDebouncing] = useFleetsEndpoint(args);
81
- const [fleetsList, fleetsLoading, fleetsError, fleetsRefetch, updating] = useFetchPeriodically<FleetList>({
82
- endpoint: fleetsEndpoint,
83
- });
78
+ export type FleetLoad = {
79
+ fleets: Fleet[];
80
+ isLoading: boolean;
81
+ error: unknown;
82
+ isUpdating: boolean;
83
+ refetch: VoidFunction;
84
+ pagination: PaginationDetails;
85
+ };
84
86
 
85
- return [fleetsList?.items || [], fleetsLoading, fleetsError, updating || fleetsDebouncing, fleetsRefetch];
87
+ export const useFleets = (args: FleetsEndpointArgs): FleetLoad => {
88
+ const pagination = useTablePagination();
89
+ const [fleetsEndpoint, fleetsDebouncing] = useFleetsEndpoint({ ...args, nextContinue: pagination.nextContinue });
90
+ const [fleetsList, isLoading, error, refetch, updating] = useFetchPeriodically<FleetList>(
91
+ {
92
+ endpoint: fleetsEndpoint,
93
+ },
94
+ pagination.onPageFetched,
95
+ );
96
+ return {
97
+ fleets: fleetsList?.items || [],
98
+ isLoading,
99
+ error,
100
+ isUpdating: updating || fleetsDebouncing,
101
+ refetch,
102
+ pagination,
103
+ };
86
104
  };
@@ -14,16 +14,14 @@ import {
14
14
  TextContent,
15
15
  TextVariants,
16
16
  } from '@patternfly/react-core';
17
- import { FleetList } from '@flightctl/types';
18
17
  import { useTranslation } from '../../../../hooks/useTranslation';
19
18
  import ApplicationStatusChart from './ApplicationStatusChart';
20
19
  import DeviceStatusChart from './DeviceStatusChart';
21
20
  import SystemUpdateStatusChart from './SystemUpdateStatusChart';
22
- import { useFetchPeriodically } from '../../../../hooks/useFetchPeriodically';
23
21
  import StatusCardFilters from './StatusCardFilters';
24
22
  import ErrorAlert from '../../../ErrorAlert/ErrorAlert';
25
23
  import { FlightCtlLabel } from '../../../../types/extraTypes';
26
- import { useDevices, useDevicesSummary } from '../../../Device/DevicesPage/useDevices';
24
+ import { useDevicesSummary } from '../../../Device/DevicesPage/useDevices';
27
25
 
28
26
  const StatusCard = () => {
29
27
  const { t } = useTranslation();
@@ -35,26 +33,17 @@ const StatusCard = () => {
35
33
  labels,
36
34
  });
37
35
 
38
- // TODO https://issues.redhat.com/browse/EDM-684 Use the new API endpoint to retrieve device labels
39
- const [, /* devices */ loading, error, , , allLabels] = useDevices({
40
- ownerFleets: fleets,
41
- labels,
42
- });
43
-
44
- // TODO https://issues.redhat.com/browse/EDM-683 Use the new API endpoint to retrieve fleet names
45
- const [fleetsList, flLoading, flError] = useFetchPeriodically<FleetList>({
46
- endpoint: 'fleets',
47
- });
36
+ const error = false;
48
37
 
49
38
  let content: React.ReactNode;
50
- if (loading || flLoading || summaryLoading) {
39
+ if (summaryLoading) {
51
40
  content = (
52
41
  <Bullseye>
53
42
  <Spinner />
54
43
  </Bullseye>
55
44
  );
56
- } else if (error || flError) {
57
- content = <ErrorAlert error={error || flError} />;
45
+ } else if (error) {
46
+ content = <ErrorAlert error={error} />;
58
47
  } else {
59
48
  content = (
60
49
  <Stack>
@@ -97,10 +86,8 @@ const StatusCard = () => {
97
86
  </FlexItem>
98
87
  <FlexItem>
99
88
  <StatusCardFilters
100
- fleets={fleetsList?.items || []}
101
89
  selectedFleets={fleets}
102
90
  setSelectedFleets={setFleets}
103
- allLabels={allLabels}
104
91
  selectedLabels={labels}
105
92
  setSelectedLabels={setLabels}
106
93
  />
@@ -11,26 +11,21 @@ import {
11
11
  ToolbarGroup,
12
12
  ToolbarItem,
13
13
  } from '@patternfly/react-core';
14
- import { Fleet } from '@flightctl/types';
15
14
  import { useTranslation } from '../../../../hooks/useTranslation';
16
15
  import { labelToString } from '../../../../utils/labels';
17
16
  import { FlightCtlLabel } from '../../../../types/extraTypes';
18
17
  import DeviceTableToolbarFilters from '../../../Device/DevicesPage/DeviceToolbarFilters';
19
18
 
20
19
  type StatusCardFiltersProps = {
21
- fleets: Fleet[];
22
20
  selectedFleets: string[];
23
21
  setSelectedFleets: (fleets: string[]) => void;
24
- allLabels: FlightCtlLabel[];
25
22
  selectedLabels: FlightCtlLabel[];
26
23
  setSelectedLabels: (labels: FlightCtlLabel[]) => void;
27
24
  };
28
25
 
29
26
  const StatusCardFilters: React.FC<StatusCardFiltersProps> = ({
30
- fleets,
31
27
  selectedFleets,
32
28
  setSelectedFleets,
33
- allLabels,
34
29
  selectedLabels,
35
30
  setSelectedLabels,
36
31
  }) => {
@@ -46,10 +41,8 @@ const StatusCardFilters: React.FC<StatusCardFiltersProps> = ({
46
41
  <ToolbarGroup>
47
42
  <ToolbarItem variant="search-filter">
48
43
  <DeviceTableToolbarFilters
49
- fleets={fleets}
50
44
  selectedFleetNames={selectedFleets}
51
45
  setSelectedFleets={setSelectedFleets}
52
- allLabels={allLabels}
53
46
  selectedLabels={selectedLabels}
54
47
  setSelectedLabels={setSelectedLabels}
55
48
  />
@@ -2,17 +2,29 @@ import * as React from 'react';
2
2
  import { Grid, GridItem } from '@patternfly/react-core';
3
3
  import StatusCard from './Cards/Status/StatusCard';
4
4
  import ToDoCard from './Cards/ToDo/ToDoCard';
5
+ import { useAccessReview } from '../../hooks/useAccessReview';
6
+ import { RESOURCE, VERB } from '../../types/rbac';
7
+ import PageWithPermissions from '../common/PageWithPermissions';
5
8
 
6
9
  const Overview = () => {
10
+ const [canListDevices, devicesLoading] = useAccessReview(RESOURCE.DEVICE, VERB.LIST);
11
+ const [canListErs, erLoading] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.LIST);
12
+
7
13
  return (
8
- <Grid hasGutter>
9
- <GridItem>
10
- <StatusCard />
11
- </GridItem>
12
- <GridItem md={6} lg={4}>
13
- <ToDoCard />
14
- </GridItem>
15
- </Grid>
14
+ <PageWithPermissions allowed={canListDevices || canListErs} loading={devicesLoading || erLoading}>
15
+ <Grid hasGutter>
16
+ {canListDevices && (
17
+ <GridItem>
18
+ <StatusCard />
19
+ </GridItem>
20
+ )}
21
+ {canListErs && (
22
+ <GridItem md={6} lg={4}>
23
+ <ToDoCard />
24
+ </GridItem>
25
+ )}
26
+ </Grid>
27
+ </PageWithPermissions>
16
28
  );
17
29
  };
18
30
 
@@ -13,16 +13,21 @@ import {
13
13
  StackItem,
14
14
  Title,
15
15
  } from '@patternfly/react-core';
16
- import { useTranslation } from '../../../hooks/useTranslation';
17
- import { useFetch } from '../../../hooks/useFetch';
18
16
 
19
- import CreateRepositoryForm from './CreateRepositoryForm';
20
-
21
- import { isPromiseFulfilled } from '../../../types/typeUtils';
22
17
  import { Repository, ResourceSync, ResourceSyncList } from '@flightctl/types';
23
- import { getErrorMessage } from '../../../utils/error';
18
+
19
+ import { useTranslation } from '../../../hooks/useTranslation';
20
+ import { useFetch } from '../../../hooks/useFetch';
24
21
  import { Link, ROUTE, useNavigate } from '../../../hooks/useNavigate';
25
22
  import { useAppContext } from '../../../hooks/useAppContext';
23
+ import { useAccessReview } from '../../../hooks/useAccessReview';
24
+ import { isPromiseFulfilled } from '../../../types/typeUtils';
25
+ import { RESOURCE, VERB } from '../../../types/rbac';
26
+ import { getErrorMessage } from '../../../utils/error';
27
+ import { commonQueries } from '../../../utils/query';
28
+ import PageWithPermissions from '../../common/PageWithPermissions';
29
+
30
+ import CreateRepositoryForm from './CreateRepositoryForm';
26
31
 
27
32
  const CreateRepository = () => {
28
33
  const { t } = useTranslation();
@@ -30,6 +35,7 @@ const CreateRepository = () => {
30
35
  router: { useParams },
31
36
  } = useAppContext();
32
37
  const { repositoryId } = useParams<{ repositoryId: string }>();
38
+
33
39
  const { get } = useFetch();
34
40
  const [repoError, setRepoError] = React.useState<string>();
35
41
  const [rsError, setRsError] = React.useState<string>();
@@ -44,7 +50,7 @@ const CreateRepository = () => {
44
50
  try {
45
51
  const results = await Promise.allSettled([
46
52
  get<Repository>(`repositories/${repositoryId}`),
47
- get<ResourceSyncList>(`resourcesyncs?fieldSelector=spec.repository=${repositoryId}`),
53
+ get<ResourceSyncList>(commonQueries.getResourceSyncsByRepo(repositoryId as string)),
48
54
  ]);
49
55
 
50
56
  if (isPromiseFulfilled(results[0])) {
@@ -70,7 +76,8 @@ const CreateRepository = () => {
70
76
  const reload = async () => {
71
77
  try {
72
78
  setIsLoading(true);
73
- const rsList = await get<ResourceSyncList>(`resourcesyncs?fieldSelector=spec.repository${repositoryId}`);
79
+
80
+ const rsList = await get<ResourceSyncList>(commonQueries.getResourceSyncsByRepo(repositoryId as string));
74
81
  setResourceSyncs(rsList.items);
75
82
  setRsError(undefined);
76
83
  } catch (e) {
@@ -141,4 +148,13 @@ const CreateRepository = () => {
141
148
  );
142
149
  };
143
150
 
144
- export default CreateRepository;
151
+ const CreateRepositoryWithPermissions = () => {
152
+ const [allowed, loading] = useAccessReview(RESOURCE.REPOSITORY, VERB.CREATE);
153
+ return (
154
+ <PageWithPermissions allowed={allowed} loading={loading}>
155
+ <CreateRepository />
156
+ </PageWithPermissions>
157
+ );
158
+ };
159
+
160
+ export default CreateRepositoryWithPermissions;
@@ -40,8 +40,9 @@ import CheckboxField from '../../form/CheckboxField';
40
40
  import RadioField from '../../form/RadioField';
41
41
  import TextField from '../../form/TextField';
42
42
  import FlightCtlForm from '../../form/FlightCtlForm';
43
-
44
43
  import { getDnsSubdomainValidations } from '../../form/validations';
44
+ import { useAccessReview } from '../../../hooks/useAccessReview';
45
+ import { RESOURCE, VERB } from '../../../types/rbac';
45
46
 
46
47
  import './CreateRepositoryForm.css';
47
48
 
@@ -285,13 +286,15 @@ const CreateRepositoryFormContent = ({ isEdit, isReadOnly, onClose, children }:
285
286
  const { values, setFieldValue, isValid, dirty, submitForm, isSubmitting } = useFormikContext<RepositoryFormValues>();
286
287
  const isSubmitDisabled = isSubmitting || !dirty || !isValid;
287
288
 
289
+ const [canCreateRS] = useAccessReview(RESOURCE.RESOURCE_SYNC, VERB.CREATE);
290
+
288
291
  const showResourceSyncs = values.canUseResourceSyncs && values.repoType === RepoSpecType.GIT;
289
292
  return (
290
293
  <FlightCtlForm className="fctl-create-repo">
291
294
  <fieldset disabled={isReadOnly}>
292
295
  <Grid hasGutter span={8}>
293
296
  <RepositoryForm isEdit={isEdit} />
294
- {showResourceSyncs && (
297
+ {showResourceSyncs && canCreateRS && (
295
298
  <Checkbox
296
299
  id="use-resource-syncs"
297
300
  label={