@flightctl/ui-components 0.0.5 → 0.4.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts +8 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +91 -9
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.d.ts.map +1 -1
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js +15 -51
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +10 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +65 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts +5 -2
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +19 -10
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts +3 -4
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +6 -18
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts +4 -3
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +13 -4
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js +4 -14
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +2 -0
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js +14 -6
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts +2 -5
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js +8 -8
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts +3 -6
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +91 -17
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +10 -6
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +46 -42
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/types.d.ts +1 -10
- package/dist/src/components/Device/DevicesPage/types.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/types.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts +2 -0
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.js +10 -3
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts +8 -3
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js +26 -47
- package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts +2 -2
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +19 -4
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +7 -2
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +99 -7
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts +5 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.js → ApplicationTemplates.js} +31 -24
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +9 -10
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts +2 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -6
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.js → ConfigurationTemplates.js} +42 -28
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +53 -12
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +7 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js +13 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +38 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts +3 -0
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.js +5 -2
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
- package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.d.ts → SystemdUnitsModal/SystemdUnitsModal.d.ts} +6 -6
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -0
- package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.js → SystemdUnitsModal/SystemdUnitsModal.js} +28 -15
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +15 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js +57 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +14 -4
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +9 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +97 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +15 -11
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
- package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.d.ts +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.d.ts.map +1 -0
- package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.js +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.css +10 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.d.ts +5 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.js +22 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +9 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +42 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts +2 -2
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +19 -2
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +2 -4
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +6 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +61 -35
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts +2 -2
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js +16 -6
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js +7 -7
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts +2 -5
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.js +38 -24
- package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
- package/dist/src/components/Fleet/FleetRow.d.ts +2 -0
- package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetRow.js +16 -14
- package/dist/src/components/Fleet/FleetRow.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.d.ts +2 -2
- package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +37 -33
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts +2 -2
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +11 -2
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +5 -2
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
- package/dist/src/components/Fleet/useFleets.d.ts +26 -0
- package/dist/src/components/Fleet/useFleets.d.ts.map +1 -0
- package/dist/src/components/Fleet/useFleets.js +71 -0
- package/dist/src/components/Fleet/useFleets.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +6 -14
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts +0 -3
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +2 -2
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js +5 -9
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Overview.js +11 -5
- package/dist/src/components/OverviewPage/Overview.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts +2 -2
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js +15 -6
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +4 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.js +22 -6
- package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js +3 -2
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts +2 -2
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +16 -5
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
- package/dist/src/components/Repository/RepositoryList.d.ts +0 -1
- package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryList.js +55 -46
- package/dist/src/components/Repository/RepositoryList.js.map +1 -1
- package/dist/src/components/Repository/useRepositories.d.ts +16 -0
- package/dist/src/components/Repository/useRepositories.d.ts.map +1 -0
- package/dist/src/components/Repository/useRepositories.js +40 -0
- package/dist/src/components/Repository/useRepositories.js.map +1 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +21 -23
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Table/Table.d.ts +12 -3
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/Table.js +4 -4
- package/dist/src/components/Table/Table.js.map +1 -1
- package/dist/src/components/Table/TablePagination.d.ts +8 -0
- package/dist/src/components/Table/TablePagination.d.ts.map +1 -0
- package/dist/src/components/Table/TablePagination.js +38 -0
- package/dist/src/components/Table/TablePagination.js.map +1 -0
- package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
- package/dist/src/components/Terminal/Terminal.js +1 -0
- package/dist/src/components/Terminal/Terminal.js.map +1 -1
- package/dist/src/components/charts/DonutChart.css +5 -0
- package/dist/src/components/charts/DonutChart.js +1 -1
- package/dist/src/components/charts/DonutChart.js.map +1 -1
- package/dist/src/components/common/AccessDenied.d.ts +4 -0
- package/dist/src/components/common/AccessDenied.d.ts.map +1 -0
- package/dist/src/components/common/AccessDenied.js +15 -0
- package/dist/src/components/common/AccessDenied.js.map +1 -0
- package/dist/src/components/common/ButtonWithPermissions.d.ts +8 -0
- package/dist/src/components/common/ButtonWithPermissions.d.ts.map +1 -0
- package/dist/src/components/common/ButtonWithPermissions.js +12 -0
- package/dist/src/components/common/ButtonWithPermissions.js.map +1 -0
- package/dist/src/components/common/LearnMoreLink.d.ts +7 -0
- package/dist/src/components/common/LearnMoreLink.d.ts.map +1 -0
- package/dist/src/components/common/LearnMoreLink.js +13 -0
- package/dist/src/components/common/LearnMoreLink.js.map +1 -0
- package/dist/src/components/common/LeaveFormConfirmation.js +1 -1
- package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -1
- package/dist/src/components/common/PageWithPermissions.d.ts +7 -0
- package/dist/src/components/common/PageWithPermissions.d.ts.map +1 -0
- package/dist/src/components/common/PageWithPermissions.js +17 -0
- package/dist/src/components/common/PageWithPermissions.js.map +1 -0
- package/dist/src/components/form/FilterSelect.d.ts +2 -4
- package/dist/src/components/form/FilterSelect.d.ts.map +1 -1
- package/dist/src/components/form/FilterSelect.js.map +1 -1
- package/dist/src/components/form/FlightCtlForm.css +3 -0
- package/dist/src/components/form/FlightCtlForm.d.ts +1 -0
- package/dist/src/components/form/FlightCtlForm.d.ts.map +1 -1
- package/dist/src/components/form/FlightCtlForm.js +2 -1
- package/dist/src/components/form/FlightCtlForm.js.map +1 -1
- package/dist/src/components/form/FormSelect.d.ts +1 -0
- package/dist/src/components/form/FormSelect.d.ts.map +1 -1
- package/dist/src/components/form/FormSelect.js +14 -2
- package/dist/src/components/form/FormSelect.js.map +1 -1
- package/dist/src/components/form/LabelsField.d.ts +2 -1
- package/dist/src/components/form/LabelsField.d.ts.map +1 -1
- package/dist/src/components/form/LabelsField.js +6 -6
- package/dist/src/components/form/LabelsField.js.map +1 -1
- package/dist/src/components/form/validations.d.ts +13 -2
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +39 -24
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +2 -5
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +2 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +4 -4
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +2 -3
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +6 -5
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
- package/dist/src/constants.d.ts +2 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +3 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/useAccessReview.d.ts +4 -0
- package/dist/src/hooks/useAccessReview.d.ts.map +1 -0
- package/dist/src/hooks/useAccessReview.js +33 -0
- package/dist/src/hooks/useAccessReview.js.map +1 -0
- package/dist/src/hooks/useAppContext.d.ts +8 -7
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useAppContext.js +2 -2
- package/dist/src/hooks/useAppContext.js.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +4 -2
- package/dist/src/hooks/useFetch.d.ts.map +1 -1
- package/dist/src/hooks/useFetchPeriodically.d.ts +1 -1
- package/dist/src/hooks/useFetchPeriodically.d.ts.map +1 -1
- package/dist/src/hooks/useFetchPeriodically.js +4 -1
- package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
- package/dist/src/hooks/useFleetImportAccessReview.d.ts +3 -0
- package/dist/src/hooks/useFleetImportAccessReview.d.ts.map +1 -0
- package/dist/src/hooks/useFleetImportAccessReview.js +12 -0
- package/dist/src/hooks/useFleetImportAccessReview.js.map +1 -0
- package/dist/src/hooks/useNavigate.d.ts +3 -3
- package/dist/src/hooks/useNavigate.d.ts.map +1 -1
- package/dist/src/hooks/useNavigate.js +3 -3
- package/dist/src/hooks/useNavigate.js.map +1 -1
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts +2 -0
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts.map +1 -0
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.js +13 -0
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.js.map +1 -0
- package/dist/src/hooks/useTablePagination.d.ts +10 -0
- package/dist/src/hooks/useTablePagination.d.ts.map +1 -0
- package/dist/src/hooks/useTablePagination.js +33 -0
- package/dist/src/hooks/useTablePagination.js.map +1 -0
- package/dist/src/hooks/useWebSocket.d.ts +2 -2
- package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/src/hooks/useWebSocket.js.map +1 -1
- package/dist/src/links.d.ts +3 -0
- package/dist/src/links.d.ts.map +1 -0
- package/dist/src/links.js +6 -0
- package/dist/src/links.js.map +1 -0
- package/dist/src/types/rbac.d.ts +18 -0
- package/dist/src/types/rbac.d.ts.map +1 -0
- package/dist/src/types/rbac.js +23 -0
- package/dist/src/types/rbac.js.map +1 -0
- package/dist/src/utils/api.d.ts +3 -3
- package/dist/src/utils/api.d.ts.map +1 -1
- package/dist/src/utils/api.js.map +1 -1
- package/dist/src/utils/labels.d.ts +1 -1
- package/dist/src/utils/labels.d.ts.map +1 -1
- package/dist/src/utils/labels.js +4 -8
- package/dist/src/utils/labels.js.map +1 -1
- package/dist/src/utils/query.d.ts +15 -0
- package/dist/src/utils/query.d.ts.map +1 -0
- package/dist/src/utils/query.js +64 -0
- package/dist/src/utils/query.js.map +1 -0
- package/dist/src/utils/search.d.ts +1 -0
- package/dist/src/utils/search.d.ts.map +1 -1
- package/dist/src/utils/search.js +7 -7
- package/dist/src/utils/search.js.map +1 -1
- package/dist/src/utils/status/devices.d.ts +2 -1
- package/dist/src/utils/status/devices.d.ts.map +1 -1
- package/dist/src/utils/status/devices.js +1 -0
- package/dist/src/utils/status/devices.js.map +1 -1
- package/package.json +10 -10
- package/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +150 -13
- package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +31 -132
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +102 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +33 -16
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +8 -38
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +21 -4
- package/src/components/Device/DevicesPage/DeviceFilterSelect.tsx +13 -34
- package/src/components/Device/DevicesPage/DeviceTableRow.tsx +21 -9
- package/src/components/Device/DevicesPage/DeviceTableToolbar.tsx +13 -20
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +128 -48
- package/src/components/Device/DevicesPage/DevicesPage.tsx +86 -66
- package/src/components/Device/DevicesPage/types.ts +1 -13
- package/src/components/Device/DevicesPage/useDeviceBackendFilters.ts +14 -3
- package/src/components/Device/DevicesPage/useDevices.ts +49 -57
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +24 -4
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +156 -47
- package/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.tsx → ApplicationTemplates.tsx} +89 -53
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +22 -26
- package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +17 -12
- package/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.tsx → ConfigurationTemplates.tsx} +110 -52
- package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +108 -11
- package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +19 -0
- package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +75 -0
- package/src/components/Device/EditDeviceWizard/types.ts +3 -0
- package/src/components/Device/EditDeviceWizard/utils.ts +14 -4
- package/src/components/Device/{MatchPatternsModal/MatchPatternsModal.tsx → SystemdUnitsModal/SystemdUnitsModal.tsx} +36 -19
- package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +114 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +28 -9
- package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +167 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +28 -17
- package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.tsx +3 -2
- package/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.css +10 -0
- package/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.tsx +27 -0
- package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +63 -0
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +28 -2
- package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +2 -5
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +7 -0
- package/src/components/Fleet/CreateFleet/utils.ts +101 -49
- package/src/components/Fleet/FleetDetails/FleetDetails.tsx +57 -36
- package/src/components/Fleet/FleetDetails/FleetDevices.tsx +12 -18
- package/src/components/Fleet/FleetResourceSyncs.tsx +53 -41
- package/src/components/Fleet/FleetRow.tsx +28 -16
- package/src/components/Fleet/FleetsPage.tsx +70 -49
- package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +16 -3
- package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +25 -19
- package/src/components/Fleet/useFleets.ts +104 -0
- package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +6 -18
- package/src/components/OverviewPage/Cards/Status/StatusCardFilters.tsx +0 -7
- package/src/components/OverviewPage/Cards/ToDo/ToDoCard.tsx +6 -10
- package/src/components/OverviewPage/Overview.tsx +20 -8
- package/src/components/Repository/CreateRepository/CreateRepository.tsx +25 -9
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +5 -2
- package/src/components/Repository/CreateRepository/utils.ts +23 -7
- package/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.tsx +5 -3
- package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +32 -10
- package/src/components/Repository/RepositoryList.tsx +113 -70
- package/src/components/Repository/useRepositories.ts +59 -0
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +42 -40
- package/src/components/Table/Table.tsx +22 -9
- package/src/components/Table/TablePagination.tsx +74 -0
- package/src/components/Terminal/Terminal.tsx +1 -0
- package/src/components/charts/DonutChart.css +5 -0
- package/src/components/charts/DonutChart.tsx +1 -1
- package/src/components/common/AccessDenied.tsx +17 -0
- package/src/components/common/ButtonWithPermissions.tsx +14 -0
- package/src/components/common/LearnMoreLink.tsx +26 -0
- package/src/components/common/PageWithPermissions.tsx +19 -0
- package/src/components/form/FilterSelect.tsx +2 -4
- package/src/components/form/FlightCtlForm.css +3 -0
- package/src/components/form/FlightCtlForm.tsx +3 -1
- package/src/components/form/FormSelect.tsx +22 -2
- package/src/components/form/LabelsField.tsx +17 -13
- package/src/components/form/validations.ts +53 -25
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +2 -5
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -4
- package/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.tsx +2 -4
- package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +10 -5
- package/src/constants.ts +2 -1
- package/src/hooks/useAccessReview.ts +33 -0
- package/src/hooks/useAppContext.tsx +6 -5
- package/src/hooks/useFetchPeriodically.ts +4 -0
- package/src/hooks/useFleetImportAccessReview.ts +8 -0
- package/src/hooks/useNavigate.tsx +3 -3
- package/src/hooks/usePendingEnrollmentRequestsCount.ts +12 -0
- package/src/hooks/useTablePagination.tsx +44 -0
- package/src/hooks/useWebSocket.ts +4 -4
- package/src/links.ts +5 -0
- package/src/types/rbac.ts +18 -0
- package/src/utils/api.ts +3 -3
- package/src/utils/labels.ts +3 -7
- package/src/utils/query.ts +70 -0
- package/src/utils/search.ts +1 -1
- package/src/utils/status/devices.ts +1 -0
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts +0 -12
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts.map +0 -1
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js +0 -40
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js.map +0 -1
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts +0 -10
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts.map +0 -1
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js +0 -38
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts +0 -13
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js +0 -104
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts +0 -8
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.js +0 -16
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts +0 -5
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts +0 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts +0 -11
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js +0 -39
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.d.ts.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js.map +0 -1
- package/dist/src/components/common/HelperTextItems.d.ts +0 -3
- package/dist/src/components/common/HelperTextItems.d.ts.map +0 -1
- package/dist/src/components/common/HelperTextItems.js +0 -17
- package/dist/src/components/common/HelperTextItems.js.map +0 -1
- package/dist/src/hooks/useTableSort.d.ts +0 -7
- package/dist/src/hooks/useTableSort.d.ts.map +0 -1
- package/dist/src/hooks/useTableSort.js +0 -38
- package/dist/src/hooks/useTableSort.js.map +0 -1
- package/dist/src/utils/sort/device.d.ts +0 -4
- package/dist/src/utils/sort/device.d.ts.map +0 -1
- package/dist/src/utils/sort/device.js +0 -49
- package/dist/src/utils/sort/device.js.map +0 -1
- package/dist/src/utils/sort/fleet.d.ts +0 -4
- package/dist/src/utils/sort/fleet.d.ts.map +0 -1
- package/dist/src/utils/sort/fleet.js +0 -18
- package/dist/src/utils/sort/fleet.js.map +0 -1
- package/dist/src/utils/sort/generic.d.ts +0 -8
- package/dist/src/utils/sort/generic.d.ts.map +0 -1
- package/dist/src/utils/sort/generic.js +0 -37
- package/dist/src/utils/sort/generic.js.map +0 -1
- package/dist/src/utils/sort/repository.d.ts +0 -6
- package/dist/src/utils/sort/repository.d.ts.map +0 -1
- package/dist/src/utils/sort/repository.js +0 -28
- package/dist/src/utils/sort/repository.js.map +0 -1
- package/dist/src/utils/sort/resourceSync.d.ts +0 -6
- package/dist/src/utils/sort/resourceSync.d.ts.map +0 -1
- package/dist/src/utils/sort/resourceSync.js +0 -29
- package/dist/src/utils/sort/resourceSync.js.map +0 -1
- package/src/components/DetailsPage/Tables/SystemdDetailsTable.tsx +0 -63
- package/src/components/Device/DeviceDetails/SystemdTable.tsx +0 -65
- package/src/components/Device/DevicesPage/EnrollmentRequestList.tsx +0 -183
- package/src/components/Device/DevicesPage/useDeviceFilters.ts +0 -15
- package/src/components/Device/MatchPatternsModal/MatchPatternsForm.tsx +0 -92
- package/src/components/common/HelperTextItems.tsx +0 -25
- package/src/hooks/useTableSort.ts +0 -42
- package/src/utils/sort/device.ts +0 -60
- package/src/utils/sort/fleet.ts +0 -16
- package/src/utils/sort/generic.ts +0 -37
- package/src/utils/sort/repository.ts +0 -28
- package/src/utils/sort/resourceSync.ts +0 -30
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
Button,
|
|
4
3
|
EmptyStateActions,
|
|
5
4
|
EmptyStateBody,
|
|
6
5
|
EmptyStateFooter,
|
|
@@ -18,16 +17,11 @@ import { TopologyIcon } from '@patternfly/react-icons/dist/js/icons/topology-ico
|
|
|
18
17
|
import { Trans } from 'react-i18next';
|
|
19
18
|
import { TFunction } from 'i18next';
|
|
20
19
|
|
|
21
|
-
import { Fleet, FleetList } from '@flightctl/types';
|
|
22
|
-
import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
|
|
23
20
|
import ListPage from '../ListPage/ListPage';
|
|
24
21
|
import ListPageBody from '../ListPage/ListPageBody';
|
|
25
|
-
import
|
|
26
|
-
import { sortByStatus, sortFleetsByOSImg } from '../../utils/sort/fleet';
|
|
22
|
+
import TablePagination from '../Table/TablePagination';
|
|
27
23
|
import TableTextSearch from '../Table/TableTextSearch';
|
|
28
|
-
import Table, {
|
|
29
|
-
import { useTableTextSearch } from '../../hooks/useTableTextSearch';
|
|
30
|
-
import { useTableSort } from '../../hooks/useTableSort';
|
|
24
|
+
import Table, { ApiSortTableColumn } from '../Table/Table';
|
|
31
25
|
import { useTableSelect } from '../../hooks/useTableSelect';
|
|
32
26
|
import TableActions from '../Table/TableActions';
|
|
33
27
|
import { getResourceId } from '../../utils/resource';
|
|
@@ -38,21 +32,38 @@ import { useTranslation } from '../../hooks/useTranslation';
|
|
|
38
32
|
import { ROUTE, useNavigate } from '../../hooks/useNavigate';
|
|
39
33
|
import DeleteFleetModal from './DeleteFleetModal/DeleteFleetModal';
|
|
40
34
|
import FleetResourceSyncs from './FleetResourceSyncs';
|
|
35
|
+
import { useFleetBackendFilters, useFleets } from './useFleets';
|
|
36
|
+
import { useAccessReview } from '../../hooks/useAccessReview';
|
|
37
|
+
import ButtonWithPermissions from '../common/ButtonWithPermissions';
|
|
38
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
39
|
+
import PageWithPermissions from '../common/PageWithPermissions';
|
|
40
|
+
import { useFleetImportAccessReview } from '../../hooks/useFleetImportAccessReview';
|
|
41
41
|
|
|
42
42
|
const FleetPageActions = ({ createText }: { createText?: string }) => {
|
|
43
43
|
const { t } = useTranslation();
|
|
44
44
|
const navigate = useNavigate();
|
|
45
|
+
const canCreateFleet = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
|
|
46
|
+
const canImportFleet = useFleetImportAccessReview();
|
|
47
|
+
|
|
45
48
|
return (
|
|
46
49
|
<Split hasGutter>
|
|
47
50
|
<SplitItem>
|
|
48
|
-
<
|
|
51
|
+
<ButtonWithPermissions
|
|
52
|
+
permissions={canCreateFleet}
|
|
53
|
+
variant="primary"
|
|
54
|
+
onClick={() => navigate(ROUTE.FLEET_CREATE)}
|
|
55
|
+
>
|
|
49
56
|
{createText || t('Create a fleet')}
|
|
50
|
-
</
|
|
57
|
+
</ButtonWithPermissions>
|
|
51
58
|
</SplitItem>
|
|
52
59
|
<SplitItem>
|
|
53
|
-
<
|
|
60
|
+
<ButtonWithPermissions
|
|
61
|
+
permissions={canImportFleet}
|
|
62
|
+
variant="secondary"
|
|
63
|
+
onClick={() => navigate(ROUTE.FLEET_IMPORT)}
|
|
64
|
+
>
|
|
54
65
|
{t('Import fleets')}
|
|
55
|
-
</
|
|
66
|
+
</ButtonWithPermissions>
|
|
56
67
|
</SplitItem>
|
|
57
68
|
</Split>
|
|
58
69
|
);
|
|
@@ -78,84 +89,90 @@ const FleetEmptyState = () => {
|
|
|
78
89
|
);
|
|
79
90
|
};
|
|
80
91
|
|
|
81
|
-
const getColumns = (t: TFunction):
|
|
92
|
+
const getColumns = (t: TFunction): ApiSortTableColumn[] => [
|
|
82
93
|
{
|
|
83
94
|
name: t('Name'),
|
|
84
|
-
onSort: sortByName,
|
|
85
95
|
},
|
|
86
96
|
{
|
|
87
97
|
name: t('System image'),
|
|
88
|
-
onSort: sortFleetsByOSImg,
|
|
89
98
|
},
|
|
90
99
|
{
|
|
91
100
|
name: t('Devices'),
|
|
92
101
|
},
|
|
93
102
|
{
|
|
94
103
|
name: t('Status'),
|
|
95
|
-
onSort: sortByStatus,
|
|
96
104
|
},
|
|
97
105
|
];
|
|
98
106
|
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const FleetTable = ({ fleetLoad }: { fleetLoad: FleetLoad }) => {
|
|
107
|
+
const FleetTable = () => {
|
|
102
108
|
const { t } = useTranslation();
|
|
103
109
|
|
|
110
|
+
const fleetColumns = React.useMemo(() => getColumns(t), [t]);
|
|
111
|
+
const { name, setName, hasFiltersEnabled } = useFleetBackendFilters();
|
|
112
|
+
|
|
113
|
+
const { fleets, isLoading, error, isUpdating, refetch, pagination } = useFleets({ name, addDevicesCount: true });
|
|
114
|
+
|
|
104
115
|
const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
|
|
105
116
|
const [fleetToDeleteId, setFleetToDeleteId] = React.useState<string>();
|
|
106
117
|
|
|
107
|
-
const [fleetList, loading, error, refetch] = fleetLoad;
|
|
108
|
-
const columns = React.useMemo(() => getColumns(t), [t]);
|
|
109
|
-
const fleets = fleetList?.items || [];
|
|
110
|
-
const { search, setSearch, filteredData } = useTableTextSearch(fleets, getSearchText);
|
|
111
|
-
const { getSortParams, sortedData: sortedFleets } = useTableSort(filteredData, columns);
|
|
112
118
|
const { onRowSelect, isAllSelected, hasSelectedRows, isRowSelected, setAllSelected } = useTableSelect();
|
|
113
119
|
|
|
120
|
+
const [canDelete] = useAccessReview(RESOURCE.FLEET, VERB.DELETE);
|
|
121
|
+
const [canCreate] = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
|
|
122
|
+
const [canEdit] = useAccessReview(RESOURCE.FLEET, VERB.PATCH);
|
|
123
|
+
|
|
114
124
|
return (
|
|
115
|
-
<ListPageBody error={error} loading={
|
|
125
|
+
<ListPageBody error={error} loading={isLoading}>
|
|
116
126
|
<Toolbar inset={{ default: 'insetNone' }}>
|
|
117
127
|
<ToolbarContent>
|
|
118
128
|
<ToolbarGroup>
|
|
119
129
|
<ToolbarItem variant="search-filter">
|
|
120
|
-
<TableTextSearch value={
|
|
130
|
+
<TableTextSearch value={name} setValue={setName} placeholder={t('Search by name')} />
|
|
121
131
|
</ToolbarItem>
|
|
122
132
|
</ToolbarGroup>
|
|
123
|
-
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
{canCreate && (
|
|
134
|
+
<ToolbarItem>
|
|
135
|
+
<FleetPageActions createText={t('Create fleet')} />
|
|
136
|
+
</ToolbarItem>
|
|
137
|
+
)}
|
|
138
|
+
{canDelete && (
|
|
139
|
+
<ToolbarItem>
|
|
140
|
+
<TableActions isDisabled={!hasSelectedRows}>
|
|
141
|
+
<SelectList>
|
|
142
|
+
<SelectOption onClick={() => setIsMassDeleteModalOpen(true)}>{t('Delete')}</SelectOption>
|
|
143
|
+
</SelectList>
|
|
144
|
+
</TableActions>
|
|
145
|
+
</ToolbarItem>
|
|
146
|
+
)}
|
|
133
147
|
</ToolbarContent>
|
|
134
148
|
</Toolbar>
|
|
135
149
|
<Table
|
|
136
150
|
aria-label={t('Fleets table')}
|
|
137
|
-
|
|
138
|
-
|
|
151
|
+
loading={isUpdating}
|
|
152
|
+
columns={fleetColumns}
|
|
153
|
+
emptyFilters={!hasFiltersEnabled}
|
|
139
154
|
emptyData={fleets.length === 0}
|
|
140
|
-
getSortParams={getSortParams}
|
|
141
155
|
isAllSelected={isAllSelected}
|
|
142
156
|
onSelectAll={setAllSelected}
|
|
143
157
|
>
|
|
144
158
|
<Tbody>
|
|
145
|
-
{
|
|
159
|
+
{fleets.map((fleet, rowIndex) => (
|
|
146
160
|
<FleetRow
|
|
147
161
|
key={getResourceId(fleet)}
|
|
148
162
|
fleet={fleet}
|
|
149
163
|
rowIndex={rowIndex}
|
|
164
|
+
canDelete={canDelete}
|
|
150
165
|
onDeleteClick={() => {
|
|
151
166
|
setFleetToDeleteId(fleet.metadata.name || '');
|
|
152
167
|
}}
|
|
153
168
|
isRowSelected={isRowSelected}
|
|
154
169
|
onRowSelect={onRowSelect}
|
|
170
|
+
canEdit={canEdit}
|
|
155
171
|
/>
|
|
156
172
|
))}
|
|
157
173
|
</Tbody>
|
|
158
174
|
</Table>
|
|
175
|
+
<TablePagination pagination={pagination} isUpdating={isUpdating} />
|
|
159
176
|
{fleets.length === 0 && <FleetEmptyState />}
|
|
160
177
|
{fleetToDeleteId && (
|
|
161
178
|
<DeleteFleetModal
|
|
@@ -171,7 +188,7 @@ const FleetTable = ({ fleetLoad }: { fleetLoad: FleetLoad }) => {
|
|
|
171
188
|
{isMassDeleteModalOpen && (
|
|
172
189
|
<MassDeleteFleetModal
|
|
173
190
|
onClose={() => setIsMassDeleteModalOpen(false)}
|
|
174
|
-
fleets={
|
|
191
|
+
fleets={fleets.filter(isRowSelected)}
|
|
175
192
|
onDeleteSuccess={() => {
|
|
176
193
|
setIsMassDeleteModalOpen(false);
|
|
177
194
|
refetch();
|
|
@@ -182,23 +199,27 @@ const FleetTable = ({ fleetLoad }: { fleetLoad: FleetLoad }) => {
|
|
|
182
199
|
);
|
|
183
200
|
};
|
|
184
201
|
|
|
185
|
-
type FleetLoad = [FleetList | undefined, boolean, unknown, VoidFunction, boolean];
|
|
186
|
-
|
|
187
202
|
const FleetsPage = () => {
|
|
188
203
|
const { t } = useTranslation();
|
|
189
204
|
|
|
190
|
-
// TODO move the fetch down to FleetTable when the API includes the filter for pending / errored resource syncs
|
|
191
|
-
const fleetLoad = useFetchPeriodically<FleetList>({ endpoint: 'fleets?addDevicesCount=true' });
|
|
192
|
-
|
|
193
205
|
return (
|
|
194
206
|
<>
|
|
195
|
-
<FleetResourceSyncs
|
|
207
|
+
<FleetResourceSyncs />
|
|
196
208
|
|
|
197
209
|
<ListPage title={t('Fleets')}>
|
|
198
|
-
<FleetTable
|
|
210
|
+
<FleetTable />
|
|
199
211
|
</ListPage>
|
|
200
212
|
</>
|
|
201
213
|
);
|
|
202
214
|
};
|
|
203
215
|
|
|
204
|
-
|
|
216
|
+
const FleetsPageWithPermissions = () => {
|
|
217
|
+
const [allowed, loading] = useAccessReview(RESOURCE.FLEET, VERB.LIST);
|
|
218
|
+
return (
|
|
219
|
+
<PageWithPermissions allowed={allowed} loading={loading}>
|
|
220
|
+
<FleetsPage />
|
|
221
|
+
</PageWithPermissions>
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export default FleetsPageWithPermissions;
|
|
@@ -40,6 +40,8 @@ import { useTranslation } from '../../../hooks/useTranslation';
|
|
|
40
40
|
import { Link, ROUTE, useNavigate } from '../../../hooks/useNavigate';
|
|
41
41
|
import LeaveFormConfirmation from '../../common/LeaveFormConfirmation';
|
|
42
42
|
import ErrorBoundary from '../../common/ErrorBoundary';
|
|
43
|
+
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
44
|
+
import { useFleetImportAccessReview } from '../../../hooks/useFleetImportAccessReview';
|
|
43
45
|
|
|
44
46
|
import './ImportFleetWizard.css';
|
|
45
47
|
|
|
@@ -97,11 +99,13 @@ const ImportFleetWizard = () => {
|
|
|
97
99
|
const [errors, setErrors] = React.useState<string[]>();
|
|
98
100
|
const navigate = useNavigate();
|
|
99
101
|
const [currentStep, setCurrentStep] = React.useState<WizardStepType>();
|
|
100
|
-
const [repoList, isLoading, error] = useFetchPeriodically<RepositoryList>({
|
|
102
|
+
const [repoList, isLoading, error] = useFetchPeriodically<RepositoryList>({
|
|
103
|
+
endpoint: 'repositories',
|
|
104
|
+
});
|
|
101
105
|
|
|
102
106
|
const gitRepositories = (repoList?.items || []).filter((repo) => repo.spec.type === RepoSpecType.GIT);
|
|
103
107
|
|
|
104
|
-
let body;
|
|
108
|
+
let body: React.ReactNode;
|
|
105
109
|
|
|
106
110
|
if (isLoading) {
|
|
107
111
|
body = (
|
|
@@ -213,4 +217,13 @@ const ImportFleetWizard = () => {
|
|
|
213
217
|
);
|
|
214
218
|
};
|
|
215
219
|
|
|
216
|
-
|
|
220
|
+
const ImportFleetWizardWithPermissions = () => {
|
|
221
|
+
const [allowed, isLoading] = useFleetImportAccessReview();
|
|
222
|
+
return (
|
|
223
|
+
<PageWithPermissions allowed={allowed} loading={isLoading}>
|
|
224
|
+
<ImportFleetWizard />
|
|
225
|
+
</PageWithPermissions>
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export default ImportFleetWizardWithPermissions;
|
|
@@ -12,6 +12,8 @@ import { getLastTransitionTimeText, getRepositorySyncStatus } from '../../../../
|
|
|
12
12
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
13
13
|
import FormSelect from '../../../form/FormSelect';
|
|
14
14
|
import FlightCtlForm from '../../../form/FlightCtlForm';
|
|
15
|
+
import { useAccessReview } from '../../../../hooks/useAccessReview';
|
|
16
|
+
import { RESOURCE, VERB } from '../../../../types/rbac';
|
|
15
17
|
|
|
16
18
|
export const repositoryStepId = 'repository';
|
|
17
19
|
|
|
@@ -75,6 +77,8 @@ const RepositoryStep = ({ repositories, hasLoaded }: { repositories: Repository[
|
|
|
75
77
|
const { t } = useTranslation();
|
|
76
78
|
const { values, setFieldValue } = useFormikContext<ImportFleetFormValues>();
|
|
77
79
|
|
|
80
|
+
const [canCreateRepo] = useAccessReview(RESOURCE.REPOSITORY, VERB.CREATE);
|
|
81
|
+
|
|
78
82
|
const noRepositoriesExist = hasLoaded && repositories.length === 0;
|
|
79
83
|
React.useEffect(() => {
|
|
80
84
|
if (values.useExistingRepo && noRepositoriesExist) {
|
|
@@ -85,25 +89,27 @@ const RepositoryStep = ({ repositories, hasLoaded }: { repositories: Repository[
|
|
|
85
89
|
return (
|
|
86
90
|
<FlightCtlForm>
|
|
87
91
|
<Grid span={8}>
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
92
|
+
{canCreateRepo && (
|
|
93
|
+
<FormSection>
|
|
94
|
+
<FormGroup isInline>
|
|
95
|
+
<Radio
|
|
96
|
+
isChecked={values.useExistingRepo}
|
|
97
|
+
onChange={() => setFieldValue('useExistingRepo', true, true)}
|
|
98
|
+
id="existing-repo"
|
|
99
|
+
name="repo"
|
|
100
|
+
label={t('Use an existing Git repository')}
|
|
101
|
+
isDisabled={noRepositoriesExist}
|
|
102
|
+
/>
|
|
103
|
+
<Radio
|
|
104
|
+
isChecked={!values.useExistingRepo}
|
|
105
|
+
onChange={() => setFieldValue('useExistingRepo', false, true)}
|
|
106
|
+
id="new-repo"
|
|
107
|
+
name="repo"
|
|
108
|
+
label={t('Use a new Git repository')}
|
|
109
|
+
/>
|
|
110
|
+
</FormGroup>
|
|
111
|
+
</FormSection>
|
|
112
|
+
)}
|
|
107
113
|
<FormSection>
|
|
108
114
|
{values.useExistingRepo ? <ExistingRepoForm repositories={repositories} /> : <RepositoryForm />}
|
|
109
115
|
</FormSection>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useDebounce } from 'use-debounce';
|
|
3
|
+
|
|
4
|
+
import { Fleet, FleetList } from '@flightctl/types';
|
|
5
|
+
import { useAppContext } from '../../hooks/useAppContext';
|
|
6
|
+
import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
|
|
7
|
+
import { PaginationDetails, useTablePagination } from '../../hooks/useTablePagination';
|
|
8
|
+
import { PAGE_SIZE } from '../../constants';
|
|
9
|
+
|
|
10
|
+
export enum FleetSearchParams {
|
|
11
|
+
Name = 'name',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type FleetsEndpointArgs = {
|
|
15
|
+
name?: string;
|
|
16
|
+
nextContinue?: string;
|
|
17
|
+
addDevicesCount?: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const useFleetBackendFilters = () => {
|
|
21
|
+
const {
|
|
22
|
+
router: { useSearchParams },
|
|
23
|
+
} = useAppContext();
|
|
24
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
25
|
+
const paramsRef = React.useRef(searchParams);
|
|
26
|
+
const name = searchParams.get(FleetSearchParams.Name) || undefined;
|
|
27
|
+
|
|
28
|
+
const setName = React.useCallback(
|
|
29
|
+
(nameVal: string) => {
|
|
30
|
+
const newParams = new URLSearchParams({
|
|
31
|
+
[FleetSearchParams.Name]: nameVal,
|
|
32
|
+
});
|
|
33
|
+
paramsRef.current = newParams;
|
|
34
|
+
setSearchParams(newParams);
|
|
35
|
+
},
|
|
36
|
+
[setSearchParams],
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const hasFiltersEnabled = !!name;
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
name,
|
|
43
|
+
setName,
|
|
44
|
+
hasFiltersEnabled,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getFleetsEndpoint = ({
|
|
49
|
+
name,
|
|
50
|
+
addDevicesCount,
|
|
51
|
+
nextContinue,
|
|
52
|
+
}: {
|
|
53
|
+
name?: string;
|
|
54
|
+
addDevicesCount?: boolean;
|
|
55
|
+
nextContinue?: string;
|
|
56
|
+
}) => {
|
|
57
|
+
const params = new URLSearchParams({
|
|
58
|
+
limit: `${PAGE_SIZE}`,
|
|
59
|
+
});
|
|
60
|
+
if (name) {
|
|
61
|
+
params.set('fieldSelector', `metadata.name contains ${name}`);
|
|
62
|
+
}
|
|
63
|
+
if (addDevicesCount) {
|
|
64
|
+
params.set('addDevicesCount', 'true');
|
|
65
|
+
}
|
|
66
|
+
if (nextContinue) {
|
|
67
|
+
params.set('continue', nextContinue);
|
|
68
|
+
}
|
|
69
|
+
return `fleets?${params.toString()}`;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const useFleetsEndpoint = (args: FleetsEndpointArgs): [string, boolean] => {
|
|
73
|
+
const endpoint = getFleetsEndpoint(args);
|
|
74
|
+
const [fleetsEndpointDebounced] = useDebounce(endpoint, 1000);
|
|
75
|
+
return [fleetsEndpointDebounced, endpoint !== fleetsEndpointDebounced];
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type FleetLoad = {
|
|
79
|
+
fleets: Fleet[];
|
|
80
|
+
isLoading: boolean;
|
|
81
|
+
error: unknown;
|
|
82
|
+
isUpdating: boolean;
|
|
83
|
+
refetch: VoidFunction;
|
|
84
|
+
pagination: PaginationDetails;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const useFleets = (args: FleetsEndpointArgs): FleetLoad => {
|
|
88
|
+
const pagination = useTablePagination();
|
|
89
|
+
const [fleetsEndpoint, fleetsDebouncing] = useFleetsEndpoint({ ...args, nextContinue: pagination.nextContinue });
|
|
90
|
+
const [fleetsList, isLoading, error, refetch, updating] = useFetchPeriodically<FleetList>(
|
|
91
|
+
{
|
|
92
|
+
endpoint: fleetsEndpoint,
|
|
93
|
+
},
|
|
94
|
+
pagination.onPageFetched,
|
|
95
|
+
);
|
|
96
|
+
return {
|
|
97
|
+
fleets: fleetsList?.items || [],
|
|
98
|
+
isLoading,
|
|
99
|
+
error,
|
|
100
|
+
isUpdating: updating || fleetsDebouncing,
|
|
101
|
+
refetch,
|
|
102
|
+
pagination,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
@@ -14,16 +14,14 @@ import {
|
|
|
14
14
|
TextContent,
|
|
15
15
|
TextVariants,
|
|
16
16
|
} from '@patternfly/react-core';
|
|
17
|
-
import { FleetList } from '@flightctl/types';
|
|
18
17
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
19
18
|
import ApplicationStatusChart from './ApplicationStatusChart';
|
|
20
19
|
import DeviceStatusChart from './DeviceStatusChart';
|
|
21
20
|
import SystemUpdateStatusChart from './SystemUpdateStatusChart';
|
|
22
|
-
import { useFetchPeriodically } from '../../../../hooks/useFetchPeriodically';
|
|
23
21
|
import StatusCardFilters from './StatusCardFilters';
|
|
24
22
|
import ErrorAlert from '../../../ErrorAlert/ErrorAlert';
|
|
25
23
|
import { FlightCtlLabel } from '../../../../types/extraTypes';
|
|
26
|
-
import {
|
|
24
|
+
import { useDevicesSummary } from '../../../Device/DevicesPage/useDevices';
|
|
27
25
|
|
|
28
26
|
const StatusCard = () => {
|
|
29
27
|
const { t } = useTranslation();
|
|
@@ -35,31 +33,23 @@ const StatusCard = () => {
|
|
|
35
33
|
labels,
|
|
36
34
|
});
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
const [devices, loading, error, , , allLabels] = useDevices({
|
|
40
|
-
ownerFleets: fleets,
|
|
41
|
-
labels,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const [fleetsList, flLoading, flError] = useFetchPeriodically<FleetList>({
|
|
45
|
-
endpoint: 'fleets',
|
|
46
|
-
});
|
|
36
|
+
const error = false;
|
|
47
37
|
|
|
48
38
|
let content: React.ReactNode;
|
|
49
|
-
if (
|
|
39
|
+
if (summaryLoading) {
|
|
50
40
|
content = (
|
|
51
41
|
<Bullseye>
|
|
52
42
|
<Spinner />
|
|
53
43
|
</Bullseye>
|
|
54
44
|
);
|
|
55
|
-
} else if (error
|
|
56
|
-
content = <ErrorAlert error={error
|
|
45
|
+
} else if (error) {
|
|
46
|
+
content = <ErrorAlert error={error} />;
|
|
57
47
|
} else {
|
|
58
48
|
content = (
|
|
59
49
|
<Stack>
|
|
60
50
|
<StackItem>
|
|
61
51
|
<TextContent>
|
|
62
|
-
<Text component={TextVariants.small}>{t('{{count}} Devices', { count:
|
|
52
|
+
<Text component={TextVariants.small}>{t('{{count}} Devices', { count: devicesSummary?.total || 0 })}</Text>
|
|
63
53
|
</TextContent>
|
|
64
54
|
</StackItem>
|
|
65
55
|
<StackItem>
|
|
@@ -96,10 +86,8 @@ const StatusCard = () => {
|
|
|
96
86
|
</FlexItem>
|
|
97
87
|
<FlexItem>
|
|
98
88
|
<StatusCardFilters
|
|
99
|
-
fleets={fleetsList?.items || []}
|
|
100
89
|
selectedFleets={fleets}
|
|
101
90
|
setSelectedFleets={setFleets}
|
|
102
|
-
allLabels={allLabels}
|
|
103
91
|
selectedLabels={labels}
|
|
104
92
|
setSelectedLabels={setLabels}
|
|
105
93
|
/>
|
|
@@ -11,26 +11,21 @@ import {
|
|
|
11
11
|
ToolbarGroup,
|
|
12
12
|
ToolbarItem,
|
|
13
13
|
} from '@patternfly/react-core';
|
|
14
|
-
import { Fleet } from '@flightctl/types';
|
|
15
14
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
16
15
|
import { labelToString } from '../../../../utils/labels';
|
|
17
16
|
import { FlightCtlLabel } from '../../../../types/extraTypes';
|
|
18
17
|
import DeviceTableToolbarFilters from '../../../Device/DevicesPage/DeviceToolbarFilters';
|
|
19
18
|
|
|
20
19
|
type StatusCardFiltersProps = {
|
|
21
|
-
fleets: Fleet[];
|
|
22
20
|
selectedFleets: string[];
|
|
23
21
|
setSelectedFleets: (fleets: string[]) => void;
|
|
24
|
-
allLabels: FlightCtlLabel[];
|
|
25
22
|
selectedLabels: FlightCtlLabel[];
|
|
26
23
|
setSelectedLabels: (labels: FlightCtlLabel[]) => void;
|
|
27
24
|
};
|
|
28
25
|
|
|
29
26
|
const StatusCardFilters: React.FC<StatusCardFiltersProps> = ({
|
|
30
|
-
fleets,
|
|
31
27
|
selectedFleets,
|
|
32
28
|
setSelectedFleets,
|
|
33
|
-
allLabels,
|
|
34
29
|
selectedLabels,
|
|
35
30
|
setSelectedLabels,
|
|
36
31
|
}) => {
|
|
@@ -46,10 +41,8 @@ const StatusCardFilters: React.FC<StatusCardFiltersProps> = ({
|
|
|
46
41
|
<ToolbarGroup>
|
|
47
42
|
<ToolbarItem variant="search-filter">
|
|
48
43
|
<DeviceTableToolbarFilters
|
|
49
|
-
fleets={fleets}
|
|
50
44
|
selectedFleetNames={selectedFleets}
|
|
51
45
|
setSelectedFleets={setSelectedFleets}
|
|
52
|
-
allLabels={allLabels}
|
|
53
46
|
selectedLabels={selectedLabels}
|
|
54
47
|
setSelectedLabels={setSelectedLabels}
|
|
55
48
|
/>
|
|
@@ -13,18 +13,15 @@ import {
|
|
|
13
13
|
TextContent,
|
|
14
14
|
TextVariants,
|
|
15
15
|
} from '@patternfly/react-core';
|
|
16
|
-
import { EnrollmentRequestList } from '@flightctl/types';
|
|
17
16
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
18
|
-
import {
|
|
19
|
-
import { EnrollmentRequestStatus, getApprovalStatus } from '../../../../utils/status/enrollmentRequest';
|
|
17
|
+
import { usePendingEnrollmentRequestsCount } from '../../../../hooks/usePendingEnrollmentRequestsCount';
|
|
20
18
|
import { Link, ROUTE } from '../../../../hooks/useNavigate';
|
|
21
19
|
import ErrorAlert from '../../../ErrorAlert/ErrorAlert';
|
|
22
20
|
|
|
23
21
|
const ToDoCard = () => {
|
|
24
22
|
const { t } = useTranslation();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
23
|
+
|
|
24
|
+
const [pendingErCount, loading, error] = usePendingEnrollmentRequestsCount();
|
|
28
25
|
|
|
29
26
|
let content: React.ReactNode;
|
|
30
27
|
if (loading) {
|
|
@@ -36,15 +33,14 @@ const ToDoCard = () => {
|
|
|
36
33
|
} else if (error) {
|
|
37
34
|
content = <ErrorAlert error={error} />;
|
|
38
35
|
} else {
|
|
39
|
-
|
|
40
|
-
if (pendingErs?.length) {
|
|
36
|
+
if (pendingErCount) {
|
|
41
37
|
content = (
|
|
42
38
|
<List>
|
|
43
39
|
<ListItem>
|
|
44
40
|
<Split hasGutter>
|
|
45
|
-
<SplitItem isFilled>{t('{{ count }} devices pending approval', { count:
|
|
41
|
+
<SplitItem isFilled>{t('{{ count }} devices pending approval', { count: pendingErCount })}</SplitItem>
|
|
46
42
|
<SplitItem>
|
|
47
|
-
<Link to={ROUTE.DEVICES}>{t('Review pending devices', { count:
|
|
43
|
+
<Link to={ROUTE.DEVICES}>{t('Review pending devices', { count: pendingErCount })}</Link>
|
|
48
44
|
</SplitItem>
|
|
49
45
|
</Split>
|
|
50
46
|
</ListItem>
|
|
@@ -2,17 +2,29 @@ import * as React from 'react';
|
|
|
2
2
|
import { Grid, GridItem } from '@patternfly/react-core';
|
|
3
3
|
import StatusCard from './Cards/Status/StatusCard';
|
|
4
4
|
import ToDoCard from './Cards/ToDo/ToDoCard';
|
|
5
|
+
import { useAccessReview } from '../../hooks/useAccessReview';
|
|
6
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
7
|
+
import PageWithPermissions from '../common/PageWithPermissions';
|
|
5
8
|
|
|
6
9
|
const Overview = () => {
|
|
10
|
+
const [canListDevices, devicesLoading] = useAccessReview(RESOURCE.DEVICE, VERB.LIST);
|
|
11
|
+
const [canListErs, erLoading] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.LIST);
|
|
12
|
+
|
|
7
13
|
return (
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
<PageWithPermissions allowed={canListDevices || canListErs} loading={devicesLoading || erLoading}>
|
|
15
|
+
<Grid hasGutter>
|
|
16
|
+
{canListDevices && (
|
|
17
|
+
<GridItem>
|
|
18
|
+
<StatusCard />
|
|
19
|
+
</GridItem>
|
|
20
|
+
)}
|
|
21
|
+
{canListErs && (
|
|
22
|
+
<GridItem md={6} lg={4}>
|
|
23
|
+
<ToDoCard />
|
|
24
|
+
</GridItem>
|
|
25
|
+
)}
|
|
26
|
+
</Grid>
|
|
27
|
+
</PageWithPermissions>
|
|
16
28
|
);
|
|
17
29
|
};
|
|
18
30
|
|