@flightctl/ui-components 0.0.10 → 0.4.0-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 -4
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +18 -9
- 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 +0 -3
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js +2 -2
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts +1 -4
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +70 -16
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +6 -8
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +41 -37
- 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/useDevices.d.ts +9 -10
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js +9 -29
- 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/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestList.js +40 -38
- 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/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/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 +34 -24
- 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 +11 -3
- package/dist/src/components/Fleet/useFleets.d.ts.map +1 -1
- package/dist/src/components/Fleet/useFleets.js +22 -12
- package/dist/src/components/Fleet/useFleets.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +5 -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/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 +0 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/Table.js +2 -2
- 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/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/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 +4 -3
- 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/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 +9 -0
- package/dist/src/utils/query.d.ts.map +1 -1
- package/dist/src/utils/query.js +33 -1
- package/dist/src/utils/query.js.map +1 -1
- 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/package.json +5 -5
- 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 +0 -7
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +93 -40
- package/src/components/Device/DevicesPage/DevicesPage.tsx +64 -58
- package/src/components/Device/DevicesPage/types.ts +1 -13
- package/src/components/Device/DevicesPage/useDevices.ts +19 -38
- 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/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestList.tsx +57 -48
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +28 -17
- package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.tsx +3 -2
- 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/FleetResourceSyncs.tsx +53 -41
- package/src/components/Fleet/FleetRow.tsx +28 -16
- package/src/components/Fleet/FleetsPage.tsx +63 -53
- 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 +40 -22
- package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +5 -18
- package/src/components/OverviewPage/Cards/Status/StatusCardFilters.tsx +0 -7
- 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 -71
- package/src/components/Repository/useRepositories.ts +59 -0
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +41 -40
- package/src/components/Table/Table.tsx +3 -4
- package/src/components/Table/TablePagination.tsx +74 -0
- package/src/components/Terminal/Terminal.tsx +1 -0
- 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 +8 -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/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 +41 -0
- package/src/utils/search.ts +1 -1
- 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 -6
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts.map +0 -1
- 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/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/useApiTableSort.d.ts +0 -8
- package/dist/src/hooks/useApiTableSort.d.ts.map +0 -1
- package/dist/src/hooks/useApiTableSort.js +0 -44
- package/dist/src/hooks/useApiTableSort.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/generic.d.ts +0 -5
- package/dist/src/utils/sort/generic.d.ts.map +0 -1
- package/dist/src/utils/sort/generic.js +0 -10
- 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/MatchPatternsModal/MatchPatternsForm.tsx +0 -92
- package/src/components/common/HelperTextItems.tsx +0 -25
- package/src/hooks/useApiTableSort.ts +0 -49
- package/src/hooks/useTableSort.ts +0 -42
- package/src/utils/sort/generic.ts +0 -8
- 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,
|
|
@@ -13,14 +12,14 @@ import {
|
|
|
13
12
|
ToolbarGroup,
|
|
14
13
|
ToolbarItem,
|
|
15
14
|
} from '@patternfly/react-core';
|
|
16
|
-
import { Tbody
|
|
15
|
+
import { Tbody } from '@patternfly/react-table';
|
|
17
16
|
import { TopologyIcon } from '@patternfly/react-icons/dist/js/icons/topology-icon';
|
|
18
17
|
import { Trans } from 'react-i18next';
|
|
19
18
|
import { TFunction } from 'i18next';
|
|
20
19
|
|
|
21
|
-
import { Fleet } from '@flightctl/types';
|
|
22
20
|
import ListPage from '../ListPage/ListPage';
|
|
23
21
|
import ListPageBody from '../ListPage/ListPageBody';
|
|
22
|
+
import TablePagination from '../Table/TablePagination';
|
|
24
23
|
import TableTextSearch from '../Table/TableTextSearch';
|
|
25
24
|
import Table, { ApiSortTableColumn } from '../Table/Table';
|
|
26
25
|
import { useTableSelect } from '../../hooks/useTableSelect';
|
|
@@ -33,23 +32,38 @@ import { useTranslation } from '../../hooks/useTranslation';
|
|
|
33
32
|
import { ROUTE, useNavigate } from '../../hooks/useNavigate';
|
|
34
33
|
import DeleteFleetModal from './DeleteFleetModal/DeleteFleetModal';
|
|
35
34
|
import FleetResourceSyncs from './FleetResourceSyncs';
|
|
36
|
-
import { useApiTableSort } from '../../hooks/useApiTableSort';
|
|
37
35
|
import { useFleetBackendFilters, useFleets } from './useFleets';
|
|
36
|
+
import { useAccessReview } from '../../hooks/useAccessReview';
|
|
37
|
+
import ButtonWithPermissions from '../common/ButtonWithPermissions';
|
|
38
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
39
|
+
import PageWithPermissions from '../common/PageWithPermissions';
|
|
40
|
+
import { useFleetImportAccessReview } from '../../hooks/useFleetImportAccessReview';
|
|
38
41
|
|
|
39
42
|
const FleetPageActions = ({ createText }: { createText?: string }) => {
|
|
40
43
|
const { t } = useTranslation();
|
|
41
44
|
const navigate = useNavigate();
|
|
45
|
+
const canCreateFleet = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
|
|
46
|
+
const canImportFleet = useFleetImportAccessReview();
|
|
47
|
+
|
|
42
48
|
return (
|
|
43
49
|
<Split hasGutter>
|
|
44
50
|
<SplitItem>
|
|
45
|
-
<
|
|
51
|
+
<ButtonWithPermissions
|
|
52
|
+
permissions={canCreateFleet}
|
|
53
|
+
variant="primary"
|
|
54
|
+
onClick={() => navigate(ROUTE.FLEET_CREATE)}
|
|
55
|
+
>
|
|
46
56
|
{createText || t('Create a fleet')}
|
|
47
|
-
</
|
|
57
|
+
</ButtonWithPermissions>
|
|
48
58
|
</SplitItem>
|
|
49
59
|
<SplitItem>
|
|
50
|
-
<
|
|
60
|
+
<ButtonWithPermissions
|
|
61
|
+
permissions={canImportFleet}
|
|
62
|
+
variant="secondary"
|
|
63
|
+
onClick={() => navigate(ROUTE.FLEET_IMPORT)}
|
|
64
|
+
>
|
|
51
65
|
{t('Import fleets')}
|
|
52
|
-
</
|
|
66
|
+
</ButtonWithPermissions>
|
|
53
67
|
</SplitItem>
|
|
54
68
|
</Split>
|
|
55
69
|
);
|
|
@@ -78,12 +92,9 @@ const FleetEmptyState = () => {
|
|
|
78
92
|
const getColumns = (t: TFunction): ApiSortTableColumn[] => [
|
|
79
93
|
{
|
|
80
94
|
name: t('Name'),
|
|
81
|
-
sortableField: 'metadata.name',
|
|
82
|
-
defaultSort: true,
|
|
83
95
|
},
|
|
84
96
|
{
|
|
85
97
|
name: t('System image'),
|
|
86
|
-
sortableField: 'spec.template.spec.os.image',
|
|
87
98
|
},
|
|
88
99
|
{
|
|
89
100
|
name: t('Devices'),
|
|
@@ -93,26 +104,25 @@ const getColumns = (t: TFunction): ApiSortTableColumn[] => [
|
|
|
93
104
|
},
|
|
94
105
|
];
|
|
95
106
|
|
|
96
|
-
|
|
97
|
-
fleetColumns: ApiSortTableColumn[];
|
|
98
|
-
fleetLoad: FleetLoad;
|
|
99
|
-
getSortParams: (columnIndex: number) => ThProps['sort'];
|
|
100
|
-
hasFiltersEnabled: boolean;
|
|
101
|
-
name: string | undefined;
|
|
102
|
-
setName: (name: string) => void;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColumns, fleetLoad }: FleetTableProps) => {
|
|
107
|
+
const FleetTable = () => {
|
|
106
108
|
const { t } = useTranslation();
|
|
107
109
|
|
|
110
|
+
const fleetColumns = React.useMemo(() => getColumns(t), [t]);
|
|
111
|
+
const { name, setName, hasFiltersEnabled } = useFleetBackendFilters();
|
|
112
|
+
|
|
113
|
+
const { fleets, isLoading, error, isUpdating, refetch, pagination } = useFleets({ name, addDevicesCount: true });
|
|
114
|
+
|
|
108
115
|
const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
|
|
109
116
|
const [fleetToDeleteId, setFleetToDeleteId] = React.useState<string>();
|
|
110
|
-
const [fleets, loading, error, isFilterUpdating, refetch] = fleetLoad;
|
|
111
117
|
|
|
112
118
|
const { onRowSelect, isAllSelected, hasSelectedRows, isRowSelected, setAllSelected } = useTableSelect();
|
|
113
119
|
|
|
120
|
+
const [canDelete] = useAccessReview(RESOURCE.FLEET, VERB.DELETE);
|
|
121
|
+
const [canCreate] = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
|
|
122
|
+
const [canEdit] = useAccessReview(RESOURCE.FLEET, VERB.PATCH);
|
|
123
|
+
|
|
114
124
|
return (
|
|
115
|
-
<ListPageBody error={error} loading={
|
|
125
|
+
<ListPageBody error={error} loading={isLoading}>
|
|
116
126
|
<Toolbar inset={{ default: 'insetNone' }}>
|
|
117
127
|
<ToolbarContent>
|
|
118
128
|
<ToolbarGroup>
|
|
@@ -120,25 +130,28 @@ const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColu
|
|
|
120
130
|
<TableTextSearch value={name} setValue={setName} placeholder={t('Search by name')} />
|
|
121
131
|
</ToolbarItem>
|
|
122
132
|
</ToolbarGroup>
|
|
123
|
-
|
|
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
|
-
loading={
|
|
151
|
+
loading={isUpdating}
|
|
138
152
|
columns={fleetColumns}
|
|
139
153
|
emptyFilters={!hasFiltersEnabled}
|
|
140
154
|
emptyData={fleets.length === 0}
|
|
141
|
-
getSortParams={getSortParams}
|
|
142
155
|
isAllSelected={isAllSelected}
|
|
143
156
|
onSelectAll={setAllSelected}
|
|
144
157
|
>
|
|
@@ -148,15 +161,18 @@ const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColu
|
|
|
148
161
|
key={getResourceId(fleet)}
|
|
149
162
|
fleet={fleet}
|
|
150
163
|
rowIndex={rowIndex}
|
|
164
|
+
canDelete={canDelete}
|
|
151
165
|
onDeleteClick={() => {
|
|
152
166
|
setFleetToDeleteId(fleet.metadata.name || '');
|
|
153
167
|
}}
|
|
154
168
|
isRowSelected={isRowSelected}
|
|
155
169
|
onRowSelect={onRowSelect}
|
|
170
|
+
canEdit={canEdit}
|
|
156
171
|
/>
|
|
157
172
|
))}
|
|
158
173
|
</Tbody>
|
|
159
174
|
</Table>
|
|
175
|
+
<TablePagination pagination={pagination} isUpdating={isUpdating} />
|
|
160
176
|
{fleets.length === 0 && <FleetEmptyState />}
|
|
161
177
|
{fleetToDeleteId && (
|
|
162
178
|
<DeleteFleetModal
|
|
@@ -183,33 +199,27 @@ const FleetTable = ({ name, setName, hasFiltersEnabled, getSortParams, fleetColu
|
|
|
183
199
|
);
|
|
184
200
|
};
|
|
185
201
|
|
|
186
|
-
type FleetLoad = [Fleet[], boolean, unknown, boolean, VoidFunction];
|
|
187
|
-
|
|
188
202
|
const FleetsPage = () => {
|
|
189
203
|
const { t } = useTranslation();
|
|
190
204
|
|
|
191
|
-
// TODO move the fetch down to FleetTable when the API includes the filter for pending / errored resource syncs
|
|
192
|
-
const columns = React.useMemo(() => getColumns(t), [t]);
|
|
193
|
-
const { name, setName, hasFiltersEnabled } = useFleetBackendFilters();
|
|
194
|
-
const { getSortParams, sortField, direction } = useApiTableSort(columns);
|
|
195
|
-
const fleetLoad = useFleets({ name, addDevicesCount: true, sortField, direction });
|
|
196
|
-
|
|
197
205
|
return (
|
|
198
206
|
<>
|
|
199
|
-
<FleetResourceSyncs
|
|
207
|
+
<FleetResourceSyncs />
|
|
200
208
|
|
|
201
209
|
<ListPage title={t('Fleets')}>
|
|
202
|
-
<FleetTable
|
|
203
|
-
name={name}
|
|
204
|
-
setName={setName}
|
|
205
|
-
hasFiltersEnabled={hasFiltersEnabled}
|
|
206
|
-
getSortParams={getSortParams}
|
|
207
|
-
fleetLoad={fleetLoad}
|
|
208
|
-
fleetColumns={columns}
|
|
209
|
-
/>
|
|
210
|
+
<FleetTable />
|
|
210
211
|
</ListPage>
|
|
211
212
|
</>
|
|
212
213
|
);
|
|
213
214
|
};
|
|
214
215
|
|
|
215
|
-
|
|
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>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useDebounce } from 'use-debounce';
|
|
2
3
|
|
|
4
|
+
import { Fleet, FleetList } from '@flightctl/types';
|
|
3
5
|
import { useAppContext } from '../../hooks/useAppContext';
|
|
4
6
|
import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
+
import { PaginationDetails, useTablePagination } from '../../hooks/useTablePagination';
|
|
8
|
+
import { PAGE_SIZE } from '../../constants';
|
|
7
9
|
|
|
8
10
|
export enum FleetSearchParams {
|
|
9
11
|
Name = 'name',
|
|
@@ -11,9 +13,8 @@ export enum FleetSearchParams {
|
|
|
11
13
|
|
|
12
14
|
type FleetsEndpointArgs = {
|
|
13
15
|
name?: string;
|
|
16
|
+
nextContinue?: string;
|
|
14
17
|
addDevicesCount?: boolean;
|
|
15
|
-
sortField?: string;
|
|
16
|
-
direction?: string;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export const useFleetBackendFilters = () => {
|
|
@@ -45,29 +46,27 @@ export const useFleetBackendFilters = () => {
|
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
const getFleetsEndpoint = ({
|
|
48
|
-
addDevicesCount,
|
|
49
49
|
name,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
addDevicesCount,
|
|
51
|
+
nextContinue,
|
|
52
52
|
}: {
|
|
53
|
-
addDevicesCount?: boolean;
|
|
54
53
|
name?: string;
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
addDevicesCount?: boolean;
|
|
55
|
+
nextContinue?: string;
|
|
57
56
|
}) => {
|
|
58
|
-
const params = new URLSearchParams(
|
|
57
|
+
const params = new URLSearchParams({
|
|
58
|
+
limit: `${PAGE_SIZE}`,
|
|
59
|
+
});
|
|
59
60
|
if (name) {
|
|
60
61
|
params.set('fieldSelector', `metadata.name contains ${name}`);
|
|
61
62
|
}
|
|
62
63
|
if (addDevicesCount) {
|
|
63
64
|
params.set('addDevicesCount', 'true');
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
params.set('sortBy', sortField);
|
|
68
|
-
params.set('sortOrder', direction || SortOrder.ASC);
|
|
66
|
+
if (nextContinue) {
|
|
67
|
+
params.set('continue', nextContinue);
|
|
69
68
|
}
|
|
70
|
-
return
|
|
69
|
+
return `fleets?${params.toString()}`;
|
|
71
70
|
};
|
|
72
71
|
|
|
73
72
|
const useFleetsEndpoint = (args: FleetsEndpointArgs): [string, boolean] => {
|
|
@@ -76,11 +75,30 @@ const useFleetsEndpoint = (args: FleetsEndpointArgs): [string, boolean] => {
|
|
|
76
75
|
return [fleetsEndpointDebounced, endpoint !== fleetsEndpointDebounced];
|
|
77
76
|
};
|
|
78
77
|
|
|
79
|
-
export
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
export type FleetLoad = {
|
|
79
|
+
fleets: Fleet[];
|
|
80
|
+
isLoading: boolean;
|
|
81
|
+
error: unknown;
|
|
82
|
+
isUpdating: boolean;
|
|
83
|
+
refetch: VoidFunction;
|
|
84
|
+
pagination: PaginationDetails;
|
|
85
|
+
};
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
export const useFleets = (args: FleetsEndpointArgs): FleetLoad => {
|
|
88
|
+
const pagination = useTablePagination();
|
|
89
|
+
const [fleetsEndpoint, fleetsDebouncing] = useFleetsEndpoint({ ...args, nextContinue: pagination.nextContinue });
|
|
90
|
+
const [fleetsList, isLoading, error, refetch, updating] = useFetchPeriodically<FleetList>(
|
|
91
|
+
{
|
|
92
|
+
endpoint: fleetsEndpoint,
|
|
93
|
+
},
|
|
94
|
+
pagination.onPageFetched,
|
|
95
|
+
);
|
|
96
|
+
return {
|
|
97
|
+
fleets: fleetsList?.items || [],
|
|
98
|
+
isLoading,
|
|
99
|
+
error,
|
|
100
|
+
isUpdating: updating || fleetsDebouncing,
|
|
101
|
+
refetch,
|
|
102
|
+
pagination,
|
|
103
|
+
};
|
|
86
104
|
};
|
|
@@ -14,16 +14,14 @@ import {
|
|
|
14
14
|
TextContent,
|
|
15
15
|
TextVariants,
|
|
16
16
|
} from '@patternfly/react-core';
|
|
17
|
-
import { FleetList } from '@flightctl/types';
|
|
18
17
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
19
18
|
import ApplicationStatusChart from './ApplicationStatusChart';
|
|
20
19
|
import DeviceStatusChart from './DeviceStatusChart';
|
|
21
20
|
import SystemUpdateStatusChart from './SystemUpdateStatusChart';
|
|
22
|
-
import { useFetchPeriodically } from '../../../../hooks/useFetchPeriodically';
|
|
23
21
|
import StatusCardFilters from './StatusCardFilters';
|
|
24
22
|
import ErrorAlert from '../../../ErrorAlert/ErrorAlert';
|
|
25
23
|
import { FlightCtlLabel } from '../../../../types/extraTypes';
|
|
26
|
-
import {
|
|
24
|
+
import { useDevicesSummary } from '../../../Device/DevicesPage/useDevices';
|
|
27
25
|
|
|
28
26
|
const StatusCard = () => {
|
|
29
27
|
const { t } = useTranslation();
|
|
@@ -35,26 +33,17 @@ const StatusCard = () => {
|
|
|
35
33
|
labels,
|
|
36
34
|
});
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
const [, /* devices */ loading, error, , , allLabels] = useDevices({
|
|
40
|
-
ownerFleets: fleets,
|
|
41
|
-
labels,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// TODO https://issues.redhat.com/browse/EDM-683 Use the new API endpoint to retrieve fleet names
|
|
45
|
-
const [fleetsList, flLoading, flError] = useFetchPeriodically<FleetList>({
|
|
46
|
-
endpoint: 'fleets',
|
|
47
|
-
});
|
|
36
|
+
const error = false;
|
|
48
37
|
|
|
49
38
|
let content: React.ReactNode;
|
|
50
|
-
if (
|
|
39
|
+
if (summaryLoading) {
|
|
51
40
|
content = (
|
|
52
41
|
<Bullseye>
|
|
53
42
|
<Spinner />
|
|
54
43
|
</Bullseye>
|
|
55
44
|
);
|
|
56
|
-
} else if (error
|
|
57
|
-
content = <ErrorAlert error={error
|
|
45
|
+
} else if (error) {
|
|
46
|
+
content = <ErrorAlert error={error} />;
|
|
58
47
|
} else {
|
|
59
48
|
content = (
|
|
60
49
|
<Stack>
|
|
@@ -97,10 +86,8 @@ const StatusCard = () => {
|
|
|
97
86
|
</FlexItem>
|
|
98
87
|
<FlexItem>
|
|
99
88
|
<StatusCardFilters
|
|
100
|
-
fleets={fleetsList?.items || []}
|
|
101
89
|
selectedFleets={fleets}
|
|
102
90
|
setSelectedFleets={setFleets}
|
|
103
|
-
allLabels={allLabels}
|
|
104
91
|
selectedLabels={labels}
|
|
105
92
|
setSelectedLabels={setLabels}
|
|
106
93
|
/>
|
|
@@ -11,26 +11,21 @@ import {
|
|
|
11
11
|
ToolbarGroup,
|
|
12
12
|
ToolbarItem,
|
|
13
13
|
} from '@patternfly/react-core';
|
|
14
|
-
import { Fleet } from '@flightctl/types';
|
|
15
14
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
16
15
|
import { labelToString } from '../../../../utils/labels';
|
|
17
16
|
import { FlightCtlLabel } from '../../../../types/extraTypes';
|
|
18
17
|
import DeviceTableToolbarFilters from '../../../Device/DevicesPage/DeviceToolbarFilters';
|
|
19
18
|
|
|
20
19
|
type StatusCardFiltersProps = {
|
|
21
|
-
fleets: Fleet[];
|
|
22
20
|
selectedFleets: string[];
|
|
23
21
|
setSelectedFleets: (fleets: string[]) => void;
|
|
24
|
-
allLabels: FlightCtlLabel[];
|
|
25
22
|
selectedLabels: FlightCtlLabel[];
|
|
26
23
|
setSelectedLabels: (labels: FlightCtlLabel[]) => void;
|
|
27
24
|
};
|
|
28
25
|
|
|
29
26
|
const StatusCardFilters: React.FC<StatusCardFiltersProps> = ({
|
|
30
|
-
fleets,
|
|
31
27
|
selectedFleets,
|
|
32
28
|
setSelectedFleets,
|
|
33
|
-
allLabels,
|
|
34
29
|
selectedLabels,
|
|
35
30
|
setSelectedLabels,
|
|
36
31
|
}) => {
|
|
@@ -46,10 +41,8 @@ const StatusCardFilters: React.FC<StatusCardFiltersProps> = ({
|
|
|
46
41
|
<ToolbarGroup>
|
|
47
42
|
<ToolbarItem variant="search-filter">
|
|
48
43
|
<DeviceTableToolbarFilters
|
|
49
|
-
fleets={fleets}
|
|
50
44
|
selectedFleetNames={selectedFleets}
|
|
51
45
|
setSelectedFleets={setSelectedFleets}
|
|
52
|
-
allLabels={allLabels}
|
|
53
46
|
selectedLabels={selectedLabels}
|
|
54
47
|
setSelectedLabels={setSelectedLabels}
|
|
55
48
|
/>
|
|
@@ -2,17 +2,29 @@ import * as React from 'react';
|
|
|
2
2
|
import { Grid, GridItem } from '@patternfly/react-core';
|
|
3
3
|
import StatusCard from './Cards/Status/StatusCard';
|
|
4
4
|
import ToDoCard from './Cards/ToDo/ToDoCard';
|
|
5
|
+
import { useAccessReview } from '../../hooks/useAccessReview';
|
|
6
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
7
|
+
import PageWithPermissions from '../common/PageWithPermissions';
|
|
5
8
|
|
|
6
9
|
const Overview = () => {
|
|
10
|
+
const [canListDevices, devicesLoading] = useAccessReview(RESOURCE.DEVICE, VERB.LIST);
|
|
11
|
+
const [canListErs, erLoading] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.LIST);
|
|
12
|
+
|
|
7
13
|
return (
|
|
8
|
-
<
|
|
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
|
|
|
@@ -13,16 +13,21 @@ import {
|
|
|
13
13
|
StackItem,
|
|
14
14
|
Title,
|
|
15
15
|
} from '@patternfly/react-core';
|
|
16
|
-
import { useTranslation } from '../../../hooks/useTranslation';
|
|
17
|
-
import { useFetch } from '../../../hooks/useFetch';
|
|
18
16
|
|
|
19
|
-
import CreateRepositoryForm from './CreateRepositoryForm';
|
|
20
|
-
|
|
21
|
-
import { isPromiseFulfilled } from '../../../types/typeUtils';
|
|
22
17
|
import { Repository, ResourceSync, ResourceSyncList } from '@flightctl/types';
|
|
23
|
-
|
|
18
|
+
|
|
19
|
+
import { useTranslation } from '../../../hooks/useTranslation';
|
|
20
|
+
import { useFetch } from '../../../hooks/useFetch';
|
|
24
21
|
import { Link, ROUTE, useNavigate } from '../../../hooks/useNavigate';
|
|
25
22
|
import { useAppContext } from '../../../hooks/useAppContext';
|
|
23
|
+
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
24
|
+
import { isPromiseFulfilled } from '../../../types/typeUtils';
|
|
25
|
+
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
26
|
+
import { getErrorMessage } from '../../../utils/error';
|
|
27
|
+
import { commonQueries } from '../../../utils/query';
|
|
28
|
+
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
29
|
+
|
|
30
|
+
import CreateRepositoryForm from './CreateRepositoryForm';
|
|
26
31
|
|
|
27
32
|
const CreateRepository = () => {
|
|
28
33
|
const { t } = useTranslation();
|
|
@@ -30,6 +35,7 @@ const CreateRepository = () => {
|
|
|
30
35
|
router: { useParams },
|
|
31
36
|
} = useAppContext();
|
|
32
37
|
const { repositoryId } = useParams<{ repositoryId: string }>();
|
|
38
|
+
|
|
33
39
|
const { get } = useFetch();
|
|
34
40
|
const [repoError, setRepoError] = React.useState<string>();
|
|
35
41
|
const [rsError, setRsError] = React.useState<string>();
|
|
@@ -44,7 +50,7 @@ const CreateRepository = () => {
|
|
|
44
50
|
try {
|
|
45
51
|
const results = await Promise.allSettled([
|
|
46
52
|
get<Repository>(`repositories/${repositoryId}`),
|
|
47
|
-
get<ResourceSyncList>(
|
|
53
|
+
get<ResourceSyncList>(commonQueries.getResourceSyncsByRepo(repositoryId as string)),
|
|
48
54
|
]);
|
|
49
55
|
|
|
50
56
|
if (isPromiseFulfilled(results[0])) {
|
|
@@ -70,7 +76,8 @@ const CreateRepository = () => {
|
|
|
70
76
|
const reload = async () => {
|
|
71
77
|
try {
|
|
72
78
|
setIsLoading(true);
|
|
73
|
-
|
|
79
|
+
|
|
80
|
+
const rsList = await get<ResourceSyncList>(commonQueries.getResourceSyncsByRepo(repositoryId as string));
|
|
74
81
|
setResourceSyncs(rsList.items);
|
|
75
82
|
setRsError(undefined);
|
|
76
83
|
} catch (e) {
|
|
@@ -141,4 +148,13 @@ const CreateRepository = () => {
|
|
|
141
148
|
);
|
|
142
149
|
};
|
|
143
150
|
|
|
144
|
-
|
|
151
|
+
const CreateRepositoryWithPermissions = () => {
|
|
152
|
+
const [allowed, loading] = useAccessReview(RESOURCE.REPOSITORY, VERB.CREATE);
|
|
153
|
+
return (
|
|
154
|
+
<PageWithPermissions allowed={allowed} loading={loading}>
|
|
155
|
+
<CreateRepository />
|
|
156
|
+
</PageWithPermissions>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export default CreateRepositoryWithPermissions;
|
|
@@ -40,8 +40,9 @@ import CheckboxField from '../../form/CheckboxField';
|
|
|
40
40
|
import RadioField from '../../form/RadioField';
|
|
41
41
|
import TextField from '../../form/TextField';
|
|
42
42
|
import FlightCtlForm from '../../form/FlightCtlForm';
|
|
43
|
-
|
|
44
43
|
import { getDnsSubdomainValidations } from '../../form/validations';
|
|
44
|
+
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
45
|
+
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
45
46
|
|
|
46
47
|
import './CreateRepositoryForm.css';
|
|
47
48
|
|
|
@@ -285,13 +286,15 @@ const CreateRepositoryFormContent = ({ isEdit, isReadOnly, onClose, children }:
|
|
|
285
286
|
const { values, setFieldValue, isValid, dirty, submitForm, isSubmitting } = useFormikContext<RepositoryFormValues>();
|
|
286
287
|
const isSubmitDisabled = isSubmitting || !dirty || !isValid;
|
|
287
288
|
|
|
289
|
+
const [canCreateRS] = useAccessReview(RESOURCE.RESOURCE_SYNC, VERB.CREATE);
|
|
290
|
+
|
|
288
291
|
const showResourceSyncs = values.canUseResourceSyncs && values.repoType === RepoSpecType.GIT;
|
|
289
292
|
return (
|
|
290
293
|
<FlightCtlForm className="fctl-create-repo">
|
|
291
294
|
<fieldset disabled={isReadOnly}>
|
|
292
295
|
<Grid hasGutter span={8}>
|
|
293
296
|
<RepositoryForm isEdit={isEdit} />
|
|
294
|
-
{showResourceSyncs && (
|
|
297
|
+
{showResourceSyncs && canCreateRS && (
|
|
295
298
|
<Checkbox
|
|
296
299
|
id="use-resource-syncs"
|
|
297
300
|
label={
|