@flightctl/ui-components 0.4.0 → 0.5.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/DetailsPageActions.d.ts +11 -4
- package/dist/src/components/DetailsPage/DetailsPageActions.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/DetailsPageActions.js +15 -4
- package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +2 -2
- 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 +22 -15
- 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 +42 -39
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts +7 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js +41 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts +7 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +30 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts +16 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js +57 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts +16 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +73 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts +10 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js +19 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts +8 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js +34 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +0 -22
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +9 -92
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts +16 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/{DeviceTableRow.js → EnrolledDeviceTableRow.js} +9 -13
- package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts +23 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +99 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts +2 -0
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js +16 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +5 -3
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +2 -2
- 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 +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.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 +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +7 -7
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts +9 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js +37 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +6 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +4 -13
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +2 -2
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -1
- 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 +32 -3
- 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 +4 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts +26 -0
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js +63 -0
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +19 -10
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts +9 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js +52 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts +8 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js +95 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts +4 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js +32 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts +4 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js +78 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/types.d.ts +21 -0
- package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/types.js +6 -0
- package/dist/src/components/Fleet/CreateFleet/types.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +15 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js +9 -7
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts +9 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/{FleetDevices.js → FleetDevicesCharts.js} +4 -4
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts +10 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js +30 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js.map +1 -0
- package/dist/src/components/Fleet/FleetResourceSyncs.js +2 -2
- package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
- package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetRow.js +7 -5
- package/dist/src/components/Fleet/FleetRow.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +2 -2
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/useFleets.d.ts +3 -3
- package/dist/src/components/Fleet/useFleets.d.ts.map +1 -1
- package/dist/src/components/Fleet/useFleets.js +3 -3
- package/dist/src/components/Fleet/useFleets.js.map +1 -1
- package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
- package/dist/src/components/ListPage/ListPage.js +6 -1
- package/dist/src/components/ListPage/ListPage.js.map +1 -1
- package/dist/src/components/ListPage/ListPageActions.d.ts +8 -15
- package/dist/src/components/ListPage/ListPageActions.d.ts.map +1 -1
- package/dist/src/components/ListPage/ListPageActions.js +25 -5
- package/dist/src/components/ListPage/ListPageActions.js.map +1 -1
- package/dist/src/components/ListPage/types.d.ts +11 -11
- package/dist/src/components/ListPage/types.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js +0 -1
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js.map +1 -1
- package/dist/src/components/OverviewPage/OverviewPage.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/OverviewPage.js +6 -1
- package/dist/src/components/OverviewPage/OverviewPage.js.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/useRepositories.d.ts +2 -2
- package/dist/src/components/Repository/useRepositories.d.ts.map +1 -1
- package/dist/src/components/Repository/useRepositories.js.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +2 -2
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Status/DeviceLifecycleStatus.d.ts +7 -0
- package/dist/src/components/Status/DeviceLifecycleStatus.d.ts.map +1 -0
- package/dist/src/components/Status/DeviceLifecycleStatus.js +25 -0
- package/dist/src/components/Status/DeviceLifecycleStatus.js.map +1 -0
- package/dist/src/components/Status/StatusDisplay.d.ts +1 -1
- package/dist/src/components/Status/StatusDisplay.d.ts.map +1 -1
- package/dist/src/components/Status/StatusDisplay.js +3 -3
- package/dist/src/components/Status/StatusDisplay.js.map +1 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/Table.js +2 -2
- package/dist/src/components/Table/Table.js.map +1 -1
- package/dist/src/components/Table/TablePagination.d.ts +4 -3
- package/dist/src/components/Table/TablePagination.d.ts.map +1 -1
- package/dist/src/components/Table/TablePagination.js +6 -5
- package/dist/src/components/Table/TablePagination.js.map +1 -1
- package/dist/src/components/common/EditableLabelControl.d.ts.map +1 -1
- package/dist/src/components/common/EditableLabelControl.js +5 -7
- package/dist/src/components/common/EditableLabelControl.js.map +1 -1
- package/dist/src/components/common/TechPreviewBadge.d.ts +4 -0
- package/dist/src/components/common/TechPreviewBadge.d.ts.map +1 -0
- package/dist/src/components/common/TechPreviewBadge.js +23 -0
- package/dist/src/components/common/TechPreviewBadge.js.map +1 -0
- package/dist/src/components/form/LabelsField.d.ts.map +1 -1
- package/dist/src/components/form/LabelsField.js +4 -1
- package/dist/src/components/form/LabelsField.js.map +1 -1
- package/dist/src/components/form/NumberField.d.ts +10 -0
- package/dist/src/components/form/NumberField.d.ts.map +1 -0
- package/dist/src/components/form/NumberField.js +51 -0
- package/dist/src/components/form/NumberField.js.map +1 -0
- package/dist/src/components/form/TextListField.d.ts +12 -0
- package/dist/src/components/form/TextListField.d.ts.map +1 -0
- package/dist/src/components/form/TextListField.js +46 -0
- package/dist/src/components/form/TextListField.js.map +1 -0
- package/dist/src/components/form/validations.d.ts +34 -6
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +78 -4
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts +9 -0
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts.map +1 -0
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.js +51 -0
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.js.map +1 -0
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +4 -2
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +11 -4
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts +10 -0
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts.map +1 -0
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js +67 -0
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js.map +1 -0
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/useAppContext.d.ts +1 -1
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +1 -1
- package/dist/src/hooks/useFetchPeriodically.js +10 -10
- package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
- package/dist/src/hooks/useTablePagination.d.ts +5 -3
- package/dist/src/hooks/useTablePagination.d.ts.map +1 -1
- package/dist/src/hooks/useTablePagination.js +9 -5
- package/dist/src/hooks/useTablePagination.js.map +1 -1
- package/dist/src/hooks/useWebSocket.d.ts +1 -1
- package/dist/src/hooks/useWebSocket.js +4 -4
- package/dist/src/hooks/useWebSocket.js.map +1 -1
- package/dist/src/links.d.ts +1 -0
- package/dist/src/links.d.ts.map +1 -1
- package/dist/src/links.js +2 -1
- package/dist/src/links.js.map +1 -1
- package/dist/src/types/rbac.d.ts +3 -1
- package/dist/src/types/rbac.d.ts.map +1 -1
- package/dist/src/types/rbac.js +2 -0
- package/dist/src/types/rbac.js.map +1 -1
- package/dist/src/utils/api.d.ts +3 -6
- package/dist/src/utils/api.d.ts.map +1 -1
- package/dist/src/utils/api.js.map +1 -1
- package/dist/src/utils/apiCalls.d.ts +2 -0
- package/dist/src/utils/apiCalls.d.ts.map +1 -0
- package/dist/src/utils/apiCalls.js +23 -0
- package/dist/src/utils/apiCalls.js.map +1 -0
- package/dist/src/utils/devices.d.ts +6 -3
- package/dist/src/utils/devices.d.ts.map +1 -1
- package/dist/src/utils/devices.js +20 -1
- package/dist/src/utils/devices.js.map +1 -1
- package/dist/src/utils/patch.d.ts +4 -1
- package/dist/src/utils/patch.d.ts.map +1 -1
- package/dist/src/utils/patch.js +166 -9
- package/dist/src/utils/patch.js.map +1 -1
- package/dist/src/utils/status/common.js +13 -12
- package/dist/src/utils/status/common.js.map +1 -1
- package/dist/src/utils/status/devices.d.ts +3 -3
- package/dist/src/utils/status/devices.d.ts.map +1 -1
- package/dist/src/utils/status/devices.js +40 -5
- package/dist/src/utils/status/devices.js.map +1 -1
- package/dist/src/utils/status/fleet.d.ts +4 -4
- package/dist/src/utils/status/fleet.d.ts.map +1 -1
- package/dist/src/utils/status/fleet.js +15 -2
- package/dist/src/utils/status/fleet.js.map +1 -1
- package/dist/src/utils/tooltip.d.ts +7 -0
- package/dist/src/utils/tooltip.d.ts.map +1 -0
- package/dist/src/utils/tooltip.js +6 -0
- package/dist/src/utils/tooltip.js.map +1 -0
- package/package.json +1 -1
- package/src/components/DetailsPage/DetailsPageActions.tsx +34 -6
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +1 -1
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +3 -3
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +53 -34
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +71 -54
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx +75 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +47 -0
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +1 -4
- package/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.tsx +89 -0
- package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +156 -0
- package/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.tsx +30 -0
- package/src/components/Device/DevicesPage/DevicesEmptyStates.tsx +46 -0
- package/src/components/Device/DevicesPage/DevicesPage.tsx +45 -215
- package/src/components/Device/DevicesPage/{DeviceTableRow.tsx → EnrolledDeviceTableRow.tsx} +16 -20
- package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +208 -0
- package/src/components/Device/DevicesPage/useDevices.ts +21 -1
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +6 -3
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +1 -1
- package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +2 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +1 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +1 -0
- package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +27 -19
- package/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.tsx +55 -0
- package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +9 -7
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +10 -36
- package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +2 -2
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +2 -2
- package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +3 -2
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +46 -5
- package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +4 -0
- package/src/components/Fleet/CreateFleet/fleetSpecUtils.ts +62 -0
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +65 -30
- package/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.tsx +87 -0
- package/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.tsx +155 -0
- package/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.tsx +91 -0
- package/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.tsx +190 -0
- package/src/components/Fleet/CreateFleet/types.ts +25 -0
- package/src/components/Fleet/CreateFleet/utils.ts +20 -1
- package/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx +10 -7
- package/src/components/Fleet/FleetDetails/{FleetDevices.tsx → FleetDevicesCharts.tsx} +4 -4
- package/src/components/Fleet/FleetDetails/FleetDevicesCount.tsx +53 -0
- package/src/components/Fleet/FleetResourceSyncs.tsx +2 -2
- package/src/components/Fleet/FleetRow.tsx +12 -4
- package/src/components/Fleet/FleetsPage.tsx +2 -2
- package/src/components/Fleet/useFleets.ts +7 -7
- package/src/components/ListPage/ListPage.tsx +12 -4
- package/src/components/ListPage/ListPageActions.tsx +50 -16
- package/src/components/ListPage/types.ts +8 -8
- package/src/components/OverviewPage/Cards/Status/DeviceStatusChart.tsx +0 -1
- package/src/components/OverviewPage/OverviewPage.tsx +12 -4
- package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +1 -1
- package/src/components/Repository/useRepositories.ts +2 -2
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +2 -2
- package/src/components/Status/DeviceLifecycleStatus.tsx +33 -0
- package/src/components/Status/StatusDisplay.tsx +4 -4
- package/src/components/Table/Table.tsx +2 -1
- package/src/components/Table/TablePagination.tsx +9 -7
- package/src/components/common/EditableLabelControl.tsx +7 -6
- package/src/components/common/TechPreviewBadge.tsx +43 -0
- package/src/components/form/LabelsField.tsx +4 -1
- package/src/components/form/NumberField.tsx +78 -0
- package/src/components/form/TextListField.tsx +82 -0
- package/src/components/form/validations.ts +103 -10
- package/src/components/modals/DecommissionModal/DecommissionModal.tsx +95 -0
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -8
- package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx +130 -0
- package/src/constants.ts +1 -1
- package/src/hooks/useAppContext.tsx +1 -1
- package/src/hooks/useFetchPeriodically.ts +11 -11
- package/src/hooks/{useTablePagination.tsx → useTablePagination.ts} +13 -7
- package/src/hooks/useWebSocket.ts +4 -4
- package/src/links.ts +2 -0
- package/src/types/rbac.ts +2 -0
- package/src/utils/api.ts +13 -6
- package/src/utils/apiCalls.ts +15 -0
- package/src/utils/devices.ts +21 -3
- package/src/utils/patch.ts +182 -8
- package/src/utils/status/common.ts +8 -8
- package/src/utils/status/devices.ts +39 -8
- package/src/utils/status/fleet.ts +21 -6
- package/src/utils/tooltip.ts +2 -0
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts +0 -8
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts.map +0 -1
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js +0 -23
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +0 -16
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts +0 -9
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts +0 -7
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js +0 -13
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js.map +0 -1
- package/dist/src/components/Status/IntegrityStatus.d.ts +0 -7
- package/dist/src/components/Status/IntegrityStatus.d.ts.map +0 -1
- package/dist/src/components/Status/IntegrityStatus.js +0 -17
- package/dist/src/components/Status/IntegrityStatus.js.map +0 -1
- package/dist/src/utils/status/integrity.d.ts +0 -5
- package/dist/src/utils/status/integrity.d.ts.map +0 -1
- package/dist/src/utils/status/integrity.js +0 -28
- package/dist/src/utils/status/integrity.js.map +0 -1
- package/src/components/DetailsPage/Tables/IntegrityDetails.tsx +0 -44
- package/src/components/Fleet/FleetDetails/FleetDevicesLink.tsx +0 -16
- package/src/components/Status/IntegrityStatus.tsx +0 -19
- package/src/utils/status/integrity.ts +0 -26
|
@@ -50,7 +50,7 @@ const EditDeviceWizardNav = () => {
|
|
|
50
50
|
</WizardNavItem>
|
|
51
51
|
<WizardNavItem
|
|
52
52
|
stepIndex={reviewDeviceStepIndex}
|
|
53
|
-
content={t('Review and
|
|
53
|
+
content={t('Review and save')}
|
|
54
54
|
isCurrent={activeStep?.index === reviewDeviceStepIndex + 1}
|
|
55
55
|
isDisabled={isReviewDeviceDisabled}
|
|
56
56
|
onClick={() => {
|
|
@@ -86,6 +86,7 @@ const ApplicationSection = ({ index }: { index: number }) => {
|
|
|
86
86
|
</SplitItem>
|
|
87
87
|
<SplitItem>
|
|
88
88
|
<Button
|
|
89
|
+
aria-label={t('Delete variable')}
|
|
89
90
|
variant="link"
|
|
90
91
|
icon={<MinusCircleIcon />}
|
|
91
92
|
iconPosition="end"
|
|
@@ -139,6 +140,7 @@ const ApplicationTemplates = () => {
|
|
|
139
140
|
</SplitItem>
|
|
140
141
|
<SplitItem>
|
|
141
142
|
<Button
|
|
143
|
+
aria-label={t('Delete application')}
|
|
142
144
|
variant="link"
|
|
143
145
|
icon={<MinusCircleIcon />}
|
|
144
146
|
iconPosition="start"
|
|
@@ -121,6 +121,7 @@ const ConfigInlineTemplateForm = ({ index }: ConfigInlineTemplateFormProps) => {
|
|
|
121
121
|
{inlineConfig.files.length > 1 && (
|
|
122
122
|
<SplitItem>
|
|
123
123
|
<Button
|
|
124
|
+
aria-label={t('Delete file')}
|
|
124
125
|
variant="link"
|
|
125
126
|
icon={<MinusCircleIcon />}
|
|
126
127
|
iconPosition="start"
|
|
@@ -24,6 +24,7 @@ export const reviewDeviceStepId = 'review-device';
|
|
|
24
24
|
const ReviewStep = ({ error }: { error?: string }) => {
|
|
25
25
|
const { t } = useTranslation();
|
|
26
26
|
const { values } = useFormikContext<EditDeviceFormValues>();
|
|
27
|
+
|
|
27
28
|
return (
|
|
28
29
|
<Stack hasGutter>
|
|
29
30
|
<StackItem isFilled>
|
|
@@ -37,12 +38,15 @@ const ReviewStep = ({ error }: { error?: string }) => {
|
|
|
37
38
|
<DescriptionListTerm>{t('Alias')}</DescriptionListTerm>
|
|
38
39
|
<DescriptionListDescription>{values.deviceAlias || t('Untitled')}</DescriptionListDescription>
|
|
39
40
|
</DescriptionListGroup>
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
{values.labels.length > 0 && (
|
|
42
|
+
<DescriptionListGroup>
|
|
43
|
+
<DescriptionListTerm>{t('Device labels')}</DescriptionListTerm>
|
|
44
|
+
<DescriptionListDescription>
|
|
45
|
+
<LabelsView prefix="device" labels={toAPILabel(values.labels)} />
|
|
46
|
+
</DescriptionListDescription>
|
|
47
|
+
</DescriptionListGroup>
|
|
48
|
+
)}
|
|
49
|
+
|
|
46
50
|
{values.fleetMatch && (
|
|
47
51
|
<DescriptionListGroup>
|
|
48
52
|
<DescriptionListTerm>{t('Device fleet')}</DescriptionListTerm>
|
|
@@ -52,21 +56,25 @@ const ReviewStep = ({ error }: { error?: string }) => {
|
|
|
52
56
|
<DescriptionListGroup>
|
|
53
57
|
<DescriptionListTerm>{t('System image')}</DescriptionListTerm>
|
|
54
58
|
<DescriptionListDescription>
|
|
55
|
-
{values.osImage || t(`
|
|
56
|
-
</DescriptionListDescription>
|
|
57
|
-
</DescriptionListGroup>
|
|
58
|
-
<DescriptionListGroup>
|
|
59
|
-
<DescriptionListTerm>{t('Configurations')}</DescriptionListTerm>
|
|
60
|
-
<DescriptionListDescription>
|
|
61
|
-
<RepositorySourceList configs={values.configTemplates.map(getAPIConfig)} />
|
|
62
|
-
</DescriptionListDescription>
|
|
63
|
-
</DescriptionListGroup>
|
|
64
|
-
<DescriptionListGroup>
|
|
65
|
-
<DescriptionListTerm>{t('Applications')}</DescriptionListTerm>
|
|
66
|
-
<DescriptionListDescription>
|
|
67
|
-
<ReviewApplications apps={values.applications} />
|
|
59
|
+
{values.osImage || t(`Edge Manager will not manage system image`)}
|
|
68
60
|
</DescriptionListDescription>
|
|
69
61
|
</DescriptionListGroup>
|
|
62
|
+
{values.configTemplates.length > 0 && (
|
|
63
|
+
<DescriptionListGroup>
|
|
64
|
+
<DescriptionListTerm>{t('Configurations')}</DescriptionListTerm>
|
|
65
|
+
<DescriptionListDescription>
|
|
66
|
+
<RepositorySourceList configs={values.configTemplates.map(getAPIConfig)} />
|
|
67
|
+
</DescriptionListDescription>
|
|
68
|
+
</DescriptionListGroup>
|
|
69
|
+
)}
|
|
70
|
+
{values.applications.length > 0 && (
|
|
71
|
+
<DescriptionListGroup>
|
|
72
|
+
<DescriptionListTerm>{t('Applications')}</DescriptionListTerm>
|
|
73
|
+
<DescriptionListDescription>
|
|
74
|
+
<ReviewApplications apps={values.applications} />
|
|
75
|
+
</DescriptionListDescription>
|
|
76
|
+
</DescriptionListGroup>
|
|
77
|
+
)}
|
|
70
78
|
</FlightControlDescriptionList>
|
|
71
79
|
</StackItem>
|
|
72
80
|
{!!error && (
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Stack, StackItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
import { DisruptionBudgetForm, RolloutPolicyForm } from '../../../Fleet/CreateFleet/types';
|
|
5
|
+
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
6
|
+
import LabelsView from '../../../common/LabelsView';
|
|
7
|
+
|
|
8
|
+
export const ReviewUpdateRolloutPolicy = ({ rolloutPolicy }: { rolloutPolicy: RolloutPolicyForm }) => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
|
|
11
|
+
return rolloutPolicy.isAdvanced
|
|
12
|
+
? '-'
|
|
13
|
+
: t('{{ count }} batches have been defined', { count: rolloutPolicy.batches.length });
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const ReviewUpdateDisruptionBudget = ({ disruptionBudget }: { disruptionBudget: DisruptionBudgetForm }) => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
if (!disruptionBudget.isAdvanced) {
|
|
19
|
+
return '-';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const groupBy = disruptionBudget.groupBy || [];
|
|
23
|
+
const labels =
|
|
24
|
+
groupBy.length === 0
|
|
25
|
+
? null
|
|
26
|
+
: groupBy.reduce((acc, labelKey) => {
|
|
27
|
+
acc[labelKey] = '';
|
|
28
|
+
return acc;
|
|
29
|
+
}, {});
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Stack hasGutter>
|
|
33
|
+
{labels ? (
|
|
34
|
+
<StackItem>
|
|
35
|
+
<LabelsView labels={labels} prefix="disruption" />
|
|
36
|
+
</StackItem>
|
|
37
|
+
) : (
|
|
38
|
+
t('Applies to all the fleet devices')
|
|
39
|
+
)}
|
|
40
|
+
|
|
41
|
+
{disruptionBudget.minAvailable && (
|
|
42
|
+
<StackItem>
|
|
43
|
+
{t('Minimum available devices: {{ minAvailable }}', { minAvailable: disruptionBudget.minAvailable })}
|
|
44
|
+
</StackItem>
|
|
45
|
+
)}
|
|
46
|
+
{disruptionBudget.maxUnavailable && (
|
|
47
|
+
<StackItem>
|
|
48
|
+
{t('Maximum unavailable devices: {{ maxUnavailable }}', {
|
|
49
|
+
maxUnavailable: disruptionBudget.maxUnavailable,
|
|
50
|
+
})}
|
|
51
|
+
</StackItem>
|
|
52
|
+
)}
|
|
53
|
+
</Stack>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -13,13 +13,15 @@ const SystemdUnitsForm = () => {
|
|
|
13
13
|
const { values, setFieldValue, errors } = useFormikContext<DeviceSpecConfigFormValues>();
|
|
14
14
|
|
|
15
15
|
const onAdd = (text: string) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if (text) {
|
|
17
|
+
void setFieldValue(
|
|
18
|
+
'systemdUnits',
|
|
19
|
+
values.systemdUnits.concat({
|
|
20
|
+
pattern: text,
|
|
21
|
+
exists: false,
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
24
|
+
}
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
const onEdit = (editIndex: number, text: string) => {
|
package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import DetailsPage from '../../DetailsPage/DetailsPage';
|
|
3
|
-
import IntegrityDetails from '../../DetailsPage/Tables/IntegrityDetails';
|
|
4
|
-
import LabelsView from '../../common/LabelsView';
|
|
5
|
-
import { useFetchPeriodically } from '../../../hooks/useFetchPeriodically';
|
|
6
|
-
import { timeSinceText } from '../../../utils/dates';
|
|
7
|
-
import {
|
|
8
|
-
EnrollmentRequestStatus as EnrollmentRequestStatusType,
|
|
9
|
-
getApprovalStatus,
|
|
10
|
-
} from '../../../utils/status/enrollmentRequest';
|
|
1
|
+
import * as React from 'react';
|
|
11
2
|
import {
|
|
12
3
|
Bullseye,
|
|
13
4
|
Card,
|
|
@@ -23,8 +14,16 @@ import {
|
|
|
23
14
|
TextArea,
|
|
24
15
|
} from '@patternfly/react-core';
|
|
25
16
|
import { EnrollmentRequest } from '@flightctl/types';
|
|
26
|
-
import * as React from 'react';
|
|
27
17
|
|
|
18
|
+
import ConditionsTable from '../../DetailsPage/Tables/ConditionsTable';
|
|
19
|
+
import DetailsPage from '../../DetailsPage/DetailsPage';
|
|
20
|
+
import LabelsView from '../../common/LabelsView';
|
|
21
|
+
import { useFetchPeriodically } from '../../../hooks/useFetchPeriodically';
|
|
22
|
+
import { timeSinceText } from '../../../utils/dates';
|
|
23
|
+
import {
|
|
24
|
+
EnrollmentRequestStatus as EnrollmentRequestStatusType,
|
|
25
|
+
getApprovalStatus,
|
|
26
|
+
} from '../../../utils/status/enrollmentRequest';
|
|
28
27
|
import { useFetch } from '../../../hooks/useFetch';
|
|
29
28
|
import ApproveDeviceModal from '../../modals/ApproveDeviceModal/ApproveDeviceModal';
|
|
30
29
|
import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
|
|
@@ -193,31 +192,6 @@ const EnrollmentRequestDetails = () => {
|
|
|
193
192
|
</DetailsPageCardBody>
|
|
194
193
|
</DetailsPageCard>
|
|
195
194
|
</GridItem>
|
|
196
|
-
{!isPendingApproval && (
|
|
197
|
-
<GridItem md={6}>
|
|
198
|
-
<DetailsPageCard>
|
|
199
|
-
<CardTitle>{t('Device conditions')}</CardTitle>
|
|
200
|
-
<DetailsPageCardBody>
|
|
201
|
-
{er && (
|
|
202
|
-
<ConditionsTable
|
|
203
|
-
ariaLabel={t('Device conditions table')}
|
|
204
|
-
conditions={er.spec.deviceStatus?.conditions}
|
|
205
|
-
/>
|
|
206
|
-
)}
|
|
207
|
-
</DetailsPageCardBody>
|
|
208
|
-
</DetailsPageCard>
|
|
209
|
-
</GridItem>
|
|
210
|
-
)}
|
|
211
|
-
{!isPendingApproval && (
|
|
212
|
-
<GridItem md={6}>
|
|
213
|
-
<DetailsPageCard>
|
|
214
|
-
<CardTitle>{t('System integrity details')}</CardTitle>
|
|
215
|
-
<DetailsPageCardBody>
|
|
216
|
-
{er && <IntegrityDetails integrity={er.spec.deviceStatus?.integrity} />}
|
|
217
|
-
</DetailsPageCardBody>
|
|
218
|
-
</DetailsPageCard>
|
|
219
|
-
</GridItem>
|
|
220
|
-
)}
|
|
221
195
|
</Grid>
|
|
222
196
|
{er && isApprovalModalOpen && (
|
|
223
197
|
<ApproveDeviceModal
|
|
@@ -65,9 +65,9 @@ const EnrollmentRequestList = ({ refetchDevices, isStandalone }: EnrollmentReque
|
|
|
65
65
|
|
|
66
66
|
const { onRowSelect, hasSelectedRows, isAllSelected, isRowSelected, setAllSelected } = useTableSelect();
|
|
67
67
|
|
|
68
|
-
const { deleteAction, deleteModal } = useDeleteListAction({
|
|
68
|
+
const { action: deleteAction, modal: deleteModal } = useDeleteListAction({
|
|
69
69
|
resourceType: 'EnrollmentRequest',
|
|
70
|
-
|
|
70
|
+
onConfirm: async (enrollmentId: string) => {
|
|
71
71
|
await remove(`enrollmentrequests/${enrollmentId}`);
|
|
72
72
|
refetch();
|
|
73
73
|
},
|
|
@@ -4,7 +4,7 @@ import { Button } from '@patternfly/react-core';
|
|
|
4
4
|
|
|
5
5
|
import { EnrollmentRequest } from '@flightctl/types';
|
|
6
6
|
import { timeSinceText } from '../../utils/dates';
|
|
7
|
-
import {
|
|
7
|
+
import { ListAction } from '../ListPage/types';
|
|
8
8
|
import { useTranslation } from '../../hooks/useTranslation';
|
|
9
9
|
import { ROUTE } from '../../hooks/useNavigate';
|
|
10
10
|
import ResourceLink from '../common/ResourceLink';
|
|
@@ -15,7 +15,7 @@ type EnrollmentRequestTableRow = {
|
|
|
15
15
|
isRowSelected: (er: EnrollmentRequest) => boolean;
|
|
16
16
|
er: EnrollmentRequest;
|
|
17
17
|
onApprove: (id: string) => void;
|
|
18
|
-
deleteAction:
|
|
18
|
+
deleteAction: ListAction;
|
|
19
19
|
canApprove: boolean;
|
|
20
20
|
canDelete: boolean;
|
|
21
21
|
};
|
|
@@ -38,9 +38,10 @@ export const usePendingEnrollments = (): [
|
|
|
38
38
|
boolean,
|
|
39
39
|
unknown,
|
|
40
40
|
VoidFunction,
|
|
41
|
-
pagination: Pick<PaginationDetails
|
|
41
|
+
pagination: Pick<PaginationDetails<EnrollmentRequestList>, 'currentPage' | 'setCurrentPage' | 'itemCount'>,
|
|
42
42
|
] => {
|
|
43
|
-
const { currentPage, setCurrentPage, itemCount, nextContinue, onPageFetched } =
|
|
43
|
+
const { currentPage, setCurrentPage, itemCount, nextContinue, onPageFetched } =
|
|
44
|
+
useTablePagination<EnrollmentRequestList>();
|
|
44
45
|
const [pendingErEndpoint, isDebouncing] = useEnrollmentRequestsEndpoint({ nextContinue });
|
|
45
46
|
|
|
46
47
|
const [erList, isLoading, error, refetch] = useFetchPeriodically<EnrollmentRequestList>(
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@patternfly/react-core';
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import { Fleet } from '@flightctl/types';
|
|
16
|
-
import { Formik } from 'formik';
|
|
16
|
+
import { Formik, FormikErrors } from 'formik';
|
|
17
17
|
import { FleetFormValues } from './types';
|
|
18
18
|
import { useFetch } from '../../../hooks/useFetch';
|
|
19
19
|
import { getErrorMessage } from '../../../utils/error';
|
|
@@ -25,6 +25,7 @@ import DeviceTemplateStep, {
|
|
|
25
25
|
isDeviceTemplateStepValid,
|
|
26
26
|
} from '../../Device/EditDeviceWizard/steps/DeviceTemplateStep';
|
|
27
27
|
import ReviewStep, { reviewStepId } from './steps/ReviewStep';
|
|
28
|
+
import UpdatePolicyStep, { isUpdatePolicyStepValid, updatePolicyStepId } from './steps/UpdatePolicyStep';
|
|
28
29
|
import { getFleetPatches, getFleetResource, getInitialValues, getValidationSchema } from './utils';
|
|
29
30
|
import CreateFleetWizardFooter from './CreateFleetWizardFooter';
|
|
30
31
|
import { useEditFleet } from './useEditFleet';
|
|
@@ -37,6 +38,38 @@ import { useAppContext } from '../../../hooks/useAppContext';
|
|
|
37
38
|
|
|
38
39
|
import './CreateFleetWizard.css';
|
|
39
40
|
|
|
41
|
+
const orderedIds = [generalInfoStepId, deviceTemplateStepId, updatePolicyStepId, reviewStepId];
|
|
42
|
+
|
|
43
|
+
const getValidStepIds = (formikErrors: FormikErrors<FleetFormValues>): string[] => {
|
|
44
|
+
const validStepIds: string[] = [];
|
|
45
|
+
if (isGeneralInfoStepValid(formikErrors)) {
|
|
46
|
+
validStepIds.push(generalInfoStepId);
|
|
47
|
+
}
|
|
48
|
+
if (isDeviceTemplateStepValid(formikErrors)) {
|
|
49
|
+
validStepIds.push(deviceTemplateStepId);
|
|
50
|
+
}
|
|
51
|
+
if (isUpdatePolicyStepValid(formikErrors)) {
|
|
52
|
+
validStepIds.push(updatePolicyStepId);
|
|
53
|
+
}
|
|
54
|
+
// Review step is always valid. We disable it if some of the previous steps are invalid
|
|
55
|
+
if (validStepIds.length === orderedIds.length - 1) {
|
|
56
|
+
validStepIds.push(reviewStepId);
|
|
57
|
+
}
|
|
58
|
+
return validStepIds;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const isDisabledStep = (stepId: string | undefined, validStepIds: string[]) => {
|
|
62
|
+
if (!stepId) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const stepIdx = orderedIds.findIndex((stepOrderId) => stepOrderId === stepId);
|
|
67
|
+
|
|
68
|
+
return orderedIds.some((orderedId, orderedStepIdx) => {
|
|
69
|
+
return orderedStepIdx < stepIdx && !validStepIds.includes(orderedId);
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
40
73
|
const CreateFleetWizard = () => {
|
|
41
74
|
const { t } = useTranslation();
|
|
42
75
|
const { post, patch } = useFetch();
|
|
@@ -90,7 +123,8 @@ const CreateFleetWizard = () => {
|
|
|
90
123
|
}}
|
|
91
124
|
>
|
|
92
125
|
{({ errors: formikErrors }) => {
|
|
93
|
-
const
|
|
126
|
+
const validStepIds = getValidStepIds(formikErrors);
|
|
127
|
+
|
|
94
128
|
return (
|
|
95
129
|
<>
|
|
96
130
|
<LeaveFormConfirmation />
|
|
@@ -110,14 +144,21 @@ const CreateFleetWizard = () => {
|
|
|
110
144
|
<WizardStep
|
|
111
145
|
name={t('Device template')}
|
|
112
146
|
id={deviceTemplateStepId}
|
|
113
|
-
isDisabled={(
|
|
147
|
+
isDisabled={isDisabledStep(deviceTemplateStepId, validStepIds)}
|
|
114
148
|
>
|
|
115
149
|
{currentStep?.id === deviceTemplateStepId && <DeviceTemplateStep isFleet />}
|
|
116
150
|
</WizardStep>
|
|
117
151
|
<WizardStep
|
|
118
|
-
name={
|
|
152
|
+
name={t('Updates')}
|
|
153
|
+
id={updatePolicyStepId}
|
|
154
|
+
isDisabled={isDisabledStep(updatePolicyStepId, validStepIds)}
|
|
155
|
+
>
|
|
156
|
+
{currentStep?.id === updatePolicyStepId && <UpdatePolicyStep />}
|
|
157
|
+
</WizardStep>
|
|
158
|
+
<WizardStep
|
|
159
|
+
name={isEdit ? t('Review and save') : t('Review and create')}
|
|
119
160
|
id={reviewStepId}
|
|
120
|
-
isDisabled={
|
|
161
|
+
isDisabled={isDisabledStep(reviewStepId, validStepIds)}
|
|
121
162
|
>
|
|
122
163
|
{currentStep?.id === reviewStepId && <ReviewStep error={error} />}
|
|
123
164
|
</WizardStep>
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
deviceTemplateStepId,
|
|
11
11
|
isDeviceTemplateStepValid,
|
|
12
12
|
} from '../../Device/EditDeviceWizard/steps/DeviceTemplateStep';
|
|
13
|
+
import { isUpdatePolicyStepValid, updatePolicyStepId } from './steps/UpdatePolicyStep';
|
|
13
14
|
|
|
14
15
|
type CreateFleetWizardFooterProps = {
|
|
15
16
|
isEdit: boolean;
|
|
@@ -27,7 +28,10 @@ const CreateFleetWizardFooter = ({ isEdit }: CreateFleetWizardFooterProps) => {
|
|
|
27
28
|
isStepValid = isGeneralInfoStepValid(errors);
|
|
28
29
|
} else if (activeStep.id === deviceTemplateStepId) {
|
|
29
30
|
isStepValid = isDeviceTemplateStepValid(errors);
|
|
31
|
+
} else if (activeStep.id === updatePolicyStepId) {
|
|
32
|
+
isStepValid = isUpdatePolicyStepValid(errors);
|
|
30
33
|
}
|
|
34
|
+
|
|
31
35
|
const primaryBtn = isReviewStep ? (
|
|
32
36
|
<Button variant="primary" onClick={submitForm} isDisabled={isSubmitting} isLoading={isSubmitting}>
|
|
33
37
|
{isEdit ? t('Save') : t('Create fleet')}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Duration, FleetSpec, Percentage } from '@flightctl/types';
|
|
2
|
+
|
|
3
|
+
import { BatchLimitType } from './types';
|
|
4
|
+
import { fromAPILabel } from '../../../utils/labels';
|
|
5
|
+
|
|
6
|
+
export const DEFAULT_BACKEND_UPDATE_TIMEOUT_MINUTES = 1140; // 24h, expressed in minutes
|
|
7
|
+
const DEFAULT_BACKEND_SUCCESS_THRESHOLD_PERCENTAGE = '90%';
|
|
8
|
+
|
|
9
|
+
const numberValue = (value: Percentage | number | undefined) => {
|
|
10
|
+
if (value === undefined || typeof value === 'number') {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
return Number(value.replace(/[%]/, ''));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const getEmptyInitializedBatch = () => ({
|
|
17
|
+
limit: '',
|
|
18
|
+
limitType: BatchLimitType.BatchLimitPercent,
|
|
19
|
+
successThreshold: numberValue(DEFAULT_BACKEND_SUCCESS_THRESHOLD_PERCENTAGE),
|
|
20
|
+
selector: [],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const durationToMinutes = (duration: Duration) => {
|
|
24
|
+
const timeoutVal = Number(duration.replace(/[shm]/, ''));
|
|
25
|
+
if (!timeoutVal) {
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (duration.includes('s')) {
|
|
30
|
+
return Math.round(timeoutVal / 60);
|
|
31
|
+
}
|
|
32
|
+
if (duration.includes('h')) {
|
|
33
|
+
return Math.round(timeoutVal * 60);
|
|
34
|
+
}
|
|
35
|
+
return timeoutVal;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const getRolloutPolicyValues = (fleetSpec?: FleetSpec) => {
|
|
39
|
+
const batches = (fleetSpec?.rolloutPolicy?.deviceSelection?.sequence || []).map((batch) => ({
|
|
40
|
+
selector: fromAPILabel(batch.selector?.matchLabels || {}),
|
|
41
|
+
limit: numberValue(batch.limit),
|
|
42
|
+
limitType:
|
|
43
|
+
typeof batch.limit === 'number' ? BatchLimitType.BatchLimitAbsoluteNumber : BatchLimitType.BatchLimitPercent,
|
|
44
|
+
// If the policy does not specify the threshold, we set the backend's default as the field is required in the UI
|
|
45
|
+
successThreshold: numberValue(batch.successThreshold || DEFAULT_BACKEND_SUCCESS_THRESHOLD_PERCENTAGE),
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
// If the policy does not specify the timeout, we set the backend's default as the field is required in the UI
|
|
49
|
+
const updateTimeout = fleetSpec?.rolloutPolicy?.defaultUpdateTimeout || `${DEFAULT_BACKEND_UPDATE_TIMEOUT_MINUTES}m`;
|
|
50
|
+
return { isAdvanced: batches.length > 0, batches, updateTimeout: durationToMinutes(updateTimeout) };
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const getDisruptionBudgetValues = (fleetSpec?: FleetSpec) => {
|
|
54
|
+
const budget = fleetSpec?.rolloutPolicy?.disruptionBudget || {};
|
|
55
|
+
const groupLabels = budget.groupBy || [];
|
|
56
|
+
return {
|
|
57
|
+
isAdvanced: Boolean(groupLabels.length > 0 || budget.minAvailable || budget.maxUnavailable),
|
|
58
|
+
groupBy: groupLabels,
|
|
59
|
+
minAvailable: budget.minAvailable,
|
|
60
|
+
maxUnavailable: budget.maxUnavailable,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -19,12 +19,17 @@ import { getErrorMessage } from '../../../../utils/error';
|
|
|
19
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
|
+
import {
|
|
23
|
+
ReviewUpdateDisruptionBudget,
|
|
24
|
+
ReviewUpdateRolloutPolicy,
|
|
25
|
+
} from '../../../Device/EditDeviceWizard/steps/ReviewUpdatePolicy';
|
|
22
26
|
|
|
23
27
|
export const reviewStepId = 'review';
|
|
24
28
|
|
|
25
29
|
const ReviewStep = ({ error }: { error?: unknown }) => {
|
|
26
30
|
const { t } = useTranslation();
|
|
27
31
|
const { values } = useFormikContext<FleetFormValues>();
|
|
32
|
+
|
|
28
33
|
return (
|
|
29
34
|
<Stack hasGutter>
|
|
30
35
|
<StackItem isFilled>
|
|
@@ -38,42 +43,72 @@ const ReviewStep = ({ error }: { error?: unknown }) => {
|
|
|
38
43
|
<DescriptionListTerm>{t('Name')}</DescriptionListTerm>
|
|
39
44
|
<DescriptionListDescription>{values.name}</DescriptionListDescription>
|
|
40
45
|
</DescriptionListGroup>
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
{values.fleetLabels.length > 0 && (
|
|
47
|
+
<DescriptionListGroup>
|
|
48
|
+
<DescriptionListTerm>{t('Fleet labels')}</DescriptionListTerm>
|
|
49
|
+
<DescriptionListDescription>
|
|
50
|
+
<LabelsView prefix="fleet" labels={toAPILabel(values.fleetLabels)} />
|
|
51
|
+
</DescriptionListDescription>
|
|
52
|
+
</DescriptionListGroup>
|
|
53
|
+
)}
|
|
54
|
+
|
|
55
|
+
{values.labels.length > 0 && (
|
|
56
|
+
<DescriptionListGroup>
|
|
57
|
+
<DescriptionListTerm>{t('Device selector')}</DescriptionListTerm>
|
|
58
|
+
<DescriptionListDescription>
|
|
59
|
+
<LabelsView prefix="device" labels={toAPILabel(values.labels)} />
|
|
60
|
+
</DescriptionListDescription>
|
|
61
|
+
</DescriptionListGroup>
|
|
62
|
+
)}
|
|
63
|
+
|
|
53
64
|
<DescriptionListGroup>
|
|
54
65
|
<DescriptionListTerm>{t('System image')}</DescriptionListTerm>
|
|
55
66
|
<DescriptionListDescription>
|
|
56
67
|
{values.osImage || t(`The fleet will not manage system image`)}
|
|
57
68
|
</DescriptionListDescription>
|
|
58
69
|
</DescriptionListGroup>
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
{values.configTemplates.length > 0 && (
|
|
71
|
+
<DescriptionListGroup>
|
|
72
|
+
<DescriptionListTerm>{t('Configurations')}</DescriptionListTerm>
|
|
73
|
+
<DescriptionListDescription>
|
|
74
|
+
<RepositorySourceList configs={values.configTemplates.map(getAPIConfig)} />
|
|
75
|
+
</DescriptionListDescription>
|
|
76
|
+
</DescriptionListGroup>
|
|
77
|
+
)}
|
|
78
|
+
{values.applications.length > 0 && (
|
|
79
|
+
<DescriptionListGroup>
|
|
80
|
+
<DescriptionListTerm>{t('Applications')}</DescriptionListTerm>
|
|
81
|
+
<DescriptionListDescription>
|
|
82
|
+
<ReviewApplications apps={values.applications} />
|
|
83
|
+
</DescriptionListDescription>
|
|
84
|
+
</DescriptionListGroup>
|
|
85
|
+
)}
|
|
86
|
+
|
|
87
|
+
{values.systemdUnits.length > 0 && (
|
|
88
|
+
<DescriptionListGroup>
|
|
89
|
+
<DescriptionListTerm>{t('Tracked systemd services')}</DescriptionListTerm>
|
|
90
|
+
<DescriptionListDescription>
|
|
91
|
+
<ReviewTrackedSystemdServices systemdUnits={values.systemdUnits} />
|
|
92
|
+
</DescriptionListDescription>
|
|
93
|
+
</DescriptionListGroup>
|
|
94
|
+
)}
|
|
95
|
+
|
|
96
|
+
{values.rolloutPolicy.isAdvanced && (
|
|
97
|
+
<DescriptionListGroup>
|
|
98
|
+
<DescriptionListTerm>{t('Rollout policy')}</DescriptionListTerm>
|
|
99
|
+
<DescriptionListDescription>
|
|
100
|
+
<ReviewUpdateRolloutPolicy rolloutPolicy={values.rolloutPolicy} />
|
|
101
|
+
</DescriptionListDescription>
|
|
102
|
+
</DescriptionListGroup>
|
|
103
|
+
)}
|
|
104
|
+
{values.disruptionBudget.isAdvanced && (
|
|
105
|
+
<DescriptionListGroup>
|
|
106
|
+
<DescriptionListTerm>{t('Disruption budget')}</DescriptionListTerm>
|
|
107
|
+
<DescriptionListDescription>
|
|
108
|
+
<ReviewUpdateDisruptionBudget disruptionBudget={values.disruptionBudget} />
|
|
109
|
+
</DescriptionListDescription>
|
|
110
|
+
</DescriptionListGroup>
|
|
111
|
+
)}
|
|
77
112
|
</FlightControlDescriptionList>
|
|
78
113
|
</StackItem>
|
|
79
114
|
{!!error && (
|