@flightctl/ui-components 0.0.5 → 0.4.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts +8 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +91 -9
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.d.ts.map +1 -1
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js +15 -51
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +10 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +65 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts +5 -2
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +19 -10
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts +3 -4
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +6 -18
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts +4 -3
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +13 -4
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js +4 -14
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +2 -0
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js +14 -6
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts +2 -5
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js +8 -8
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts +3 -6
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +91 -17
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +10 -6
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +46 -42
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/types.d.ts +1 -10
- package/dist/src/components/Device/DevicesPage/types.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/types.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts +2 -0
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.js +10 -3
- package/dist/src/components/Device/DevicesPage/useDeviceBackendFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts +8 -3
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js +26 -47
- package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts +2 -2
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +19 -4
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +7 -2
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +99 -7
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts +5 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.js → ApplicationTemplates.js} +31 -24
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +9 -10
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts +2 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -6
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.js → ConfigurationTemplates.js} +42 -28
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +53 -12
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +7 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js +13 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +38 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts +3 -0
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.js +5 -2
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
- package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.d.ts → SystemdUnitsModal/SystemdUnitsModal.d.ts} +6 -6
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -0
- package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.js → SystemdUnitsModal/SystemdUnitsModal.js} +28 -15
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +15 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js +57 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +14 -4
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +9 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +97 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +15 -11
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
- package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.d.ts +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.d.ts.map +1 -0
- package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.js +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.css +10 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.d.ts +5 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.js +22 -0
- package/dist/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +9 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +42 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts +2 -2
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +19 -2
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +2 -4
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +6 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +61 -35
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts +2 -2
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js +16 -6
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js +7 -7
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts +2 -5
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.js +38 -24
- package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
- package/dist/src/components/Fleet/FleetRow.d.ts +2 -0
- package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetRow.js +16 -14
- package/dist/src/components/Fleet/FleetRow.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.d.ts +2 -2
- package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +37 -33
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts +2 -2
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +11 -2
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +5 -2
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
- package/dist/src/components/Fleet/useFleets.d.ts +26 -0
- package/dist/src/components/Fleet/useFleets.d.ts.map +1 -0
- package/dist/src/components/Fleet/useFleets.js +71 -0
- package/dist/src/components/Fleet/useFleets.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +6 -14
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts +0 -3
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +2 -2
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js +5 -9
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Overview.js +11 -5
- package/dist/src/components/OverviewPage/Overview.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts +2 -2
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js +15 -6
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +4 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.js +22 -6
- package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js +3 -2
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts +2 -2
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +16 -5
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
- package/dist/src/components/Repository/RepositoryList.d.ts +0 -1
- package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryList.js +55 -46
- package/dist/src/components/Repository/RepositoryList.js.map +1 -1
- package/dist/src/components/Repository/useRepositories.d.ts +16 -0
- package/dist/src/components/Repository/useRepositories.d.ts.map +1 -0
- package/dist/src/components/Repository/useRepositories.js +40 -0
- package/dist/src/components/Repository/useRepositories.js.map +1 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +21 -23
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Table/Table.d.ts +12 -3
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/Table.js +4 -4
- package/dist/src/components/Table/Table.js.map +1 -1
- package/dist/src/components/Table/TablePagination.d.ts +8 -0
- package/dist/src/components/Table/TablePagination.d.ts.map +1 -0
- package/dist/src/components/Table/TablePagination.js +38 -0
- package/dist/src/components/Table/TablePagination.js.map +1 -0
- package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
- package/dist/src/components/Terminal/Terminal.js +1 -0
- package/dist/src/components/Terminal/Terminal.js.map +1 -1
- package/dist/src/components/charts/DonutChart.css +5 -0
- package/dist/src/components/charts/DonutChart.js +1 -1
- package/dist/src/components/charts/DonutChart.js.map +1 -1
- package/dist/src/components/common/AccessDenied.d.ts +4 -0
- package/dist/src/components/common/AccessDenied.d.ts.map +1 -0
- package/dist/src/components/common/AccessDenied.js +15 -0
- package/dist/src/components/common/AccessDenied.js.map +1 -0
- package/dist/src/components/common/ButtonWithPermissions.d.ts +8 -0
- package/dist/src/components/common/ButtonWithPermissions.d.ts.map +1 -0
- package/dist/src/components/common/ButtonWithPermissions.js +12 -0
- package/dist/src/components/common/ButtonWithPermissions.js.map +1 -0
- package/dist/src/components/common/LearnMoreLink.d.ts +7 -0
- package/dist/src/components/common/LearnMoreLink.d.ts.map +1 -0
- package/dist/src/components/common/LearnMoreLink.js +13 -0
- package/dist/src/components/common/LearnMoreLink.js.map +1 -0
- package/dist/src/components/common/LeaveFormConfirmation.js +1 -1
- package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -1
- package/dist/src/components/common/PageWithPermissions.d.ts +7 -0
- package/dist/src/components/common/PageWithPermissions.d.ts.map +1 -0
- package/dist/src/components/common/PageWithPermissions.js +17 -0
- package/dist/src/components/common/PageWithPermissions.js.map +1 -0
- package/dist/src/components/form/FilterSelect.d.ts +2 -4
- package/dist/src/components/form/FilterSelect.d.ts.map +1 -1
- package/dist/src/components/form/FilterSelect.js.map +1 -1
- package/dist/src/components/form/FlightCtlForm.css +3 -0
- package/dist/src/components/form/FlightCtlForm.d.ts +1 -0
- package/dist/src/components/form/FlightCtlForm.d.ts.map +1 -1
- package/dist/src/components/form/FlightCtlForm.js +2 -1
- package/dist/src/components/form/FlightCtlForm.js.map +1 -1
- package/dist/src/components/form/FormSelect.d.ts +1 -0
- package/dist/src/components/form/FormSelect.d.ts.map +1 -1
- package/dist/src/components/form/FormSelect.js +14 -2
- package/dist/src/components/form/FormSelect.js.map +1 -1
- package/dist/src/components/form/LabelsField.d.ts +2 -1
- package/dist/src/components/form/LabelsField.d.ts.map +1 -1
- package/dist/src/components/form/LabelsField.js +6 -6
- package/dist/src/components/form/LabelsField.js.map +1 -1
- package/dist/src/components/form/validations.d.ts +13 -2
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +39 -24
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +2 -5
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +2 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +4 -4
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +2 -3
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +6 -5
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
- package/dist/src/constants.d.ts +2 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +3 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/useAccessReview.d.ts +4 -0
- package/dist/src/hooks/useAccessReview.d.ts.map +1 -0
- package/dist/src/hooks/useAccessReview.js +33 -0
- package/dist/src/hooks/useAccessReview.js.map +1 -0
- package/dist/src/hooks/useAppContext.d.ts +8 -7
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useAppContext.js +2 -2
- package/dist/src/hooks/useAppContext.js.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +4 -2
- package/dist/src/hooks/useFetch.d.ts.map +1 -1
- package/dist/src/hooks/useFetchPeriodically.d.ts +1 -1
- package/dist/src/hooks/useFetchPeriodically.d.ts.map +1 -1
- package/dist/src/hooks/useFetchPeriodically.js +4 -1
- package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
- package/dist/src/hooks/useFleetImportAccessReview.d.ts +3 -0
- package/dist/src/hooks/useFleetImportAccessReview.d.ts.map +1 -0
- package/dist/src/hooks/useFleetImportAccessReview.js +12 -0
- package/dist/src/hooks/useFleetImportAccessReview.js.map +1 -0
- package/dist/src/hooks/useNavigate.d.ts +3 -3
- package/dist/src/hooks/useNavigate.d.ts.map +1 -1
- package/dist/src/hooks/useNavigate.js +3 -3
- package/dist/src/hooks/useNavigate.js.map +1 -1
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts +2 -0
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.d.ts.map +1 -0
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.js +13 -0
- package/dist/src/hooks/usePendingEnrollmentRequestsCount.js.map +1 -0
- package/dist/src/hooks/useTablePagination.d.ts +10 -0
- package/dist/src/hooks/useTablePagination.d.ts.map +1 -0
- package/dist/src/hooks/useTablePagination.js +33 -0
- package/dist/src/hooks/useTablePagination.js.map +1 -0
- package/dist/src/hooks/useWebSocket.d.ts +2 -2
- package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/src/hooks/useWebSocket.js.map +1 -1
- package/dist/src/links.d.ts +3 -0
- package/dist/src/links.d.ts.map +1 -0
- package/dist/src/links.js +6 -0
- package/dist/src/links.js.map +1 -0
- package/dist/src/types/rbac.d.ts +18 -0
- package/dist/src/types/rbac.d.ts.map +1 -0
- package/dist/src/types/rbac.js +23 -0
- package/dist/src/types/rbac.js.map +1 -0
- package/dist/src/utils/api.d.ts +3 -3
- package/dist/src/utils/api.d.ts.map +1 -1
- package/dist/src/utils/api.js.map +1 -1
- package/dist/src/utils/labels.d.ts +1 -1
- package/dist/src/utils/labels.d.ts.map +1 -1
- package/dist/src/utils/labels.js +4 -8
- package/dist/src/utils/labels.js.map +1 -1
- package/dist/src/utils/query.d.ts +15 -0
- package/dist/src/utils/query.d.ts.map +1 -0
- package/dist/src/utils/query.js +64 -0
- package/dist/src/utils/query.js.map +1 -0
- package/dist/src/utils/search.d.ts +1 -0
- package/dist/src/utils/search.d.ts.map +1 -1
- package/dist/src/utils/search.js +7 -7
- package/dist/src/utils/search.js.map +1 -1
- package/dist/src/utils/status/devices.d.ts +2 -1
- package/dist/src/utils/status/devices.d.ts.map +1 -1
- package/dist/src/utils/status/devices.js +1 -0
- package/dist/src/utils/status/devices.js.map +1 -1
- package/package.json +10 -10
- package/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +150 -13
- package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +31 -132
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +102 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +33 -16
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +8 -38
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +21 -4
- package/src/components/Device/DevicesPage/DeviceFilterSelect.tsx +13 -34
- package/src/components/Device/DevicesPage/DeviceTableRow.tsx +21 -9
- package/src/components/Device/DevicesPage/DeviceTableToolbar.tsx +13 -20
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +128 -48
- package/src/components/Device/DevicesPage/DevicesPage.tsx +86 -66
- package/src/components/Device/DevicesPage/types.ts +1 -13
- package/src/components/Device/DevicesPage/useDeviceBackendFilters.ts +14 -3
- package/src/components/Device/DevicesPage/useDevices.ts +49 -57
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +24 -4
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +156 -47
- package/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.tsx → ApplicationTemplates.tsx} +89 -53
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +22 -26
- package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +17 -12
- package/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.tsx → ConfigurationTemplates.tsx} +110 -52
- package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +108 -11
- package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +19 -0
- package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +75 -0
- package/src/components/Device/EditDeviceWizard/types.ts +3 -0
- package/src/components/Device/EditDeviceWizard/utils.ts +14 -4
- package/src/components/Device/{MatchPatternsModal/MatchPatternsModal.tsx → SystemdUnitsModal/SystemdUnitsModal.tsx} +36 -19
- package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +114 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +28 -9
- package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +167 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +28 -17
- package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.tsx +3 -2
- package/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.css +10 -0
- package/src/components/EnrollmentRequest/PendingEnrollmentRequestsBadge.tsx +27 -0
- package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +63 -0
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +28 -2
- package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +2 -5
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +7 -0
- package/src/components/Fleet/CreateFleet/utils.ts +101 -49
- package/src/components/Fleet/FleetDetails/FleetDetails.tsx +57 -36
- package/src/components/Fleet/FleetDetails/FleetDevices.tsx +12 -18
- package/src/components/Fleet/FleetResourceSyncs.tsx +53 -41
- package/src/components/Fleet/FleetRow.tsx +28 -16
- package/src/components/Fleet/FleetsPage.tsx +70 -49
- package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +16 -3
- package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +25 -19
- package/src/components/Fleet/useFleets.ts +104 -0
- package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +6 -18
- package/src/components/OverviewPage/Cards/Status/StatusCardFilters.tsx +0 -7
- package/src/components/OverviewPage/Cards/ToDo/ToDoCard.tsx +6 -10
- package/src/components/OverviewPage/Overview.tsx +20 -8
- package/src/components/Repository/CreateRepository/CreateRepository.tsx +25 -9
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +5 -2
- package/src/components/Repository/CreateRepository/utils.ts +23 -7
- package/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.tsx +5 -3
- package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +32 -10
- package/src/components/Repository/RepositoryList.tsx +113 -70
- package/src/components/Repository/useRepositories.ts +59 -0
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +42 -40
- package/src/components/Table/Table.tsx +22 -9
- package/src/components/Table/TablePagination.tsx +74 -0
- package/src/components/Terminal/Terminal.tsx +1 -0
- package/src/components/charts/DonutChart.css +5 -0
- package/src/components/charts/DonutChart.tsx +1 -1
- package/src/components/common/AccessDenied.tsx +17 -0
- package/src/components/common/ButtonWithPermissions.tsx +14 -0
- package/src/components/common/LearnMoreLink.tsx +26 -0
- package/src/components/common/PageWithPermissions.tsx +19 -0
- package/src/components/form/FilterSelect.tsx +2 -4
- package/src/components/form/FlightCtlForm.css +3 -0
- package/src/components/form/FlightCtlForm.tsx +3 -1
- package/src/components/form/FormSelect.tsx +22 -2
- package/src/components/form/LabelsField.tsx +17 -13
- package/src/components/form/validations.ts +53 -25
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +2 -5
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -4
- package/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.tsx +2 -4
- package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +10 -5
- package/src/constants.ts +2 -1
- package/src/hooks/useAccessReview.ts +33 -0
- package/src/hooks/useAppContext.tsx +6 -5
- package/src/hooks/useFetchPeriodically.ts +4 -0
- package/src/hooks/useFleetImportAccessReview.ts +8 -0
- package/src/hooks/useNavigate.tsx +3 -3
- package/src/hooks/usePendingEnrollmentRequestsCount.ts +12 -0
- package/src/hooks/useTablePagination.tsx +44 -0
- package/src/hooks/useWebSocket.ts +4 -4
- package/src/links.ts +5 -0
- package/src/types/rbac.ts +18 -0
- package/src/utils/api.ts +3 -3
- package/src/utils/labels.ts +3 -7
- package/src/utils/query.ts +70 -0
- package/src/utils/search.ts +1 -1
- package/src/utils/status/devices.ts +1 -0
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts +0 -12
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts.map +0 -1
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js +0 -40
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js.map +0 -1
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts +0 -10
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts.map +0 -1
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js +0 -38
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts +0 -13
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js +0 -104
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts +0 -8
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.js +0 -16
- package/dist/src/components/Device/DevicesPage/useDeviceFilters.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts +0 -5
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts +0 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts +0 -11
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js +0 -39
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.d.ts.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js.map +0 -1
- package/dist/src/components/common/HelperTextItems.d.ts +0 -3
- package/dist/src/components/common/HelperTextItems.d.ts.map +0 -1
- package/dist/src/components/common/HelperTextItems.js +0 -17
- package/dist/src/components/common/HelperTextItems.js.map +0 -1
- package/dist/src/hooks/useTableSort.d.ts +0 -7
- package/dist/src/hooks/useTableSort.d.ts.map +0 -1
- package/dist/src/hooks/useTableSort.js +0 -38
- package/dist/src/hooks/useTableSort.js.map +0 -1
- package/dist/src/utils/sort/device.d.ts +0 -4
- package/dist/src/utils/sort/device.d.ts.map +0 -1
- package/dist/src/utils/sort/device.js +0 -49
- package/dist/src/utils/sort/device.js.map +0 -1
- package/dist/src/utils/sort/fleet.d.ts +0 -4
- package/dist/src/utils/sort/fleet.d.ts.map +0 -1
- package/dist/src/utils/sort/fleet.js +0 -18
- package/dist/src/utils/sort/fleet.js.map +0 -1
- package/dist/src/utils/sort/generic.d.ts +0 -8
- package/dist/src/utils/sort/generic.d.ts.map +0 -1
- package/dist/src/utils/sort/generic.js +0 -37
- package/dist/src/utils/sort/generic.js.map +0 -1
- package/dist/src/utils/sort/repository.d.ts +0 -6
- package/dist/src/utils/sort/repository.d.ts.map +0 -1
- package/dist/src/utils/sort/repository.js +0 -28
- package/dist/src/utils/sort/repository.js.map +0 -1
- package/dist/src/utils/sort/resourceSync.d.ts +0 -6
- package/dist/src/utils/sort/resourceSync.d.ts.map +0 -1
- package/dist/src/utils/sort/resourceSync.js +0 -29
- package/dist/src/utils/sort/resourceSync.js.map +0 -1
- package/src/components/DetailsPage/Tables/SystemdDetailsTable.tsx +0 -63
- package/src/components/Device/DeviceDetails/SystemdTable.tsx +0 -65
- package/src/components/Device/DevicesPage/EnrollmentRequestList.tsx +0 -183
- package/src/components/Device/DevicesPage/useDeviceFilters.ts +0 -15
- package/src/components/Device/MatchPatternsModal/MatchPatternsForm.tsx +0 -92
- package/src/components/common/HelperTextItems.tsx +0 -25
- package/src/hooks/useTableSort.ts +0 -42
- package/src/utils/sort/device.ts +0 -60
- package/src/utils/sort/fleet.ts +0 -16
- package/src/utils/sort/generic.ts +0 -37
- package/src/utils/sort/repository.ts +0 -28
- package/src/utils/sort/resourceSync.ts +0 -30
|
@@ -6,13 +6,21 @@ import { useWebSocket } from '../../../hooks/useWebSocket';
|
|
|
6
6
|
import ErrorAlert from '../../ErrorAlert/ErrorAlert';
|
|
7
7
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
8
8
|
import Terminal, { ImperativeTerminalType } from '../../Terminal/Terminal';
|
|
9
|
+
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
10
|
+
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
11
|
+
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
type TerminalTabProps = {
|
|
14
|
+
device: Device;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const TerminalTab = ({ device }: TerminalTabProps) => {
|
|
11
18
|
const { t } = useTranslation();
|
|
12
19
|
const terminal = React.useRef<ImperativeTerminalType>(null);
|
|
13
20
|
|
|
14
|
-
const onMsgReceived = React.useCallback((message:
|
|
15
|
-
|
|
21
|
+
const onMsgReceived = React.useCallback(async (message: Blob) => {
|
|
22
|
+
const msg = await message.text();
|
|
23
|
+
terminal.current?.onDataReceived(msg);
|
|
16
24
|
}, []);
|
|
17
25
|
|
|
18
26
|
const { sendMessage, isClosed, error, reconnect } = useWebSocket(
|
|
@@ -50,4 +58,13 @@ const TerminalTab = ({ device }: { device: Device }) => {
|
|
|
50
58
|
);
|
|
51
59
|
};
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
const TerminalTabWithPermissions = (props: TerminalTabProps) => {
|
|
62
|
+
const [allowed, loading] = useAccessReview(RESOURCE.DEVICE_CONSOLE, VERB.GET);
|
|
63
|
+
return (
|
|
64
|
+
<PageWithPermissions allowed={allowed} loading={loading}>
|
|
65
|
+
<TerminalTab {...props} />
|
|
66
|
+
</PageWithPermissions>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export default TerminalTabWithPermissions;
|
|
@@ -4,8 +4,7 @@ import { TFunction } from 'i18next';
|
|
|
4
4
|
|
|
5
5
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
6
6
|
import FilterSelect, { FilterSelectGroup } from '../../form/FilterSelect';
|
|
7
|
-
import {
|
|
8
|
-
import { FilterOptionsFC, FilterStatusMap, UpdateStatus } from './types';
|
|
7
|
+
import { FilterStatusMap, UpdateStatus } from './types';
|
|
9
8
|
import StatusDisplay from '../../Status/StatusDisplay';
|
|
10
9
|
import { DeviceSummaryStatus, FilterSearchParams, getDeviceStatusItems } from '../../../utils/status/devices';
|
|
11
10
|
import { StatusItem } from '../../../utils/status/common';
|
|
@@ -38,29 +37,6 @@ export const getStatusItem = (
|
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
39
|
|
|
41
|
-
const FilterOption: FilterOptionsFC = ({ items, selectedFilters, onClick, filter }) => {
|
|
42
|
-
const { t } = useTranslation();
|
|
43
|
-
const filteredItems = items.filter((statusItem) => fuzzySeach(filter, statusItem.label));
|
|
44
|
-
if (!filteredItems.length) {
|
|
45
|
-
return (
|
|
46
|
-
<SelectOption key="no-option" isDisabled>
|
|
47
|
-
{t('No status available')}
|
|
48
|
-
</SelectOption>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
return filteredItems.map((statusItem) => (
|
|
52
|
-
<SelectOption
|
|
53
|
-
onClick={() => onClick(statusItem.id)}
|
|
54
|
-
key={statusItem.id}
|
|
55
|
-
hasCheckbox
|
|
56
|
-
value={statusItem.id}
|
|
57
|
-
isSelected={selectedFilters.includes(statusItem.id)}
|
|
58
|
-
>
|
|
59
|
-
<StatusDisplay item={statusItem} />
|
|
60
|
-
</SelectOption>
|
|
61
|
-
));
|
|
62
|
-
};
|
|
63
|
-
|
|
64
40
|
type DeviceStatusFilterProps = {
|
|
65
41
|
activeStatuses: FilterStatusMap;
|
|
66
42
|
updateStatus: UpdateStatus;
|
|
@@ -69,7 +45,6 @@ type DeviceStatusFilterProps = {
|
|
|
69
45
|
|
|
70
46
|
const DeviceStatusFilter = ({ activeStatuses, updateStatus, isFilterUpdating }: DeviceStatusFilterProps) => {
|
|
71
47
|
const { t } = useTranslation();
|
|
72
|
-
const [filter, setFilter] = React.useState('');
|
|
73
48
|
|
|
74
49
|
const selectedFilters = Object.values(activeStatuses).reduce((acc, curr) => {
|
|
75
50
|
acc += curr.length;
|
|
@@ -80,8 +55,6 @@ const DeviceStatusFilter = ({ activeStatuses, updateStatus, isFilterUpdating }:
|
|
|
80
55
|
<FilterSelect
|
|
81
56
|
selectedFilters={selectedFilters}
|
|
82
57
|
placeholder={t('Filter by status')}
|
|
83
|
-
filter={filter}
|
|
84
|
-
setFilter={setFilter}
|
|
85
58
|
isFilterUpdating={isFilterUpdating}
|
|
86
59
|
>
|
|
87
60
|
<SelectList>
|
|
@@ -89,15 +62,21 @@ const DeviceStatusFilter = ({ activeStatuses, updateStatus, isFilterUpdating }:
|
|
|
89
62
|
{Object.keys(activeStatuses).map((k) => {
|
|
90
63
|
const key = k as keyof FilterStatusMap;
|
|
91
64
|
const { title, items } = getStatusItem(t, key);
|
|
65
|
+
const currentItems = activeStatuses[key] as unknown as DeviceSummaryStatus[];
|
|
92
66
|
return (
|
|
93
67
|
<GridItem key={key} span={4}>
|
|
94
68
|
<FilterSelectGroup label={title}>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
69
|
+
{items.map((statusItem) => (
|
|
70
|
+
<SelectOption
|
|
71
|
+
onClick={() => updateStatus(key, statusItem.id)}
|
|
72
|
+
key={statusItem.id}
|
|
73
|
+
hasCheckbox
|
|
74
|
+
value={statusItem.id}
|
|
75
|
+
isSelected={currentItems.includes(statusItem.id)}
|
|
76
|
+
>
|
|
77
|
+
<StatusDisplay item={statusItem} />
|
|
78
|
+
</SelectOption>
|
|
79
|
+
))}
|
|
101
80
|
</FilterSelectGroup>
|
|
102
81
|
</GridItem>
|
|
103
82
|
);
|
|
@@ -19,6 +19,8 @@ type DeviceTableRowProps = {
|
|
|
19
19
|
rowIndex: number;
|
|
20
20
|
onRowSelect: (device: Device) => OnSelect;
|
|
21
21
|
isRowSelected: (device: Device) => boolean;
|
|
22
|
+
canDelete: boolean;
|
|
23
|
+
canEdit: boolean;
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
const DeviceTableRow: React.FC<DeviceTableRowProps> = ({
|
|
@@ -27,6 +29,8 @@ const DeviceTableRow: React.FC<DeviceTableRowProps> = ({
|
|
|
27
29
|
rowIndex,
|
|
28
30
|
onRowSelect,
|
|
29
31
|
isRowSelected,
|
|
32
|
+
canDelete,
|
|
33
|
+
canEdit,
|
|
30
34
|
}) => {
|
|
31
35
|
const { t } = useTranslation();
|
|
32
36
|
const navigate = useNavigate();
|
|
@@ -72,19 +76,27 @@ const DeviceTableRow: React.FC<DeviceTableRowProps> = ({
|
|
|
72
76
|
<Td isActionCell>
|
|
73
77
|
<ActionsColumn
|
|
74
78
|
items={[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
...(canEdit
|
|
80
|
+
? [
|
|
81
|
+
{
|
|
82
|
+
title: t('Edit device configurations'),
|
|
83
|
+
onClick: () => navigate({ route: ROUTE.DEVICE_EDIT, postfix: deviceName }),
|
|
84
|
+
...editActionProps,
|
|
85
|
+
},
|
|
86
|
+
]
|
|
87
|
+
: []),
|
|
80
88
|
{
|
|
81
89
|
title: t('View device details'),
|
|
82
90
|
onClick: () => navigate({ route: ROUTE.DEVICE_DETAILS, postfix: deviceName }),
|
|
83
91
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
...(canDelete
|
|
93
|
+
? [
|
|
94
|
+
deleteAction({
|
|
95
|
+
resourceId: deviceName,
|
|
96
|
+
resourceName: deviceAlias,
|
|
97
|
+
}),
|
|
98
|
+
]
|
|
99
|
+
: []),
|
|
88
100
|
]}
|
|
89
101
|
/>
|
|
90
102
|
</Td>
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
ToolbarItem,
|
|
12
12
|
} from '@patternfly/react-core';
|
|
13
13
|
|
|
14
|
-
import { Fleet } from '@flightctl/types';
|
|
15
14
|
import { TableTextSearchProps } from '../../Table/TableTextSearch';
|
|
16
15
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
17
16
|
import DeviceStatusFilter, { getStatusItem } from './DeviceFilterSelect';
|
|
@@ -21,16 +20,14 @@ import { labelToString } from '../../../utils/labels';
|
|
|
21
20
|
import DeviceTableToolbarFilters from './DeviceToolbarFilters';
|
|
22
21
|
|
|
23
22
|
type DeviceTableToolbarProps = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
allLabels: FlightCtlLabel[];
|
|
23
|
+
nameOrAlias: TableTextSearchProps['value'];
|
|
24
|
+
setNameOrAlias: TableTextSearchProps['setValue'];
|
|
27
25
|
ownerFleets: string[];
|
|
28
26
|
setOwnerFleets: (ownerFleets: string[]) => void;
|
|
29
27
|
activeStatuses: FilterStatusMap;
|
|
30
28
|
setActiveStatuses: (statuses: FilterStatusMap) => void;
|
|
31
29
|
selectedLabels: FlightCtlLabel[];
|
|
32
30
|
setSelectedLabels: (labels: FlightCtlLabel[]) => void;
|
|
33
|
-
fleets: Fleet[];
|
|
34
31
|
isFilterUpdating: boolean;
|
|
35
32
|
};
|
|
36
33
|
|
|
@@ -38,14 +35,12 @@ const DeviceTableToolbar: React.FC<React.PropsWithChildren<DeviceTableToolbarPro
|
|
|
38
35
|
const {
|
|
39
36
|
ownerFleets,
|
|
40
37
|
setOwnerFleets,
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
nameOrAlias,
|
|
39
|
+
setNameOrAlias,
|
|
43
40
|
activeStatuses,
|
|
44
41
|
setActiveStatuses,
|
|
45
|
-
allLabels,
|
|
46
42
|
selectedLabels,
|
|
47
43
|
setSelectedLabels,
|
|
48
|
-
fleets,
|
|
49
44
|
isFilterUpdating,
|
|
50
45
|
} = rest;
|
|
51
46
|
|
|
@@ -86,14 +81,12 @@ const DeviceTableToolbar: React.FC<React.PropsWithChildren<DeviceTableToolbarPro
|
|
|
86
81
|
</ToolbarItem>
|
|
87
82
|
<ToolbarItem variant="search-filter">
|
|
88
83
|
<DeviceTableToolbarFilters
|
|
89
|
-
allLabels={allLabels}
|
|
90
84
|
selectedLabels={selectedLabels}
|
|
91
85
|
selectedFleetNames={ownerFleets}
|
|
92
86
|
setSelectedLabels={setSelectedLabels}
|
|
93
87
|
setSelectedFleets={setOwnerFleets}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
setSearch={setSearch}
|
|
88
|
+
nameOrAlias={nameOrAlias}
|
|
89
|
+
setNameOrAlias={setNameOrAlias}
|
|
97
90
|
/>
|
|
98
91
|
</ToolbarItem>
|
|
99
92
|
</ToolbarGroup>
|
|
@@ -112,10 +105,10 @@ type DeviceToolbarChipsProps = Omit<DeviceTableToolbarProps, 'setActiveStatuses'
|
|
|
112
105
|
const DeviceToolbarChips = ({
|
|
113
106
|
activeStatuses,
|
|
114
107
|
updateStatus,
|
|
108
|
+
nameOrAlias,
|
|
109
|
+
setNameOrAlias,
|
|
115
110
|
ownerFleets,
|
|
116
|
-
search,
|
|
117
111
|
setOwnerFleets,
|
|
118
|
-
setSearch,
|
|
119
112
|
selectedLabels,
|
|
120
113
|
setSelectedLabels,
|
|
121
114
|
}: DeviceToolbarChipsProps) => {
|
|
@@ -149,10 +142,10 @@ const DeviceToolbarChips = ({
|
|
|
149
142
|
</ChipGroup>
|
|
150
143
|
</SplitItem>
|
|
151
144
|
)}
|
|
152
|
-
{
|
|
145
|
+
{nameOrAlias && (
|
|
153
146
|
<SplitItem>
|
|
154
|
-
<ChipGroup categoryName={t('Name / Alias')} isClosable onClick={() =>
|
|
155
|
-
<Chip onClick={() =>
|
|
147
|
+
<ChipGroup categoryName={t('Name / Alias')} isClosable onClick={() => setNameOrAlias('')}>
|
|
148
|
+
<Chip onClick={() => setNameOrAlias('')}>{nameOrAlias}</Chip>
|
|
156
149
|
</ChipGroup>
|
|
157
150
|
</SplitItem>
|
|
158
151
|
)}
|
|
@@ -173,14 +166,14 @@ const DeviceToolbarChips = ({
|
|
|
173
166
|
</ChipGroup>
|
|
174
167
|
</SplitItem>
|
|
175
168
|
)}
|
|
176
|
-
{(!!statusKeys.length || !!ownerFleets.length || !!
|
|
169
|
+
{(!!statusKeys.length || !!ownerFleets.length || !!nameOrAlias || !!selectedLabels.length) && (
|
|
177
170
|
<SplitItem>
|
|
178
171
|
<Button
|
|
179
172
|
variant="link"
|
|
180
173
|
onClick={() => {
|
|
181
174
|
updateStatus();
|
|
182
175
|
setOwnerFleets([]);
|
|
183
|
-
|
|
176
|
+
setNameOrAlias('');
|
|
184
177
|
setSelectedLabels([]);
|
|
185
178
|
}}
|
|
186
179
|
>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
2
3
|
import {
|
|
3
4
|
Button,
|
|
4
5
|
Icon,
|
|
@@ -8,6 +9,7 @@ import {
|
|
|
8
9
|
SelectGroup,
|
|
9
10
|
SelectList,
|
|
10
11
|
SelectOption,
|
|
12
|
+
Spinner,
|
|
11
13
|
TextInputGroup,
|
|
12
14
|
TextInputGroupMain,
|
|
13
15
|
TextInputGroupUtilities,
|
|
@@ -15,13 +17,16 @@ import {
|
|
|
15
17
|
import { TimesIcon } from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
16
18
|
import { SearchIcon } from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
17
19
|
|
|
18
|
-
import { Fleet } from '@flightctl/types';
|
|
20
|
+
import { DeviceList, Fleet, FleetList } from '@flightctl/types';
|
|
19
21
|
import { FlightCtlLabel } from '../../../types/extraTypes';
|
|
22
|
+
import { isPromiseFulfilled } from '../../../types/typeUtils';
|
|
20
23
|
|
|
21
24
|
import TableTextSearch, { TableTextSearchProps } from '../../Table/TableTextSearch';
|
|
22
25
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
26
|
+
import { useFetch } from '../../../hooks/useFetch';
|
|
27
|
+
import { commonQueries as queries } from '../../../utils/query';
|
|
28
|
+
import { MAX_TOTAL_SEARCH_RESULTS, getSearchResultsCount } from '../../../utils/search';
|
|
29
|
+
import { labelToString, stringToLabel } from '../../../utils/labels';
|
|
25
30
|
|
|
26
31
|
import './DeviceToolbarFilters.css';
|
|
27
32
|
|
|
@@ -29,8 +34,6 @@ const NAME_SEARCH = 'NameAndAlias';
|
|
|
29
34
|
const LABEL_SEARCH = 'LabelsAndFleets';
|
|
30
35
|
|
|
31
36
|
type LabelFleetSelectorProps = {
|
|
32
|
-
fleets: Fleet[];
|
|
33
|
-
allLabels: FlightCtlLabel[];
|
|
34
37
|
selectedFleetNames: string[];
|
|
35
38
|
selectedLabels: FlightCtlLabel[];
|
|
36
39
|
onSelect: (type: 'fleet' | 'label', value: string) => void;
|
|
@@ -39,18 +42,25 @@ type LabelFleetSelectorProps = {
|
|
|
39
42
|
|
|
40
43
|
const LabelFleetResults = ({
|
|
41
44
|
allLabels,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
fleetNames,
|
|
46
|
+
isUpdating,
|
|
47
|
+
}: {
|
|
48
|
+
isUpdating: boolean;
|
|
49
|
+
fleetNames: string[];
|
|
50
|
+
allLabels: FlightCtlLabel[];
|
|
51
|
+
}) => {
|
|
46
52
|
const { t } = useTranslation();
|
|
47
53
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
if (isUpdating) {
|
|
55
|
+
return (
|
|
56
|
+
<div className="fctl-device-toolbar-filters__hint">
|
|
57
|
+
<Spinner size="md" className="pf-v5-u-mr-sm" />
|
|
58
|
+
{t('Searching...')}
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
51
62
|
|
|
52
|
-
const
|
|
53
|
-
const [visibleLabels, visibleFleets] = getSearchResultsCount(filteredLabels.length, availableFleetNames.length);
|
|
63
|
+
const [visibleLabels, visibleFleets] = getSearchResultsCount(allLabels.length, fleetNames.length);
|
|
54
64
|
if (visibleLabels + visibleFleets === 0) {
|
|
55
65
|
return <div className="fctl-device-toolbar-filters__hint">{t('No results')}</div>;
|
|
56
66
|
}
|
|
@@ -60,9 +70,10 @@ const LabelFleetResults = ({
|
|
|
60
70
|
{visibleLabels > 0 && (
|
|
61
71
|
<SelectGroup label={t('Labels')}>
|
|
62
72
|
<SelectList id="select-typeahead-labels-listbox">
|
|
63
|
-
{
|
|
73
|
+
{allLabels
|
|
64
74
|
.filter((_, index) => index < visibleLabels)
|
|
65
|
-
.map((
|
|
75
|
+
.map((label) => {
|
|
76
|
+
const labelStr = labelToString(label);
|
|
66
77
|
return (
|
|
67
78
|
<SelectOption key={`label@@${labelStr}`} value={`label@@${labelStr}`}>
|
|
68
79
|
{labelStr}
|
|
@@ -75,7 +86,7 @@ const LabelFleetResults = ({
|
|
|
75
86
|
{visibleFleets > 0 && (
|
|
76
87
|
<SelectGroup label={t('Fleets')}>
|
|
77
88
|
<SelectList id="select-typeahead-fleets-listbox">
|
|
78
|
-
{
|
|
89
|
+
{fleetNames
|
|
79
90
|
.filter((_, index) => index < visibleFleets)
|
|
80
91
|
.map((fleetName) => (
|
|
81
92
|
<SelectOption key={`fleet@@${fleetName}`} value={`fleet@@${fleetName}`}>
|
|
@@ -89,24 +100,24 @@ const LabelFleetResults = ({
|
|
|
89
100
|
);
|
|
90
101
|
};
|
|
91
102
|
|
|
92
|
-
const LabelFleetSelector = ({
|
|
93
|
-
fleets,
|
|
94
|
-
selectedFleetNames,
|
|
95
|
-
allLabels,
|
|
96
|
-
selectedLabels,
|
|
97
|
-
onSelect,
|
|
98
|
-
placeholder,
|
|
99
|
-
}: LabelFleetSelectorProps) => {
|
|
103
|
+
const LabelFleetSelector = ({ selectedFleetNames, selectedLabels, onSelect, placeholder }: LabelFleetSelectorProps) => {
|
|
100
104
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
101
105
|
const [filterText, setFilterText] = React.useState<string>('');
|
|
106
|
+
const [fleetNameResults, setFleetNameResults] = React.useState<string[]>([]);
|
|
107
|
+
const [labelResults, setLabelResults] = React.useState<FlightCtlLabel[]>([]);
|
|
108
|
+
const [isUpdating, setIsUpdating] = React.useState<boolean>(false);
|
|
109
|
+
|
|
110
|
+
const { get } = useFetch();
|
|
102
111
|
|
|
103
112
|
const textInputRef = React.useRef<HTMLInputElement>();
|
|
104
113
|
|
|
105
114
|
const { t } = useTranslation();
|
|
106
115
|
|
|
107
116
|
const onToggleClick = () => {
|
|
117
|
+
if (!isOpen) {
|
|
118
|
+
textInputRef?.current?.focus();
|
|
119
|
+
}
|
|
108
120
|
setIsOpen(!isOpen);
|
|
109
|
-
textInputRef?.current?.focus();
|
|
110
121
|
};
|
|
111
122
|
|
|
112
123
|
const onClearButtonClick = () => {
|
|
@@ -126,8 +137,61 @@ const LabelFleetSelector = ({
|
|
|
126
137
|
}
|
|
127
138
|
};
|
|
128
139
|
|
|
140
|
+
const fetchTextMatches = async (val: string) => {
|
|
141
|
+
const labelMatches = get<DeviceList>(
|
|
142
|
+
// We ask for more items since can't get a precise amount of labels while querying for devices
|
|
143
|
+
queries.getDevicesWithExactLabelMatching([stringToLabel(val)], { limit: MAX_TOTAL_SEARCH_RESULTS * 2 }),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const fleetMatches = get<FleetList>(queries.getFleetsWithNameMatching(val, { limit: MAX_TOTAL_SEARCH_RESULTS }));
|
|
147
|
+
|
|
148
|
+
const [labelMatchResult, fleetMatchResult] = await Promise.allSettled([labelMatches, fleetMatches]);
|
|
149
|
+
|
|
150
|
+
let newLabels: FlightCtlLabel[] = [];
|
|
151
|
+
if (isPromiseFulfilled(labelMatchResult)) {
|
|
152
|
+
// In case we somehow still receive partial label matches, we extract the actual labels
|
|
153
|
+
const matchingLabels = labelMatchResult.value.items.reduce((prevLabels, newDevice) => {
|
|
154
|
+
const deviceLabels = newDevice.metadata.labels || {};
|
|
155
|
+
Object.entries(deviceLabels).forEach(([key, value]) => {
|
|
156
|
+
const labelText = labelToString({ key, value });
|
|
157
|
+
if (labelText.includes(val) && !prevLabels.includes(labelText)) {
|
|
158
|
+
prevLabels.push(labelText);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return prevLabels;
|
|
162
|
+
}, [] as string[]);
|
|
163
|
+
|
|
164
|
+
newLabels = matchingLabels.map(stringToLabel).sort();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
let newFleets: string[] = [];
|
|
168
|
+
if (isPromiseFulfilled(fleetMatchResult)) {
|
|
169
|
+
newFleets = fleetMatchResult.value.items?.map((fleet: Fleet) => fleet.metadata.name || '') || [];
|
|
170
|
+
}
|
|
171
|
+
setLabelResults(newLabels);
|
|
172
|
+
setFleetNameResults(newFleets);
|
|
173
|
+
setIsUpdating(false);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
177
|
+
const debouncedUpdate = React.useCallback(
|
|
178
|
+
debounce((val: string) => {
|
|
179
|
+
fetchTextMatches(val);
|
|
180
|
+
}, 800),
|
|
181
|
+
[],
|
|
182
|
+
);
|
|
183
|
+
|
|
129
184
|
const onTextInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
|
|
130
|
-
|
|
185
|
+
if (value) {
|
|
186
|
+
setFilterText(value);
|
|
187
|
+
if (!isUpdating) {
|
|
188
|
+
// Start showing the spinner before the debounced function is triggered
|
|
189
|
+
setIsUpdating(true);
|
|
190
|
+
}
|
|
191
|
+
void debouncedUpdate(value);
|
|
192
|
+
} else {
|
|
193
|
+
setFilterText('');
|
|
194
|
+
}
|
|
131
195
|
};
|
|
132
196
|
|
|
133
197
|
const selectedIds = selectedFleetNames
|
|
@@ -193,42 +257,57 @@ const LabelFleetSelector = ({
|
|
|
193
257
|
}}
|
|
194
258
|
toggle={toggle}
|
|
195
259
|
>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
selectedFleetNames={selectedFleetNames}
|
|
200
|
-
allLabels={allLabels}
|
|
201
|
-
selectedLabels={selectedLabels}
|
|
202
|
-
/>
|
|
260
|
+
{filterText && (
|
|
261
|
+
<LabelFleetResults isUpdating={isUpdating} fleetNames={fleetNameResults} allLabels={labelResults} />
|
|
262
|
+
)}
|
|
203
263
|
</Select>
|
|
204
264
|
);
|
|
205
265
|
};
|
|
206
266
|
|
|
207
267
|
type DeviceToolbarFilterProps = {
|
|
208
|
-
fleets: Fleet[];
|
|
209
268
|
selectedFleetNames: string[];
|
|
210
269
|
setSelectedFleets: (ownerFleets: string[]) => void;
|
|
211
|
-
allLabels: FlightCtlLabel[];
|
|
212
270
|
selectedLabels: FlightCtlLabel[];
|
|
213
271
|
setSelectedLabels: (labels: FlightCtlLabel[]) => void;
|
|
214
|
-
|
|
215
|
-
|
|
272
|
+
nameOrAlias?: TableTextSearchProps['value'];
|
|
273
|
+
setNameOrAlias?: TableTextSearchProps['setValue'];
|
|
216
274
|
};
|
|
217
275
|
|
|
218
276
|
const DeviceToolbarFilter = ({
|
|
219
|
-
fleets,
|
|
220
277
|
selectedFleetNames,
|
|
221
278
|
setSelectedFleets,
|
|
222
|
-
allLabels,
|
|
223
279
|
selectedLabels,
|
|
224
280
|
setSelectedLabels,
|
|
225
|
-
|
|
226
|
-
|
|
281
|
+
nameOrAlias,
|
|
282
|
+
setNameOrAlias,
|
|
227
283
|
}: DeviceToolbarFilterProps) => {
|
|
228
284
|
const { t } = useTranslation();
|
|
229
285
|
const [isSearchTypeExpanded, setIsSearchTypeExpanded] = React.useState(false);
|
|
230
286
|
const [selectedSearchType, setSelectedSearchType] = React.useState(LABEL_SEARCH);
|
|
231
287
|
|
|
288
|
+
const [typingText, setTypingText] = React.useState<string>('');
|
|
289
|
+
const debouncedSetParam = React.useMemo(
|
|
290
|
+
() =>
|
|
291
|
+
debounce((setValue: TableTextSearchProps['setValue'], value: string) => {
|
|
292
|
+
setValue(value || '');
|
|
293
|
+
}, 500),
|
|
294
|
+
[],
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
React.useEffect(() => {
|
|
298
|
+
if (setNameOrAlias) {
|
|
299
|
+
debouncedSetParam(setNameOrAlias, typingText);
|
|
300
|
+
}
|
|
301
|
+
}, [typingText, setNameOrAlias, debouncedSetParam]);
|
|
302
|
+
|
|
303
|
+
React.useEffect(() => {
|
|
304
|
+
if (!nameOrAlias && typingText) {
|
|
305
|
+
setTypingText('');
|
|
306
|
+
}
|
|
307
|
+
// When the filter is cleared from the chips, clear the "typingText" too
|
|
308
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
309
|
+
}, [nameOrAlias, setTypingText]);
|
|
310
|
+
|
|
232
311
|
const onToggle = () => {
|
|
233
312
|
setIsSearchTypeExpanded(!isSearchTypeExpanded);
|
|
234
313
|
};
|
|
@@ -239,6 +318,9 @@ const DeviceToolbarFilter = ({
|
|
|
239
318
|
) => {
|
|
240
319
|
setSelectedSearchType(selection as string);
|
|
241
320
|
setIsSearchTypeExpanded(false);
|
|
321
|
+
if (selection === LABEL_SEARCH) {
|
|
322
|
+
setTypingText('');
|
|
323
|
+
}
|
|
242
324
|
};
|
|
243
325
|
|
|
244
326
|
const onSelectFleetOrLabel = (type: 'fleet' | 'label', id: string) => {
|
|
@@ -259,7 +341,7 @@ const DeviceToolbarFilter = ({
|
|
|
259
341
|
|
|
260
342
|
return (
|
|
261
343
|
<>
|
|
262
|
-
{
|
|
344
|
+
{setNameOrAlias && (
|
|
263
345
|
<Select
|
|
264
346
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
265
347
|
<MenuToggle
|
|
@@ -286,13 +368,11 @@ const DeviceToolbarFilter = ({
|
|
|
286
368
|
</SelectOption>
|
|
287
369
|
</Select>
|
|
288
370
|
)}
|
|
289
|
-
{
|
|
290
|
-
<TableTextSearch value={
|
|
371
|
+
{setNameOrAlias && selectedSearchType === NAME_SEARCH ? (
|
|
372
|
+
<TableTextSearch value={typingText} setValue={setTypingText} />
|
|
291
373
|
) : (
|
|
292
374
|
<LabelFleetSelector
|
|
293
|
-
placeholder={
|
|
294
|
-
allLabels={allLabels}
|
|
295
|
-
fleets={fleets}
|
|
375
|
+
placeholder={setNameOrAlias ? undefined : t('Filter by labels and fleets')}
|
|
296
376
|
selectedFleetNames={selectedFleetNames}
|
|
297
377
|
selectedLabels={selectedLabels}
|
|
298
378
|
onSelect={onSelectFleetOrLabel}
|