@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
@@ -0,0 +1,114 @@
1
+ import * as React from 'react';
2
+ import { Alert, Button, Label, LabelGroup, TextInput } from '@patternfly/react-core';
3
+ import { useFormikContext } from 'formik';
4
+
5
+ import { useTranslation } from '../../../hooks/useTranslation';
6
+ import ErrorHelperText from '../../form/FieldHelperText';
7
+ import FlightCtlActionGroup from '../../form/FlightCtlActionGroup';
8
+ import FlightCtlForm from '../../form/FlightCtlForm';
9
+
10
+ export type SystemdUnitFormValue = {
11
+ pattern: string;
12
+ exists: boolean;
13
+ };
14
+
15
+ export type SystemdUnitsFormValues = {
16
+ systemdUnits: SystemdUnitFormValue[];
17
+ };
18
+
19
+ export type TrackSystemdUnitsFormProps = {
20
+ onClose: (reload?: boolean) => void;
21
+ error?: string;
22
+ };
23
+
24
+ const TrackSystemdUnitsForm: React.FC<TrackSystemdUnitsFormProps> = ({ onClose, error }) => {
25
+ const { t } = useTranslation();
26
+ const {
27
+ values,
28
+ setFieldValue,
29
+ submitForm,
30
+ isSubmitting,
31
+ errors: formErrors,
32
+ } = useFormikContext<SystemdUnitsFormValues>();
33
+ const [currentText, setCurrentText] = React.useState<string>('');
34
+
35
+ const onDeleteSystemdUnit = (deleteIndex: number) => {
36
+ const newSystemdUnits = values.systemdUnits.filter((_, index) => deleteIndex !== index);
37
+ void setFieldValue('systemdUnits', newSystemdUnits);
38
+ };
39
+
40
+ const onAdd = () => {
41
+ if (currentText) {
42
+ const newSystemdUnits = [...values.systemdUnits, { pattern: currentText, exists: false }];
43
+ void setFieldValue('systemdUnits', newSystemdUnits);
44
+ setCurrentText('');
45
+ }
46
+ };
47
+
48
+ const onEdit = (editIndex: number, nextText: string) => {
49
+ const newSystemdUnits = [...values.systemdUnits].map((systemdUnit, index) => {
50
+ if (index === editIndex) {
51
+ return { pattern: nextText, exists: false };
52
+ }
53
+ return systemdUnit;
54
+ });
55
+ void setFieldValue('systemdUnits', newSystemdUnits);
56
+ };
57
+
58
+ const textError = typeof formErrors.systemdUnits === 'string' ? formErrors.systemdUnits : undefined;
59
+ return (
60
+ <FlightCtlForm>
61
+ <TextInput
62
+ aria-label={t('Systemd service name')}
63
+ placeholder={t('Type here')}
64
+ value={currentText}
65
+ onBlur={onAdd}
66
+ onKeyDown={(ev) => {
67
+ if (ev.key === 'Enter') {
68
+ onAdd();
69
+ }
70
+ }}
71
+ onChange={(_ev, text) => {
72
+ setCurrentText(text);
73
+ }}
74
+ />
75
+ <LabelGroup numLabels={20} defaultIsOpen>
76
+ {values.systemdUnits.map((systemdUnit, index) => {
77
+ if (systemdUnit.exists) {
78
+ return null;
79
+ }
80
+ return (
81
+ <Label
82
+ key={index}
83
+ id={`${index}`}
84
+ onClose={() => onDeleteSystemdUnit(index)}
85
+ onEditCancel={(_, prevText) => onEdit(index, prevText)}
86
+ onEditComplete={(_, newText) => onEdit(index, newText)}
87
+ isEditable
88
+ >
89
+ {systemdUnit.pattern}
90
+ </Label>
91
+ );
92
+ })}
93
+ </LabelGroup>
94
+ <ErrorHelperText error={textError} />
95
+ {error && <Alert isInline title={error} variant="danger" />}
96
+ <FlightCtlActionGroup>
97
+ <Button
98
+ key="confirm"
99
+ variant="primary"
100
+ onClick={submitForm}
101
+ isDisabled={isSubmitting || !!textError}
102
+ isLoading={isSubmitting}
103
+ >
104
+ {t('Track services')}
105
+ </Button>
106
+ <Button key="cancel" variant="link" onClick={() => onClose()} isDisabled={isSubmitting}>
107
+ {t('Cancel')}
108
+ </Button>
109
+ </FlightCtlActionGroup>
110
+ </FlightCtlForm>
111
+ );
112
+ };
113
+
114
+ export default TrackSystemdUnitsForm;
@@ -35,6 +35,9 @@ import FlightControlDescriptionList from '../../common/FlightCtlDescriptionList'
35
35
  import { useTranslation } from '../../../hooks/useTranslation';
36
36
  import { ROUTE, useNavigate } from '../../../hooks/useNavigate';
37
37
  import { useAppContext } from '../../../hooks/useAppContext';
38
+ import { useAccessReview } from '../../../hooks/useAccessReview';
39
+ import { RESOURCE, VERB } from '../../../types/rbac';
40
+ import PageWithPermissions from '../../common/PageWithPermissions';
38
41
 
39
42
  import './EnrollmentRequestDetails.css';
40
43
 
@@ -49,6 +52,9 @@ const EnrollmentRequestDetails = () => {
49
52
  });
50
53
  const { remove } = useFetch();
51
54
  const navigate = useNavigate();
55
+ const [canApprove] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST_APPROVAL, VERB.POST);
56
+ const [canDelete] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.DELETE);
57
+
52
58
  const [isApprovalModalOpen, setIsApprovalModalOpen] = React.useState(false);
53
59
 
54
60
  const { deleteAction, deleteModal } = useDeleteAction({
@@ -72,14 +78,18 @@ const EnrollmentRequestDetails = () => {
72
78
  resourceType="Devices"
73
79
  resourceTypeLabel={t('Devices')}
74
80
  actions={
75
- <DetailsPageActions>
76
- <DropdownList>
77
- <DropdownItem onClick={() => setIsApprovalModalOpen(true)} isDisabled={!isPendingApproval}>
78
- {t('Approve')}
79
- </DropdownItem>
80
- {deleteAction}
81
- </DropdownList>
82
- </DetailsPageActions>
81
+ (canApprove || canApprove) && (
82
+ <DetailsPageActions>
83
+ <DropdownList>
84
+ {canApprove && (
85
+ <DropdownItem onClick={() => setIsApprovalModalOpen(true)} isDisabled={!isPendingApproval}>
86
+ {t('Approve')}
87
+ </DropdownItem>
88
+ )}
89
+ {canDelete && deleteAction}
90
+ </DropdownList>
91
+ </DetailsPageActions>
92
+ )
83
93
  }
84
94
  >
85
95
  <Grid hasGutter>
@@ -223,4 +233,13 @@ const EnrollmentRequestDetails = () => {
223
233
  );
224
234
  };
225
235
 
226
- export default EnrollmentRequestDetails;
236
+ const EnrollmentRequestDetailsWithPermissions = () => {
237
+ const [allowed, loading] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.GET);
238
+ return (
239
+ <PageWithPermissions allowed={allowed} loading={loading}>
240
+ <EnrollmentRequestDetails />
241
+ </PageWithPermissions>
242
+ );
243
+ };
244
+
245
+ export default EnrollmentRequestDetailsWithPermissions;
@@ -1,56 +1,60 @@
1
1
  import * as React from 'react';
2
2
  import { TFunction } from 'react-i18next';
3
3
  import { Tbody } from '@patternfly/react-table';
4
- import { SelectList, SelectOption, Spinner, ToolbarItem } from '@patternfly/react-core';
5
-
6
- import { EnrollmentRequest, EnrollmentRequestList as EnrollmentRequestListType } from '@flightctl/types';
7
-
8
- import Table, { ApiSortTableColumn } from '../../Table/Table';
9
- import TableActions from '../../Table/TableActions';
10
- import ListPage from '../../ListPage/ListPage';
11
- import ListPageBody from '../../ListPage/ListPageBody';
12
- import { useDeleteListAction } from '../../ListPage/ListPageActions';
13
- import { useFetch } from '../../../hooks/useFetch';
14
- import { useTranslation } from '../../../hooks/useTranslation';
15
- import { useFetchPeriodically } from '../../../hooks/useFetchPeriodically';
16
- import { useTableSelect } from '../../../hooks/useTableSelect';
17
- import { useApiTableSort } from '../../../hooks/useApiTableSort';
18
- import { useTableTextSearch } from '../../../hooks/useTableTextSearch';
19
-
20
- import ApproveDeviceModal from '../../modals/ApproveDeviceModal/ApproveDeviceModal';
21
- import MassDeleteDeviceModal from '../../modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal';
22
- import MassApproveDeviceModal from '../../modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal';
23
- import EnrollmentRequestTableRow from '../../EnrollmentRequest/EnrollmentRequestTableRow';
4
+ import { SelectList, SelectOption, ToolbarItem } from '@patternfly/react-core';
5
+ import { MicrochipIcon } from '@patternfly/react-icons/dist/js/icons';
6
+
7
+ import { EnrollmentRequest, EnrollmentRequestList } from '@flightctl/types';
8
+
9
+ import Table, { ApiSortTableColumn } from '../Table/Table';
10
+ import TableActions from '../Table/TableActions';
11
+ import ListPage from '../ListPage/ListPage';
12
+ import ListPageBody from '../ListPage/ListPageBody';
13
+ import { useDeleteListAction } from '../ListPage/ListPageActions';
14
+ import { useFetch } from '../../hooks/useFetch';
15
+ import { useTranslation } from '../../hooks/useTranslation';
16
+ import { useTableSelect } from '../../hooks/useTableSelect';
17
+ import { useTableTextSearch } from '../../hooks/useTableTextSearch';
18
+ import ApproveDeviceModal from '../modals/ApproveDeviceModal/ApproveDeviceModal';
19
+ import MassDeleteDeviceModal from '../modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal';
20
+ import MassApproveDeviceModal from '../modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal';
21
+ import EnrollmentRequestTableRow from '../EnrollmentRequest/EnrollmentRequestTableRow';
24
22
  import EnrollmentRequestTableToolbar from './EnrollmentRequestTableToolbar';
23
+ import { RESOURCE, VERB } from '../../types/rbac';
24
+ import { useAccessReview } from '../../hooks/useAccessReview';
25
+ import ResourceListEmptyState from '../common/ResourceListEmptyState';
26
+ import { usePendingEnrollments } from './useEnrollmentRequests';
27
+ import TablePagination from '../Table/TablePagination';
28
+
29
+ const EnrollmentRequestEmptyState = () => {
30
+ const { t } = useTranslation();
31
+ return <ResourceListEmptyState icon={MicrochipIcon} titleText={t('No enrollment requests here!')} />;
32
+ };
25
33
 
26
34
  const getEnrollmentColumns = (t: TFunction): ApiSortTableColumn[] => [
27
35
  {
28
36
  name: t('Name'),
29
- sortableField: 'metadata.name',
30
- defaultSort: true,
31
37
  },
32
38
  {
33
39
  name: t('Created'),
34
- sortableField: 'metadata.creationTimestamp',
35
40
  },
36
41
  ];
37
42
 
38
43
  const getSearchText = (er: EnrollmentRequest) => [er.metadata.name];
39
44
 
40
- const EnrollmentRequestList = ({ refetchDevices }: { refetchDevices: VoidFunction }) => {
45
+ type EnrollmentRequestListProps = { refetchDevices?: VoidFunction; isStandalone?: boolean };
46
+
47
+ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentRequestListProps) => {
41
48
  const { t } = useTranslation();
49
+ const [canApprove] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST_APPROVAL, VERB.POST);
50
+ const [canDelete] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.DELETE);
42
51
  const { remove } = useFetch();
43
52
  const enrollmentColumns = React.useMemo(() => getEnrollmentColumns(t), [t]);
44
- const { getSortParams, sortField, direction } = useApiTableSort(enrollmentColumns);
45
-
46
- const [erList, isLoading, error, refetch] = useFetchPeriodically<EnrollmentRequestListType>({
47
- endpoint: `enrollmentrequests?fieldSelector=!status.approval.approved${sortField ? `&sortBy=${sortField}&sortOrder=${direction}` : ''}`,
48
- });
49
- const pendingEnrollments = erList?.items || [];
53
+ const [pendingEnrollments, isLoading, error, refetch, pagination] = usePendingEnrollments();
50
54
 
51
55
  const refetchWithDevices = () => {
52
56
  refetch();
53
- refetchDevices();
57
+ refetchDevices?.();
54
58
  };
55
59
 
56
60
  const [approvingErId, setApprovingErId] = React.useState<string>();
@@ -69,11 +73,8 @@ const EnrollmentRequestList = ({ refetchDevices }: { refetchDevices: VoidFunctio
69
73
  },
70
74
  });
71
75
 
72
- if (isLoading) {
73
- return <Spinner size="md" />;
74
- }
75
-
76
- if (pendingEnrollments.length === 0) {
76
+ // In non-standalone mode, hide the entire component when there are no pending enrollments
77
+ if (!isStandalone && pendingEnrollments.length === 0) {
77
78
  return null;
78
79
  }
79
80
 
@@ -81,24 +82,29 @@ const EnrollmentRequestList = ({ refetchDevices }: { refetchDevices: VoidFunctio
81
82
 
82
83
  return (
83
84
  <ListPage title={t('Devices pending approval')} headingLevel="h2">
84
- <ListPageBody error={error} loading={isLoading}>
85
+ <ListPageBody error={error} loading={false}>
85
86
  <EnrollmentRequestTableToolbar search={search} setSearch={setSearch} enrollments={pendingEnrollments}>
86
- <ToolbarItem>
87
- <TableActions isDisabled={!hasSelectedRows}>
88
- <SelectList>
89
- <SelectOption onClick={() => setIsMassApproveModalOpen(true)}>{t('Approve')}</SelectOption>
90
- <SelectOption onClick={() => setIsMassDeleteModalOpen(true)}>{t('Delete')}</SelectOption>
91
- </SelectList>
92
- </TableActions>
93
- </ToolbarItem>
87
+ {(canApprove || canDelete) && (
88
+ <ToolbarItem>
89
+ <TableActions isDisabled={!hasSelectedRows}>
90
+ <SelectList>
91
+ {canApprove && (
92
+ <SelectOption onClick={() => setIsMassApproveModalOpen(true)}>{t('Approve')}</SelectOption>
93
+ )}
94
+ {canDelete && (
95
+ <SelectOption onClick={() => setIsMassDeleteModalOpen(true)}>{t('Delete')}</SelectOption>
96
+ )}
97
+ </SelectList>
98
+ </TableActions>
99
+ </ToolbarItem>
100
+ )}
94
101
  </EnrollmentRequestTableToolbar>
95
102
  <Table
96
103
  aria-label={t('Table for devices pending approval')}
97
- loading={isLoading}
104
+ loading={!!isStandalone && isLoading && pendingEnrollments.length === 0}
98
105
  columns={enrollmentColumns}
99
106
  emptyFilters={filteredData.length === 0}
100
107
  emptyData={false}
101
- getSortParams={getSortParams}
102
108
  isAllSelected={isAllSelected}
103
109
  onSelectAll={setAllSelected}
104
110
  >
@@ -114,11 +120,14 @@ const EnrollmentRequestList = ({ refetchDevices }: { refetchDevices: VoidFunctio
114
120
  onApprove={() => {
115
121
  setApprovingErId(er.metadata.name as string);
116
122
  }}
123
+ canApprove={canApprove}
124
+ canDelete={canDelete}
117
125
  />
118
126
  ))}
119
127
  </Tbody>
120
128
  </Table>
121
-
129
+ <TablePagination pagination={pagination} isUpdating={isLoading} />
130
+ {isStandalone && pendingEnrollments.length === 0 && !isLoading && <EnrollmentRequestEmptyState />}
122
131
  {deleteModal}
123
132
  {currentEnrollmentRequest && (
124
133
  <ApproveDeviceModal
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ActionsColumn, OnSelect, Td, Tr } from '@patternfly/react-table';
2
+ import { ActionsColumn, IAction, OnSelect, Td, Tr } from '@patternfly/react-table';
3
3
  import { Button } from '@patternfly/react-core';
4
4
 
5
5
  import { EnrollmentRequest } from '@flightctl/types';
@@ -16,6 +16,8 @@ type EnrollmentRequestTableRow = {
16
16
  er: EnrollmentRequest;
17
17
  onApprove: (id: string) => void;
18
18
  deleteAction: DeleteListActionResult['deleteAction'];
19
+ canApprove: boolean;
20
+ canDelete: boolean;
19
21
  };
20
22
 
21
23
  const EnrollmentRequestTableRow: React.FC<EnrollmentRequestTableRow> = ({
@@ -25,6 +27,8 @@ const EnrollmentRequestTableRow: React.FC<EnrollmentRequestTableRow> = ({
25
27
  onRowSelect,
26
28
  isRowSelected,
27
29
  onApprove,
30
+ canApprove,
31
+ canDelete,
28
32
  }) => {
29
33
  const { t } = useTranslation();
30
34
  const erName = er.metadata.name as string;
@@ -33,6 +37,17 @@ const EnrollmentRequestTableRow: React.FC<EnrollmentRequestTableRow> = ({
33
37
  onApprove(erName);
34
38
  };
35
39
 
40
+ const actionItems: IAction[] = [];
41
+ if (canApprove) {
42
+ actionItems.push({
43
+ title: t('Approve'),
44
+ onClick: approveEnrollment,
45
+ });
46
+ }
47
+ if (canDelete) {
48
+ actionItems.push(deleteAction({ resourceId: erName }));
49
+ }
50
+
36
51
  return (
37
52
  <Tr data-testid={`enrollment-request-${rowIndex}`}>
38
53
  <Td
@@ -46,22 +61,18 @@ const EnrollmentRequestTableRow: React.FC<EnrollmentRequestTableRow> = ({
46
61
  <ResourceLink id={erName} routeLink={ROUTE.ENROLLMENT_REQUEST_DETAILS} />
47
62
  </Td>
48
63
  <Td dataLabel={t('Created')}>{timeSinceText(t, er.metadata.creationTimestamp)}</Td>
49
- <Td dataLabel={t('Approve')}>
50
- <Button variant="link" onClick={approveEnrollment}>
51
- {t('Approve')}
52
- </Button>
53
- </Td>
54
- <Td isActionCell>
55
- <ActionsColumn
56
- items={[
57
- {
58
- title: t('Approve'),
59
- onClick: approveEnrollment,
60
- },
61
- deleteAction({ resourceId: erName }),
62
- ]}
63
- />
64
- </Td>
64
+ {canApprove && (
65
+ <Td dataLabel={t('Approve')}>
66
+ <Button variant="link" onClick={approveEnrollment}>
67
+ {t('Approve')}
68
+ </Button>
69
+ </Td>
70
+ )}
71
+ {!!actionItems.length && (
72
+ <Td isActionCell>
73
+ <ActionsColumn items={actionItems} />
74
+ </Td>
75
+ )}
65
76
  </Tr>
66
77
  );
67
78
  };
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { Toolbar, ToolbarContent, ToolbarGroup, ToolbarItem } from '@patternfly/react-core';
3
3
 
4
- import TableTextSearch, { TableTextSearchProps } from '../../Table/TableTextSearch';
5
- import { useTranslation } from '../../../hooks/useTranslation';
6
4
  import { EnrollmentRequest } from '@flightctl/types';
5
+ import { useTranslation } from '../../hooks/useTranslation';
6
+
7
+ import TableTextSearch, { TableTextSearchProps } from '../Table/TableTextSearch';
7
8
 
8
9
  type EnrollmentRequestTableToolbarProps = {
9
10
  enrollments: EnrollmentRequest[];
@@ -0,0 +1,63 @@
1
+ import * as React from 'react';
2
+
3
+ import { useDebounce } from 'use-debounce';
4
+
5
+ import { EnrollmentRequest, EnrollmentRequestList } from '@flightctl/types';
6
+
7
+ import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
8
+ import { PaginationDetails, useTablePagination } from '../../hooks/useTablePagination';
9
+
10
+ import { PAGE_SIZE } from '../../constants';
11
+
12
+ type EnrollmentRequestsEndpointArgs = {
13
+ nextContinue?: string;
14
+ };
15
+
16
+ const getPendingEnrollmentsEndpoint = ({ nextContinue }: EnrollmentRequestsEndpointArgs) => {
17
+ const params = new URLSearchParams({
18
+ fieldSelector: '!status.approval.approved',
19
+ });
20
+
21
+ if (nextContinue !== undefined) {
22
+ params.set('limit', `${PAGE_SIZE}`);
23
+ }
24
+ if (nextContinue) {
25
+ params.set('continue', nextContinue);
26
+ }
27
+ return `enrollmentrequests?${params.toString()}`;
28
+ };
29
+
30
+ export const useEnrollmentRequestsEndpoint = (args: EnrollmentRequestsEndpointArgs): [string, boolean] => {
31
+ const endpoint = getPendingEnrollmentsEndpoint(args);
32
+ const [pendingErEndpointDebounced] = useDebounce(endpoint, 1000);
33
+ return [pendingErEndpointDebounced, endpoint !== pendingErEndpointDebounced];
34
+ };
35
+
36
+ export const usePendingEnrollments = (): [
37
+ EnrollmentRequest[],
38
+ boolean,
39
+ unknown,
40
+ VoidFunction,
41
+ pagination: Pick<PaginationDetails, 'currentPage' | 'setCurrentPage' | 'itemCount'>,
42
+ ] => {
43
+ const { currentPage, setCurrentPage, itemCount, nextContinue, onPageFetched } = useTablePagination();
44
+ const [pendingErEndpoint, isDebouncing] = useEnrollmentRequestsEndpoint({ nextContinue });
45
+
46
+ const [erList, isLoading, error, refetch] = useFetchPeriodically<EnrollmentRequestList>(
47
+ {
48
+ endpoint: pendingErEndpoint,
49
+ },
50
+ onPageFetched,
51
+ );
52
+
53
+ const pagination = React.useMemo(
54
+ () => ({
55
+ currentPage,
56
+ setCurrentPage,
57
+ itemCount,
58
+ }),
59
+ [currentPage, setCurrentPage, itemCount],
60
+ );
61
+
62
+ return [erList?.items || [], isLoading || isDebouncing, error, refetch, pagination];
63
+ };
@@ -30,6 +30,10 @@ import CreateFleetWizardFooter from './CreateFleetWizardFooter';
30
30
  import { useEditFleet } from './useEditFleet';
31
31
  import LeaveFormConfirmation from '../../common/LeaveFormConfirmation';
32
32
  import ErrorBoundary from '../../common/ErrorBoundary';
33
+ import { useAccessReview } from '../../../hooks/useAccessReview';
34
+ import { RESOURCE, VERB } from '../../../types/rbac';
35
+ import PageWithPermissions from '../../common/PageWithPermissions';
36
+ import { useAppContext } from '../../../hooks/useAppContext';
33
37
 
34
38
  import './CreateFleetWizard.css';
35
39
 
@@ -92,7 +96,12 @@ const CreateFleetWizard = () => {
92
96
  <LeaveFormConfirmation />
93
97
  <Wizard
94
98
  footer={<CreateFleetWizardFooter isEdit={isEdit} />}
95
- onStepChange={(_, step) => setCurrentStep(step)}
99
+ onStepChange={(_, step) => {
100
+ if (error) {
101
+ setError(undefined);
102
+ }
103
+ setCurrentStep(step);
104
+ }}
96
105
  className="fctl-create-fleet"
97
106
  >
98
107
  <WizardStep name={t('General info')} id={generalInfoStepId}>
@@ -149,4 +158,21 @@ const CreateFleetWizard = () => {
149
158
  );
150
159
  };
151
160
 
152
- export default CreateFleetWizard;
161
+ const CreateFleetWizardWithPermissions = () => {
162
+ const {
163
+ router: { useParams },
164
+ } = useAppContext();
165
+ const { fleetId } = useParams<{ fleetId: string }>();
166
+ const [createAllowed, createLoading] = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
167
+ const [patchAllowed, patchLoading] = useAccessReview(RESOURCE.FLEET, VERB.PATCH);
168
+ return (
169
+ <PageWithPermissions
170
+ allowed={fleetId ? patchAllowed : createAllowed}
171
+ loading={fleetId ? patchLoading : createLoading}
172
+ >
173
+ <CreateFleetWizard />
174
+ </PageWithPermissions>
175
+ );
176
+ };
177
+
178
+ export default CreateFleetWizardWithPermissions;
@@ -12,7 +12,7 @@ import { useFetch } from '../../../../hooks/useFetch';
12
12
  import { FlightCtlLabel } from '../../../../types/extraTypes';
13
13
  import { getApiListCount } from '../../../../utils/api';
14
14
  import { getErrorMessage } from '../../../../utils/error';
15
- import { labelToString } from '../../../../utils/labels';
15
+ import { commonQueries } from '../../../../utils/query';
16
16
 
17
17
  const validateLabels = (labels: FlightCtlLabel[]) =>
18
18
  hasUniqueLabelKeys(labels) && getInvalidKubernetesLabels(labels).length === 0;
@@ -27,12 +27,9 @@ const DeviceLabelSelector = () => {
27
27
  const [deviceCount, setDeviceCount] = React.useState<number>(0);
28
28
 
29
29
  const updateDeviceCount = async (matchLabels: FlightCtlLabel[]) => {
30
- const labelSelector = matchLabels.map(labelToString);
31
-
32
30
  try {
33
- // TODO remove sortBy when https://issues.redhat.com/browse/EDM-624 is fixed. Otherwise the device count can be wrong.
34
31
  const deviceListResp = await get<DeviceList>(
35
- `devices?labelSelector=${labelSelector.join(',')}&limit=1&sortBy=metadata.name`,
32
+ commonQueries.getDevicesWithExactLabelMatching(matchLabels, { limit: 1 }),
36
33
  );
37
34
  const num = getApiListCount(deviceListResp);
38
35
  setDeviceCount(num || 0);
@@ -18,6 +18,7 @@ import RepositorySourceList from '../../../Repository/RepositoryDetails/Reposito
18
18
  import { getErrorMessage } from '../../../../utils/error';
19
19
  import { getAPIConfig } from '../../../Device/EditDeviceWizard/deviceSpecUtils';
20
20
  import ReviewApplications from '../../../Device/EditDeviceWizard/steps/ReviewApplications';
21
+ import ReviewTrackedSystemdServices from '../../../Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices';
21
22
 
22
23
  export const reviewStepId = 'review';
23
24
 
@@ -67,6 +68,12 @@ const ReviewStep = ({ error }: { error?: unknown }) => {
67
68
  <ReviewApplications apps={values.applications} />
68
69
  </DescriptionListDescription>
69
70
  </DescriptionListGroup>
71
+ <DescriptionListGroup>
72
+ <DescriptionListTerm>{t('Tracked systemd services')}</DescriptionListTerm>
73
+ <DescriptionListDescription>
74
+ <ReviewTrackedSystemdServices systemdUnits={values.systemdUnits} />
75
+ </DescriptionListDescription>
76
+ </DescriptionListGroup>
70
77
  </FlightControlDescriptionList>
71
78
  </StackItem>
72
79
  {!!error && (