@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
|
@@ -4,20 +4,30 @@ import countBy from 'lodash/countBy';
|
|
|
4
4
|
|
|
5
5
|
import { FlightCtlLabel } from '../../types/extraTypes';
|
|
6
6
|
import {
|
|
7
|
+
AppForm,
|
|
8
|
+
AppSpecType,
|
|
9
|
+
BatchForm,
|
|
10
|
+
BatchLimitType,
|
|
11
|
+
DisruptionBudgetForm,
|
|
7
12
|
GitConfigTemplate,
|
|
8
13
|
HttpConfigTemplate,
|
|
14
|
+
ImageAppForm,
|
|
15
|
+
InlineAppForm,
|
|
9
16
|
InlineConfigTemplate,
|
|
10
17
|
KubeSecretTemplate,
|
|
18
|
+
RolloutPolicyForm,
|
|
11
19
|
SpecConfigTemplate,
|
|
20
|
+
SystemdUnitFormValue,
|
|
21
|
+
UpdatePolicyForm,
|
|
22
|
+
getAppIdentifier,
|
|
12
23
|
isGitConfigTemplate,
|
|
13
24
|
isHttpConfigTemplate,
|
|
25
|
+
isInlineAppForm,
|
|
14
26
|
isInlineConfigTemplate,
|
|
15
27
|
isKubeSecretTemplate,
|
|
16
28
|
} from '../../types/deviceSpec';
|
|
17
29
|
import { labelToString } from '../../utils/labels';
|
|
18
|
-
import {
|
|
19
|
-
import { SystemdUnitFormValue } from '../Device/SystemdUnitsModal/TrackSystemdUnitsForm';
|
|
20
|
-
import { BatchForm, BatchLimitType, DisruptionBudgetForm, RolloutPolicyForm } from '../Fleet/CreateFleet/types';
|
|
30
|
+
import { UpdateScheduleMode } from '../../utils/time';
|
|
21
31
|
|
|
22
32
|
const SYSTEMD_PATTERNS_REGEXP = /^[a-z][a-z0-9-_.]*$/;
|
|
23
33
|
const SYSTEMD_UNITS_MAX_PATTERNS = 256;
|
|
@@ -35,13 +45,21 @@ const K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH = 253;
|
|
|
35
45
|
// https://issues.redhat.com/browse/MGMT-18349 to make the validation more robust
|
|
36
46
|
const BASIC_DEVICE_OS_IMAGE_REGEXP = /^[a-zA-Z0-9.\-\/:@_+]*$/;
|
|
37
47
|
const APPLICATION_IMAGE_REGEXP = BASIC_DEVICE_OS_IMAGE_REGEXP;
|
|
48
|
+
const APPLICATION_NAME_REGEXP = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/;
|
|
49
|
+
const APPLICATION_VAR_NAME_REGEXP = /^[a-zA-Z_]+[a-zA-Z0-9_]*$/;
|
|
38
50
|
|
|
39
51
|
const TEMPLATE_VARIABLES_REGEXP = /{{.+?}}/g;
|
|
40
52
|
// Special characters allowed: "dot", "pipe", "spaces" "quote", "backward slash", "underscore", "forward slash", "dash"
|
|
41
53
|
const TEMPLATE_VARIABLES_CONTENT_REGEXP = /^([.a-zA-Z0-9|\s"\\_\/-])+$/;
|
|
54
|
+
const TIME_VALUE_REGEXP = /^([01][0-9]|2[0-3]):([0-5][0-9])$/;
|
|
42
55
|
|
|
43
56
|
const absolutePathRegex = /^\/.*$/;
|
|
57
|
+
|
|
58
|
+
// Accepts only relative paths. Rejects paths that start with "/", have multiple "/", or use dots (./file, ../parent/file), etc
|
|
59
|
+
const relativePathRegex = /^(?!\.\.\/|\.\.\$|\.\/)(\.\/)*[\w.-]+(?:\/[\w.-]+)*\/?$/;
|
|
60
|
+
|
|
44
61
|
export const MAX_TARGET_REVISION_LENGTH = 244;
|
|
62
|
+
const MAX_FILE_PATH_LENGTH = 253;
|
|
45
63
|
|
|
46
64
|
const isInteger = (val: number | undefined) => val === undefined || Number.isInteger(val);
|
|
47
65
|
|
|
@@ -53,7 +71,7 @@ export const getLabelValueValidations = (t: TFunction) => [
|
|
|
53
71
|
},
|
|
54
72
|
{
|
|
55
73
|
key: 'labelValueMaxLength',
|
|
56
|
-
message: t('1-{{ maxCharacters }} characters', { maxCharacters: K8S_LABEL_VALUE_MAX_LENGTH }),
|
|
74
|
+
message: t('1-{{ maxCharacters }} characters.', { maxCharacters: K8S_LABEL_VALUE_MAX_LENGTH }),
|
|
57
75
|
},
|
|
58
76
|
];
|
|
59
77
|
|
|
@@ -65,7 +83,7 @@ export const getDnsSubdomainValidations = (t: TFunction) => [
|
|
|
65
83
|
},
|
|
66
84
|
{
|
|
67
85
|
key: 'dnsSubdomainMaxLength',
|
|
68
|
-
message: t('1-{{ maxCharacters }} characters', { maxCharacters: K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH }),
|
|
86
|
+
message: t('1-{{ maxCharacters }} characters.', { maxCharacters: K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH }),
|
|
69
87
|
},
|
|
70
88
|
];
|
|
71
89
|
|
|
@@ -210,11 +228,21 @@ export const validOsImage = (t: TFunction, { isFleet }: { isFleet: boolean }) =>
|
|
|
210
228
|
},
|
|
211
229
|
);
|
|
212
230
|
|
|
213
|
-
export const validLabelsSchema = (t: TFunction) =>
|
|
231
|
+
export const validLabelsSchema = (t: TFunction, forbiddenLabels?: string[]) =>
|
|
214
232
|
Yup.array()
|
|
215
233
|
.of(
|
|
216
234
|
Yup.object<FlightCtlLabel>().shape({
|
|
217
|
-
key: Yup.string()
|
|
235
|
+
key: Yup.string()
|
|
236
|
+
.required()
|
|
237
|
+
.test('forbid labels', 'is forbidden', (key: string, testContext) => {
|
|
238
|
+
if (forbiddenLabels?.length && forbiddenLabels.includes(key)) {
|
|
239
|
+
return testContext.createError({
|
|
240
|
+
path: 'labels',
|
|
241
|
+
message: t('Label key "{{ forbiddenLabel }}" is forbidden', { forbiddenLabel: key }),
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
return true;
|
|
245
|
+
}),
|
|
218
246
|
value: Yup.string(),
|
|
219
247
|
}),
|
|
220
248
|
)
|
|
@@ -256,34 +284,105 @@ export const validGroupLabelKeysSchema = (t: TFunction) =>
|
|
|
256
284
|
return uniqueKeys.size === labelKeys?.length;
|
|
257
285
|
});
|
|
258
286
|
|
|
259
|
-
|
|
287
|
+
const appVariablesSchema = (t: TFunction) => {
|
|
260
288
|
return Yup.array()
|
|
261
289
|
.of(
|
|
262
290
|
Yup.object().shape({
|
|
263
|
-
name: Yup.string()
|
|
264
|
-
|
|
265
|
-
.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
291
|
+
name: Yup.string()
|
|
292
|
+
.required(t('Variable name is required.'))
|
|
293
|
+
.matches(APPLICATION_VAR_NAME_REGEXP, t('Use alphanumeric characters, or underscore (_)')),
|
|
294
|
+
value: Yup.string().required(t('Variable value is required.')),
|
|
295
|
+
}),
|
|
296
|
+
)
|
|
297
|
+
.required()
|
|
298
|
+
.test('unique-vars-names', t('Variable names of an application must be unique'), (vars) => {
|
|
299
|
+
const uniqueKeys = new Set(vars.map((varItem) => varItem.name));
|
|
300
|
+
return uniqueKeys.size === vars?.length;
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const appSpecTypeSchema = (t: TFunction) =>
|
|
305
|
+
Yup.string().oneOf([AppSpecType.INLINE, AppSpecType.OCI_IMAGE]).required(t('Application type is required'));
|
|
306
|
+
|
|
307
|
+
export const validApplicationsSchema = (t: TFunction) => {
|
|
308
|
+
return Yup.array()
|
|
309
|
+
.of(
|
|
310
|
+
Yup.lazy((value: AppForm) => {
|
|
311
|
+
if (isInlineAppForm(value)) {
|
|
312
|
+
return Yup.object<InlineAppForm>().shape({
|
|
313
|
+
specType: appSpecTypeSchema(t),
|
|
314
|
+
name: Yup.string()
|
|
315
|
+
.required(t('Name is required for inline applications.'))
|
|
316
|
+
.matches(
|
|
317
|
+
APPLICATION_NAME_REGEXP,
|
|
318
|
+
t(
|
|
319
|
+
'Use lowercase alphanumeric characters, or dash (-). Must start and end with an alphanumeric character.',
|
|
320
|
+
),
|
|
321
|
+
),
|
|
322
|
+
files: Yup.array()
|
|
323
|
+
.of(
|
|
324
|
+
Yup.object().shape({
|
|
325
|
+
content: Yup.string(),
|
|
326
|
+
path: Yup.string()
|
|
327
|
+
.required(t('File path is required'))
|
|
328
|
+
.max(
|
|
329
|
+
MAX_FILE_PATH_LENGTH,
|
|
330
|
+
t('File path length cannot exceed {{ maxCharacters }} characters.', {
|
|
331
|
+
maxCharacters: MAX_FILE_PATH_LENGTH,
|
|
332
|
+
}),
|
|
333
|
+
)
|
|
334
|
+
.matches(
|
|
335
|
+
relativePathRegex,
|
|
336
|
+
t('Application file path must be relative. It cannot be outside the application directory.'),
|
|
337
|
+
),
|
|
338
|
+
}),
|
|
339
|
+
)
|
|
340
|
+
.required()
|
|
341
|
+
.min(1, t('Inline applications must include at least one file.'))
|
|
342
|
+
.test('unique-file-paths', (files: InlineAppForm['files'], testContext) => {
|
|
343
|
+
const duplicateFilePaths = Object.entries(countBy(files.map((file) => file.path)))
|
|
344
|
+
.filter(([, count]) => {
|
|
345
|
+
return count > 1;
|
|
346
|
+
})
|
|
347
|
+
.map(([filePath]) => filePath);
|
|
348
|
+
|
|
349
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
350
|
+
const duplicateIndex = ((testContext.parent.files || []) as InlineAppForm['files']).findIndex((file) =>
|
|
351
|
+
duplicateFilePaths.includes(file.path),
|
|
352
|
+
);
|
|
353
|
+
if (duplicateIndex === -1) {
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return testContext.createError({
|
|
358
|
+
path: `${testContext.path}[${duplicateIndex}].path`,
|
|
359
|
+
message: () => t('Each file of the same application must use different paths.'),
|
|
360
|
+
});
|
|
361
|
+
}),
|
|
362
|
+
variables: appVariablesSchema(t),
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Image applications
|
|
367
|
+
return Yup.object<ImageAppForm>().shape({
|
|
368
|
+
specType: appSpecTypeSchema(t),
|
|
369
|
+
name: Yup.string().matches(
|
|
370
|
+
APPLICATION_NAME_REGEXP,
|
|
371
|
+
t('Use lowercase alphanumeric characters, or dash (-). Must start and end with an alphanumeric character.'),
|
|
372
|
+
),
|
|
373
|
+
image: Yup.string()
|
|
374
|
+
.required(t('Image is required.'))
|
|
375
|
+
.matches(APPLICATION_IMAGE_REGEXP, t('Application image includes invalid characters.')),
|
|
376
|
+
variables: appVariablesSchema(t),
|
|
377
|
+
});
|
|
275
378
|
}),
|
|
276
379
|
)
|
|
277
|
-
.test('unique-app-ids', (apps:
|
|
380
|
+
.test('unique-app-ids', (apps: AppForm[] | undefined, testContext) => {
|
|
278
381
|
if (!apps?.length) {
|
|
279
382
|
return true;
|
|
280
383
|
}
|
|
281
384
|
|
|
282
|
-
|
|
283
|
-
// Apps should have different names or images
|
|
284
|
-
const getAppId = (app: ApplicationFormSpec) => app.name || app.image;
|
|
285
|
-
|
|
286
|
-
const appIds = apps.map(getAppId);
|
|
385
|
+
const appIds = apps.map(getAppIdentifier);
|
|
287
386
|
const duplicateIds = Object.entries(countBy(appIds))
|
|
288
387
|
.filter(([, count]) => {
|
|
289
388
|
return count > 1;
|
|
@@ -294,7 +393,7 @@ export const validApplicationsSchema = (t: TFunction) => {
|
|
|
294
393
|
}
|
|
295
394
|
|
|
296
395
|
const errors = apps.reduce((errors, app, appIndex) => {
|
|
297
|
-
if (duplicateIds.includes(
|
|
396
|
+
if (duplicateIds.includes(appIds[appIndex])) {
|
|
298
397
|
const error = app.name
|
|
299
398
|
? new Yup.ValidationError(t('Application name must be unique.'), '', `applications[${appIndex}].name`)
|
|
300
399
|
: new Yup.ValidationError(
|
|
@@ -377,6 +476,74 @@ export const validFleetRolloutPolicySchema = (t: TFunction) => {
|
|
|
377
476
|
});
|
|
378
477
|
};
|
|
379
478
|
|
|
479
|
+
const requiredDownloadTimes = (t: TFunction, isStartTime: boolean) =>
|
|
480
|
+
Yup.string().when(['isAdvanced', 'downloadAndInstallDiffer'], ([isAdvanced, downloadAndInstallDiffer]) => {
|
|
481
|
+
if (!isAdvanced) {
|
|
482
|
+
return Yup.string();
|
|
483
|
+
}
|
|
484
|
+
if (downloadAndInstallDiffer) {
|
|
485
|
+
return Yup.string().required(
|
|
486
|
+
isStartTime ? t('Downloading start time is required') : t('Downloading end time is required'),
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
return Yup.string()
|
|
490
|
+
.required(
|
|
491
|
+
isStartTime
|
|
492
|
+
? t('Downloading and installing start times are required')
|
|
493
|
+
: t('Downloading and installing end times are required'),
|
|
494
|
+
)
|
|
495
|
+
.matches(TIME_VALUE_REGEXP, t('Time must be in hh:mm with 24-hour format', { nsSeparator: '|' }));
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
const requiredInstallTimes = (t: TFunction, isStartTime: boolean) =>
|
|
499
|
+
Yup.string().when(['isAdvanced', 'downloadAndInstallDiffer'], ([isAdvanced, downloadAndInstallDiffer]) => {
|
|
500
|
+
if (isAdvanced && downloadAndInstallDiffer) {
|
|
501
|
+
return Yup.string()
|
|
502
|
+
.required(isStartTime ? t('Installing start time is required') : t('Installing end time is required'))
|
|
503
|
+
.matches(TIME_VALUE_REGEXP, t('Time must be in hh:mm with 24-hour format', { nsSeparator: '|' }));
|
|
504
|
+
}
|
|
505
|
+
return Yup.string();
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
const updateWeekDaysSchema = (t: TFunction) =>
|
|
509
|
+
Yup.array()
|
|
510
|
+
.required()
|
|
511
|
+
.of(Yup.boolean().required())
|
|
512
|
+
.test(
|
|
513
|
+
'selected weekdays',
|
|
514
|
+
t('Select at least one day of the week for "weekly" schedules'),
|
|
515
|
+
(selectedDays: boolean[], { path, parent }) => {
|
|
516
|
+
const parentWeekMode =
|
|
517
|
+
path === 'updatePolicy.downloadWeekDays'
|
|
518
|
+
? (parent as UpdatePolicyForm).downloadScheduleMode
|
|
519
|
+
: (parent as UpdatePolicyForm).installScheduleMode;
|
|
520
|
+
|
|
521
|
+
if (parentWeekMode === UpdateScheduleMode.Weekly) {
|
|
522
|
+
return selectedDays.some(Boolean);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return true;
|
|
526
|
+
},
|
|
527
|
+
);
|
|
528
|
+
|
|
529
|
+
export const validUpdatePolicySchema = (t: TFunction) => {
|
|
530
|
+
return Yup.object().shape({
|
|
531
|
+
isAdvanced: Yup.boolean().required(),
|
|
532
|
+
downloadAndInstallDiffer: Yup.boolean().required(),
|
|
533
|
+
// Fields are flattened so "isAdvanced" can be used for validating them
|
|
534
|
+
downloadStartsAt: requiredDownloadTimes(t, true),
|
|
535
|
+
downloadEndsAt: requiredDownloadTimes(t, false),
|
|
536
|
+
downloadScheduleMode: Yup.string().oneOf([UpdateScheduleMode.Weekly, UpdateScheduleMode.Daily]).required(),
|
|
537
|
+
downloadWeekDays: updateWeekDaysSchema(t),
|
|
538
|
+
downloadTimeZone: Yup.string().required(t('Select the timezone for downloading updates')),
|
|
539
|
+
installStartsAt: requiredInstallTimes(t, true),
|
|
540
|
+
installEndsAt: requiredInstallTimes(t, false),
|
|
541
|
+
installScheduleMode: Yup.string().oneOf([UpdateScheduleMode.Weekly, UpdateScheduleMode.Daily]).required(),
|
|
542
|
+
installWeekDays: updateWeekDaysSchema(t),
|
|
543
|
+
installTimeZone: Yup.string().required(t('Select the timezone for installing updates')),
|
|
544
|
+
});
|
|
545
|
+
};
|
|
546
|
+
|
|
380
547
|
export const validFleetDisruptionBudgetSchema = (t: TFunction) => {
|
|
381
548
|
return Yup.object()
|
|
382
549
|
.shape({
|
|
@@ -453,6 +620,17 @@ export const validConfigTemplatesSchema = (t: TFunction) =>
|
|
|
453
620
|
(path) => !path || value.files.filter((file) => file.path === path).length == 1,
|
|
454
621
|
),
|
|
455
622
|
content: Yup.string(),
|
|
623
|
+
permissions: Yup.string().test(
|
|
624
|
+
'permissions',
|
|
625
|
+
t('Permissions must use octal notation'),
|
|
626
|
+
(perm: string | undefined) => {
|
|
627
|
+
if (!perm) {
|
|
628
|
+
return true;
|
|
629
|
+
}
|
|
630
|
+
const valNum = Number(`0o${perm}`);
|
|
631
|
+
return Number.isFinite(valNum) && valNum >= 0 && valNum <= 0o7777;
|
|
632
|
+
},
|
|
633
|
+
),
|
|
456
634
|
}),
|
|
457
635
|
),
|
|
458
636
|
});
|
|
@@ -508,6 +686,7 @@ export const deviceSystemdUnitsValidationSchema = (t: TFunction) =>
|
|
|
508
686
|
systemdUnits: systemdUnitListValidationSchema(t),
|
|
509
687
|
});
|
|
510
688
|
|
|
689
|
+
const forbiddenDeviceLabels = ['alias'];
|
|
511
690
|
export const deviceApprovalValidationSchema = (t: TFunction, conf: { isSingleDevice: boolean }) =>
|
|
512
691
|
Yup.object({
|
|
513
692
|
deviceAlias: conf.isSingleDevice
|
|
@@ -516,5 +695,5 @@ export const deviceApprovalValidationSchema = (t: TFunction, conf: { isSingleDev
|
|
|
516
695
|
/{{n}}/,
|
|
517
696
|
t('Device aliases must be unique. Add a number to the template to generate unique aliases.'),
|
|
518
697
|
),
|
|
519
|
-
labels: validLabelsSchema(t),
|
|
698
|
+
labels: validLabelsSchema(t, forbiddenDeviceLabels),
|
|
520
699
|
});
|
|
@@ -32,6 +32,7 @@ const ApproveDeviceForm: React.FC<ApproveDeviceFormProps> = ({ enrollmentRequest
|
|
|
32
32
|
|
|
33
33
|
const disableSubmit = Object.keys(formErrors).length > 0;
|
|
34
34
|
const [matchLabelsOnChange, matchStatus] = useDeviceLabelMatch();
|
|
35
|
+
const defaultAlias = enrollmentRequest.spec.labels?.alias;
|
|
35
36
|
|
|
36
37
|
return (
|
|
37
38
|
<FlightCtlForm>
|
|
@@ -39,12 +40,11 @@ const ApproveDeviceForm: React.FC<ApproveDeviceFormProps> = ({ enrollmentRequest
|
|
|
39
40
|
fieldName="deviceAlias"
|
|
40
41
|
aria-label={t('Alias')}
|
|
41
42
|
validations={getLabelValueValidations(t)}
|
|
43
|
+
isDisabled={!!defaultAlias}
|
|
42
44
|
/>
|
|
43
|
-
{
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
</FormGroup>
|
|
47
|
-
)}
|
|
45
|
+
<FormGroup label={t('Name')} aria-label={t('Name')}>
|
|
46
|
+
<ResourceLink id={enrollmentRequest.metadata.name as string} variant="full" />
|
|
47
|
+
</FormGroup>
|
|
48
48
|
<FormGroup label={t('Labels')}>
|
|
49
49
|
<LabelsField name="labels" onChangeCallback={matchLabelsOnChange} />
|
|
50
50
|
</FormGroup>
|
|
@@ -21,11 +21,12 @@ const DeviceEnrollmentModal: React.FC<DeviceEnrollmentModalProps> = ({ enrollmen
|
|
|
21
21
|
const { t } = useTranslation();
|
|
22
22
|
const { put } = useFetch();
|
|
23
23
|
const [error, setError] = React.useState<string>();
|
|
24
|
+
const labels = enrollmentRequest.spec.labels || {};
|
|
24
25
|
return (
|
|
25
26
|
<Formik<ApproveDeviceFormValues>
|
|
26
27
|
initialValues={{
|
|
27
|
-
labels: fromAPILabel(
|
|
28
|
-
deviceAlias: '',
|
|
28
|
+
labels: fromAPILabel(labels, { isDefault: true }).filter((label) => label.key !== 'alias'),
|
|
29
|
+
deviceAlias: labels.alias || '',
|
|
29
30
|
}}
|
|
30
31
|
validationSchema={deviceApprovalValidationSchema(t, { isSingleDevice: true })}
|
|
31
32
|
onSubmit={async ({ labels, deviceAlias }) => {
|
|
@@ -3,7 +3,6 @@ import { Formik, FormikProps } from 'formik';
|
|
|
3
3
|
import { Alert } from '@patternfly/react-core';
|
|
4
4
|
import { TFunction } from 'i18next';
|
|
5
5
|
import * as Yup from 'yup';
|
|
6
|
-
import debounce from 'lodash/debounce';
|
|
7
6
|
|
|
8
7
|
import { Device } from '@flightctl/types';
|
|
9
8
|
import LabelsField from '../../form/LabelsField';
|
|
@@ -14,7 +13,7 @@ import { useTranslation } from '../../../hooks/useTranslation';
|
|
|
14
13
|
import { fromAPILabel } from '../../../utils/labels';
|
|
15
14
|
import { validLabelsSchema } from '../../form/validations';
|
|
16
15
|
import { getErrorMessage } from '../../../utils/error';
|
|
17
|
-
import {
|
|
16
|
+
import { getDeviceLabelPatches } from '../../../utils/patch';
|
|
18
17
|
import LabelsView from '../../common/LabelsView';
|
|
19
18
|
|
|
20
19
|
type EditLabelsFormValues = {
|
|
@@ -26,16 +25,15 @@ type EditLabelsFormContentProps = {
|
|
|
26
25
|
submitForm: (values: EditLabelsFormValues) => Promise<string>;
|
|
27
26
|
};
|
|
28
27
|
|
|
28
|
+
const forbiddenDeviceLabels = ['alias'];
|
|
29
|
+
|
|
29
30
|
const getValidationSchema = (t: TFunction) => {
|
|
30
31
|
return Yup.object<EditLabelsFormValues>({
|
|
31
|
-
labels: validLabelsSchema(t),
|
|
32
|
+
labels: validLabelsSchema(t, forbiddenDeviceLabels),
|
|
32
33
|
});
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
const delayResponse = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
36
|
-
|
|
37
36
|
const EditLabelsFormContent = ({ isSubmitting, submitForm }: EditLabelsFormContentProps) => {
|
|
38
|
-
const { t } = useTranslation();
|
|
39
37
|
const [submitError, setSubmitError] = React.useState<string>();
|
|
40
38
|
|
|
41
39
|
const onChangedLabels = async (newLabels: FlightCtlLabel[], hasErrors: boolean) => {
|
|
@@ -46,17 +44,9 @@ const EditLabelsFormContent = ({ isSubmitting, submitForm }: EditLabelsFormConte
|
|
|
46
44
|
}
|
|
47
45
|
};
|
|
48
46
|
|
|
49
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
-
const debouncedSubmit = React.useCallback(debounce(onChangedLabels, 2000), []);
|
|
51
|
-
|
|
52
47
|
return (
|
|
53
48
|
<FlightCtlForm>
|
|
54
|
-
<LabelsField
|
|
55
|
-
name="labels"
|
|
56
|
-
addButtonText={isSubmitting ? t('Saving...') : undefined}
|
|
57
|
-
isLoading={isSubmitting}
|
|
58
|
-
onChangeCallback={debouncedSubmit}
|
|
59
|
-
/>
|
|
49
|
+
<LabelsField name="labels" isLoading={isSubmitting} onChangeCallback={onChangedLabels} />
|
|
60
50
|
{submitError && <Alert isInline title={submitError} variant="danger" />}
|
|
61
51
|
</FlightCtlForm>
|
|
62
52
|
);
|
|
@@ -76,20 +66,19 @@ const EditLabelsForm = ({ device, onDeviceUpdate }: EditLabelsFormProps) => {
|
|
|
76
66
|
const { t } = useTranslation();
|
|
77
67
|
const { patch } = useFetch();
|
|
78
68
|
|
|
79
|
-
const
|
|
69
|
+
const currentLabelsMap = device.metadata.labels || {};
|
|
70
|
+
const currentLabelsList = fromAPILabel(currentLabelsMap || {});
|
|
80
71
|
|
|
81
72
|
return (
|
|
82
73
|
<Formik<EditLabelsFormValues>
|
|
83
74
|
initialValues={{
|
|
84
|
-
labels:
|
|
75
|
+
labels: currentLabelsList.filter((label) => label.key !== 'alias'),
|
|
85
76
|
}}
|
|
86
77
|
onSubmit={async (values: EditLabelsFormValues) => {
|
|
87
78
|
try {
|
|
88
|
-
const labelsPatch =
|
|
79
|
+
const labelsPatch = getDeviceLabelPatches(currentLabelsMap, values.labels);
|
|
89
80
|
if (labelsPatch.length > 0) {
|
|
90
81
|
await patch(`devices/${device.metadata.name}`, labelsPatch);
|
|
91
|
-
// The API call is "too" quick, allow the "Saving" button to be briefly seen
|
|
92
|
-
await delayResponse(150);
|
|
93
82
|
onDeviceUpdate();
|
|
94
83
|
}
|
|
95
84
|
return null;
|
package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx
CHANGED
|
@@ -80,18 +80,18 @@ const MassDecommissionDeviceModal = ({ onClose, devices, onSuccess }: MassDecomm
|
|
|
80
80
|
<Table>
|
|
81
81
|
<Thead>
|
|
82
82
|
<Tr>
|
|
83
|
-
<Th>{t('Name')}</Th>
|
|
84
83
|
<Th>{t('Alias')}</Th>
|
|
84
|
+
<Th>{t('Name')}</Th>
|
|
85
85
|
</Tr>
|
|
86
86
|
</Thead>
|
|
87
87
|
<Tbody>
|
|
88
88
|
{devices.map((device) => {
|
|
89
89
|
return (
|
|
90
90
|
<Tr key={device.metadata.name}>
|
|
91
|
+
<Td dataLabel={t('Alias')}>{device.metadata.labels?.alias || '-'}</Td>
|
|
91
92
|
<Td dataLabel={t('Name')}>
|
|
92
93
|
<ResourceLink id={device.metadata.name as string} />
|
|
93
94
|
</Td>
|
|
94
|
-
<Td dataLabel={t('Alias')}>{device.metadata.labels?.alias || '-'}</Td>
|
|
95
95
|
</Tr>
|
|
96
96
|
);
|
|
97
97
|
})}
|
|
@@ -67,18 +67,18 @@ const MassDeleteDeviceModal: React.FC<MassDeleteDeviceModalProps> = ({ onClose,
|
|
|
67
67
|
<Table>
|
|
68
68
|
<Thead>
|
|
69
69
|
<Tr>
|
|
70
|
-
<Th>{t('Name')}</Th>
|
|
71
70
|
<Th>{t('Alias')}</Th>
|
|
71
|
+
<Th>{t('Name')}</Th>
|
|
72
72
|
</Tr>
|
|
73
73
|
</Thead>
|
|
74
74
|
<Tbody>
|
|
75
75
|
{resources.map((resource) => {
|
|
76
76
|
return (
|
|
77
77
|
<Tr key={resource.metadata.name}>
|
|
78
|
+
<Td dataLabel={t('Alias')}>{resource.metadata.labels?.alias || '-'}</Td>
|
|
78
79
|
<Td dataLabel={t('Name')}>
|
|
79
80
|
<ResourceLink id={resource.metadata.name as string} />
|
|
80
81
|
</Td>
|
|
81
|
-
<Td dataLabel={t('Alias')}>{resource.metadata.labels?.alias || '-'}</Td>
|
|
82
82
|
</Tr>
|
|
83
83
|
);
|
|
84
84
|
})}
|
|
@@ -30,8 +30,8 @@ const MassDeleteFleetTable = ({ fleets }: { fleets: Array<Fleet> }) => {
|
|
|
30
30
|
<Table>
|
|
31
31
|
<Thead>
|
|
32
32
|
<Tr>
|
|
33
|
-
<Th>{t('Name')}</Th>
|
|
34
|
-
<Th>{t('Managed by')}</Th>
|
|
33
|
+
<Th modifier="fitContent">{t('Name')}</Th>
|
|
34
|
+
<Th modifier="fitContent">{t('Managed by')}</Th>
|
|
35
35
|
</Tr>
|
|
36
36
|
</Thead>
|
|
37
37
|
<Tbody>
|
package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx
CHANGED
|
@@ -126,8 +126,8 @@ const MassDeleteRepositoryModal: React.FC<MassDeleteRepositoryModalProps> = ({
|
|
|
126
126
|
<Table>
|
|
127
127
|
<Thead>
|
|
128
128
|
<Tr>
|
|
129
|
-
<Th>{t('Repository name')}</Th>
|
|
130
|
-
<Th>{t('# Resource syncs')}</Th>
|
|
129
|
+
<Th modifier="fitContent">{t('Repository name')}</Th>
|
|
130
|
+
<Th modifier="fitContent">{t('# Resource syncs')}</Th>
|
|
131
131
|
</Tr>
|
|
132
132
|
</Thead>
|
|
133
133
|
<Tbody>
|