@flightctl/ui-components 0.5.1 → 0.6.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/DetailsPage.d.ts +3 -2
- package/dist/src/components/DetailsPage/DetailsPage.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/DetailsPage.js +2 -2
- package/dist/src/components/DetailsPage/DetailsPage.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +5 -3
- 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 +4 -5
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.d.ts +10 -0
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.js +110 -0
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +7 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +9 -6
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js +3 -3
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +3 -3
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +34 -3
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +35 -30
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +11 -2
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +14 -11
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +9 -2
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js +21 -6
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +11 -4
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +6 -5
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +123 -10
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts +8 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js +19 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts +8 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js +49 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +52 -19
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +13 -16
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -5
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js +2 -2
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +16 -16
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.d.ts +8 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.js +58 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts +2 -2
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js +17 -12
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +2 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +29 -3
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.js +8 -7
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +1 -4
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +5 -5
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +2 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +19 -11
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +5 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +2 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +8 -4
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +2 -2
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js +8 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts +19 -2
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js +53 -18
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js +1 -2
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js +9 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js +22 -9
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js +4 -4
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js +5 -5
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.css +3 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.d.ts +9 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.js +127 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +13 -4
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +8 -12
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js.map +1 -1
- package/dist/src/components/ListPage/ListPage.d.ts +1 -0
- package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
- package/dist/src/components/ListPage/ListPage.js +3 -3
- package/dist/src/components/ListPage/ListPage.js.map +1 -1
- package/dist/src/components/Masthead/CommandLineToolsPage.d.ts +4 -0
- package/dist/src/components/Masthead/CommandLineToolsPage.d.ts.map +1 -0
- package/dist/src/components/Masthead/CommandLineToolsPage.js +90 -0
- package/dist/src/components/Masthead/CommandLineToolsPage.js.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesModal.d.ts.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesModal.js.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesProvider.d.ts.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesProvider.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +3 -3
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.d.ts +4 -0
- package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/{ToDo/ToDoCard.js → Tasks/TasksCard.js} +4 -4
- package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.js.map +1 -0
- package/dist/src/components/OverviewPage/Overview.js +2 -2
- package/dist/src/components/OverviewPage/Overview.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +6 -5
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js +3 -3
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.js +4 -1
- package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js.map +1 -1
- package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryList.js +3 -11
- package/dist/src/components/Repository/RepositoryList.js.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +3 -6
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Status/DeviceResourceStatus.js +3 -3
- package/dist/src/components/Status/utils.d.ts.map +1 -1
- package/dist/src/components/Status/utils.js +3 -3
- package/dist/src/components/Status/utils.js.map +1 -1
- package/dist/src/components/Table/Table.d.ts +2 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/Table.js +9 -5
- package/dist/src/components/Table/Table.js.map +1 -1
- package/dist/src/components/Table/TablePagination.d.ts.map +1 -1
- package/dist/src/components/Table/TablePagination.js +1 -1
- package/dist/src/components/Table/TablePagination.js.map +1 -1
- package/dist/src/components/Terminal/Terminal.d.ts +1 -1
- package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
- package/dist/src/components/Terminal/Terminal.js +10 -3
- package/dist/src/components/Terminal/Terminal.js.map +1 -1
- package/dist/src/components/charts/DonutChart.js +1 -1
- package/dist/src/components/charts/DonutChart.js.map +1 -1
- package/dist/src/components/common/LeaveFormConfirmation.js +1 -1
- package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -1
- package/dist/src/components/common/WithHelperText.d.ts +10 -5
- package/dist/src/components/common/WithHelperText.d.ts.map +1 -1
- package/dist/src/components/common/WithHelperText.js +13 -8
- package/dist/src/components/common/WithHelperText.js.map +1 -1
- package/dist/src/components/form/CheckboxField.d.ts +6 -3
- package/dist/src/components/form/CheckboxField.d.ts.map +1 -1
- package/dist/src/components/form/CheckboxField.js +20 -1
- package/dist/src/components/form/CheckboxField.js.map +1 -1
- package/dist/src/components/form/FormSelectTypeahead.d.ts +3 -3
- package/dist/src/components/form/FormSelectTypeahead.d.ts.map +1 -1
- package/dist/src/components/form/FormSelectTypeahead.js +43 -53
- package/dist/src/components/form/FormSelectTypeahead.js.map +1 -1
- package/dist/src/components/form/RichValidationTextField.d.ts +1 -1
- package/dist/src/components/form/RichValidationTextField.d.ts.map +1 -1
- package/dist/src/components/form/RichValidationTextField.js +8 -4
- package/dist/src/components/form/RichValidationTextField.js.map +1 -1
- package/dist/src/components/form/validations.d.ts +44 -4
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +148 -25
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js +5 -3
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +3 -2
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +7 -12
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js +4 -4
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js +4 -4
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js +2 -2
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +2 -2
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
- package/dist/src/hooks/timeZones.d.ts +3 -0
- package/dist/src/hooks/timeZones.d.ts.map +1 -0
- package/dist/src/hooks/timeZones.js +607 -0
- package/dist/src/hooks/timeZones.js.map +1 -0
- package/dist/src/hooks/useAppContext.d.ts +14 -8
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useAppContext.js +13 -6
- package/dist/src/hooks/useAppContext.js.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +3 -5
- package/dist/src/hooks/useFetch.d.ts.map +1 -1
- package/dist/src/hooks/useFetch.js +3 -2
- package/dist/src/hooks/useFetch.js.map +1 -1
- package/dist/src/hooks/useNavigate.d.ts +2 -1
- package/dist/src/hooks/useNavigate.d.ts.map +1 -1
- package/dist/src/hooks/useNavigate.js +1 -0
- package/dist/src/hooks/useNavigate.js.map +1 -1
- package/dist/src/hooks/useTimeZones.d.ts +4 -0
- package/dist/src/hooks/useTimeZones.d.ts.map +1 -0
- package/dist/src/hooks/useTimeZones.js +22 -0
- package/dist/src/hooks/useTimeZones.js.map +1 -0
- package/dist/src/hooks/useWebSocket.d.ts +6 -2
- package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/src/hooks/useWebSocket.js +22 -7
- 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 -1
- package/dist/src/links.js +10 -3
- package/dist/src/links.js.map +1 -1
- package/dist/src/types/deviceSpec.d.ts +93 -5
- package/dist/src/types/deviceSpec.d.ts.map +1 -1
- package/dist/src/types/deviceSpec.js +28 -2
- package/dist/src/types/deviceSpec.js.map +1 -1
- package/dist/src/types/extraTypes.d.ts +19 -1
- package/dist/src/types/extraTypes.d.ts.map +1 -1
- package/dist/src/types/extraTypes.js.map +1 -1
- package/dist/src/utils/labels.d.ts +1 -0
- package/dist/src/utils/labels.d.ts.map +1 -1
- package/dist/src/utils/labels.js +9 -2
- package/dist/src/utils/labels.js.map +1 -1
- package/dist/src/utils/patch.d.ts +13 -5
- package/dist/src/utils/patch.d.ts.map +1 -1
- package/dist/src/utils/patch.js +115 -71
- package/dist/src/utils/patch.js.map +1 -1
- package/dist/src/utils/query.d.ts +1 -0
- package/dist/src/utils/query.d.ts.map +1 -1
- package/dist/src/utils/query.js +10 -3
- package/dist/src/utils/query.js.map +1 -1
- package/dist/src/utils/search.d.ts +6 -0
- package/dist/src/utils/search.d.ts.map +1 -1
- package/dist/src/utils/search.js +9 -1
- package/dist/src/utils/search.js.map +1 -1
- package/dist/src/utils/time.d.ts +31 -0
- package/dist/src/utils/time.d.ts.map +1 -0
- package/dist/src/utils/time.js +134 -0
- package/dist/src/utils/time.js.map +1 -0
- package/package.json +1 -4
- package/src/components/DetailsPage/DetailsPage.tsx +6 -4
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +6 -3
- package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +4 -13
- package/src/components/Device/DeviceDetails/DeviceAliasEdit.tsx +180 -0
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +8 -1
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +21 -5
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +3 -4
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx +7 -10
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +3 -3
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +43 -5
- package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +2 -1
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +66 -38
- package/src/components/Device/DevicesPage/DevicesPage.tsx +11 -2
- package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +16 -11
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +11 -2
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.tsx +22 -6
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +15 -2
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +147 -14
- package/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.tsx +28 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.tsx +94 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +81 -50
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +23 -28
- package/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.tsx +1 -2
- package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +18 -39
- package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +8 -14
- package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +26 -39
- package/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.tsx +88 -0
- package/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.tsx +1 -1
- package/src/components/Device/EditDeviceWizard/steps/ReviewApplications.tsx +18 -19
- package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +3 -3
- package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +2 -2
- package/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.tsx +2 -1
- package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +1 -1
- package/src/components/Device/EditDeviceWizard/utils.ts +16 -9
- package/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.tsx +7 -6
- package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +1 -5
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +7 -9
- package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +30 -17
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +5 -1
- package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +12 -4
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +4 -3
- package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +9 -2
- package/src/components/Fleet/CreateFleet/fleetSpecUtils.ts +51 -17
- package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +1 -1
- package/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.tsx +2 -13
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +3 -3
- package/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.tsx +10 -1
- package/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.tsx +49 -16
- package/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.tsx +18 -33
- package/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.tsx +14 -24
- package/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.css +3 -0
- package/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.tsx +246 -0
- package/src/components/Fleet/CreateFleet/utils.ts +23 -7
- package/src/components/Fleet/FleetsPage.tsx +15 -17
- package/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.tsx +1 -1
- package/src/components/ListPage/ListPage.tsx +7 -4
- package/src/components/Masthead/CommandLineToolsPage.tsx +179 -0
- package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +6 -6
- package/src/components/OverviewPage/Cards/{ToDo/ToDoCard.tsx → Tasks/TasksCard.tsx} +3 -3
- package/src/components/OverviewPage/Overview.tsx +2 -2
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +11 -26
- package/src/components/Repository/CreateRepository/CreateResourceSyncsForm.tsx +8 -17
- package/src/components/Repository/CreateRepository/utils.ts +4 -1
- package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +3 -4
- package/src/components/Repository/RepositoryList.tsx +9 -16
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +7 -11
- package/src/components/Status/DeviceResourceStatus.tsx +4 -4
- package/src/components/Status/utils.ts +3 -5
- package/src/components/Table/Table.tsx +32 -9
- package/src/components/Table/TablePagination.tsx +0 -1
- package/src/components/Terminal/Terminal.tsx +10 -4
- package/src/components/charts/DonutChart.tsx +2 -2
- package/src/components/common/LeaveFormConfirmation.tsx +2 -2
- package/src/components/common/WithHelperText.tsx +53 -21
- package/src/components/form/CheckboxField.tsx +28 -3
- package/src/components/form/FormSelectTypeahead.tsx +53 -80
- package/src/components/form/RichValidationTextField.tsx +73 -62
- package/src/components/form/validations.ts +207 -28
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.tsx +5 -5
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +3 -2
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -20
- package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx +2 -2
- package/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.tsx +2 -2
- package/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.tsx +2 -2
- package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +2 -2
- package/src/hooks/timeZones.ts +606 -0
- package/src/hooks/useAppContext.tsx +20 -10
- package/src/hooks/useFetch.ts +3 -2
- package/src/hooks/useNavigate.tsx +1 -0
- package/src/hooks/useTimeZones.ts +26 -0
- package/src/hooks/useWebSocket.ts +29 -7
- package/src/links.ts +13 -4
- package/src/types/deviceSpec.ts +118 -2
- package/src/types/extraTypes.ts +33 -1
- package/src/utils/labels.ts +7 -1
- package/src/utils/patch.ts +126 -72
- package/src/utils/query.ts +13 -4
- package/src/utils/search.ts +8 -0
- package/src/utils/time.ts +147 -0
- package/dist/jest.config.d.ts +0 -12
- package/dist/jest.config.d.ts.map +0 -1
- package/dist/jest.config.js +0 -24
- package/dist/jest.config.js.map +0 -1
- package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts +0 -2
- package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts.map +0 -1
- package/dist/src/components/DetailsPage/DetailsPage.spec.js +0 -81
- package/dist/src/components/DetailsPage/DetailsPage.spec.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts +0 -23
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/types.js +0 -3
- package/dist/src/components/Device/EditDeviceWizard/types.js.map +0 -1
- package/dist/src/components/Fleet/CreateFleet/types.d.ts +0 -29
- package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +0 -1
- package/dist/src/components/Fleet/CreateFleet/types.js +0 -9
- package/dist/src/components/Fleet/CreateFleet/types.js.map +0 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts +0 -4
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts.map +0 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesModal.d.ts.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesModal.js.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesProvider.d.ts.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesProvider.js.map +0 -1
- package/dist/src/setupTests.d.ts +0 -2
- package/dist/src/setupTests.d.ts.map +0 -1
- package/dist/src/setupTests.js +0 -24
- package/dist/src/setupTests.js.map +0 -1
- package/dist/src/tests/test-utils.d.ts +0 -7
- package/dist/src/tests/test-utils.d.ts.map +0 -1
- package/dist/src/tests/test-utils.js +0 -21
- package/dist/src/tests/test-utils.js.map +0 -1
- package/src/components/DetailsPage/DetailsPage.spec.tsx +0 -128
- package/src/components/Device/EditDeviceWizard/types.ts +0 -22
- package/src/components/Fleet/CreateFleet/types.ts +0 -33
- package/src/setupTests.ts +0 -21
- package/src/tests/test-utils.tsx +0 -21
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesModal.d.ts +0 -0
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesModal.js +0 -0
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.d.ts +0 -0
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.js +0 -0
- /package/src/components/{UserPreferences → Masthead}/UserPreferencesModal.tsx +0 -0
- /package/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.tsx +0 -0
package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx
CHANGED
|
@@ -29,7 +29,7 @@ import ApproveDeviceModal from '../../modals/ApproveDeviceModal/ApproveDeviceMod
|
|
|
29
29
|
import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
|
|
30
30
|
import DetailsPageActions, { useDeleteAction } from '../../DetailsPage/DetailsPageActions';
|
|
31
31
|
import EnrollmentRequestStatus from '../../Status/EnrollmentRequestStatus';
|
|
32
|
-
import
|
|
32
|
+
import LabelWithHelperText from '../../common/WithHelperText';
|
|
33
33
|
import FlightControlDescriptionList from '../../common/FlightCtlDescriptionList';
|
|
34
34
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
35
35
|
import { ROUTE, useNavigate } from '../../../hooks/useNavigate';
|
|
@@ -67,7 +67,6 @@ const EnrollmentRequestDetails = () => {
|
|
|
67
67
|
|
|
68
68
|
const approvalStatus = er ? getApprovalStatus(er) : '-';
|
|
69
69
|
const isPendingApproval = approvalStatus === EnrollmentRequestStatusType.Pending;
|
|
70
|
-
|
|
71
70
|
return (
|
|
72
71
|
<DetailsPage
|
|
73
72
|
loading={loading}
|
|
@@ -77,7 +76,7 @@ const EnrollmentRequestDetails = () => {
|
|
|
77
76
|
resourceType="Devices"
|
|
78
77
|
resourceTypeLabel={t('Devices')}
|
|
79
78
|
actions={
|
|
80
|
-
(canApprove ||
|
|
79
|
+
(canApprove || canDelete) && (
|
|
81
80
|
<DetailsPageActions>
|
|
82
81
|
<DropdownList>
|
|
83
82
|
{canApprove && (
|
|
@@ -120,9 +119,9 @@ const EnrollmentRequestDetails = () => {
|
|
|
120
119
|
</DescriptionListDescription>
|
|
121
120
|
</DescriptionListGroup>
|
|
122
121
|
<DescriptionListGroup>
|
|
123
|
-
<DescriptionListTerm>{t('
|
|
122
|
+
<DescriptionListTerm>{t('Default labels')}</DescriptionListTerm>
|
|
124
123
|
<DescriptionListDescription>
|
|
125
|
-
<LabelsView prefix="er" labels={er?.
|
|
124
|
+
<LabelsView prefix="er" labels={er?.spec.labels} />
|
|
126
125
|
</DescriptionListDescription>
|
|
127
126
|
</DescriptionListGroup>
|
|
128
127
|
<DescriptionListGroup>
|
|
@@ -138,9 +137,8 @@ const EnrollmentRequestDetails = () => {
|
|
|
138
137
|
<GridItem md={6}>
|
|
139
138
|
<DetailsPageCard>
|
|
140
139
|
<CardTitle>
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
ariaLabel={t('Certificate signing request')}
|
|
140
|
+
<LabelWithHelperText
|
|
141
|
+
label={t('Certificate signing request')}
|
|
144
142
|
content={t('A PEM-encoded PKCS#10 certificate signing request.')}
|
|
145
143
|
/>
|
|
146
144
|
</CardTitle>
|
|
@@ -162,7 +160,7 @@ const EnrollmentRequestDetails = () => {
|
|
|
162
160
|
<GridItem md={6}>
|
|
163
161
|
<DetailsPageCard>
|
|
164
162
|
<CardTitle>
|
|
165
|
-
<
|
|
163
|
+
<LabelWithHelperText label={t('Certificate')} content={t('A PEM-encoded signed certificate.')} />
|
|
166
164
|
</CardTitle>
|
|
167
165
|
<DetailsPageCardBody>
|
|
168
166
|
{er?.status?.certificate ? (
|
|
@@ -4,7 +4,7 @@ import { Tbody } from '@patternfly/react-table';
|
|
|
4
4
|
import { SelectList, SelectOption, ToolbarItem } from '@patternfly/react-core';
|
|
5
5
|
import { MicrochipIcon } from '@patternfly/react-icons/dist/js/icons';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { EnrollmentRequestList } from '@flightctl/types';
|
|
8
8
|
|
|
9
9
|
import Table, { ApiSortTableColumn } from '../Table/Table';
|
|
10
10
|
import TableActions from '../Table/TableActions';
|
|
@@ -14,7 +14,6 @@ import { useDeleteListAction } from '../ListPage/ListPageActions';
|
|
|
14
14
|
import { useFetch } from '../../hooks/useFetch';
|
|
15
15
|
import { useTranslation } from '../../hooks/useTranslation';
|
|
16
16
|
import { useTableSelect } from '../../hooks/useTableSelect';
|
|
17
|
-
import { useTableTextSearch } from '../../hooks/useTableTextSearch';
|
|
18
17
|
import ApproveDeviceModal from '../modals/ApproveDeviceModal/ApproveDeviceModal';
|
|
19
18
|
import MassDeleteDeviceModal from '../modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal';
|
|
20
19
|
import MassApproveDeviceModal from '../modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal';
|
|
@@ -32,6 +31,9 @@ const EnrollmentRequestEmptyState = () => {
|
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
const getEnrollmentColumns = (t: TFunction): ApiSortTableColumn[] => [
|
|
34
|
+
{
|
|
35
|
+
name: t('Alias'),
|
|
36
|
+
},
|
|
35
37
|
{
|
|
36
38
|
name: t('Name'),
|
|
37
39
|
},
|
|
@@ -40,17 +42,22 @@ const getEnrollmentColumns = (t: TFunction): ApiSortTableColumn[] => [
|
|
|
40
42
|
},
|
|
41
43
|
];
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
type EnrollmentRequestListProps = {
|
|
46
|
+
refetchDevices?: VoidFunction;
|
|
47
|
+
onEmptyListChanged?: (isEmpty: boolean) => void;
|
|
48
|
+
isStandalone?: boolean;
|
|
49
|
+
};
|
|
46
50
|
|
|
47
|
-
const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentRequestListProps) => {
|
|
51
|
+
const EnrollmentRequestList = ({ onEmptyListChanged, refetchDevices, isStandalone }: EnrollmentRequestListProps) => {
|
|
48
52
|
const { t } = useTranslation();
|
|
49
53
|
const [canApprove] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST_APPROVAL, VERB.POST);
|
|
50
54
|
const [canDelete] = useAccessReview(RESOURCE.ENROLLMENT_REQUEST, VERB.DELETE);
|
|
51
55
|
const { remove } = useFetch();
|
|
56
|
+
const [search, setSearch] = React.useState<string>('');
|
|
57
|
+
|
|
52
58
|
const enrollmentColumns = React.useMemo(() => getEnrollmentColumns(t), [t]);
|
|
53
|
-
const [pendingEnrollments, isLoading, error, refetch, pagination] = usePendingEnrollments();
|
|
59
|
+
const [pendingEnrollments, isLoading, error, refetch, pagination] = usePendingEnrollments(search);
|
|
60
|
+
const itemCount = pendingEnrollments.length;
|
|
54
61
|
|
|
55
62
|
const refetchWithDevices = () => {
|
|
56
63
|
refetch();
|
|
@@ -61,8 +68,6 @@ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentReque
|
|
|
61
68
|
const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
|
|
62
69
|
const [isMassApproveModalOpen, setIsMassApproveModalOpen] = React.useState(false);
|
|
63
70
|
|
|
64
|
-
const { search, setSearch, filteredData } = useTableTextSearch(pendingEnrollments, getSearchText);
|
|
65
|
-
|
|
66
71
|
const { onRowSelect, hasSelectedRows, isAllSelected, isRowSelected, setAllSelected } = useTableSelect();
|
|
67
72
|
|
|
68
73
|
const { action: deleteAction, modal: deleteModal } = useDeleteListAction({
|
|
@@ -73,8 +78,15 @@ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentReque
|
|
|
73
78
|
},
|
|
74
79
|
});
|
|
75
80
|
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
React.useEffect(() => {
|
|
82
|
+
if (onEmptyListChanged && !search && !isLoading) {
|
|
83
|
+
onEmptyListChanged?.(itemCount === 0);
|
|
84
|
+
}
|
|
85
|
+
}, [search, itemCount, isLoading, onEmptyListChanged]);
|
|
86
|
+
|
|
87
|
+
// In non-standalone mode, hide the entire component when the search result is empty (and not due to filtering)
|
|
88
|
+
const isLastUnfilteredListEmpty = !search && itemCount === 0;
|
|
89
|
+
if (!isStandalone && isLastUnfilteredListEmpty) {
|
|
78
90
|
return null;
|
|
79
91
|
}
|
|
80
92
|
|
|
@@ -101,10 +113,11 @@ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentReque
|
|
|
101
113
|
</EnrollmentRequestTableToolbar>
|
|
102
114
|
<Table
|
|
103
115
|
aria-label={t('Table for devices pending approval')}
|
|
104
|
-
loading={!!isStandalone && isLoading &&
|
|
116
|
+
loading={!!isStandalone && isLoading && isLastUnfilteredListEmpty}
|
|
105
117
|
columns={enrollmentColumns}
|
|
106
|
-
|
|
107
|
-
|
|
118
|
+
emptyData={itemCount === 0}
|
|
119
|
+
clearFilters={() => setSearch('')}
|
|
120
|
+
hasFilters={!!search}
|
|
108
121
|
isAllSelected={isAllSelected}
|
|
109
122
|
onSelectAll={setAllSelected}
|
|
110
123
|
>
|
|
@@ -127,7 +140,7 @@ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentReque
|
|
|
127
140
|
</Tbody>
|
|
128
141
|
</Table>
|
|
129
142
|
<TablePagination pagination={pagination} isUpdating={isLoading} />
|
|
130
|
-
{isStandalone &&
|
|
143
|
+
{isStandalone && itemCount === 0 && !isLoading && <EnrollmentRequestEmptyState />}
|
|
131
144
|
{deleteModal}
|
|
132
145
|
{currentEnrollmentRequest && (
|
|
133
146
|
<ApproveDeviceModal
|
|
@@ -141,7 +154,7 @@ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentReque
|
|
|
141
154
|
{isMassDeleteModalOpen && (
|
|
142
155
|
<MassDeleteDeviceModal
|
|
143
156
|
onClose={() => setIsMassDeleteModalOpen(false)}
|
|
144
|
-
resources={
|
|
157
|
+
resources={pendingEnrollments.filter(isRowSelected)}
|
|
145
158
|
onDeleteSuccess={() => {
|
|
146
159
|
setIsMassDeleteModalOpen(false);
|
|
147
160
|
refetch();
|
|
@@ -151,7 +164,7 @@ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentReque
|
|
|
151
164
|
{isMassApproveModalOpen && (
|
|
152
165
|
<MassApproveDeviceModal
|
|
153
166
|
onClose={() => setIsMassApproveModalOpen(false)}
|
|
154
|
-
pendingEnrollments={
|
|
167
|
+
pendingEnrollments={pendingEnrollments.filter(isRowSelected)}
|
|
155
168
|
onApproveSuccess={() => {
|
|
156
169
|
setAllSelected(false);
|
|
157
170
|
setIsMassApproveModalOpen(false);
|
|
@@ -32,6 +32,7 @@ const EnrollmentRequestTableRow: React.FC<EnrollmentRequestTableRow> = ({
|
|
|
32
32
|
}) => {
|
|
33
33
|
const { t } = useTranslation();
|
|
34
34
|
const erName = er.metadata.name as string;
|
|
35
|
+
const erAlias = er.spec.labels?.alias;
|
|
35
36
|
|
|
36
37
|
const approveEnrollment = () => {
|
|
37
38
|
onApprove(erName);
|
|
@@ -57,8 +58,11 @@ const EnrollmentRequestTableRow: React.FC<EnrollmentRequestTableRow> = ({
|
|
|
57
58
|
isSelected: isRowSelected(er),
|
|
58
59
|
}}
|
|
59
60
|
/>
|
|
61
|
+
<Td dataLabel={t('Alias')}>
|
|
62
|
+
<ResourceLink id={erName} name={erAlias || t('Untitled')} routeLink={ROUTE.ENROLLMENT_REQUEST_DETAILS} />
|
|
63
|
+
</Td>
|
|
60
64
|
<Td dataLabel={t('Name')}>
|
|
61
|
-
<ResourceLink id={erName}
|
|
65
|
+
<ResourceLink id={erName} />
|
|
62
66
|
</Td>
|
|
63
67
|
<Td dataLabel={t('Created')}>{timeSinceText(t, er.metadata.creationTimestamp)}</Td>
|
|
64
68
|
{canApprove && (
|
|
@@ -10,12 +10,18 @@ import { PaginationDetails, useTablePagination } from '../../hooks/useTablePagin
|
|
|
10
10
|
import { PAGE_SIZE } from '../../constants';
|
|
11
11
|
|
|
12
12
|
type EnrollmentRequestsEndpointArgs = {
|
|
13
|
+
search?: string;
|
|
13
14
|
nextContinue?: string;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
const getPendingEnrollmentsEndpoint = ({ nextContinue }: EnrollmentRequestsEndpointArgs) => {
|
|
17
|
+
const getPendingEnrollmentsEndpoint = ({ search, nextContinue }: EnrollmentRequestsEndpointArgs) => {
|
|
18
|
+
const fieldSelector = ['!status.approval.approved'];
|
|
19
|
+
if (search) {
|
|
20
|
+
fieldSelector.push(`metadata.name contains ${search}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
const params = new URLSearchParams({
|
|
18
|
-
fieldSelector:
|
|
24
|
+
fieldSelector: fieldSelector.join(','),
|
|
19
25
|
});
|
|
20
26
|
|
|
21
27
|
if (nextContinue !== undefined) {
|
|
@@ -33,7 +39,9 @@ export const useEnrollmentRequestsEndpoint = (args: EnrollmentRequestsEndpointAr
|
|
|
33
39
|
return [pendingErEndpointDebounced, endpoint !== pendingErEndpointDebounced];
|
|
34
40
|
};
|
|
35
41
|
|
|
36
|
-
export const usePendingEnrollments = (
|
|
42
|
+
export const usePendingEnrollments = (
|
|
43
|
+
search?: string,
|
|
44
|
+
): [
|
|
37
45
|
EnrollmentRequest[],
|
|
38
46
|
boolean,
|
|
39
47
|
unknown,
|
|
@@ -42,7 +50,7 @@ export const usePendingEnrollments = (): [
|
|
|
42
50
|
] => {
|
|
43
51
|
const { currentPage, setCurrentPage, itemCount, nextContinue, onPageFetched } =
|
|
44
52
|
useTablePagination<EnrollmentRequestList>();
|
|
45
|
-
const [pendingErEndpoint, isDebouncing] = useEnrollmentRequestsEndpoint({ nextContinue });
|
|
53
|
+
const [pendingErEndpoint, isDebouncing] = useEnrollmentRequestsEndpoint({ search, nextContinue });
|
|
46
54
|
|
|
47
55
|
const [erList, isLoading, error, refetch] = useFetchPeriodically<EnrollmentRequestList>(
|
|
48
56
|
{
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import {
|
|
2
3
|
Alert,
|
|
3
4
|
Breadcrumb,
|
|
@@ -11,10 +12,11 @@ import {
|
|
|
11
12
|
WizardStep,
|
|
12
13
|
WizardStepType,
|
|
13
14
|
} from '@patternfly/react-core';
|
|
14
|
-
import * as React from 'react';
|
|
15
15
|
import { Fleet } from '@flightctl/types';
|
|
16
16
|
import { Formik, FormikErrors } from 'formik';
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
import { FleetFormValues } from './../../../types/deviceSpec';
|
|
19
|
+
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
18
20
|
import { useFetch } from '../../../hooks/useFetch';
|
|
19
21
|
import { getErrorMessage } from '../../../utils/error';
|
|
20
22
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
@@ -32,7 +34,6 @@ import { useEditFleet } from './useEditFleet';
|
|
|
32
34
|
import LeaveFormConfirmation from '../../common/LeaveFormConfirmation';
|
|
33
35
|
import ErrorBoundary from '../../common/ErrorBoundary';
|
|
34
36
|
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
35
|
-
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
36
37
|
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
37
38
|
import { useAppContext } from '../../../hooks/useAppContext';
|
|
38
39
|
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
3
3
|
import { Button, WizardFooterWrapper, useWizardContext } from '@patternfly/react-core';
|
|
4
4
|
import { useFormikContext } from 'formik';
|
|
5
|
-
import { FleetFormValues } from '
|
|
5
|
+
import { FleetFormValues } from './../../../types/deviceSpec';
|
|
6
6
|
import { useNavigate } from '../../../hooks/useNavigate';
|
|
7
7
|
import { reviewStepId } from './steps/ReviewStep';
|
|
8
8
|
import { generalInfoStepId, isGeneralInfoStepValid } from './steps/GeneralInfoStep';
|
|
@@ -21,6 +21,7 @@ const CreateFleetWizardFooter = ({ isEdit }: CreateFleetWizardFooterProps) => {
|
|
|
21
21
|
const { goToNextStep, goToPrevStep, activeStep } = useWizardContext();
|
|
22
22
|
const { submitForm, isSubmitting, errors } = useFormikContext<FleetFormValues>();
|
|
23
23
|
const navigate = useNavigate();
|
|
24
|
+
const buttonRef = React.useRef<HTMLButtonElement>();
|
|
24
25
|
|
|
25
26
|
const isReviewStep = activeStep.id === reviewStepId;
|
|
26
27
|
let isStepValid = true;
|
|
@@ -32,12 +33,18 @@ const CreateFleetWizardFooter = ({ isEdit }: CreateFleetWizardFooterProps) => {
|
|
|
32
33
|
isStepValid = isUpdatePolicyStepValid(errors);
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
const onMoveNext = () => {
|
|
37
|
+
goToNextStep();
|
|
38
|
+
// Blur the button, otherwise it keeps the focus from the previous click
|
|
39
|
+
buttonRef.current?.blur();
|
|
40
|
+
};
|
|
41
|
+
|
|
35
42
|
const primaryBtn = isReviewStep ? (
|
|
36
43
|
<Button variant="primary" onClick={submitForm} isDisabled={isSubmitting} isLoading={isSubmitting}>
|
|
37
44
|
{isEdit ? t('Save') : t('Create fleet')}
|
|
38
45
|
</Button>
|
|
39
46
|
) : (
|
|
40
|
-
<Button variant="primary" onClick={
|
|
47
|
+
<Button variant="primary" onClick={onMoveNext} isDisabled={!isStepValid} ref={buttonRef}>
|
|
41
48
|
{t('Next')}
|
|
42
49
|
</Button>
|
|
43
50
|
);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type DeviceUpdatePolicySpec, FleetSpec, Percentage } from '@flightctl/types';
|
|
2
2
|
|
|
3
|
-
import { BatchLimitType } from '
|
|
3
|
+
import { BatchLimitType, UpdatePolicyForm } from './../../../types/deviceSpec';
|
|
4
4
|
import { fromAPILabel } from '../../../utils/labels';
|
|
5
|
+
import * as timeUtils from '../../../utils/time';
|
|
6
|
+
import { schedulesAreEqual } from '../../../utils/patch';
|
|
5
7
|
|
|
6
8
|
export const DEFAULT_BACKEND_UPDATE_TIMEOUT_MINUTES = 1140; // 24h, expressed in minutes
|
|
7
9
|
const DEFAULT_BACKEND_SUCCESS_THRESHOLD_PERCENTAGE = '90%';
|
|
@@ -20,20 +22,23 @@ export const getEmptyInitializedBatch = () => ({
|
|
|
20
22
|
selector: [],
|
|
21
23
|
});
|
|
22
24
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
export const getEmptyUpdateFormParams = () => ({
|
|
26
|
+
isEditable: true,
|
|
27
|
+
isAdvanced: false,
|
|
28
|
+
downloadAndInstallDiffer: false,
|
|
29
|
+
// Download schedule
|
|
30
|
+
downloadStartsAt: timeUtils.defaultStartTime,
|
|
31
|
+
downloadEndsAt: timeUtils.defaultEndTime,
|
|
32
|
+
downloadScheduleMode: timeUtils.UpdateScheduleMode.Daily,
|
|
33
|
+
downloadWeekDays: [false, false, false, false, false, false, false],
|
|
34
|
+
downloadTimeZone: timeUtils.localDeviceTimezone,
|
|
35
|
+
// Install schedule (updateSchedule in the API)
|
|
36
|
+
installStartsAt: timeUtils.defaultStartTime,
|
|
37
|
+
installEndsAt: timeUtils.defaultEndTime,
|
|
38
|
+
installScheduleMode: timeUtils.UpdateScheduleMode.Daily,
|
|
39
|
+
installWeekDays: [false, false, false, false, false, false, false],
|
|
40
|
+
installTimeZone: timeUtils.localDeviceTimezone,
|
|
41
|
+
});
|
|
37
42
|
|
|
38
43
|
export const getRolloutPolicyValues = (fleetSpec?: FleetSpec) => {
|
|
39
44
|
const batches = (fleetSpec?.rolloutPolicy?.deviceSelection?.sequence || []).map((batch) => ({
|
|
@@ -47,7 +52,7 @@ export const getRolloutPolicyValues = (fleetSpec?: FleetSpec) => {
|
|
|
47
52
|
|
|
48
53
|
// If the policy does not specify the timeout, we set the backend's default as the field is required in the UI
|
|
49
54
|
const updateTimeout = fleetSpec?.rolloutPolicy?.defaultUpdateTimeout || `${DEFAULT_BACKEND_UPDATE_TIMEOUT_MINUTES}m`;
|
|
50
|
-
return { isAdvanced: batches.length > 0, batches, updateTimeout: durationToMinutes(updateTimeout) };
|
|
55
|
+
return { isAdvanced: batches.length > 0, batches, updateTimeout: timeUtils.durationToMinutes(updateTimeout) };
|
|
51
56
|
};
|
|
52
57
|
|
|
53
58
|
export const getDisruptionBudgetValues = (fleetSpec?: FleetSpec) => {
|
|
@@ -60,3 +65,32 @@ export const getDisruptionBudgetValues = (fleetSpec?: FleetSpec) => {
|
|
|
60
65
|
maxUnavailable: budget.maxUnavailable,
|
|
61
66
|
};
|
|
62
67
|
};
|
|
68
|
+
|
|
69
|
+
export const getUpdatePolicyValues = (updateSpec?: DeviceUpdatePolicySpec): UpdatePolicyForm => {
|
|
70
|
+
const isEqual = schedulesAreEqual(updateSpec?.updateSchedule, updateSpec?.downloadSchedule);
|
|
71
|
+
|
|
72
|
+
const downloadStartsAt = timeUtils.getTime(updateSpec?.downloadSchedule?.at);
|
|
73
|
+
const installStartsAt = timeUtils.getTime(updateSpec?.updateSchedule?.at);
|
|
74
|
+
|
|
75
|
+
const downloadWeekDays = timeUtils.getWeekDays(updateSpec?.downloadSchedule?.at);
|
|
76
|
+
const installWeekDays = timeUtils.getWeekDays(updateSpec?.updateSchedule?.at);
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
isAdvanced: Boolean(updateSpec?.downloadSchedule?.at || updateSpec?.updateSchedule?.at),
|
|
80
|
+
downloadAndInstallDiffer: !isEqual,
|
|
81
|
+
downloadStartsAt,
|
|
82
|
+
downloadEndsAt: timeUtils.getEndTime(downloadStartsAt, updateSpec?.downloadSchedule?.startGraceDuration),
|
|
83
|
+
downloadWeekDays: downloadWeekDays.selectedDays,
|
|
84
|
+
downloadScheduleMode: downloadWeekDays.allSelected
|
|
85
|
+
? timeUtils.UpdateScheduleMode.Daily
|
|
86
|
+
: timeUtils.UpdateScheduleMode.Weekly,
|
|
87
|
+
downloadTimeZone: updateSpec?.downloadSchedule?.timeZone || timeUtils.localDeviceTimezone,
|
|
88
|
+
installStartsAt,
|
|
89
|
+
installEndsAt: timeUtils.getEndTime(installStartsAt, updateSpec?.updateSchedule?.startGraceDuration),
|
|
90
|
+
installWeekDays: installWeekDays.selectedDays,
|
|
91
|
+
installScheduleMode: installWeekDays.allSelected
|
|
92
|
+
? timeUtils.UpdateScheduleMode.Daily
|
|
93
|
+
: timeUtils.UpdateScheduleMode.Weekly,
|
|
94
|
+
installTimeZone: updateSpec?.updateSchedule?.timeZone || timeUtils.localDeviceTimezone,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -95,7 +95,7 @@ const DeviceLabelSelector = () => {
|
|
|
95
95
|
/>
|
|
96
96
|
);
|
|
97
97
|
} else {
|
|
98
|
-
message = t('
|
|
98
|
+
message = t('Labels used to select devices for your fleet. If not specified, no devices will be added.');
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
return (
|
|
@@ -2,13 +2,12 @@ import * as React from 'react';
|
|
|
2
2
|
import { FormGroup, Grid } from '@patternfly/react-core';
|
|
3
3
|
import { FormikErrors } from 'formik';
|
|
4
4
|
|
|
5
|
-
import { FleetFormValues } from '
|
|
5
|
+
import { FleetFormValues } from '../../../../types/deviceSpec';
|
|
6
6
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
7
7
|
import NameField from '../../../form/NameField';
|
|
8
8
|
import LabelsField from '../../../form/LabelsField';
|
|
9
9
|
import FlightCtlForm from '../../../form/FlightCtlForm';
|
|
10
10
|
import { getDnsSubdomainValidations } from '../../../form/validations';
|
|
11
|
-
import WithHelperText from '../../../common/WithHelperText';
|
|
12
11
|
import DeviceLabelSelector from './DeviceLabelSelector';
|
|
13
12
|
|
|
14
13
|
export const generalInfoStepId = 'general-info';
|
|
@@ -34,17 +33,7 @@ const GeneralInfoStep = ({ isEdit }: { isEdit: boolean }) => {
|
|
|
34
33
|
<FormGroup label={t('Fleet labels')}>
|
|
35
34
|
<LabelsField name="fleetLabels" />
|
|
36
35
|
</FormGroup>
|
|
37
|
-
<FormGroup
|
|
38
|
-
label={
|
|
39
|
-
<WithHelperText
|
|
40
|
-
content={t(
|
|
41
|
-
'Devices matching these labels will be selected by the fleet. If left empty, no devices will be selected.',
|
|
42
|
-
)}
|
|
43
|
-
ariaLabel={t('Device selector')}
|
|
44
|
-
showLabel
|
|
45
|
-
/>
|
|
46
|
-
}
|
|
47
|
-
>
|
|
36
|
+
<FormGroup label={t('Device selector')}>
|
|
48
37
|
<DeviceLabelSelector />
|
|
49
38
|
</FormGroup>
|
|
50
39
|
</FlightCtlForm>
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
import { useFormikContext } from 'formik';
|
|
11
11
|
|
|
12
12
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
13
|
-
import { FleetFormValues } from '
|
|
13
|
+
import { FleetFormValues } from '../../../../types/deviceSpec';
|
|
14
14
|
import LabelsView from '../../../common/LabelsView';
|
|
15
15
|
import FlightControlDescriptionList from '../../../common/FlightCtlDescriptionList';
|
|
16
16
|
import { toAPILabel } from '../../../../utils/labels';
|
|
17
17
|
import RepositorySourceList from '../../../Repository/RepositoryDetails/RepositorySourceList';
|
|
18
18
|
import { getErrorMessage } from '../../../../utils/error';
|
|
19
|
-
import {
|
|
19
|
+
import { getApiConfig } from '../../../Device/EditDeviceWizard/deviceSpecUtils';
|
|
20
20
|
import ReviewApplications from '../../../Device/EditDeviceWizard/steps/ReviewApplications';
|
|
21
21
|
import ReviewTrackedSystemdServices from '../../../Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices';
|
|
22
22
|
import {
|
|
@@ -71,7 +71,7 @@ const ReviewStep = ({ error }: { error?: unknown }) => {
|
|
|
71
71
|
<DescriptionListGroup>
|
|
72
72
|
<DescriptionListTerm>{t('Configurations')}</DescriptionListTerm>
|
|
73
73
|
<DescriptionListDescription>
|
|
74
|
-
<RepositorySourceList configs={values.configTemplates.map(
|
|
74
|
+
<RepositorySourceList configs={values.configTemplates.map(getApiConfig)} />
|
|
75
75
|
</DescriptionListDescription>
|
|
76
76
|
</DescriptionListGroup>
|
|
77
77
|
)}
|
|
@@ -4,7 +4,7 @@ import { TFunction } from 'react-i18next';
|
|
|
4
4
|
|
|
5
5
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
6
6
|
|
|
7
|
-
export type StepSetting = 'all-settings' | 'rollout-policies' | 'disruption-budget';
|
|
7
|
+
export type StepSetting = 'all-settings' | 'rollout-policies' | 'update-policies' | 'disruption-budget';
|
|
8
8
|
|
|
9
9
|
type UpdateConfirmChangesModalProps = {
|
|
10
10
|
setting: StepSetting;
|
|
@@ -39,6 +39,15 @@ const getModalContent = (setting: StepSetting, t: TFunction) => {
|
|
|
39
39
|
result: t('If you confirm, all disruption budget configurations will be lost.'),
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
+
case 'update-policies': {
|
|
43
|
+
const title = t("Don't use update policies");
|
|
44
|
+
return {
|
|
45
|
+
title,
|
|
46
|
+
primaryAction: title,
|
|
47
|
+
question: t('Are you sure you want to remove the update policy configurations?'),
|
|
48
|
+
result: t('If you confirm, all update policy configurations will be lost.'),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
52
|
};
|
|
44
53
|
|
|
@@ -2,32 +2,37 @@ import * as React from 'react';
|
|
|
2
2
|
import { Alert, Checkbox, FormGroup, FormSection, Grid } from '@patternfly/react-core';
|
|
3
3
|
import { FormikErrors, useFormikContext } from 'formik';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_BACKEND_UPDATE_TIMEOUT_MINUTES,
|
|
7
|
+
getEmptyInitializedBatch,
|
|
8
|
+
getEmptyUpdateFormParams,
|
|
9
|
+
} from '../fleetSpecUtils';
|
|
7
10
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
8
|
-
import
|
|
11
|
+
import LabelWithHelperText from '../../../common/WithHelperText';
|
|
12
|
+
import { FleetFormValues } from '../../../../types/deviceSpec';
|
|
9
13
|
|
|
10
14
|
import FlightCtlForm from '../../../form/FlightCtlForm';
|
|
11
15
|
import UpdateStepRolloutPolicy from './UpdateStepRolloutPolicy';
|
|
12
16
|
import UpdateStepDisruptionBudget from './UpdateStepDisruptionBudget';
|
|
17
|
+
import UpdateStepUpdatePolicy from './UpdateStepUpdatePolicy';
|
|
13
18
|
import UpdateConfirmChangesModal, { StepSetting } from './UpdateConfirmChangesModal';
|
|
14
19
|
|
|
15
20
|
export const updatePolicyStepId = 'update-policy';
|
|
16
21
|
|
|
17
22
|
export const isUpdatePolicyStepValid = (errors: FormikErrors<FleetFormValues>) =>
|
|
18
|
-
!errors.rolloutPolicy && !errors.disruptionBudget;
|
|
23
|
+
!errors.rolloutPolicy && !errors.disruptionBudget && !errors.updatePolicy;
|
|
19
24
|
|
|
20
25
|
const UpdatePolicyStep = () => {
|
|
21
26
|
const { t } = useTranslation();
|
|
22
27
|
|
|
23
28
|
const {
|
|
24
|
-
values: { rolloutPolicy, disruptionBudget },
|
|
29
|
+
values: { rolloutPolicy, disruptionBudget, updatePolicy },
|
|
25
30
|
setFieldValue,
|
|
26
31
|
} = useFormikContext<FleetFormValues>();
|
|
27
32
|
|
|
28
33
|
const [forceShowAdvancedMode, setForceShowAdvancedMode] = React.useState<boolean>(false);
|
|
29
34
|
const [alertSwitchToBasic, setAlertSwitchToBasic] = React.useState<StepSetting>();
|
|
30
|
-
const hasAdvancedMode = rolloutPolicy.isAdvanced || disruptionBudget.isAdvanced;
|
|
35
|
+
const hasAdvancedMode = rolloutPolicy.isAdvanced || disruptionBudget.isAdvanced || updatePolicy.isAdvanced;
|
|
31
36
|
|
|
32
37
|
const onSettingsChange = (setting: StepSetting, toAdvanced: boolean) => {
|
|
33
38
|
if (toAdvanced) {
|
|
@@ -37,11 +42,15 @@ const UpdatePolicyStep = () => {
|
|
|
37
42
|
break;
|
|
38
43
|
case 'rollout-policies':
|
|
39
44
|
setFieldValue('rolloutPolicy.isAdvanced', true);
|
|
40
|
-
onChangePolicyType(true);
|
|
45
|
+
void onChangePolicyType(true);
|
|
41
46
|
break;
|
|
42
47
|
case 'disruption-budget':
|
|
43
48
|
setFieldValue('disruptionBudget.isAdvanced', true);
|
|
44
|
-
onChangeDisruptionBudget(true);
|
|
49
|
+
void onChangeDisruptionBudget(true);
|
|
50
|
+
break;
|
|
51
|
+
case 'update-policies':
|
|
52
|
+
setFieldValue('updatePolicy.isAdvanced', true);
|
|
53
|
+
void onChangeUpdatePolicy(true);
|
|
45
54
|
break;
|
|
46
55
|
}
|
|
47
56
|
} else {
|
|
@@ -68,6 +77,12 @@ const UpdatePolicyStep = () => {
|
|
|
68
77
|
}
|
|
69
78
|
};
|
|
70
79
|
|
|
80
|
+
const onChangeUpdatePolicy = async (toAdvanced: boolean) => {
|
|
81
|
+
if (!toAdvanced) {
|
|
82
|
+
await setFieldValue('updatePolicy', getEmptyUpdateFormParams());
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
71
86
|
const onModalClose = async (doSwitch: boolean) => {
|
|
72
87
|
setAlertSwitchToBasic(undefined);
|
|
73
88
|
if (!doSwitch) {
|
|
@@ -79,6 +94,7 @@ const UpdatePolicyStep = () => {
|
|
|
79
94
|
case 'all-settings':
|
|
80
95
|
await onChangePolicyType(false);
|
|
81
96
|
await onChangeDisruptionBudget(false);
|
|
97
|
+
await onChangeUpdatePolicy(false);
|
|
82
98
|
break;
|
|
83
99
|
case 'rollout-policies':
|
|
84
100
|
void onChangePolicyType(false);
|
|
@@ -86,6 +102,9 @@ const UpdatePolicyStep = () => {
|
|
|
86
102
|
case 'disruption-budget':
|
|
87
103
|
void onChangeDisruptionBudget(false);
|
|
88
104
|
break;
|
|
105
|
+
case 'update-policies':
|
|
106
|
+
void onChangeUpdatePolicy(false);
|
|
107
|
+
break;
|
|
89
108
|
}
|
|
90
109
|
setForceShowAdvancedMode(false);
|
|
91
110
|
};
|
|
@@ -108,9 +127,8 @@ const UpdatePolicyStep = () => {
|
|
|
108
127
|
{/* Rollout policies */}
|
|
109
128
|
<Checkbox
|
|
110
129
|
label={
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
ariaLabel={t('Set rollout policies')}
|
|
130
|
+
<LabelWithHelperText
|
|
131
|
+
label={t('Set rollout policies')}
|
|
114
132
|
content={t('Rollout policies allow you to control the order of updates for the fleet devices.')}
|
|
115
133
|
/>
|
|
116
134
|
}
|
|
@@ -119,15 +137,14 @@ const UpdatePolicyStep = () => {
|
|
|
119
137
|
onChange={(_ev: React.FormEvent<HTMLInputElement>, toAdvanced: boolean) =>
|
|
120
138
|
onSettingsChange('rollout-policies', toAdvanced)
|
|
121
139
|
}
|
|
140
|
+
body={rolloutPolicy.isAdvanced && <UpdateStepRolloutPolicy />}
|
|
122
141
|
/>
|
|
123
|
-
{rolloutPolicy.isAdvanced && <UpdateStepRolloutPolicy />}
|
|
124
142
|
|
|
125
143
|
{/* Disruption budget */}
|
|
126
144
|
<Checkbox
|
|
127
145
|
label={
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
ariaLabel={t('Set disruption budget')}
|
|
146
|
+
<LabelWithHelperText
|
|
147
|
+
label={t('Set disruption budget')}
|
|
131
148
|
content={t(
|
|
132
149
|
'Disruption budget allows you to limit the number of similar devices that may be updating simultaneously.',
|
|
133
150
|
)}
|
|
@@ -138,8 +155,24 @@ const UpdatePolicyStep = () => {
|
|
|
138
155
|
onChange={(_ev: React.FormEvent<HTMLInputElement>, toAdvanced: boolean) =>
|
|
139
156
|
onSettingsChange('disruption-budget', toAdvanced)
|
|
140
157
|
}
|
|
158
|
+
body={disruptionBudget.isAdvanced && <UpdateStepDisruptionBudget />}
|
|
159
|
+
/>
|
|
160
|
+
|
|
161
|
+
{/* Update (and download) policies */}
|
|
162
|
+
<Checkbox
|
|
163
|
+
label={
|
|
164
|
+
<LabelWithHelperText
|
|
165
|
+
label={t('Set update policies')}
|
|
166
|
+
content={t('Update policies allow you to control when updates should be downloaded and applied.')}
|
|
167
|
+
/>
|
|
168
|
+
}
|
|
169
|
+
isChecked={updatePolicy.isAdvanced}
|
|
170
|
+
id="advUpdatePolicy"
|
|
171
|
+
onChange={(_ev: React.FormEvent<HTMLInputElement>, toAdvanced: boolean) =>
|
|
172
|
+
onSettingsChange('update-policies', toAdvanced)
|
|
173
|
+
}
|
|
174
|
+
body={updatePolicy.isAdvanced && <UpdateStepUpdatePolicy />}
|
|
141
175
|
/>
|
|
142
|
-
{disruptionBudget.isAdvanced && <UpdateStepDisruptionBudget />}
|
|
143
176
|
</FormSection>
|
|
144
177
|
) : (
|
|
145
178
|
<Alert isInline variant="info" title={t('Default update policy')}>
|