@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
|
@@ -139,13 +139,6 @@ export const getRepositoryPatches = (values: RepositoryFormValues, repository: R
|
|
|
139
139
|
originalValue: repository.spec.url,
|
|
140
140
|
path: '/spec/url',
|
|
141
141
|
});
|
|
142
|
-
appendJSONPatch({
|
|
143
|
-
patches,
|
|
144
|
-
newValue: values.repoType === RepoSpecType.HTTP ? values.validationSuffix : undefined,
|
|
145
|
-
originalValue:
|
|
146
|
-
repository.spec.type === RepoSpecType.HTTP ? (repository.spec as HttpRepoSpec).validationSuffix : undefined,
|
|
147
|
-
path: '/spec/validationSuffix',
|
|
148
|
-
});
|
|
149
142
|
|
|
150
143
|
if (!values.useAdvancedConfig) {
|
|
151
144
|
if (isHttpRepoSpec(repository.spec)) {
|
|
@@ -153,6 +146,10 @@ export const getRepositoryPatches = (values: RepositoryFormValues, repository: R
|
|
|
153
146
|
op: 'remove',
|
|
154
147
|
path: '/spec/httpConfig',
|
|
155
148
|
});
|
|
149
|
+
patches.push({
|
|
150
|
+
op: 'remove',
|
|
151
|
+
path: '/spec/validationSuffix',
|
|
152
|
+
});
|
|
156
153
|
}
|
|
157
154
|
if (isSshRepoSpec(repository.spec)) {
|
|
158
155
|
patches.push({
|
|
@@ -199,7 +196,20 @@ export const getRepositoryPatches = (values: RepositoryFormValues, repository: R
|
|
|
199
196
|
path: '/spec/httpConfig',
|
|
200
197
|
value,
|
|
201
198
|
});
|
|
199
|
+
appendJSONPatch({
|
|
200
|
+
patches,
|
|
201
|
+
newValue: values.validationSuffix,
|
|
202
|
+
originalValue: undefined,
|
|
203
|
+
path: '/spec/validationSuffix',
|
|
204
|
+
});
|
|
202
205
|
} else {
|
|
206
|
+
appendJSONPatch({
|
|
207
|
+
patches,
|
|
208
|
+
newValue: values.repoType === RepoSpecType.HTTP ? values.validationSuffix : undefined,
|
|
209
|
+
originalValue: repository.spec.validationSuffix,
|
|
210
|
+
path: '/spec/validationSuffix',
|
|
211
|
+
});
|
|
212
|
+
|
|
203
213
|
appendJSONPatch({
|
|
204
214
|
patches,
|
|
205
215
|
newValue: values.httpConfig?.skipServerVerification,
|
|
@@ -303,6 +313,12 @@ export const getRepositoryPatches = (values: RepositoryFormValues, repository: R
|
|
|
303
313
|
op: 'remove',
|
|
304
314
|
path: '/spec/httpConfig',
|
|
305
315
|
});
|
|
316
|
+
if (repository.spec.validationSuffix) {
|
|
317
|
+
patches.push({
|
|
318
|
+
op: 'remove',
|
|
319
|
+
path: '/spec/validationSuffix',
|
|
320
|
+
});
|
|
321
|
+
}
|
|
306
322
|
}
|
|
307
323
|
if (!isSshRepoSpec(repository.spec)) {
|
|
308
324
|
const value: SshConfig = {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
import { Alert, Button, Modal, Spinner, Stack, StackItem, Text, TextContent } from '@patternfly/react-core';
|
|
4
|
+
import { Trans } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
import { ResourceSyncList } from '@flightctl/types';
|
|
4
7
|
|
|
5
8
|
import { getErrorMessage } from '../../../utils/error';
|
|
9
|
+
import { commonQueries } from '../../../utils/query';
|
|
6
10
|
import { useFetch } from '../../../hooks/useFetch';
|
|
7
|
-
import { ResourceSyncList } from '@flightctl/types';
|
|
8
|
-
import { Trans } from 'react-i18next';
|
|
9
11
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
10
12
|
|
|
11
13
|
type DeleteRepositoryModalProps = {
|
|
@@ -46,7 +48,7 @@ const DeleteRepositoryModal = ({ repositoryId, onClose, onDeleteSuccess }: Delet
|
|
|
46
48
|
|
|
47
49
|
const loadRS = React.useCallback(async () => {
|
|
48
50
|
try {
|
|
49
|
-
const resourceSyncs = await get<ResourceSyncList>(
|
|
51
|
+
const resourceSyncs = await get<ResourceSyncList>(commonQueries.getResourceSyncsByRepo(repositoryId));
|
|
50
52
|
setResourceSyncIds(resourceSyncs.items.map((rs) => rs.metadata.name || ''));
|
|
51
53
|
setRsError(undefined);
|
|
52
54
|
} catch (e) {
|
|
@@ -12,6 +12,9 @@ import DeleteRepositoryModal from './DeleteRepositoryModal';
|
|
|
12
12
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
13
13
|
import { ROUTE, useNavigate } from '../../../hooks/useNavigate';
|
|
14
14
|
import { useAppContext } from '../../../hooks/useAppContext';
|
|
15
|
+
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
16
|
+
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
17
|
+
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
15
18
|
|
|
16
19
|
const RepositoryDetails = () => {
|
|
17
20
|
const { t } = useTranslation();
|
|
@@ -30,6 +33,10 @@ const RepositoryDetails = () => {
|
|
|
30
33
|
navigate(ROUTE.REPOSITORIES);
|
|
31
34
|
};
|
|
32
35
|
|
|
36
|
+
const [canDelete] = useAccessReview(RESOURCE.REPOSITORY, VERB.DELETE);
|
|
37
|
+
const [canEdit] = useAccessReview(RESOURCE.REPOSITORY, VERB.PATCH);
|
|
38
|
+
const [canListRS] = useAccessReview(RESOURCE.RESOURCE_SYNC, VERB.LIST);
|
|
39
|
+
|
|
33
40
|
return (
|
|
34
41
|
<DetailsPage
|
|
35
42
|
loading={isLoading}
|
|
@@ -40,14 +47,20 @@ const RepositoryDetails = () => {
|
|
|
40
47
|
resourceType="Repositories"
|
|
41
48
|
resourceTypeLabel={t('Repositories')}
|
|
42
49
|
actions={
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
(canDelete || canEdit) && (
|
|
51
|
+
<DetailsPageActions>
|
|
52
|
+
<DropdownList>
|
|
53
|
+
{canEdit && (
|
|
54
|
+
<DropdownItem onClick={() => navigate({ route: ROUTE.REPO_EDIT, postfix: repositoryId })}>
|
|
55
|
+
{t('Edit repository')}
|
|
56
|
+
</DropdownItem>
|
|
57
|
+
)}
|
|
58
|
+
{canDelete && (
|
|
59
|
+
<DropdownItem onClick={() => setIsDeleteModalOpen(true)}>{t('Delete repository')}</DropdownItem>
|
|
60
|
+
)}
|
|
61
|
+
</DropdownList>
|
|
62
|
+
</DetailsPageActions>
|
|
63
|
+
)
|
|
51
64
|
}
|
|
52
65
|
>
|
|
53
66
|
{repoDetails && (
|
|
@@ -56,7 +69,7 @@ const RepositoryDetails = () => {
|
|
|
56
69
|
<GridItem>
|
|
57
70
|
<RepositoryGeneralDetailsCard repoDetails={repoDetails} />
|
|
58
71
|
</GridItem>
|
|
59
|
-
{repoDetails.spec.type !== RepoSpecType.HTTP && (
|
|
72
|
+
{canListRS && repoDetails.spec.type !== RepoSpecType.HTTP && (
|
|
60
73
|
<GridItem>
|
|
61
74
|
<RepositoryResourceSyncsCard repositoryId={repositoryId} />
|
|
62
75
|
</GridItem>
|
|
@@ -75,4 +88,13 @@ const RepositoryDetails = () => {
|
|
|
75
88
|
);
|
|
76
89
|
};
|
|
77
90
|
|
|
78
|
-
|
|
91
|
+
const RepositoryDetailsWithPermissions = () => {
|
|
92
|
+
const [allowed, loading] = useAccessReview(RESOURCE.REPOSITORY, VERB.GET);
|
|
93
|
+
return (
|
|
94
|
+
<PageWithPermissions allowed={allowed} loading={loading}>
|
|
95
|
+
<RepositoryDetails />
|
|
96
|
+
</PageWithPermissions>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default RepositoryDetailsWithPermissions;
|
|
@@ -11,18 +11,14 @@ import {
|
|
|
11
11
|
ToolbarGroup,
|
|
12
12
|
ToolbarItem,
|
|
13
13
|
} from '@patternfly/react-core';
|
|
14
|
-
import { ActionsColumn, Tbody, Td, Tr } from '@patternfly/react-table';
|
|
14
|
+
import { ActionsColumn, IAction, OnSelect, Tbody, Td, Tr } from '@patternfly/react-table';
|
|
15
15
|
import { RepositoryIcon } from '@patternfly/react-icons/dist/js/icons/repository-icon';
|
|
16
16
|
import { TFunction } from 'i18next';
|
|
17
17
|
|
|
18
|
-
import { RepoSpecType, Repository
|
|
19
|
-
import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
|
|
18
|
+
import { RepoSpecType, Repository } from '@flightctl/types';
|
|
20
19
|
import ListPageBody from '../ListPage/ListPageBody';
|
|
21
20
|
import ListPage from '../ListPage/ListPage';
|
|
22
21
|
import { getLastTransitionTimeText, getRepositorySyncStatus } from '../../utils/status/repository';
|
|
23
|
-
import { useTableSort } from '../../hooks/useTableSort';
|
|
24
|
-
import { sortByName } from '../../utils/sort/generic';
|
|
25
|
-
import * as repoSort from '../../utils/sort/repository';
|
|
26
22
|
import { useTableTextSearch } from '../../hooks/useTableTextSearch';
|
|
27
23
|
import DeleteRepositoryModal from './RepositoryDetails/DeleteRepositoryModal';
|
|
28
24
|
import TableTextSearch from '../Table/TableTextSearch';
|
|
@@ -35,15 +31,23 @@ import { useTranslation } from '../../hooks/useTranslation';
|
|
|
35
31
|
import { ROUTE, useNavigate } from '../../hooks/useNavigate';
|
|
36
32
|
import ResourceLink from '../common/ResourceLink';
|
|
37
33
|
import RepositoryStatus from '../Status/RepositoryStatus';
|
|
34
|
+
import PageWithPermissions from '../common/PageWithPermissions';
|
|
35
|
+
import { RESOURCE, VERB } from '../../types/rbac';
|
|
36
|
+
import { useAccessReview } from '../../hooks/useAccessReview';
|
|
37
|
+
import { useRepositories } from './useRepositories';
|
|
38
|
+
import TablePagination from '../Table/TablePagination';
|
|
38
39
|
|
|
39
40
|
const CreateRepositoryButton = ({ buttonText }: { buttonText?: string }) => {
|
|
40
41
|
const { t } = useTranslation();
|
|
41
42
|
const navigate = useNavigate();
|
|
43
|
+
const [canCreate] = useAccessReview(RESOURCE.REPOSITORY, VERB.CREATE);
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
canCreate && (
|
|
47
|
+
<Button variant="primary" onClick={() => navigate(ROUTE.REPO_CREATE)}>
|
|
48
|
+
{buttonText || t('Create a repository')}
|
|
49
|
+
</Button>
|
|
50
|
+
)
|
|
47
51
|
);
|
|
48
52
|
};
|
|
49
53
|
|
|
@@ -71,47 +75,103 @@ const RepositoryEmptyState = () => {
|
|
|
71
75
|
const getColumns = (t: TFunction): TableColumn<Repository>[] => [
|
|
72
76
|
{
|
|
73
77
|
name: t('Name'),
|
|
74
|
-
onSort: sortByName,
|
|
75
78
|
},
|
|
76
79
|
{
|
|
77
80
|
name: t('Type'),
|
|
78
|
-
onSort: repoSort.sortRepositoriesByType,
|
|
79
81
|
},
|
|
80
82
|
{
|
|
81
83
|
name: t('Url'),
|
|
82
|
-
onSort: repoSort.sortRepositoriesByUrl,
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
name: t('Sync status'),
|
|
86
|
-
onSort: repoSort.sortRepositoriesBySyncStatus,
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
name: t('Last transition'),
|
|
90
|
-
onSort: repoSort.sortRepositoriesByLastTransition,
|
|
91
90
|
},
|
|
92
91
|
];
|
|
93
92
|
|
|
94
93
|
const getSearchText = (repo: Repository) => [repo.metadata.name];
|
|
95
94
|
|
|
95
|
+
const RepositoryTableRow = ({
|
|
96
|
+
repository,
|
|
97
|
+
canDelete,
|
|
98
|
+
canEdit,
|
|
99
|
+
rowIndex,
|
|
100
|
+
setDeleteModalRepoId,
|
|
101
|
+
onRowSelect,
|
|
102
|
+
isRowSelected,
|
|
103
|
+
}: {
|
|
104
|
+
repository: Repository;
|
|
105
|
+
canDelete: boolean;
|
|
106
|
+
canEdit: boolean;
|
|
107
|
+
rowIndex: number;
|
|
108
|
+
setDeleteModalRepoId: (repoId?: string) => void;
|
|
109
|
+
onRowSelect: (repository: Repository) => OnSelect;
|
|
110
|
+
isRowSelected: (repository: Repository) => boolean;
|
|
111
|
+
}) => {
|
|
112
|
+
const { t } = useTranslation();
|
|
113
|
+
const navigate = useNavigate();
|
|
114
|
+
|
|
115
|
+
const actions: IAction[] = [];
|
|
116
|
+
if (canEdit) {
|
|
117
|
+
actions.push({
|
|
118
|
+
title: t('Edit repository'),
|
|
119
|
+
onClick: () => navigate({ route: ROUTE.REPO_EDIT, postfix: repository.metadata.name }),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (canDelete) {
|
|
123
|
+
actions.push({
|
|
124
|
+
title: t('Delete repository'),
|
|
125
|
+
onClick: () => setDeleteModalRepoId(repository.metadata.name),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return (
|
|
129
|
+
<Tr>
|
|
130
|
+
<Td
|
|
131
|
+
select={{
|
|
132
|
+
rowIndex,
|
|
133
|
+
onSelect: onRowSelect(repository),
|
|
134
|
+
isSelected: isRowSelected(repository),
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
<Td dataLabel={t('Name')}>
|
|
138
|
+
<ResourceLink id={repository.metadata.name as string} routeLink={ROUTE.REPO_DETAILS} />
|
|
139
|
+
</Td>
|
|
140
|
+
<Td dataLabel={t('Type')}>
|
|
141
|
+
{repository.spec.type === RepoSpecType.HTTP ? t('HTTP service') : t('Git repository')}
|
|
142
|
+
</Td>
|
|
143
|
+
<Td dataLabel={t('Url')}>{repository.spec.url || '-'}</Td>
|
|
144
|
+
<Td dataLabel={t('Sync status')}>
|
|
145
|
+
<RepositoryStatus statusInfo={getRepositorySyncStatus(repository)} />
|
|
146
|
+
</Td>
|
|
147
|
+
<Td dataLabel={t('Last transition')}>{getLastTransitionTimeText(repository, t).text}</Td>
|
|
148
|
+
{!!actions.length && (
|
|
149
|
+
<Td isActionCell>
|
|
150
|
+
<ActionsColumn items={actions} />
|
|
151
|
+
</Td>
|
|
152
|
+
)}
|
|
153
|
+
</Tr>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
96
157
|
const RepositoryTable = () => {
|
|
97
158
|
const { t } = useTranslation();
|
|
98
|
-
const [
|
|
159
|
+
const [repositories, loading, error, isUpdating, refetch, pagination] = useRepositories();
|
|
99
160
|
const [deleteModalRepoId, setDeleteModalRepoId] = React.useState<string>();
|
|
100
161
|
const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
|
|
101
162
|
|
|
102
|
-
const navigate = useNavigate();
|
|
103
|
-
|
|
104
163
|
const onDeleteSuccess = () => {
|
|
105
164
|
setDeleteModalRepoId(undefined);
|
|
106
165
|
refetch();
|
|
107
166
|
};
|
|
108
167
|
|
|
109
|
-
const { search, setSearch, filteredData } = useTableTextSearch(
|
|
110
|
-
|
|
168
|
+
const { search, setSearch, filteredData } = useTableTextSearch(repositories, getSearchText);
|
|
111
169
|
const columns = React.useMemo(() => getColumns(t), [t]);
|
|
112
|
-
const { getSortParams, sortedData } = useTableSort(filteredData, columns);
|
|
113
170
|
|
|
114
|
-
const {
|
|
171
|
+
const { hasSelectedRows, isAllSelected, isRowSelected, setAllSelected, onRowSelect } = useTableSelect<Repository>();
|
|
172
|
+
|
|
173
|
+
const [canDelete] = useAccessReview(RESOURCE.REPOSITORY, VERB.DELETE);
|
|
174
|
+
const [canEdit] = useAccessReview(RESOURCE.REPOSITORY, VERB.PATCH);
|
|
115
175
|
|
|
116
176
|
return (
|
|
117
177
|
<ListPageBody error={error} loading={loading}>
|
|
@@ -125,65 +185,44 @@ const RepositoryTable = () => {
|
|
|
125
185
|
<ToolbarItem>
|
|
126
186
|
<CreateRepositoryButton buttonText={t('Create repository')} />
|
|
127
187
|
</ToolbarItem>
|
|
128
|
-
|
|
129
|
-
<
|
|
130
|
-
<
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
188
|
+
{canDelete && (
|
|
189
|
+
<ToolbarItem>
|
|
190
|
+
<TableActions isDisabled={!hasSelectedRows}>
|
|
191
|
+
<DropdownList>
|
|
192
|
+
<SelectOption onClick={() => setIsMassDeleteModalOpen(true)}>{t('Delete')}</SelectOption>
|
|
193
|
+
</DropdownList>
|
|
194
|
+
</TableActions>
|
|
195
|
+
</ToolbarItem>
|
|
196
|
+
)}
|
|
135
197
|
</ToolbarContent>
|
|
136
198
|
</Toolbar>
|
|
137
199
|
<Table
|
|
138
200
|
aria-label={t('Repositories table')}
|
|
139
|
-
loading={
|
|
201
|
+
loading={isUpdating}
|
|
140
202
|
emptyFilters={filteredData.length === 0}
|
|
141
|
-
emptyData={
|
|
203
|
+
emptyData={repositories.length === 0}
|
|
142
204
|
isAllSelected={isAllSelected}
|
|
143
205
|
onSelectAll={setAllSelected}
|
|
144
206
|
columns={columns}
|
|
145
|
-
getSortParams={getSortParams}
|
|
146
207
|
>
|
|
147
208
|
<Tbody>
|
|
148
|
-
{
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
</Td>
|
|
160
|
-
<Td dataLabel={t('Type')}>
|
|
161
|
-
{repository.spec.type === RepoSpecType.HTTP ? t('HTTP service') : t('Git repository')}
|
|
162
|
-
</Td>
|
|
163
|
-
<Td dataLabel={t('Url')}>{repository.spec.url || '-'}</Td>
|
|
164
|
-
<Td dataLabel={t('Sync status')}>
|
|
165
|
-
<RepositoryStatus statusInfo={getRepositorySyncStatus(repository)} />
|
|
166
|
-
</Td>
|
|
167
|
-
<Td dataLabel={t('Last transition')}>{getLastTransitionTimeText(repository, t).text}</Td>
|
|
168
|
-
<Td isActionCell>
|
|
169
|
-
<ActionsColumn
|
|
170
|
-
items={[
|
|
171
|
-
{
|
|
172
|
-
title: t('Edit repository'),
|
|
173
|
-
onClick: () => navigate({ route: ROUTE.REPO_EDIT, postfix: repository.metadata.name }),
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
title: t('Delete repository'),
|
|
177
|
-
onClick: () => setDeleteModalRepoId(repository.metadata.name),
|
|
178
|
-
},
|
|
179
|
-
]}
|
|
180
|
-
/>
|
|
181
|
-
</Td>
|
|
182
|
-
</Tr>
|
|
209
|
+
{filteredData.map((repository, rowIndex) => (
|
|
210
|
+
<RepositoryTableRow
|
|
211
|
+
key={repository.metadata.name}
|
|
212
|
+
repository={repository}
|
|
213
|
+
rowIndex={rowIndex}
|
|
214
|
+
canDelete={canDelete}
|
|
215
|
+
canEdit={canEdit}
|
|
216
|
+
setDeleteModalRepoId={setDeleteModalRepoId}
|
|
217
|
+
isRowSelected={isRowSelected}
|
|
218
|
+
onRowSelect={onRowSelect}
|
|
219
|
+
/>
|
|
183
220
|
))}
|
|
184
221
|
</Tbody>
|
|
185
222
|
</Table>
|
|
186
|
-
{
|
|
223
|
+
<TablePagination isUpdating={isUpdating} pagination={pagination} />
|
|
224
|
+
|
|
225
|
+
{repositories.length === 0 && <RepositoryEmptyState />}
|
|
187
226
|
{!!deleteModalRepoId && (
|
|
188
227
|
<DeleteRepositoryModal
|
|
189
228
|
onClose={() => setDeleteModalRepoId(undefined)}
|
|
@@ -198,7 +237,7 @@ const RepositoryTable = () => {
|
|
|
198
237
|
setIsMassDeleteModalOpen(false);
|
|
199
238
|
refetch();
|
|
200
239
|
}}
|
|
201
|
-
repositories={
|
|
240
|
+
repositories={filteredData.filter(isRowSelected)}
|
|
202
241
|
/>
|
|
203
242
|
)}
|
|
204
243
|
</ListPageBody>
|
|
@@ -207,10 +246,13 @@ const RepositoryTable = () => {
|
|
|
207
246
|
|
|
208
247
|
const RepositoryList = () => {
|
|
209
248
|
const { t } = useTranslation();
|
|
249
|
+
const [allowed, loading] = useAccessReview(RESOURCE.REPOSITORY, VERB.LIST);
|
|
210
250
|
return (
|
|
211
|
-
<
|
|
212
|
-
<
|
|
213
|
-
|
|
251
|
+
<PageWithPermissions allowed={allowed} loading={loading}>
|
|
252
|
+
<ListPage title={t('Repositories')}>
|
|
253
|
+
<RepositoryTable />
|
|
254
|
+
</ListPage>
|
|
255
|
+
</PageWithPermissions>
|
|
214
256
|
);
|
|
215
257
|
};
|
|
216
258
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useDebounce } from 'use-debounce';
|
|
3
|
+
|
|
4
|
+
import { Repository, RepositoryList } from '@flightctl/types';
|
|
5
|
+
|
|
6
|
+
import { useFetchPeriodically } from '../../hooks/useFetchPeriodically';
|
|
7
|
+
import { PaginationDetails, useTablePagination } from '../../hooks/useTablePagination';
|
|
8
|
+
|
|
9
|
+
import { PAGE_SIZE } from '../../constants';
|
|
10
|
+
|
|
11
|
+
type RepositoriesEndpointArgs = {
|
|
12
|
+
nextContinue?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const getRepositoriesEndpoint = ({ nextContinue }: RepositoriesEndpointArgs) => {
|
|
16
|
+
const params = new URLSearchParams();
|
|
17
|
+
if (nextContinue !== undefined) {
|
|
18
|
+
params.set('limit', `${PAGE_SIZE}`);
|
|
19
|
+
}
|
|
20
|
+
if (nextContinue) {
|
|
21
|
+
params.set('continue', nextContinue);
|
|
22
|
+
}
|
|
23
|
+
return `repositories?${params.toString()}`;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const useRepositoriesEndpoint = (args: RepositoriesEndpointArgs): [string, boolean] => {
|
|
27
|
+
const endpoint = getRepositoriesEndpoint(args);
|
|
28
|
+
const [repositoriesEndpointDebounced] = useDebounce(endpoint, 1000);
|
|
29
|
+
return [repositoriesEndpointDebounced, endpoint !== repositoriesEndpointDebounced];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const useRepositories = (): [
|
|
33
|
+
Repository[],
|
|
34
|
+
boolean,
|
|
35
|
+
unknown,
|
|
36
|
+
boolean,
|
|
37
|
+
VoidFunction,
|
|
38
|
+
Pick<PaginationDetails, 'currentPage' | 'setCurrentPage' | 'itemCount'>,
|
|
39
|
+
] => {
|
|
40
|
+
const { currentPage, setCurrentPage, itemCount, nextContinue, onPageFetched } = useTablePagination();
|
|
41
|
+
const [repoEndpoint, isDebouncing] = useRepositoriesEndpoint({ nextContinue });
|
|
42
|
+
|
|
43
|
+
const [repoList, isLoading, error, refetch] = useFetchPeriodically<RepositoryList>(
|
|
44
|
+
{
|
|
45
|
+
endpoint: repoEndpoint,
|
|
46
|
+
},
|
|
47
|
+
onPageFetched,
|
|
48
|
+
);
|
|
49
|
+
const pagination = React.useMemo(
|
|
50
|
+
() => ({
|
|
51
|
+
currentPage,
|
|
52
|
+
setCurrentPage,
|
|
53
|
+
itemCount,
|
|
54
|
+
}),
|
|
55
|
+
[currentPage, setCurrentPage, itemCount],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return [repoList?.items || [], isLoading, error, isLoading || isDebouncing, refetch, pagination];
|
|
59
|
+
};
|