@flightctl/ui-components 0.10.0-rc7 → 1.0.0-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.d.ts +4 -0
  2. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.d.ts.map +1 -0
  3. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.js +57 -0
  4. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.js.map +1 -0
  5. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.d.ts +7 -0
  6. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.d.ts.map +1 -0
  7. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.js +118 -0
  8. package/dist/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.js.map +1 -0
  9. package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.d.ts +9 -0
  10. package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.d.ts.map +1 -0
  11. package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.js +55 -0
  12. package/dist/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.js.map +1 -0
  13. package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.d.ts +7 -0
  14. package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.d.ts.map +1 -0
  15. package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.js +35 -0
  16. package/dist/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.js.map +1 -0
  17. package/dist/src/components/AuthProvider/AuthProviderRow.d.ts +8 -0
  18. package/dist/src/components/AuthProvider/AuthProviderRow.d.ts.map +1 -0
  19. package/dist/src/components/AuthProvider/AuthProviderRow.js +67 -0
  20. package/dist/src/components/AuthProvider/AuthProviderRow.js.map +1 -0
  21. package/dist/src/components/AuthProvider/AuthProvidersPage.d.ts +4 -0
  22. package/dist/src/components/AuthProvider/AuthProvidersPage.d.ts.map +1 -0
  23. package/dist/src/components/AuthProvider/AuthProvidersPage.js +90 -0
  24. package/dist/src/components/AuthProvider/AuthProvidersPage.js.map +1 -0
  25. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.d.ts +4 -0
  26. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.d.ts.map +1 -0
  27. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.js +39 -0
  28. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.js.map +1 -0
  29. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.d.ts +6 -0
  30. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.d.ts.map +1 -0
  31. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.js +87 -0
  32. package/dist/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.js.map +1 -0
  33. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.d.ts +4 -0
  34. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.d.ts.map +1 -0
  35. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.js +94 -0
  36. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.js.map +1 -0
  37. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.d.ts +13 -0
  38. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.d.ts.map +1 -0
  39. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.js +161 -0
  40. package/dist/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.js.map +1 -0
  41. package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.d.ts +4 -0
  42. package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.d.ts.map +1 -0
  43. package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.js +19 -0
  44. package/dist/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.js.map +1 -0
  45. package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.d.ts +4 -0
  46. package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.d.ts.map +1 -0
  47. package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.js +71 -0
  48. package/dist/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.js.map +1 -0
  49. package/dist/src/components/AuthProvider/CreateAuthProvider/types.d.ts +57 -0
  50. package/dist/src/components/AuthProvider/CreateAuthProvider/types.d.ts.map +1 -0
  51. package/dist/src/components/AuthProvider/CreateAuthProvider/types.js +33 -0
  52. package/dist/src/components/AuthProvider/CreateAuthProvider/types.js.map +1 -0
  53. package/dist/src/components/AuthProvider/CreateAuthProvider/utils.d.ts +15 -0
  54. package/dist/src/components/AuthProvider/CreateAuthProvider/utils.d.ts.map +1 -0
  55. package/dist/src/components/AuthProvider/CreateAuthProvider/utils.js +466 -0
  56. package/dist/src/components/AuthProvider/CreateAuthProvider/utils.js.map +1 -0
  57. package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.d.ts +9 -0
  58. package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.d.ts.map +1 -0
  59. package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.js +67 -0
  60. package/dist/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.js.map +1 -0
  61. package/dist/src/components/AuthProvider/useAuthProviders.d.ts +8 -0
  62. package/dist/src/components/AuthProvider/useAuthProviders.d.ts.map +1 -0
  63. package/dist/src/components/AuthProvider/useAuthProviders.js +19 -0
  64. package/dist/src/components/AuthProvider/useAuthProviders.js.map +1 -0
  65. package/dist/src/components/DetailsPage/DetailsPage.d.ts +1 -1
  66. package/dist/src/components/DetailsPage/DetailsPage.d.ts.map +1 -1
  67. package/dist/src/components/DetailsPage/DetailsPageActions.d.ts.map +1 -1
  68. package/dist/src/components/DetailsPage/DetailsPageActions.js +1 -1
  69. package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -1
  70. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts +1 -7
  71. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
  72. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +26 -81
  73. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
  74. package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.d.ts +8 -0
  75. package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.d.ts.map +1 -0
  76. package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.js +67 -0
  77. package/dist/src/components/DetailsPage/Tables/SystemdUnitsTable.js.map +1 -0
  78. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +1 -3
  79. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
  80. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +5 -49
  81. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -1
  82. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
  83. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +15 -9
  84. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
  85. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
  86. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +5 -2
  87. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
  88. package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.d.ts +8 -0
  89. package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.d.ts.map +1 -0
  90. package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.js +19 -0
  91. package/dist/src/components/Device/DeviceDetails/DeviceSystemdUnits.js.map +1 -0
  92. package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
  93. package/dist/src/components/Device/DeviceDetails/TerminalTab.js +3 -2
  94. package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
  95. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -1
  96. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +7 -3
  97. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -1
  98. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts.map +1 -1
  99. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js +3 -2
  100. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js.map +1 -1
  101. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
  102. package/dist/src/components/Device/DevicesPage/DevicesPage.js +9 -15
  103. package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
  104. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -1
  105. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +8 -4
  106. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -1
  107. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
  108. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +4 -3
  109. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
  110. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +2 -1
  111. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
  112. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +230 -54
  113. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
  114. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.css +5 -0
  115. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts +10 -0
  116. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts.map +1 -0
  117. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js +169 -0
  118. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js.map +1 -0
  119. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts +2 -2
  120. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts.map +1 -1
  121. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts +2 -2
  122. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts.map +1 -1
  123. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
  124. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +95 -37
  125. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
  126. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts +11 -0
  127. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts.map +1 -0
  128. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js +99 -0
  129. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js.map +1 -0
  130. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -1
  131. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js +6 -4
  132. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
  133. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +1 -1
  134. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
  135. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts.map +1 -1
  136. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js +21 -10
  137. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js.map +1 -1
  138. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +41 -3
  139. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
  140. package/dist/src/components/Device/EditDeviceWizard/utils.js +5 -2
  141. package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
  142. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
  143. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +9 -4
  144. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
  145. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +1 -3
  146. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -1
  147. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +8 -9
  148. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
  149. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
  150. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +10 -5
  151. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
  152. package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
  153. package/dist/src/components/Fleet/CreateFleet/utils.js +2 -5
  154. package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
  155. package/dist/src/components/Fleet/FleetDetails/FleetDetailsPage.d.ts.map +1 -1
  156. package/dist/src/components/Fleet/FleetDetails/FleetDetailsPage.js +11 -6
  157. package/dist/src/components/Fleet/FleetDetails/FleetDetailsPage.js.map +1 -1
  158. package/dist/src/components/Fleet/FleetDetails/FleetYaml.d.ts +9 -0
  159. package/dist/src/components/Fleet/FleetDetails/FleetYaml.d.ts.map +1 -0
  160. package/dist/src/components/Fleet/FleetDetails/FleetYaml.js +13 -0
  161. package/dist/src/components/Fleet/FleetDetails/FleetYaml.js.map +1 -0
  162. package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -1
  163. package/dist/src/components/Fleet/FleetResourceSyncs.js +3 -2
  164. package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
  165. package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
  166. package/dist/src/components/Fleet/FleetsPage.js +22 -13
  167. package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
  168. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -1
  169. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +9 -2
  170. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -1
  171. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
  172. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +3 -2
  173. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
  174. package/dist/src/components/ListPage/ListPage.d.ts +0 -1
  175. package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
  176. package/dist/src/components/ListPage/ListPage.js +2 -5
  177. package/dist/src/components/ListPage/ListPage.js.map +1 -1
  178. package/dist/src/components/Login/ProviderSelector.d.ts +11 -0
  179. package/dist/src/components/Login/ProviderSelector.d.ts.map +1 -0
  180. package/dist/src/components/Login/ProviderSelector.js +66 -0
  181. package/dist/src/components/Login/ProviderSelector.js.map +1 -0
  182. package/dist/src/components/Login/TokenLoginForm.d.ts +9 -0
  183. package/dist/src/components/Login/TokenLoginForm.d.ts.map +1 -0
  184. package/dist/src/components/Login/TokenLoginForm.js +107 -0
  185. package/dist/src/components/Login/TokenLoginForm.js.map +1 -0
  186. package/dist/src/components/Masthead/CommandLineToolsPage.d.ts.map +1 -1
  187. package/dist/src/components/Masthead/CommandLineToolsPage.js +1 -6
  188. package/dist/src/components/Masthead/CommandLineToolsPage.js.map +1 -1
  189. package/dist/src/components/OverviewPage/Cards/Alerts/AlertsCard.d.ts.map +1 -1
  190. package/dist/src/components/OverviewPage/Cards/Alerts/AlertsCard.js +2 -0
  191. package/dist/src/components/OverviewPage/Cards/Alerts/AlertsCard.js.map +1 -1
  192. package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -1
  193. package/dist/src/components/OverviewPage/Overview.js +8 -4
  194. package/dist/src/components/OverviewPage/Overview.js.map +1 -1
  195. package/dist/src/components/OverviewPage/OverviewPage.d.ts.map +1 -1
  196. package/dist/src/components/OverviewPage/OverviewPage.js +3 -8
  197. package/dist/src/components/OverviewPage/OverviewPage.js.map +1 -1
  198. package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -1
  199. package/dist/src/components/Repository/CreateRepository/CreateRepository.js +3 -2
  200. package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -1
  201. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
  202. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +3 -2
  203. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
  204. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -1
  205. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +11 -6
  206. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
  207. package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
  208. package/dist/src/components/Repository/RepositoryList.js +11 -5
  209. package/dist/src/components/Repository/RepositoryList.js.map +1 -1
  210. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
  211. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +7 -3
  212. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
  213. package/dist/src/components/common/CodeEditor/YamlEditor.d.ts +7 -5
  214. package/dist/src/components/common/CodeEditor/YamlEditor.d.ts.map +1 -1
  215. package/dist/src/components/common/CodeEditor/YamlEditor.js +142 -10
  216. package/dist/src/components/common/CodeEditor/YamlEditor.js.map +1 -1
  217. package/dist/src/components/common/CodeEditor/YamlEditorBase.d.ts +7 -1
  218. package/dist/src/components/common/CodeEditor/YamlEditorBase.d.ts.map +1 -1
  219. package/dist/src/components/common/CodeEditor/YamlEditorBase.js +16 -8
  220. package/dist/src/components/common/CodeEditor/YamlEditorBase.js.map +1 -1
  221. package/dist/src/components/common/OrganizationGuard.d.ts.map +1 -1
  222. package/dist/src/components/common/OrganizationGuard.js +11 -19
  223. package/dist/src/components/common/OrganizationGuard.js.map +1 -1
  224. package/dist/src/components/common/PageNavigation.css +9 -0
  225. package/dist/src/components/common/PageNavigation.d.ts +4 -1
  226. package/dist/src/components/common/PageNavigation.d.ts.map +1 -1
  227. package/dist/src/components/common/PageNavigation.js +25 -10
  228. package/dist/src/components/common/PageNavigation.js.map +1 -1
  229. package/dist/src/components/common/PermissionsContext.d.ts +14 -0
  230. package/dist/src/components/common/PermissionsContext.d.ts.map +1 -0
  231. package/dist/src/components/common/PermissionsContext.js +84 -0
  232. package/dist/src/components/common/PermissionsContext.js.map +1 -0
  233. package/dist/src/components/form/FilterSelect.d.ts.map +1 -1
  234. package/dist/src/components/form/FilterSelect.js +1 -1
  235. package/dist/src/components/form/FilterSelect.js.map +1 -1
  236. package/dist/src/components/form/FormSelect.d.ts.map +1 -1
  237. package/dist/src/components/form/FormSelect.js +1 -1
  238. package/dist/src/components/form/FormSelect.js.map +1 -1
  239. package/dist/src/components/form/FormSelectTypeahead.d.ts.map +1 -1
  240. package/dist/src/components/form/FormSelectTypeahead.js +84 -4
  241. package/dist/src/components/form/FormSelectTypeahead.js.map +1 -1
  242. package/dist/src/components/form/ListItemField.d.ts +12 -0
  243. package/dist/src/components/form/ListItemField.d.ts.map +1 -0
  244. package/dist/src/components/form/ListItemField.js +67 -0
  245. package/dist/src/components/form/ListItemField.js.map +1 -0
  246. package/dist/src/components/form/NameField.d.ts +1 -1
  247. package/dist/src/components/form/NameField.d.ts.map +1 -1
  248. package/dist/src/components/form/NameField.js +4 -2
  249. package/dist/src/components/form/NameField.js.map +1 -1
  250. package/dist/src/components/form/SwitchField.d.ts +2 -1
  251. package/dist/src/components/form/SwitchField.d.ts.map +1 -1
  252. package/dist/src/components/form/SwitchField.js +2 -2
  253. package/dist/src/components/form/SwitchField.js.map +1 -1
  254. package/dist/src/components/form/validations.d.ts +50 -4
  255. package/dist/src/components/form/validations.d.ts.map +1 -1
  256. package/dist/src/components/form/validations.js +332 -41
  257. package/dist/src/components/form/validations.js.map +1 -1
  258. package/dist/src/constants.d.ts +1 -1
  259. package/dist/src/constants.d.ts.map +1 -1
  260. package/dist/src/constants.js +1 -1
  261. package/dist/src/constants.js.map +1 -1
  262. package/dist/src/hooks/useAlertsEnabled.d.ts.map +1 -1
  263. package/dist/src/hooks/useAlertsEnabled.js +10 -4
  264. package/dist/src/hooks/useAlertsEnabled.js.map +1 -1
  265. package/dist/src/hooks/useAppContext.d.ts +4 -2
  266. package/dist/src/hooks/useAppContext.d.ts.map +1 -1
  267. package/dist/src/hooks/useAppContext.js +4 -1
  268. package/dist/src/hooks/useAppContext.js.map +1 -1
  269. package/dist/src/hooks/useFetch.d.ts +0 -1
  270. package/dist/src/hooks/useFetch.d.ts.map +1 -1
  271. package/dist/src/hooks/useNavigate.d.ts +6 -2
  272. package/dist/src/hooks/useNavigate.d.ts.map +1 -1
  273. package/dist/src/hooks/useNavigate.js +4 -0
  274. package/dist/src/hooks/useNavigate.js.map +1 -1
  275. package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts.map +1 -1
  276. package/dist/src/hooks/usePendingEnrollmentRequestsCount.js +9 -1
  277. package/dist/src/hooks/usePendingEnrollmentRequestsCount.js.map +1 -1
  278. package/dist/src/hooks/useSystemRestoreContext.d.ts.map +1 -1
  279. package/dist/src/hooks/useSystemRestoreContext.js +3 -2
  280. package/dist/src/hooks/useSystemRestoreContext.js.map +1 -1
  281. package/dist/src/types/deviceSpec.d.ts +56 -15
  282. package/dist/src/types/deviceSpec.d.ts.map +1 -1
  283. package/dist/src/types/deviceSpec.js +23 -8
  284. package/dist/src/types/deviceSpec.js.map +1 -1
  285. package/dist/src/types/extraTypes.d.ts +14 -2
  286. package/dist/src/types/extraTypes.d.ts.map +1 -1
  287. package/dist/src/types/extraTypes.js +11 -1
  288. package/dist/src/types/extraTypes.js.map +1 -1
  289. package/dist/src/types/rbac.d.ts +2 -1
  290. package/dist/src/types/rbac.d.ts.map +1 -1
  291. package/dist/src/types/rbac.js +1 -0
  292. package/dist/src/types/rbac.js.map +1 -1
  293. package/dist/src/utils/authProvider.d.ts +4 -0
  294. package/dist/src/utils/authProvider.d.ts.map +1 -0
  295. package/dist/src/utils/authProvider.js +22 -0
  296. package/dist/src/utils/authProvider.js.map +1 -0
  297. package/dist/src/utils/error.d.ts +1 -0
  298. package/dist/src/utils/error.d.ts.map +1 -1
  299. package/dist/src/utils/error.js +6 -1
  300. package/dist/src/utils/error.js.map +1 -1
  301. package/dist/src/utils/k8sProvider.d.ts +3 -0
  302. package/dist/src/utils/k8sProvider.d.ts.map +1 -0
  303. package/dist/src/utils/k8sProvider.js +18 -0
  304. package/dist/src/utils/k8sProvider.js.map +1 -0
  305. package/dist/src/utils/patch.d.ts.map +1 -1
  306. package/dist/src/utils/patch.js +3 -1
  307. package/dist/src/utils/patch.js.map +1 -1
  308. package/dist/src/utils/status/applications.d.ts.map +1 -1
  309. package/dist/src/utils/status/applications.js +7 -0
  310. package/dist/src/utils/status/applications.js.map +1 -1
  311. package/package.json +1 -1
  312. package/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.tsx +111 -0
  313. package/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetailsTab.tsx +239 -0
  314. package/src/components/AuthProvider/AuthProviderDetails/DeleteAuthProviderModal.tsx +95 -0
  315. package/src/components/AuthProvider/AuthProviderDetails/RoleAssigmentDetails.tsx +53 -0
  316. package/src/components/AuthProvider/AuthProviderRow.tsx +84 -0
  317. package/src/components/AuthProvider/AuthProvidersPage.tsx +168 -0
  318. package/src/components/AuthProvider/CreateAuthProvider/AuthOrganizationAssignment.tsx +102 -0
  319. package/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.tsx +78 -0
  320. package/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.tsx +145 -0
  321. package/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx +284 -0
  322. package/src/components/AuthProvider/CreateAuthProvider/Oauth2ProviderFields.tsx +24 -0
  323. package/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.tsx +165 -0
  324. package/src/components/AuthProvider/CreateAuthProvider/types.ts +96 -0
  325. package/src/components/AuthProvider/CreateAuthProvider/utils.ts +557 -0
  326. package/src/components/AuthProvider/TestConnectionModal/TestConnectionModal.tsx +136 -0
  327. package/src/components/AuthProvider/useAuthProviders.ts +18 -0
  328. package/src/components/DetailsPage/DetailsPage.tsx +1 -1
  329. package/src/components/DetailsPage/DetailsPageActions.tsx +2 -0
  330. package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +29 -132
  331. package/src/components/DetailsPage/Tables/SystemdUnitsTable.tsx +98 -0
  332. package/src/components/Device/DeviceDetails/DeviceApplications.tsx +3 -73
  333. package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +19 -9
  334. package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +6 -2
  335. package/src/components/Device/DeviceDetails/DeviceSystemdUnits.tsx +30 -0
  336. package/src/components/Device/DeviceDetails/TerminalTab.tsx +3 -2
  337. package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +8 -3
  338. package/src/components/Device/DevicesPage/DevicesEmptyStates.tsx +3 -2
  339. package/src/components/Device/DevicesPage/DevicesPage.tsx +9 -15
  340. package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +9 -4
  341. package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +10 -4
  342. package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +291 -59
  343. package/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.css +5 -0
  344. package/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.tsx +319 -0
  345. package/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.tsx +2 -2
  346. package/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.tsx +3 -3
  347. package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +186 -80
  348. package/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.tsx +202 -0
  349. package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +6 -4
  350. package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +1 -1
  351. package/src/components/Device/EditDeviceWizard/steps/ReviewApplications.tsx +26 -10
  352. package/src/components/Device/EditDeviceWizard/utils.ts +15 -1
  353. package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +10 -4
  354. package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +9 -13
  355. package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +11 -8
  356. package/src/components/Fleet/CreateFleet/utils.ts +2 -4
  357. package/src/components/Fleet/FleetDetails/FleetDetailsPage.tsx +11 -6
  358. package/src/components/Fleet/FleetDetails/FleetYaml.tsx +13 -0
  359. package/src/components/Fleet/FleetResourceSyncs.tsx +3 -2
  360. package/src/components/Fleet/FleetsPage.tsx +34 -27
  361. package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +10 -2
  362. package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +3 -2
  363. package/src/components/ListPage/ListPage.tsx +1 -8
  364. package/src/components/Login/ProviderSelector.tsx +114 -0
  365. package/src/components/Login/TokenLoginForm.tsx +202 -0
  366. package/src/components/Masthead/CommandLineToolsPage.tsx +1 -11
  367. package/src/components/OverviewPage/Cards/Alerts/AlertsCard.tsx +2 -0
  368. package/src/components/OverviewPage/Overview.tsx +9 -4
  369. package/src/components/OverviewPage/OverviewPage.tsx +6 -13
  370. package/src/components/Repository/CreateRepository/CreateRepository.tsx +3 -2
  371. package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +3 -2
  372. package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +11 -9
  373. package/src/components/Repository/RepositoryList.tsx +11 -5
  374. package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +8 -3
  375. package/src/components/common/CodeEditor/YamlEditor.tsx +195 -15
  376. package/src/components/common/CodeEditor/YamlEditorBase.tsx +42 -8
  377. package/src/components/common/OrganizationGuard.tsx +13 -22
  378. package/src/components/common/PageNavigation.css +9 -0
  379. package/src/components/common/PageNavigation.tsx +42 -14
  380. package/src/components/common/PermissionsContext.tsx +108 -0
  381. package/src/components/form/FilterSelect.tsx +2 -0
  382. package/src/components/form/FormSelect.tsx +2 -0
  383. package/src/components/form/FormSelectTypeahead.tsx +97 -4
  384. package/src/components/form/ListItemField.tsx +123 -0
  385. package/src/components/form/NameField.tsx +3 -1
  386. package/src/components/form/SwitchField.tsx +3 -2
  387. package/src/components/form/validations.ts +413 -64
  388. package/src/constants.ts +1 -1
  389. package/src/hooks/useAlertsEnabled.ts +10 -5
  390. package/src/hooks/useAppContext.tsx +4 -3
  391. package/src/hooks/useNavigate.tsx +7 -1
  392. package/src/hooks/usePendingEnrollmentRequestsCount.ts +13 -1
  393. package/src/hooks/useSystemRestoreContext.tsx +3 -2
  394. package/src/types/deviceSpec.ts +78 -21
  395. package/src/types/extraTypes.ts +19 -1
  396. package/src/types/rbac.ts +1 -0
  397. package/src/utils/authProvider.ts +20 -0
  398. package/src/utils/error.ts +5 -0
  399. package/src/utils/k8sProvider.ts +11 -0
  400. package/src/utils/patch.ts +3 -1
  401. package/src/utils/status/applications.ts +7 -0
  402. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.css +0 -7
  403. package/dist/src/components/common/ButtonWithPermissions.d.ts +0 -8
  404. package/dist/src/components/common/ButtonWithPermissions.d.ts.map +0 -1
  405. package/dist/src/components/common/ButtonWithPermissions.js +0 -12
  406. package/dist/src/components/common/ButtonWithPermissions.js.map +0 -1
  407. package/dist/src/components/common/TechPreviewBadge.d.ts +0 -4
  408. package/dist/src/components/common/TechPreviewBadge.d.ts.map +0 -1
  409. package/dist/src/components/common/TechPreviewBadge.js +0 -24
  410. package/dist/src/components/common/TechPreviewBadge.js.map +0 -1
  411. package/dist/src/hooks/useAccessReview.d.ts +0 -4
  412. package/dist/src/hooks/useAccessReview.d.ts.map +0 -1
  413. package/dist/src/hooks/useAccessReview.js +0 -46
  414. package/dist/src/hooks/useAccessReview.js.map +0 -1
  415. package/dist/src/hooks/useFleetImportAccessReview.d.ts +0 -3
  416. package/dist/src/hooks/useFleetImportAccessReview.d.ts.map +0 -1
  417. package/dist/src/hooks/useFleetImportAccessReview.js +0 -12
  418. package/dist/src/hooks/useFleetImportAccessReview.js.map +0 -1
  419. package/src/components/DetailsPage/Tables/ApplicationsTable.css +0 -7
  420. package/src/components/common/ButtonWithPermissions.tsx +0 -14
  421. package/src/components/common/TechPreviewBadge.tsx +0 -45
  422. package/src/hooks/useAccessReview.ts +0 -49
  423. package/src/hooks/useFleetImportAccessReview.ts +0 -8
@@ -26,7 +26,7 @@ export type DetailsPageProps = {
26
26
  children: React.ReactNode;
27
27
  error: unknown;
28
28
  loading: boolean;
29
- resourceType: 'Fleets' | 'Devices' | 'Repositories' | 'Enrollment requests';
29
+ resourceType: 'Fleets' | 'Devices' | 'Repositories' | 'Enrollment requests' | 'Authentication providers';
30
30
  resourceTypeLabel: string;
31
31
  resourceLink: Route;
32
32
  actions?: React.ReactNode;
@@ -127,6 +127,8 @@ const DetailsPageActions = ({ children }: React.PropsWithChildren) => {
127
127
  onSelect={() => setActionsOpen(false)}
128
128
  onOpenChange={(isOpen: boolean) => setActionsOpen(isOpen)}
129
129
  popperProps={{ position: 'left', preventOverflow: true }}
130
+ shouldFocusToggleOnSelect
131
+ shouldFocusFirstItemOnOpen
130
132
  toggle={(toggleRef) => (
131
133
  <MenuToggle
132
134
  ref={toggleRef}
@@ -1,74 +1,40 @@
1
1
  import * as React from 'react';
2
- import { Bullseye, Button, Spinner } from '@patternfly/react-core';
2
+ import { Bullseye, Label } from '@patternfly/react-core';
3
3
  import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
4
- import MinusCircleIcon from '@patternfly/react-icons/dist/js/icons/minus-circle-icon';
5
4
 
6
5
  import { DeviceApplicationStatus } from '@flightctl/types';
7
6
  import { useTranslation } from '../../../hooks/useTranslation';
8
7
  import ApplicationStatus from '../../Status/ApplicationStatus';
9
- import WithTooltip from '../../common/WithTooltip';
10
-
11
- import './ApplicationsTable.css';
12
8
 
13
9
  type ApplicationsTableProps = {
14
- // Contains the statuses of all detected applications and systemdUnits
10
+ // Contains the statuses of all detected applications
15
11
  appsStatus: DeviceApplicationStatus[];
16
12
  // List of apps as defined the device / fleet spec
17
13
  specApps: string[];
18
- // List of systemd units as defined in the device / fleet spec
19
- specSystemdUnits: string[];
20
- // Map: (systemdUnitName, timeItWasAdded)
21
- addedSystemdUnitDates: Record<string, number>;
22
- onSystemdDelete?: (deletedUnit: string) => void;
23
- isUpdating: boolean;
24
- canEdit: boolean;
25
14
  };
26
15
 
27
- const DELETE_SYSTED_TIMEOUT = 30000; // 30 seconds
16
+ const emptyAppDetails: Partial<DeviceApplicationStatus> = {
17
+ name: '',
18
+ ready: '-',
19
+ restarts: 0,
20
+ embedded: false,
21
+ };
28
22
 
29
- const ApplicationsTable = ({
30
- appsStatus,
31
- specApps,
32
- specSystemdUnits,
33
- addedSystemdUnitDates,
34
- onSystemdDelete,
35
- isUpdating,
36
- canEdit,
37
- }: ApplicationsTableProps) => {
23
+ const ApplicationsTable = ({ appsStatus, specApps }: ApplicationsTableProps) => {
38
24
  const { t } = useTranslation();
39
25
 
40
- // Required to be able to detect removed systemd units for their correct type.
41
- // It takes a bit for them to be removed from the applications list.
42
- const [deletedSystemdUnits, setDeletedSystemdUnits] = React.useState<string[]>([]);
43
-
44
- React.useEffect(() => {
45
- // Remove a service from the deleted list if it was added back later
46
- const filtered = deletedSystemdUnits.filter((deletedUnit) => {
47
- if (addedSystemdUnitDates[deletedUnit]) {
48
- return false;
49
- }
50
- return true;
51
- });
52
- if (filtered.length < deletedSystemdUnits.length) {
53
- setDeletedSystemdUnits(filtered);
54
- }
55
- // eslint-disable-next-line react-hooks/exhaustive-deps
56
- }, [addedSystemdUnitDates]);
57
-
58
- const appsAndSystemdUnits: string[] = [];
26
+ // Includes applications already reported in status as well as those that are only in the spec yet
27
+ const allAppNames: string[] = [];
59
28
  specApps.forEach((app) => {
60
- appsAndSystemdUnits.push(app);
61
- });
62
- specSystemdUnits.forEach((systemdUnit) => {
63
- appsAndSystemdUnits.push(systemdUnit);
29
+ allAppNames.push(app);
64
30
  });
65
31
  appsStatus.forEach((appStatus) => {
66
- if (!appsAndSystemdUnits.includes(appStatus.name)) {
67
- appsAndSystemdUnits.push(appStatus.name);
32
+ if (!allAppNames.includes(appStatus.name)) {
33
+ allAppNames.push(appStatus.name);
68
34
  }
69
35
  });
70
36
 
71
- return appsAndSystemdUnits.length ? (
37
+ return allAppNames.length ? (
72
38
  <Table aria-label={t('Device applications table')}>
73
39
  <Thead>
74
40
  <Tr>
@@ -77,100 +43,31 @@ const ApplicationsTable = ({
77
43
  <Th modifier="wrap">{t('Ready')}</Th>
78
44
  <Th modifier="wrap">{t('Restarts')}</Th>
79
45
  <Th modifier="wrap">{t('Type')}</Th>
46
+ <Th modifier="wrap">{t('Embedded')}</Th>
80
47
  </Tr>
81
48
  </Thead>
82
49
  <Tbody>
83
- {appsAndSystemdUnits.map((appName) => {
84
- const appDetails = appsStatus.find((app) => app.name === appName);
85
- const isDeletedSystemdUnit = deletedSystemdUnits.includes(appName);
86
- const isAddedSystemdUnit = !!addedSystemdUnitDates[appName];
87
- const isApp =
88
- specApps.includes(appName) ||
89
- !(specSystemdUnits.includes(appName) || isDeletedSystemdUnit || isAddedSystemdUnit);
90
-
91
- const deleteSystemdUnit = canEdit && !isDeletedSystemdUnit && onSystemdDelete && (
92
- <Button
93
- aria-label={t('Delete system service')}
94
- isDisabled={isUpdating}
95
- variant="plain"
96
- icon={<MinusCircleIcon />}
97
- onClick={() => {
98
- setDeletedSystemdUnits(deletedSystemdUnits.concat(appName));
99
- onSystemdDelete(appName);
100
- }}
101
- />
102
- );
103
-
104
- if (!appDetails) {
105
- // It's an app or a systemd unit which has not been reported yet
106
- const appAddedTime = addedSystemdUnitDates[appName] || 0;
107
- // For apps there is no spinner since we don't know when the app was added to the spec
108
- const showSpinner = !isApp && Date.now() - appAddedTime < DELETE_SYSTED_TIMEOUT;
109
- return (
110
- <Tr key={appName} className="applications-table__row">
111
- <Td dataLabel={t('Name')}>{appName}</Td>
112
-
113
- <Td dataLabel={t('Status')} colSpan={showSpinner ? 3 : 1}>
114
- {showSpinner ? (
115
- <>
116
- <Spinner size="sm" /> {t('Waiting for service to be reported...')}
117
- </>
118
- ) : (
119
- '-'
120
- )}
121
- </Td>
122
- {!showSpinner && <Td dataLabel={t('Ready')}>-</Td>}
123
- {!showSpinner && <Td dataLabel={t('Restarts')}>-</Td>}
124
- <Td dataLabel={t('Type')}>
125
- {isApp ? (
126
- <>{t('App')}</>
127
- ) : (
128
- <>
129
- {t('Systemd')} {deleteSystemdUnit}
130
- </>
131
- )}
132
- </Td>
133
- </Tr>
134
- );
135
- }
136
-
137
- let typeColumnContent: React.ReactNode;
138
-
139
- if (isApp) {
140
- typeColumnContent = t('App');
141
- } else if (onSystemdDelete) {
142
- let extraContent: React.ReactNode;
143
- if (isDeletedSystemdUnit) {
144
- extraContent = (
145
- <WithTooltip
146
- showTooltip
147
- content={t('{{ appName }} is being removed, this may take some time.', { appName })}
148
- >
149
- <Spinner size="sm" />
150
- </WithTooltip>
151
- );
152
- } else {
153
- extraContent = deleteSystemdUnit;
154
- }
155
-
156
- typeColumnContent = (
157
- <>
158
- {t('Systemd')} {extraContent}
159
- </>
160
- );
161
- } else {
162
- typeColumnContent = t('Systemd');
50
+ {allAppNames.map((appName) => {
51
+ const appDetails = appsStatus.find((app) => app.name === appName) || emptyAppDetails;
52
+ let embedded = '-';
53
+ if (appDetails.embedded === true) {
54
+ embedded = t('Yes');
55
+ } else if (appDetails.embedded === false) {
56
+ embedded = t('No');
163
57
  }
164
58
 
165
59
  return (
166
- <Tr key={appName} className="fctl-applications-table__row">
60
+ <Tr key={appName}>
167
61
  <Td dataLabel={t('Name')}>{appName}</Td>
168
62
  <Td dataLabel={t('Status')}>
169
- <ApplicationStatus status={appDetails.status} />
63
+ {appDetails.status ? <ApplicationStatus status={appDetails.status} /> : '-'}
170
64
  </Td>
171
65
  <Td dataLabel={t('Ready')}>{appDetails.ready}</Td>
172
66
  <Td dataLabel={t('Restarts')}>{appDetails.restarts}</Td>
173
- <Td dataLabel={t('Type')}>{typeColumnContent}</Td>
67
+ <Td dataLabel={t('Type')}>
68
+ {appDetails.appType ? <Label variant="outline">{appDetails.appType}</Label> : '-'}
69
+ </Td>
70
+ <Td dataLabel={t('Embedded')}>{embedded}</Td>
174
71
  </Tr>
175
72
  );
176
73
  })}
@@ -0,0 +1,98 @@
1
+ import * as React from 'react';
2
+ import { Bullseye, EmptyState, EmptyStateBody, EmptyStateVariant, Label } from '@patternfly/react-core';
3
+ import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
4
+ import { CogIcon } from '@patternfly/react-icons/dist/js/icons/cog-icon';
5
+ import { ClockIcon } from '@patternfly/react-icons/dist/js/icons/clock-icon';
6
+
7
+ import { SystemdUnitStatus } from '@flightctl/types';
8
+ import FolderIcon from '@patternfly/react-icons/dist/js/icons/folder-icon';
9
+ import { DatabaseIcon } from '@patternfly/react-icons/dist/js/icons/database-icon';
10
+ import { NetworkIcon } from '@patternfly/react-icons/dist/js/icons/network-icon';
11
+ import { ConnectedIcon } from '@patternfly/react-icons/dist/js/icons/connected-icon';
12
+ import { useTranslation } from '../../../hooks/useTranslation';
13
+
14
+ const unitTypeIconMap: Record<string, React.ComponentType<{ className?: string }>> = {
15
+ service: CogIcon,
16
+ timer: ClockIcon,
17
+ socket: ConnectedIcon,
18
+ target: NetworkIcon,
19
+ mount: DatabaseIcon,
20
+ path: FolderIcon,
21
+ };
22
+
23
+ const SystemdUnitStatusIcon = ({ unitName }: { unitName: string }) => {
24
+ const unitType = unitName.split('.').pop();
25
+ const IconComponent = unitType ? unitTypeIconMap[unitType] : null;
26
+
27
+ if (!IconComponent) {
28
+ return null;
29
+ }
30
+
31
+ return <IconComponent className="pf-v5-u-mr-xs" />;
32
+ };
33
+
34
+ type SystemdUnitsTableProps = {
35
+ systemdUnitsStatus: SystemdUnitStatus[];
36
+ };
37
+
38
+ const SystemdUnitRow = ({ unitStatus }: { unitStatus: SystemdUnitStatus }) => {
39
+ const { t } = useTranslation();
40
+
41
+ return (
42
+ <Tr key={unitStatus.unit}>
43
+ <Td dataLabel={t('Name')}>
44
+ <SystemdUnitStatusIcon unitName={unitStatus.unit} /> {unitStatus.unit}
45
+ </Td>
46
+ <Td dataLabel={t('Enable')}>
47
+ <Label color="blue" variant="outline">
48
+ {unitStatus.enableState}
49
+ </Label>
50
+ </Td>
51
+ <Td dataLabel={t('Load state')}>
52
+ <Label color="blue" variant="outline">
53
+ {unitStatus.loadState}
54
+ </Label>
55
+ </Td>
56
+ <Td dataLabel={t('Status')}>
57
+ <Label color="blue" variant="outline">
58
+ {unitStatus.activeState} {unitStatus.subState && `(${unitStatus.subState})`}
59
+ </Label>
60
+ </Td>
61
+ </Tr>
62
+ );
63
+ };
64
+
65
+ // Contrary to applications, we don't show the matchPatterns that were defined in the device spec.
66
+ // Since these may contain glob patterns, etc, we can't reliably translate the patterns to a list of units.
67
+ const SystemdUnitsTable = ({ systemdUnitsStatus }: SystemdUnitsTableProps) => {
68
+ const { t } = useTranslation();
69
+
70
+ return systemdUnitsStatus.length ? (
71
+ <Table aria-label={t('System services table')}>
72
+ <Thead>
73
+ <Tr>
74
+ <Th>{t('Name')}</Th>
75
+ <Th modifier="wrap">{t('Enable')}</Th>
76
+ <Th modifier="wrap">{t('Load state')}</Th>
77
+ <Th modifier="wrap">{t('Status')}</Th>
78
+ </Tr>
79
+ </Thead>
80
+ <Tbody>
81
+ {systemdUnitsStatus.map((unitStatus) => {
82
+ return <SystemdUnitRow key={unitStatus.unit} unitStatus={unitStatus} />;
83
+ })}
84
+ </Tbody>
85
+ </Table>
86
+ ) : (
87
+ <Bullseye>
88
+ <EmptyState variant={EmptyStateVariant.sm}>
89
+ <EmptyStateBody>
90
+ <p>{t('No system services found')}</p>
91
+ <p className="pf-v5-u-font-size-sm">{t('System services can be configured via the device specification')}</p>
92
+ </EmptyStateBody>
93
+ </EmptyState>
94
+ </Bullseye>
95
+ );
96
+ };
97
+
98
+ export default SystemdUnitsTable;
@@ -1,46 +1,19 @@
1
1
  import * as React from 'react';
2
- import { Button, CardTitle, Flex, FlexItem } from '@patternfly/react-core';
2
+ import { CardTitle, Flex, FlexItem } from '@patternfly/react-core';
3
3
 
4
4
  import { Device } from '@flightctl/types';
5
5
  import { useTranslation } from '../../../hooks/useTranslation';
6
- import { useFetch } from '../../../hooks/useFetch';
7
- import { getStringListPatches } from '../../../utils/patch';
8
- import { getDeviceFleet } from '../../../utils/devices';
9
- import SystemdUnitsModal from '../SystemdUnitsModal/SystemdUnitsModal';
10
6
  import ApplicationsTable from '../../DetailsPage/Tables/ApplicationsTable';
11
7
  import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
12
8
  import { isImageAppProvider } from '../../../types/deviceSpec';
13
9
 
14
10
  type DeviceDetailsTabProps = {
15
11
  device: Required<Device>;
16
- canEdit: boolean;
17
- refetch?: VoidFunction;
18
12
  };
19
13
 
20
- const DeviceApplications = ({ device, refetch, canEdit }: React.PropsWithChildren<DeviceDetailsTabProps>) => {
14
+ const DeviceApplications = ({ device }: DeviceDetailsTabProps) => {
21
15
  const { t } = useTranslation();
22
- const { patch } = useFetch();
23
- const [showSystemdModal, setShowSystemdModal] = React.useState<boolean>(false);
24
- const [isUpdating, setIsUpdating] = React.useState<boolean>(false);
25
- const [addedSystemdDates, setAddedSystemdDates] = React.useState<Record<string, number>>({});
26
16
 
27
- const onClose = (hasChanges?: boolean, addedUnits?: string[]) => {
28
- if (hasChanges) {
29
- refetch?.();
30
- }
31
- if (addedUnits?.length) {
32
- const allAddedUnitDates = { ...addedSystemdDates };
33
- const addedDate = Date.now();
34
- addedUnits.forEach((newUnit) => {
35
- allAddedUnitDates[newUnit] = addedDate;
36
- });
37
- setAddedSystemdDates(allAddedUnitDates);
38
- }
39
- setShowSystemdModal(false);
40
- };
41
-
42
- const isManagedDevice = !!getDeviceFleet(device.metadata);
43
- const trackedSystemdUnits = device.spec?.systemd?.matchPatterns || [];
44
17
  const specApps =
45
18
  device.spec?.applications?.map((app) => {
46
19
  if (isImageAppProvider(app)) {
@@ -48,59 +21,16 @@ const DeviceApplications = ({ device, refetch, canEdit }: React.PropsWithChildre
48
21
  }
49
22
  return app.name as string;
50
23
  }) || [];
51
- const apps = device.status.applications; // includes available systemdUnits
52
-
53
- const deleteSystemdUnit = isManagedDevice
54
- ? undefined
55
- : (removedUnit: string) => {
56
- const updateDeviceSpec = async () => {
57
- const patches = getStringListPatches(
58
- '/spec/systemd',
59
- trackedSystemdUnits,
60
- trackedSystemdUnits.filter((unit) => unit !== removedUnit),
61
- (units: string[]) => ({ matchPatterns: units }),
62
- );
63
- if (patches.length > 0) {
64
- setIsUpdating(true);
65
- await patch(`devices/${device.metadata.name}`, patches);
66
- refetch?.();
67
- setIsUpdating(false);
68
- }
69
- };
70
- void updateDeviceSpec();
71
- };
72
24
 
73
25
  return (
74
26
  <DetailsPageCard>
75
27
  <CardTitle>
76
28
  <Flex justifyContent={{ default: 'justifyContentSpaceBetween' }}>
77
29
  <FlexItem>{t('Applications')}</FlexItem>
78
- {!isManagedDevice && canEdit && (
79
- <FlexItem>
80
- <Button
81
- variant="link"
82
- isDisabled={isUpdating}
83
- onClick={() => {
84
- setShowSystemdModal(true);
85
- }}
86
- >
87
- {t('Track systemd services')}
88
- </Button>
89
- </FlexItem>
90
- )}
91
30
  </Flex>
92
31
  </CardTitle>
93
32
  <DetailsPageCardBody>
94
- <ApplicationsTable
95
- appsStatus={apps}
96
- specApps={specApps}
97
- specSystemdUnits={trackedSystemdUnits}
98
- onSystemdDelete={deleteSystemdUnit}
99
- isUpdating={isUpdating}
100
- addedSystemdUnitDates={addedSystemdDates}
101
- canEdit={canEdit}
102
- />
103
- {showSystemdModal && <SystemdUnitsModal device={device} onClose={onClose} />}
33
+ <ApplicationsTable appsStatus={device.status.applications} specApps={specApps} />
104
34
  </DetailsPageCardBody>
105
35
  </DetailsPageCard>
106
36
  );
@@ -26,7 +26,7 @@ import TerminalTab from './TerminalTab';
26
26
  import NavItem from '../../NavItem/NavItem';
27
27
  import { getEditDisabledReason, getResumeDisabledReason, isDeviceEnrolled } from '../../../utils/devices';
28
28
  import { RESOURCE, VERB } from '../../../types/rbac';
29
- import { useAccessReview } from '../../../hooks/useAccessReview';
29
+ import { usePermissionsContext } from '../../common/PermissionsContext';
30
30
  import EventsCard from '../../Events/EventsCard';
31
31
  import PageWithPermissions from '../../common/PageWithPermissions';
32
32
  import YamlEditor from '../../common/CodeEditor/YamlEditor';
@@ -35,6 +35,14 @@ import { SystemRestoreBanners } from '../../SystemRestore/SystemRestoreBanners';
35
35
 
36
36
  type DeviceDetailsPageProps = React.PropsWithChildren<{ hideTerminal?: boolean }>;
37
37
 
38
+ const deviceDetailsPermissions = [
39
+ { kind: RESOURCE.DEVICE_CONSOLE, verb: VERB.GET },
40
+ { kind: RESOURCE.DEVICE, verb: VERB.DELETE },
41
+ { kind: RESOURCE.DEVICE, verb: VERB.PATCH },
42
+ { kind: RESOURCE.DEVICE_DECOMMISSION, verb: VERB.UPDATE },
43
+ { kind: RESOURCE.DEVICE_RESUME, verb: VERB.UPDATE },
44
+ ];
45
+
38
46
  const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) => {
39
47
  const { t } = useTranslation();
40
48
  const {
@@ -50,11 +58,9 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
50
58
  const deviceNameOrAlias = deviceAlias || deviceId;
51
59
  const isEnrolled = !device || isDeviceEnrolled(device);
52
60
 
53
- const [hasTerminalAccess] = useAccessReview(RESOURCE.DEVICE_CONSOLE, VERB.GET);
54
- const [canDelete] = useAccessReview(RESOURCE.DEVICE, VERB.DELETE);
55
- const [canEdit] = useAccessReview(RESOURCE.DEVICE, VERB.PATCH);
56
- const [canDecommission] = useAccessReview(RESOURCE.DEVICE_DECOMMISSION, VERB.UPDATE);
57
- const [canResume] = useAccessReview(RESOURCE.DEVICE_RESUME, VERB.UPDATE);
61
+ const { checkPermissions } = usePermissionsContext();
62
+ const [hasTerminalAccess, canDelete, canEdit, canDecommission, canResume] =
63
+ checkPermissions(deviceDetailsPermissions);
58
64
 
59
65
  const canOpenTerminal = hasTerminalAccess && isEnrolled;
60
66
 
@@ -85,7 +91,8 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
85
91
  onResumeComplete: refetch,
86
92
  });
87
93
 
88
- const editActionProps = device ? getDisabledTooltipProps(getEditDisabledReason(device, t)) : undefined;
94
+ const editDisabledReason = device ? getEditDisabledReason(device, t) : undefined;
95
+ const editActionProps = device ? getDisabledTooltipProps(editDisabledReason) : undefined;
89
96
  const resumeDevice = {
90
97
  actionText: t('Resume device'),
91
98
  title: (
@@ -188,7 +195,9 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
188
195
  />
189
196
  <Route
190
197
  path="yaml"
191
- element={<YamlEditor filename={deviceAlias || deviceId} apiObj={device} refetch={refetch} />}
198
+ element={
199
+ <YamlEditor apiObj={device} refetch={refetch} disabledEditReason={editDisabledReason} canEdit={canEdit} />
200
+ }
192
201
  />
193
202
  {!hideTerminal && canOpenTerminal && <Route path="terminal" element={<TerminalTab device={device} />} />}
194
203
  <Route path="events" element={<EventsCard kind={ResourceKind.DEVICE} objId={deviceId} />} />
@@ -201,7 +210,8 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
201
210
  };
202
211
 
203
212
  const DeviceDetailsPageWithPermissions = (props: DeviceDetailsPageProps) => {
204
- const [allowed, loading] = useAccessReview(RESOURCE.DEVICE, VERB.GET);
213
+ const { checkPermissions, loading } = usePermissionsContext();
214
+ const [allowed] = checkPermissions([{ kind: RESOURCE.DEVICE, verb: VERB.GET }]);
205
215
  return (
206
216
  <PageWithPermissions allowed={allowed} loading={loading}>
207
217
  <DeviceDetailsPage {...props} />
@@ -26,6 +26,7 @@ import DeviceLifecycleStatus from '../../Status/DeviceLifecycleStatus';
26
26
  import DeviceFleet from './DeviceFleet';
27
27
  import DeviceOs from './DeviceOs';
28
28
  import DeviceApplications from './DeviceApplications';
29
+ import DeviceSystemdUnits from './DeviceSystemdUnits';
29
30
  import StatusContent from './DeviceDetailsTabContent/StatusContent';
30
31
  import SystemResourcesContent from './DeviceDetailsTabContent/SystemResourcesContent';
31
32
 
@@ -157,7 +158,10 @@ const EnrolledDeviceDetails = ({
157
158
  </DetailsPageCard>
158
159
  </GridItem>
159
160
  <GridItem md={12} lg={6}>
160
- <DeviceApplications device={device} refetch={refetch} canEdit={canEdit} />
161
+ <DeviceApplications device={device} />
162
+ </GridItem>
163
+ <GridItem md={12} lg={6}>
164
+ <DeviceSystemdUnits device={device} />
161
165
  </GridItem>
162
166
  </Grid>
163
167
  );
@@ -221,7 +225,7 @@ const DecommissionedDeviceDetails = ({ device, children }: React.PropsWithChildr
221
225
  </DetailsPageCard>
222
226
  </GridItem>
223
227
  <GridItem md={12} lg={6}>
224
- <DeviceApplications device={device} canEdit={false} />
228
+ <DeviceApplications device={device} />
225
229
  </GridItem>
226
230
  </Grid>
227
231
  );
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { CardTitle, Flex, FlexItem } from '@patternfly/react-core';
3
+
4
+ import { Device } from '@flightctl/types';
5
+ import { useTranslation } from '../../../hooks/useTranslation';
6
+ import SystemdUnitsTable from '../../DetailsPage/Tables/SystemdUnitsTable';
7
+ import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
8
+
9
+ type DeviceSystemdUnitsProps = {
10
+ device: Required<Device>;
11
+ };
12
+
13
+ const DeviceSystemdUnits = ({ device }: DeviceSystemdUnitsProps) => {
14
+ const { t } = useTranslation();
15
+
16
+ return (
17
+ <DetailsPageCard>
18
+ <CardTitle>
19
+ <Flex justifyContent={{ default: 'justifyContentSpaceBetween' }}>
20
+ <FlexItem>{t('System services')}</FlexItem>
21
+ </Flex>
22
+ </CardTitle>
23
+ <DetailsPageCardBody>
24
+ <SystemdUnitsTable systemdUnitsStatus={device.status.systemd || []} />
25
+ </DetailsPageCardBody>
26
+ </DetailsPageCard>
27
+ );
28
+ };
29
+
30
+ export default DeviceSystemdUnits;
@@ -7,7 +7,7 @@ import ErrorAlert from '../../ErrorAlert/ErrorAlert';
7
7
  import { useTranslation } from '../../../hooks/useTranslation';
8
8
  import Terminal, { ImperativeTerminalType } from '../../Terminal/Terminal';
9
9
  import PageWithPermissions from '../../common/PageWithPermissions';
10
- import { useAccessReview } from '../../../hooks/useAccessReview';
10
+ import { usePermissionsContext } from '../../common/PermissionsContext';
11
11
  import { RESOURCE, VERB } from '../../../types/rbac';
12
12
  import { useOrganizationGuardContext } from '../../common/OrganizationGuard';
13
13
 
@@ -97,7 +97,8 @@ const TerminalTab = ({ device }: TerminalTabProps) => {
97
97
  };
98
98
 
99
99
  const TerminalTabWithPermissions = (props: TerminalTabProps) => {
100
- const [allowed, loading] = useAccessReview(RESOURCE.DEVICE_CONSOLE, VERB.GET);
100
+ const { checkPermissions, loading } = usePermissionsContext();
101
+ const [allowed] = checkPermissions([{ kind: RESOURCE.DEVICE_CONSOLE, verb: VERB.GET }]);
101
102
  return (
102
103
  <PageWithPermissions allowed={allowed} loading={loading}>
103
104
  <TerminalTab {...props} />
@@ -8,7 +8,7 @@ import { Device, DeviceList } from '@flightctl/types';
8
8
  import { PaginationDetails } from '../../../hooks/useTablePagination';
9
9
  import { useTranslation } from '../../../hooks/useTranslation';
10
10
  import { useTableSelect } from '../../../hooks/useTableSelect';
11
- import { useAccessReview } from '../../../hooks/useAccessReview';
11
+ import { usePermissionsContext } from '../../common/PermissionsContext';
12
12
  import { useFetch } from '../../../hooks/useFetch';
13
13
  import { RESOURCE, VERB } from '../../../types/rbac';
14
14
 
@@ -41,6 +41,11 @@ const getDeviceColumns = (t: TFunction): ApiSortTableColumn[] => [
41
41
  },
42
42
  ];
43
43
 
44
+ const decommissionedDevicesPermissions = [
45
+ { kind: RESOURCE.DEVICE, verb: VERB.DELETE },
46
+ { kind: RESOURCE.DEVICE, verb: VERB.PATCH },
47
+ ];
48
+
44
49
  const DecommissionedDevicesTable = ({
45
50
  devices,
46
51
  refetch,
@@ -67,8 +72,8 @@ const DecommissionedDevicesTable = ({
67
72
  },
68
73
  });
69
74
 
70
- const [canDelete] = useAccessReview(RESOURCE.DEVICE, VERB.DELETE);
71
- const [canEdit] = useAccessReview(RESOURCE.DEVICE, VERB.PATCH);
75
+ const { checkPermissions } = usePermissionsContext();
76
+ const [canDelete, canEdit] = checkPermissions(decommissionedDevicesPermissions);
72
77
 
73
78
  return (
74
79
  <>
@@ -4,7 +4,7 @@ import { Button, EmptyStateActions, EmptyStateBody, EmptyStateFooter } from '@pa
4
4
  import MicrochipIcon from '@patternfly/react-icons/dist/js/icons/microchip-icon';
5
5
  import BanIcon from '@patternfly/react-icons/dist/js/icons/ban-icon';
6
6
 
7
- import { useAccessReview } from '../../../hooks/useAccessReview';
7
+ import { usePermissionsContext } from '../../common/PermissionsContext';
8
8
  import { useTranslation } from '../../../hooks/useTranslation';
9
9
  import { Link, ROUTE } from '../../../hooks/useNavigate';
10
10
  import { RESOURCE, VERB } from '../../../types/rbac';
@@ -16,7 +16,8 @@ type DevicesEmptyStateProps = {
16
16
 
17
17
  export const EnrolledDevicesEmptyState = ({ onAddDevice }: DevicesEmptyStateProps) => {
18
18
  const { t } = useTranslation();
19
- const [canCreateFleet] = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
19
+ const { checkPermissions } = usePermissionsContext();
20
+ const [canCreateFleet] = checkPermissions([{ kind: RESOURCE.FLEET, verb: VERB.CREATE }]);
20
21
  return (
21
22
  <ResourceListEmptyState icon={MicrochipIcon} titleText={t('No devices here!')}>
22
23
  <EmptyStateBody>