@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
|
@@ -5,28 +5,40 @@ import { FleetFormValues } from './types';
|
|
|
5
5
|
import { API_VERSION } from '../../../constants';
|
|
6
6
|
import { toAPILabel } from '../../../utils/labels';
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
systemdUnitListValidationSchema,
|
|
9
9
|
validApplicationsSchema,
|
|
10
10
|
validConfigTemplatesSchema,
|
|
11
11
|
validKubernetesDnsSubdomain,
|
|
12
12
|
validLabelsSchema,
|
|
13
|
+
validOsImage,
|
|
13
14
|
} from '../../form/validations';
|
|
14
|
-
import { appendJSONPatch, getApplicationPatches, getLabelPatches, toAPIApplication } from '../../../utils/patch';
|
|
15
15
|
import {
|
|
16
|
+
appendJSONPatch,
|
|
17
|
+
getApplicationPatches,
|
|
18
|
+
getLabelPatches,
|
|
19
|
+
getStringListPatches,
|
|
20
|
+
toAPIApplication,
|
|
21
|
+
} from '../../../utils/patch';
|
|
22
|
+
import {
|
|
23
|
+
ACMCrdConfig,
|
|
24
|
+
ACMImportConfig,
|
|
25
|
+
MicroshiftRegistrationHook,
|
|
16
26
|
getAPIConfig,
|
|
17
27
|
getApplicationValues,
|
|
18
28
|
getConfigTemplatesValues,
|
|
19
29
|
getDeviceSpecConfigPatches,
|
|
30
|
+
hasMicroshiftRegistrationConfig,
|
|
20
31
|
} from '../../Device/EditDeviceWizard/deviceSpecUtils';
|
|
21
32
|
|
|
22
33
|
export const getValidationSchema = (t: TFunction) => {
|
|
23
34
|
return Yup.object<FleetFormValues>({
|
|
24
35
|
name: validKubernetesDnsSubdomain(t, { isRequired: true }),
|
|
25
|
-
osImage:
|
|
36
|
+
osImage: validOsImage(t, { isFleet: true }),
|
|
26
37
|
fleetLabels: validLabelsSchema(t),
|
|
27
38
|
labels: validLabelsSchema(t),
|
|
28
39
|
configTemplates: validConfigTemplatesSchema(t),
|
|
29
40
|
applications: validApplicationsSchema(t),
|
|
41
|
+
systemdUnits: systemdUnitListValidationSchema(t),
|
|
30
42
|
});
|
|
31
43
|
};
|
|
32
44
|
|
|
@@ -94,6 +106,9 @@ export const getFleetPatches = (currentFleet: Fleet, updatedFleet: FleetFormValu
|
|
|
94
106
|
// Configurations
|
|
95
107
|
const currentConfigs = currentFleet.spec.template.spec.config || [];
|
|
96
108
|
const newConfigs = updatedFleet.configTemplates.map(getAPIConfig);
|
|
109
|
+
if (updatedFleet.registerMicroShift) {
|
|
110
|
+
newConfigs.push(ACMCrdConfig, ACMImportConfig, MicroshiftRegistrationHook);
|
|
111
|
+
}
|
|
97
112
|
const configPatches = getDeviceSpecConfigPatches(currentConfigs, newConfigs, '/spec/template/spec/config');
|
|
98
113
|
allPatches = allPatches.concat(configPatches);
|
|
99
114
|
|
|
@@ -105,56 +120,93 @@ export const getFleetPatches = (currentFleet: Fleet, updatedFleet: FleetFormValu
|
|
|
105
120
|
);
|
|
106
121
|
allPatches = allPatches.concat(appPatches);
|
|
107
122
|
|
|
123
|
+
// Systemd services
|
|
124
|
+
const unitPatches = getStringListPatches(
|
|
125
|
+
'/spec/template/spec/systemd',
|
|
126
|
+
currentFleet.spec.template.spec.systemd?.matchPatterns || [],
|
|
127
|
+
updatedFleet.systemdUnits.map((unit) => unit.pattern),
|
|
128
|
+
(list) => ({ matchPatterns: list }),
|
|
129
|
+
);
|
|
130
|
+
allPatches = allPatches.concat(unitPatches);
|
|
131
|
+
|
|
108
132
|
return allPatches;
|
|
109
133
|
};
|
|
110
134
|
|
|
111
|
-
export const getFleetResource = (values: FleetFormValues): Fleet =>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
export const getFleetResource = (values: FleetFormValues): Fleet => {
|
|
136
|
+
const systemdPatterns =
|
|
137
|
+
values.systemdUnits.length === 0
|
|
138
|
+
? undefined
|
|
139
|
+
: {
|
|
140
|
+
systemd: {
|
|
141
|
+
matchPatterns: values.systemdUnits.map((unit) => unit.pattern),
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
const fleet: Fleet = {
|
|
145
|
+
apiVersion: API_VERSION,
|
|
146
|
+
kind: 'Fleet',
|
|
147
|
+
metadata: {
|
|
148
|
+
name: values.name,
|
|
149
|
+
labels: toAPILabel(values.fleetLabels),
|
|
121
150
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
fleet: values.name,
|
|
126
|
-
},
|
|
151
|
+
spec: {
|
|
152
|
+
selector: {
|
|
153
|
+
matchLabels: toAPILabel(values.labels),
|
|
127
154
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
155
|
+
template: {
|
|
156
|
+
metadata: {
|
|
157
|
+
labels: {
|
|
158
|
+
fleet: values.name,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
spec: {
|
|
162
|
+
os: values.osImage ? { image: values.osImage || '' } : undefined,
|
|
163
|
+
config: values.configTemplates.map(getAPIConfig),
|
|
164
|
+
applications: values.applications.map(toAPIApplication),
|
|
165
|
+
...systemdPatterns,
|
|
166
|
+
},
|
|
132
167
|
},
|
|
133
168
|
},
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
if (values.registerMicroShift) {
|
|
172
|
+
fleet.spec.template.spec.config?.push(ACMCrdConfig, ACMImportConfig, MicroshiftRegistrationHook);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return fleet;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const getInitialValues = (fleet?: Fleet): FleetFormValues => {
|
|
179
|
+
if (fleet) {
|
|
180
|
+
const registerMicroShift = hasMicroshiftRegistrationConfig(fleet.spec.template.spec);
|
|
181
|
+
return {
|
|
182
|
+
name: fleet.metadata.name || '',
|
|
183
|
+
labels: Object.keys(fleet.spec.selector?.matchLabels || {}).map((key) => ({
|
|
184
|
+
key,
|
|
185
|
+
value: fleet.spec.selector?.matchLabels?.[key],
|
|
186
|
+
})),
|
|
187
|
+
fleetLabels: Object.keys(fleet.metadata.labels || {}).map((key) => ({
|
|
188
|
+
key,
|
|
189
|
+
value: fleet.metadata.labels?.[key],
|
|
190
|
+
})),
|
|
191
|
+
osImage: fleet.spec.template.spec.os?.image || '',
|
|
192
|
+
configTemplates: getConfigTemplatesValues(fleet.spec.template.spec, registerMicroShift),
|
|
193
|
+
applications: getApplicationValues(fleet.spec.template.spec),
|
|
194
|
+
systemdUnits: (fleet.spec.template.spec.systemd?.matchPatterns || []).map((p) => ({
|
|
195
|
+
pattern: p,
|
|
196
|
+
exists: true,
|
|
197
|
+
})),
|
|
198
|
+
registerMicroShift,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return {
|
|
203
|
+
name: '',
|
|
204
|
+
labels: [],
|
|
205
|
+
fleetLabels: [],
|
|
206
|
+
osImage: '',
|
|
207
|
+
configTemplates: [],
|
|
208
|
+
applications: [],
|
|
209
|
+
systemdUnits: [],
|
|
210
|
+
registerMicroShift: false,
|
|
211
|
+
};
|
|
212
|
+
};
|
|
@@ -10,6 +10,9 @@ import { useTranslation } from '../../../hooks/useTranslation';
|
|
|
10
10
|
import { ROUTE, useNavigate } from '../../../hooks/useNavigate';
|
|
11
11
|
import { useAppContext } from '../../../hooks/useAppContext';
|
|
12
12
|
import DeleteFleetModal from '../DeleteFleetModal/DeleteFleetModal';
|
|
13
|
+
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
14
|
+
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
15
|
+
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
13
16
|
|
|
14
17
|
const FleetDetails = () => {
|
|
15
18
|
const { t } = useTranslation();
|
|
@@ -25,6 +28,9 @@ const FleetDetails = () => {
|
|
|
25
28
|
|
|
26
29
|
const navigate = useNavigate();
|
|
27
30
|
|
|
31
|
+
const [canDelete] = useAccessReview(RESOURCE.FLEET, VERB.DELETE);
|
|
32
|
+
const [canEdit] = useAccessReview(RESOURCE.FLEET, VERB.PATCH);
|
|
33
|
+
|
|
28
34
|
const isManaged = !!fleet?.metadata?.owner;
|
|
29
35
|
|
|
30
36
|
return (
|
|
@@ -36,41 +42,47 @@ const FleetDetails = () => {
|
|
|
36
42
|
resourceType="Fleets"
|
|
37
43
|
resourceTypeLabel={t('Fleets')}
|
|
38
44
|
actions={
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
(canDelete || canEdit) && (
|
|
46
|
+
<DetailsPageActions>
|
|
47
|
+
<DropdownList>
|
|
48
|
+
{canEdit && (
|
|
49
|
+
<DropdownItem
|
|
50
|
+
isAriaDisabled={isManaged}
|
|
51
|
+
tooltipProps={
|
|
52
|
+
isManaged
|
|
53
|
+
? {
|
|
54
|
+
content: t('Fleets managed by a resource sync cannot be edited'),
|
|
55
|
+
}
|
|
56
|
+
: undefined
|
|
57
|
+
}
|
|
58
|
+
onClick={() => navigate({ route: ROUTE.FLEET_EDIT, postfix: fleetId })}
|
|
59
|
+
>
|
|
60
|
+
{t('Edit fleet')}
|
|
61
|
+
</DropdownItem>
|
|
62
|
+
)}
|
|
63
|
+
{canDelete && (
|
|
64
|
+
<DropdownItem
|
|
65
|
+
title={t('Delete fleet')}
|
|
66
|
+
onClick={() => {
|
|
67
|
+
setIsDeleteModalOpen(true);
|
|
68
|
+
}}
|
|
69
|
+
isAriaDisabled={isManaged}
|
|
70
|
+
tooltipProps={
|
|
71
|
+
isManaged
|
|
72
|
+
? {
|
|
73
|
+
content: t(
|
|
74
|
+
"This fleet is managed by a resource sync and cannot be directly deleted. Either remove this fleet's definition from the resource sync configuration, or delete the resource sync first.",
|
|
75
|
+
),
|
|
76
|
+
}
|
|
77
|
+
: undefined
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
{t('Delete fleet')}
|
|
81
|
+
</DropdownItem>
|
|
82
|
+
)}
|
|
83
|
+
</DropdownList>
|
|
84
|
+
</DetailsPageActions>
|
|
85
|
+
)
|
|
74
86
|
}
|
|
75
87
|
>
|
|
76
88
|
{fleet && (
|
|
@@ -94,4 +106,13 @@ const FleetDetails = () => {
|
|
|
94
106
|
);
|
|
95
107
|
};
|
|
96
108
|
|
|
97
|
-
|
|
109
|
+
const FleetDetailsWithPermissions = () => {
|
|
110
|
+
const [allowed, loading] = useAccessReview(RESOURCE.FLEET, VERB.GET);
|
|
111
|
+
return (
|
|
112
|
+
<PageWithPermissions allowed={allowed} loading={loading}>
|
|
113
|
+
<FleetDetails />
|
|
114
|
+
</PageWithPermissions>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export default FleetDetailsWithPermissions;
|
|
@@ -7,14 +7,16 @@ import {
|
|
|
7
7
|
Stack,
|
|
8
8
|
StackItem,
|
|
9
9
|
} from '@patternfly/react-core';
|
|
10
|
-
import {
|
|
10
|
+
import { Trans } from 'react-i18next';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { ConditionType, ResourceSync, ResourceSyncList } from '@flightctl/types';
|
|
13
13
|
|
|
14
14
|
import { useTranslation } from '../../hooks/useTranslation';
|
|
15
15
|
import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
|
|
16
16
|
import { Link, ROUTE } from '../../hooks/useNavigate';
|
|
17
17
|
import { getLastTransitionTime, getRepositorySyncStatus } from '../../utils/status/repository';
|
|
18
|
+
import { useAccessReview } from '../../hooks/useAccessReview';
|
|
19
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
18
20
|
|
|
19
21
|
// Entries format: <rs0Name>@@<rs0LastSync>,<rs1Name>@@<rs1LastSync>,...
|
|
20
22
|
const RS_DISMISS_STORAGE_KEY = 'FC_DISMISS_SYNCS';
|
|
@@ -39,11 +41,16 @@ const isDismissed = (rs: ResourceSync) => {
|
|
|
39
41
|
return dismissedEntries.includes(rsDismissKey);
|
|
40
42
|
};
|
|
41
43
|
|
|
42
|
-
const hasError = (rs: ResourceSync
|
|
43
|
-
const rsStatus = getRepositorySyncStatus(rs,
|
|
44
|
+
const hasError = (rs: ResourceSync) => {
|
|
45
|
+
const rsStatus = getRepositorySyncStatus(rs, (msg: string) => msg);
|
|
44
46
|
return ['Not parsed', 'Not synced', 'Not accessible'].includes(rsStatus.status);
|
|
45
47
|
};
|
|
46
48
|
|
|
49
|
+
const isPending = (rs: ResourceSync) => {
|
|
50
|
+
const rsStatus = getRepositorySyncStatus(rs, (msg: string) => msg);
|
|
51
|
+
return rsStatus?.status !== ConditionType.ResourceSyncSynced;
|
|
52
|
+
};
|
|
53
|
+
|
|
47
54
|
const ResourceSyncInfoAlert = ({ rs }: { rs: ResourceSync }) => {
|
|
48
55
|
const { t } = useTranslation();
|
|
49
56
|
const name = rs.metadata.name as string;
|
|
@@ -108,54 +115,59 @@ const ResourceSyncErrorAlert = ({ rs, refetch }: { rs: ResourceSync; refetch: Vo
|
|
|
108
115
|
);
|
|
109
116
|
};
|
|
110
117
|
|
|
111
|
-
const
|
|
112
|
-
const
|
|
118
|
+
const getVisibleResourceSyncs = (rsList: ResourceSync[]) => {
|
|
119
|
+
const pendingRs: ResourceSync[] = [];
|
|
120
|
+
const errorRs: ResourceSync[] = [];
|
|
121
|
+
|
|
122
|
+
rsList.forEach((rs) => {
|
|
123
|
+
if (isDismissed(rs)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (hasError(rs)) {
|
|
127
|
+
errorRs.push(rs);
|
|
128
|
+
} else if (isPending(rs)) {
|
|
129
|
+
pendingRs.push(rs);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return { pendingRs, errorRs };
|
|
133
|
+
};
|
|
113
134
|
|
|
114
|
-
|
|
135
|
+
const FleetResourceSyncs = () => {
|
|
136
|
+
const [rsList, , , rsRefetch] = useFetchPeriodically<ResourceSyncList>({
|
|
137
|
+
endpoint: 'resourcesyncs',
|
|
138
|
+
});
|
|
115
139
|
|
|
116
140
|
// TODO Remove the client-side filtering once the API filter is available
|
|
117
|
-
const
|
|
118
|
-
() => [
|
|
119
|
-
...(rsList?.items || []).filter((rs) => {
|
|
120
|
-
if (isDismissed(rs)) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
if (hasError(rs, t)) {
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
return !fleets.some((fleet) => fleet.metadata.owner === `ResourceSync/${rs.metadata.name}`);
|
|
127
|
-
}),
|
|
128
|
-
],
|
|
129
|
-
[fleets, rsList, t],
|
|
130
|
-
);
|
|
141
|
+
const { pendingRs, errorRs } = React.useMemo(() => getVisibleResourceSyncs(rsList?.items || []), [rsList]);
|
|
131
142
|
|
|
132
|
-
if (
|
|
143
|
+
if (pendingRs.length === 0 && errorRs.length === 0) {
|
|
133
144
|
return null;
|
|
134
145
|
}
|
|
135
146
|
return (
|
|
136
147
|
<PageSection variant={PageSectionVariants.light}>
|
|
137
148
|
<Stack hasGutter>
|
|
138
|
-
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<ResourceSyncErrorAlert rs={rs} refetch={rsRefetch} />
|
|
153
|
-
</StackItem>
|
|
154
|
-
);
|
|
155
|
-
})}
|
|
149
|
+
{errorRs.map((rs) => {
|
|
150
|
+
return (
|
|
151
|
+
<StackItem key={rs.metadata.name as string}>
|
|
152
|
+
<ResourceSyncInfoAlert rs={rs} />
|
|
153
|
+
</StackItem>
|
|
154
|
+
);
|
|
155
|
+
})}
|
|
156
|
+
{pendingRs.map((rs) => {
|
|
157
|
+
return (
|
|
158
|
+
<StackItem key={rs.metadata.name as string}>
|
|
159
|
+
<ResourceSyncErrorAlert rs={rs} refetch={rsRefetch} />
|
|
160
|
+
</StackItem>
|
|
161
|
+
);
|
|
162
|
+
})}
|
|
156
163
|
</Stack>
|
|
157
164
|
</PageSection>
|
|
158
165
|
);
|
|
159
166
|
};
|
|
160
167
|
|
|
161
|
-
|
|
168
|
+
const FleetResourceSyncsWithPermissions = () => {
|
|
169
|
+
const [allowed] = useAccessReview(RESOURCE.RESOURCE_SYNC, VERB.LIST);
|
|
170
|
+
return allowed && <FleetResourceSyncs />;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export default FleetResourceSyncsWithPermissions;
|
|
@@ -15,14 +15,16 @@ type FleetRowProps = {
|
|
|
15
15
|
onRowSelect: (fleet: Fleet) => OnSelect;
|
|
16
16
|
isRowSelected: (fleet: Fleet) => boolean;
|
|
17
17
|
onDeleteClick: () => void;
|
|
18
|
+
canDelete: boolean;
|
|
19
|
+
canEdit: boolean;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
|
-
const useFleetActions = (fleetName: string, isManaged: boolean) => {
|
|
22
|
+
const useFleetActions = (fleetName: string, isManaged: boolean, canEdit: boolean) => {
|
|
21
23
|
const actions: IAction[] = [];
|
|
22
24
|
const navigate = useNavigate();
|
|
23
25
|
const { t } = useTranslation();
|
|
24
26
|
|
|
25
|
-
if (isManaged) {
|
|
27
|
+
if (isManaged || !canEdit) {
|
|
26
28
|
actions.push({
|
|
27
29
|
title: t("View fleet's configuration"),
|
|
28
30
|
onClick: () => navigate({ route: ROUTE.FLEET_DETAILS, postfix: fleetName }),
|
|
@@ -36,24 +38,34 @@ const useFleetActions = (fleetName: string, isManaged: boolean) => {
|
|
|
36
38
|
return actions;
|
|
37
39
|
};
|
|
38
40
|
|
|
39
|
-
const FleetRow: React.FC<FleetRowProps> = ({
|
|
41
|
+
const FleetRow: React.FC<FleetRowProps> = ({
|
|
42
|
+
fleet,
|
|
43
|
+
rowIndex,
|
|
44
|
+
onRowSelect,
|
|
45
|
+
isRowSelected,
|
|
46
|
+
onDeleteClick,
|
|
47
|
+
canDelete,
|
|
48
|
+
canEdit,
|
|
49
|
+
}) => {
|
|
40
50
|
const { t } = useTranslation();
|
|
41
51
|
const fleetName = fleet.metadata.name || '';
|
|
42
52
|
|
|
43
53
|
const isManaged = !!fleet.metadata?.owner;
|
|
44
|
-
const actions = useFleetActions(fleetName, isManaged);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const actions = useFleetActions(fleetName, isManaged, canEdit);
|
|
55
|
+
if (canDelete) {
|
|
56
|
+
actions.push({
|
|
57
|
+
title: t('Delete fleet'),
|
|
58
|
+
onClick: onDeleteClick,
|
|
59
|
+
tooltipProps: isManaged
|
|
60
|
+
? {
|
|
61
|
+
content: t(
|
|
62
|
+
"This fleet is managed by a resource sync and cannot be directly deleted. Either remove this fleet's definition from the resource sync configuration, or delete the resource sync first.",
|
|
63
|
+
),
|
|
64
|
+
}
|
|
65
|
+
: undefined,
|
|
66
|
+
isAriaDisabled: isManaged,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
57
69
|
|
|
58
70
|
return (
|
|
59
71
|
<Tr>
|