@flightctl/ui-components 1.1.0-rc1 → 1.1.0-rc3
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/Repository/CreateRepository/CreateRepositoryForm.css +5 -1
- package/dist/types/imagebuilder/index.d.ts +2 -0
- package/dist/types/imagebuilder/index.d.ts.map +1 -1
- package/dist/types/imagebuilder/index.js +3 -1
- package/dist/types/imagebuilder/index.js.map +1 -1
- package/dist/types/imagebuilder/models/ApiVersion.d.ts +8 -0
- package/dist/types/imagebuilder/models/ApiVersion.d.ts.map +1 -0
- package/dist/types/imagebuilder/models/ApiVersion.js +16 -0
- package/dist/types/imagebuilder/models/ApiVersion.js.map +1 -0
- package/dist/types/imagebuilder/models/ImageBuild.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageBuild.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/ImageBuildList.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageBuildList.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/ImageExport.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageExport.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/ImageExportList.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageExportList.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/Status.d.ts +28 -0
- package/dist/types/imagebuilder/models/Status.d.ts.map +1 -0
- package/dist/types/imagebuilder/models/Status.js +3 -0
- package/dist/types/imagebuilder/models/Status.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/models/ApiVersion.d.ts +9 -0
- package/dist/types/models/ApiVersion.d.ts.map +1 -0
- package/dist/types/models/ApiVersion.js +17 -0
- package/dist/types/models/ApiVersion.js.map +1 -0
- package/dist/types/models/ApplicationProviderBase.d.ts +12 -0
- package/dist/types/models/ApplicationProviderBase.d.ts.map +1 -0
- package/dist/types/models/ApplicationProviderBase.js +3 -0
- package/dist/types/models/ApplicationProviderBase.js.map +1 -0
- package/dist/types/models/ApplicationProviderSpec.d.ts +5 -15
- package/dist/types/models/ApplicationProviderSpec.d.ts.map +1 -1
- package/dist/types/models/ApplicationUser.d.ts +7 -0
- package/dist/types/models/ApplicationUser.d.ts.map +1 -0
- package/dist/types/models/ApplicationUser.js +3 -0
- package/dist/types/models/ApplicationUser.js.map +1 -0
- package/dist/types/models/AuthConfig.d.ts +2 -4
- package/dist/types/models/AuthConfig.d.ts.map +1 -1
- package/dist/types/models/AuthProvider.d.ts +2 -4
- package/dist/types/models/AuthProvider.d.ts.map +1 -1
- package/dist/types/models/AuthProviderList.d.ts +2 -4
- package/dist/types/models/AuthProviderList.d.ts.map +1 -1
- package/dist/types/models/CertificateSigningRequest.d.ts +2 -4
- package/dist/types/models/CertificateSigningRequest.d.ts.map +1 -1
- package/dist/types/models/CertificateSigningRequestList.d.ts +2 -4
- package/dist/types/models/CertificateSigningRequestList.d.ts.map +1 -1
- package/dist/types/models/ComposeApplication.d.ts +7 -0
- package/dist/types/models/ComposeApplication.d.ts.map +1 -0
- package/dist/types/models/ComposeApplication.js +3 -0
- package/dist/types/models/ComposeApplication.js.map +1 -0
- package/dist/types/models/ContainerApplication.d.ts +18 -0
- package/dist/types/models/ContainerApplication.d.ts.map +1 -0
- package/dist/types/models/ContainerApplication.js +3 -0
- package/dist/types/models/ContainerApplication.js.map +1 -0
- package/dist/types/models/ContainerApplicationProperties.d.ts +13 -0
- package/dist/types/models/ContainerApplicationProperties.d.ts.map +1 -0
- package/dist/types/models/ContainerApplicationProperties.js +3 -0
- package/dist/types/models/ContainerApplicationProperties.js.map +1 -0
- package/dist/types/models/Device.d.ts +2 -4
- package/dist/types/models/Device.d.ts.map +1 -1
- package/dist/types/models/DeviceList.d.ts +2 -4
- package/dist/types/models/DeviceList.d.ts.map +1 -1
- package/dist/types/models/EnrollmentRequest.d.ts +2 -4
- package/dist/types/models/EnrollmentRequest.d.ts.map +1 -1
- package/dist/types/models/EnrollmentRequestList.d.ts +2 -4
- package/dist/types/models/EnrollmentRequestList.d.ts.map +1 -1
- package/dist/types/models/Event.d.ts +2 -4
- package/dist/types/models/Event.d.ts.map +1 -1
- package/dist/types/models/Event.js.map +1 -1
- package/dist/types/models/EventList.d.ts +2 -4
- package/dist/types/models/EventList.d.ts.map +1 -1
- package/dist/types/models/Fleet.d.ts +2 -4
- package/dist/types/models/Fleet.d.ts.map +1 -1
- package/dist/types/models/FleetList.d.ts +2 -4
- package/dist/types/models/FleetList.d.ts.map +1 -1
- package/dist/types/models/HelmApplication.d.ts +20 -0
- package/dist/types/models/HelmApplication.d.ts.map +1 -0
- package/dist/types/models/HelmApplication.js +3 -0
- package/dist/types/models/HelmApplication.js.map +1 -0
- package/dist/types/models/ImageApplicationProviderSpec.d.ts +2 -22
- package/dist/types/models/ImageApplicationProviderSpec.d.ts.map +1 -1
- package/dist/types/models/InlineApplicationProviderSpec.d.ts +2 -3
- package/dist/types/models/InlineApplicationProviderSpec.d.ts.map +1 -1
- package/dist/types/models/Organization.d.ts +2 -4
- package/dist/types/models/Organization.d.ts.map +1 -1
- package/dist/types/models/OrganizationList.d.ts +2 -4
- package/dist/types/models/OrganizationList.d.ts.map +1 -1
- package/dist/types/models/QuadletApplication.d.ts +8 -0
- package/dist/types/models/QuadletApplication.d.ts.map +1 -0
- package/dist/types/models/QuadletApplication.js +3 -0
- package/dist/types/models/QuadletApplication.js.map +1 -0
- package/dist/types/models/Repository.d.ts +2 -4
- package/dist/types/models/Repository.d.ts.map +1 -1
- package/dist/types/models/RepositoryList.d.ts +2 -4
- package/dist/types/models/RepositoryList.d.ts.map +1 -1
- package/dist/types/models/ResourceSync.d.ts +2 -4
- package/dist/types/models/ResourceSync.d.ts.map +1 -1
- package/dist/types/models/ResourceSyncList.d.ts +2 -4
- package/dist/types/models/ResourceSyncList.d.ts.map +1 -1
- package/dist/types/models/Status.d.ts +2 -4
- package/dist/types/models/Status.d.ts.map +1 -1
- package/dist/types/models/TemplateVersion.d.ts +2 -4
- package/dist/types/models/TemplateVersion.d.ts.map +1 -1
- package/dist/types/models/TemplateVersionList.d.ts +2 -4
- package/dist/types/models/TemplateVersionList.d.ts.map +1 -1
- package/dist/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.js +51 -51
- package/dist/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.js.map +1 -1
- package/dist/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.js +1 -1
- package/dist/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.js +5 -4
- package/dist/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/TerminalTab.js +5 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +3 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +310 -363
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js +18 -19
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.js +5 -4
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js +2 -2
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts +3 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js +20 -23
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationIntegritySettings.js +3 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationIntegritySettings.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +25 -45
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.d.ts +8 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.d.ts.map +1 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.js +37 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.js.map +1 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js +5 -8
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/utils.d.ts +18 -18
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.d.ts +4 -2
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.d.ts.map +1 -1
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.js +2 -2
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.js.map +1 -1
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.d.ts +1 -1
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.js +3 -3
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/ui-components/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +3 -1
- package/dist/ui-components/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.d.ts +7 -0
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.d.ts.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.js +40 -0
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.js.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.d.ts +8 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.d.ts.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.js +37 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.js.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.js +4 -3
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.js +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.js +13 -10
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.js +4 -2
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.js +7 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/types.d.ts +3 -5
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/types.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.d.ts +3 -2
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.js +139 -34
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.js +23 -12
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.js +115 -39
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.d.ts +1 -0
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.js +17 -18
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.d.ts +5 -2
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.js +22 -12
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildsPage.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildsPage.js +17 -8
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildsPage.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.d.ts +10 -9
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.js +122 -26
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.js.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts +2 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.js +10 -4
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/utils.js +3 -4
- package/dist/ui-components/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/ui-components/src/components/form/RepositorySelect.d.ts.map +1 -1
- package/dist/ui-components/src/components/form/RepositorySelect.js +1 -1
- package/dist/ui-components/src/components/form/RepositorySelect.js.map +1 -1
- package/dist/ui-components/src/components/form/UploadField.d.ts.map +1 -1
- package/dist/ui-components/src/components/form/UploadField.js +25 -16
- package/dist/ui-components/src/components/form/UploadField.js.map +1 -1
- package/dist/ui-components/src/components/form/validations.d.ts +25 -18
- package/dist/ui-components/src/components/form/validations.d.ts.map +1 -1
- package/dist/ui-components/src/components/form/validations.js +79 -33
- package/dist/ui-components/src/components/form/validations.js.map +1 -1
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.d.ts +2 -1
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.d.ts.map +1 -1
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js +2 -2
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js.map +1 -1
- package/dist/ui-components/src/constants.d.ts +5 -6
- package/dist/ui-components/src/constants.d.ts.map +1 -1
- package/dist/ui-components/src/constants.js +19 -11
- package/dist/ui-components/src/constants.js.map +1 -1
- package/dist/ui-components/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/ui-components/src/hooks/useWebSocket.js +25 -4
- package/dist/ui-components/src/hooks/useWebSocket.js.map +1 -1
- package/dist/ui-components/src/types/deviceSpec.d.ts +44 -76
- package/dist/ui-components/src/types/deviceSpec.d.ts.map +1 -1
- package/dist/ui-components/src/types/deviceSpec.js +13 -26
- package/dist/ui-components/src/types/deviceSpec.js.map +1 -1
- package/dist/ui-components/src/types/extraTypes.d.ts +1 -7
- package/dist/ui-components/src/types/extraTypes.d.ts.map +1 -1
- package/dist/ui-components/src/types/extraTypes.js.map +1 -1
- package/dist/ui-components/src/types/rbac.d.ts +7 -1
- package/dist/ui-components/src/types/rbac.d.ts.map +1 -1
- package/dist/ui-components/src/types/rbac.js +6 -0
- package/dist/ui-components/src/types/rbac.js.map +1 -1
- package/dist/ui-components/src/utils/imageBuilds.d.ts +1 -0
- package/dist/ui-components/src/utils/imageBuilds.d.ts.map +1 -1
- package/dist/ui-components/src/utils/imageBuilds.js +20 -29
- package/dist/ui-components/src/utils/imageBuilds.js.map +1 -1
- package/dist/ui-components/src/utils/search.d.ts +2 -1
- package/dist/ui-components/src/utils/search.d.ts.map +1 -1
- package/dist/ui-components/src/utils/search.js +2 -2
- package/dist/ui-components/src/utils/search.js.map +1 -1
- package/package.json +2 -2
- package/src/components/AuthProvider/CreateAuthProvider/utils.ts +2 -2
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +2 -2
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +10 -4
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +9 -1
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +361 -425
- package/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.tsx +19 -29
- package/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.tsx +5 -13
- package/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.tsx +2 -16
- package/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.tsx +8 -7
- package/src/components/Device/EditDeviceWizard/steps/ApplicationIntegritySettings.tsx +5 -5
- package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +29 -101
- package/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.tsx +87 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.tsx +5 -10
- package/src/components/ErrorAlert/ErrorAlert.tsx +13 -3
- package/src/components/Fleet/CreateFleet/utils.ts +4 -5
- package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +11 -8
- package/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.tsx +81 -0
- package/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.tsx +61 -0
- package/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.tsx +8 -3
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.tsx +1 -1
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.tsx +18 -10
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.tsx +5 -1
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.tsx +13 -1
- package/src/components/ImageBuilds/CreateImageBuildWizard/types.ts +3 -6
- package/src/components/ImageBuilds/CreateImageBuildWizard/utils.ts +161 -37
- package/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.tsx +36 -17
- package/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.tsx +131 -44
- package/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.tsx +22 -26
- package/src/components/ImageBuilds/ImageBuildRow.tsx +41 -20
- package/src/components/ImageBuilds/ImageBuildsPage.tsx +34 -15
- package/src/components/ImageBuilds/ImageExportCards.tsx +198 -80
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.css +5 -1
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +14 -4
- package/src/components/Repository/CreateRepository/utils.ts +4 -4
- package/src/components/form/RepositorySelect.tsx +1 -0
- package/src/components/form/UploadField.tsx +29 -30
- package/src/components/form/validations.ts +156 -106
- package/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.tsx +3 -1
- package/src/constants.ts +19 -6
- package/src/hooks/useWebSocket.ts +25 -3
- package/src/types/deviceSpec.ts +68 -108
- package/src/types/extraTypes.ts +2 -12
- package/src/types/rbac.ts +6 -0
- package/src/utils/imageBuilds.ts +22 -32
- package/src/utils/search.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadField.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/UploadField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"UploadField.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/UploadField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAsHF,QAAA,MAAM,kBAAkB,2DAA4D,gBAAgB,sBASnG,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -6,23 +6,25 @@ const formik_1 = require("formik");
|
|
|
6
6
|
const react_core_1 = require("@patternfly/react-core");
|
|
7
7
|
const useTranslation_1 = require("../../hooks/useTranslation");
|
|
8
8
|
const FieldHelperText_1 = tslib_1.__importStar(require("./FieldHelperText"));
|
|
9
|
-
const
|
|
9
|
+
const ONE_MB = 1024 * 1024;
|
|
10
|
+
const UploadMaxFileSizeHelperText = ({ maxFileBytes }) => {
|
|
11
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
12
|
+
const showKB = maxFileBytes < ONE_MB;
|
|
13
|
+
const maxFileSize = maxFileBytes / (showKB ? 1024 : ONE_MB);
|
|
14
|
+
const helperText = showKB
|
|
15
|
+
? t('Max file size {{ maxFileSize }} KB', { maxFileSize })
|
|
16
|
+
: t('Max file size {{ maxFileSize }} MB', { maxFileSize });
|
|
17
|
+
return React.createElement(FieldHelperText_1.DefaultHelperText, { helperText: helperText });
|
|
18
|
+
};
|
|
19
|
+
const UploadErrorHelperText = ({ meta, isUploading, isRejected, }) => {
|
|
10
20
|
const { t } = (0, useTranslation_1.useTranslation)();
|
|
11
|
-
const maxFileMB = (maxFileBytes || 0) / (1024 * 1024);
|
|
12
|
-
const defaultContent = maxFileBytes ? (React.createElement(FieldHelperText_1.DefaultHelperText, { helperText: t('Max file size {{ maxFileSize }} MB', { maxFileSize: maxFileMB }) })) : null;
|
|
13
21
|
if (isRejected) {
|
|
14
|
-
return
|
|
15
|
-
defaultContent,
|
|
16
|
-
React.createElement(FieldHelperText_1.default, { error: t('Content exceeds max file size of {{ maxFileSize }} MB', {
|
|
17
|
-
maxFileSize: maxFileMB,
|
|
18
|
-
}) })));
|
|
22
|
+
return React.createElement(FieldHelperText_1.default, { error: t('File exceeds maximum allowed size.') });
|
|
19
23
|
}
|
|
20
24
|
else if (!isUploading && !!(meta === null || meta === void 0 ? void 0 : meta.error)) {
|
|
21
|
-
return
|
|
22
|
-
defaultContent,
|
|
23
|
-
React.createElement(FieldHelperText_1.default, { meta: meta })));
|
|
25
|
+
return React.createElement(FieldHelperText_1.default, { meta: meta });
|
|
24
26
|
}
|
|
25
|
-
return
|
|
27
|
+
return null;
|
|
26
28
|
};
|
|
27
29
|
const UploadField = ({ ariaLabel, maxFileBytes, isRequired, name }) => {
|
|
28
30
|
const { t } = (0, useTranslation_1.useTranslation)();
|
|
@@ -47,13 +49,17 @@ const UploadField = ({ ariaLabel, maxFileBytes, isRequired, name }) => {
|
|
|
47
49
|
return;
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
// To prevent timing issues with validations, we must touch the field before we set the new value
|
|
51
53
|
void setTouched(true);
|
|
54
|
+
void setValue(file, true);
|
|
52
55
|
setIsRejected(false);
|
|
53
56
|
};
|
|
54
57
|
return (React.createElement(react_core_1.FormGroup, { fieldId: fieldId, "aria-label": ariaLabel, isRequired: isRequired },
|
|
55
58
|
React.createElement(react_core_1.FileUpload, { type: "text", id: field.name, isRequired: isRequired, filenamePlaceholder: t('Drag a file or browse to upload'), browseButtonText: t('Browse...'), clearButtonText: t('Clear'), allowEditingUploadedText: true, style: { resize: 'vertical' }, validated: isValid || isFileUploading ? 'default' : 'error', value: field.value, filename: filename ? t('Content loaded from: {{ filename }}', { filename }) : '', onDataChange: handleFileChange, onTextChange: handleFileChange, onFileInputChange: (_event, file) => {
|
|
56
|
-
if (
|
|
59
|
+
if (maxFileBytes && file.size > maxFileBytes) {
|
|
60
|
+
handleFileRejected(true);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
57
63
|
setFilename(file.name);
|
|
58
64
|
setIsRejected(false);
|
|
59
65
|
}
|
|
@@ -65,10 +71,13 @@ const UploadField = ({ ariaLabel, maxFileBytes, isRequired, name }) => {
|
|
|
65
71
|
onDropRejected: () => handleFileRejected(true),
|
|
66
72
|
}, onClearClick: () => {
|
|
67
73
|
setFilename('');
|
|
74
|
+
if (!isRequired) {
|
|
75
|
+
void setTouched(false);
|
|
76
|
+
}
|
|
68
77
|
void setValue('');
|
|
69
|
-
void setTouched(false);
|
|
70
78
|
} }),
|
|
71
|
-
React.createElement(
|
|
79
|
+
maxFileBytes && React.createElement(UploadMaxFileSizeHelperText, { maxFileBytes: maxFileBytes }),
|
|
80
|
+
React.createElement(UploadErrorHelperText, { meta: meta, isUploading: isFileUploading, isRejected: isRejected })));
|
|
72
81
|
};
|
|
73
82
|
const UploadFieldWrapper = (_a) => {
|
|
74
83
|
var { name, ariaLabel, maxFileBytes, isRequired } = _a, rest = tslib_1.__rest(_a, ["name", "ariaLabel", "maxFileBytes", "isRequired"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadField.js","sourceRoot":"","sources":["../../../../../src/components/form/UploadField.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,mCAAkD;AAClD,uDAAyE;AACzE,+DAA4D;AAC5D,6EAAuE;AAavE,MAAM,
|
|
1
|
+
{"version":3,"file":"UploadField.js","sourceRoot":"","sources":["../../../../../src/components/form/UploadField.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,mCAAkD;AAClD,uDAAyE;AACzE,+DAA4D;AAC5D,6EAAuE;AAavE,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3B,MAAM,2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Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, "">;
|
|
27
27
|
export declare const validApplicationAndVolumeName: (t: TFunction) => Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, "">;
|
|
28
|
+
export declare const getBuildNameValidations: (t: TFunction) => {
|
|
29
|
+
key: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}[];
|
|
32
|
+
export declare const validImageBuildName: (t: TFunction) => Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
|
|
28
33
|
export declare const maxLengthString: (t: TFunction, props: {
|
|
29
34
|
maxLength: number;
|
|
30
35
|
fieldName: string;
|
|
@@ -32,6 +37,8 @@ export declare const maxLengthString: (t: TFunction, props: {
|
|
|
32
37
|
export declare const validOsImage: (t: TFunction, { isFleet }: {
|
|
33
38
|
isFleet: boolean;
|
|
34
39
|
}) => Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, "">;
|
|
40
|
+
export declare const validHelmNamespace: (t: TFunction) => Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, "">;
|
|
41
|
+
export declare const validHelmValuesFile: (t: TFunction) => Yup.StringSchema<string | undefined, Yup.AnyObject, undefined, "">;
|
|
35
42
|
export declare const validLabelsSchema: (t: TFunction, forbiddenLabels?: string[]) => Yup.ArraySchema<{
|
|
36
43
|
value?: string | undefined;
|
|
37
44
|
key: string;
|
|
@@ -44,34 +51,34 @@ export declare const isValidPortMapping: (hostPort: string, containerPort: strin
|
|
|
44
51
|
export declare const validateCPULimit: (cpu: string | undefined) => boolean;
|
|
45
52
|
export declare const validateMemoryLimit: (memory: string | undefined) => boolean;
|
|
46
53
|
export declare const validApplicationsSchema: (t: TFunction) => Yup.ArraySchema<({
|
|
54
|
+
ports?: {
|
|
55
|
+
hostPort: string;
|
|
56
|
+
containerPort: string;
|
|
57
|
+
}[] | undefined;
|
|
47
58
|
volumes?: {
|
|
48
59
|
imageRef?: string | undefined;
|
|
49
60
|
imagePullPolicy?: string | undefined;
|
|
50
61
|
mountPath?: string | undefined;
|
|
51
62
|
name: string;
|
|
52
63
|
}[] | undefined;
|
|
53
|
-
|
|
54
|
-
hostPort: string;
|
|
55
|
-
containerPort: string;
|
|
56
|
-
}[] | undefined;
|
|
64
|
+
name?: string | undefined;
|
|
57
65
|
runAs?: string | undefined;
|
|
58
66
|
image: string;
|
|
59
|
-
variables: {
|
|
60
|
-
value: string;
|
|
61
|
-
name: string;
|
|
62
|
-
}[];
|
|
63
67
|
appType: AppType.AppTypeContainer;
|
|
64
68
|
specType: AppSpecType.OCI_IMAGE;
|
|
65
|
-
name: string;
|
|
66
69
|
limits: {
|
|
67
70
|
cpu?: string | undefined;
|
|
68
71
|
memory?: string | undefined;
|
|
69
72
|
};
|
|
73
|
+
variables: {
|
|
74
|
+
value: string;
|
|
75
|
+
name: string;
|
|
76
|
+
}[];
|
|
70
77
|
} | {
|
|
71
78
|
name?: string | undefined;
|
|
72
79
|
namespace?: string | undefined;
|
|
73
|
-
valuesYaml?: string | undefined;
|
|
74
80
|
valuesFiles?: (string | undefined)[] | undefined;
|
|
81
|
+
valuesYaml?: string | undefined;
|
|
75
82
|
image: string;
|
|
76
83
|
appType: AppType.AppTypeHelm;
|
|
77
84
|
specType: AppSpecType.OCI_IMAGE;
|
|
@@ -83,25 +90,25 @@ export declare const validApplicationsSchema: (t: TFunction) => Yup.ArraySchema<
|
|
|
83
90
|
}[] | undefined;
|
|
84
91
|
name?: string | undefined;
|
|
85
92
|
image: string;
|
|
93
|
+
appType: NonNullable<AppType.AppTypeCompose | AppType.AppTypeQuadlet | undefined>;
|
|
94
|
+
specType: AppSpecType.OCI_IMAGE;
|
|
86
95
|
variables: {
|
|
87
96
|
value: string;
|
|
88
97
|
name: string;
|
|
89
98
|
}[];
|
|
90
|
-
appType: NonNullable<AppType.AppTypeCompose | AppType.AppTypeQuadlet | undefined>;
|
|
91
|
-
specType: AppSpecType.OCI_IMAGE;
|
|
92
99
|
} | {
|
|
93
100
|
volumes?: {
|
|
94
101
|
name: string;
|
|
95
102
|
imageRef: string;
|
|
96
103
|
imagePullPolicy: NonNullable<ImagePullPolicy | undefined>;
|
|
97
104
|
}[] | undefined;
|
|
105
|
+
name: string;
|
|
106
|
+
appType: AppType.AppTypeQuadlet;
|
|
107
|
+
specType: NonNullable<AppSpecType | undefined>;
|
|
98
108
|
variables: {
|
|
99
109
|
value: string;
|
|
100
110
|
name: string;
|
|
101
111
|
}[];
|
|
102
|
-
appType: AppType.AppTypeQuadlet;
|
|
103
|
-
specType: NonNullable<AppSpecType | undefined>;
|
|
104
|
-
name: string;
|
|
105
112
|
files: {
|
|
106
113
|
content?: string | undefined;
|
|
107
114
|
path: string;
|
|
@@ -112,13 +119,13 @@ export declare const validApplicationsSchema: (t: TFunction) => Yup.ArraySchema<
|
|
|
112
119
|
imageRef: string;
|
|
113
120
|
imagePullPolicy: NonNullable<ImagePullPolicy | undefined>;
|
|
114
121
|
}[] | undefined;
|
|
122
|
+
name: string;
|
|
123
|
+
appType: AppType.AppTypeCompose;
|
|
124
|
+
specType: NonNullable<AppSpecType | undefined>;
|
|
115
125
|
variables: {
|
|
116
126
|
value: string;
|
|
117
127
|
name: string;
|
|
118
128
|
}[];
|
|
119
|
-
appType: AppType.AppTypeCompose;
|
|
120
|
-
specType: NonNullable<AppSpecType | undefined>;
|
|
121
|
-
name: string;
|
|
122
129
|
files: {
|
|
123
130
|
content?: string | undefined;
|
|
124
131
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/validations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAEL,WAAW,EAEX,cAAc,EASd,WAAW,
|
|
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;;;;;;MAG3D,CAAC;AAGL,eAAO,MAAM,8BAA8B,MAAO,SAAS,QAAQ;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE;;;;;;;;;MAS1F,CAAC;AAEL,eAAO,MAAM,gCAAgC,MAAO,SAAS;;;;;;;;MAYzD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createMassResumeValidationSchema = exports.deviceApprovalValidationSchema = exports.deviceSystemdUnitsValidationSchema = exports.systemdUnitListValidationSchema = exports.validConfigTemplatesSchema = exports.validFleetDisruptionBudgetSchema = exports.validUpdatePolicySchema = exports.validFleetRolloutPolicySchema = exports.validApplicationsSchema = exports.validateMemoryLimit = exports.validateCPULimit = exports.isValidPortMapping = exports.isDuplicatePortMapping = exports.isValidPortNumber = exports.validatePortNumber = exports.validGroupLabelKeysSchema = exports.validLabelsSchema = exports.validOsImage = exports.maxLengthString = exports.validApplicationAndVolumeName = exports.validKubernetesLabelValue = exports.validKubernetesDnsSubdomain = exports.getInvalidKubernetesLabels = exports.hasUniqueLabelKeys = exports.getKubernetesDnsSubdomainErrors = exports.getDnsSubdomainValidations = exports.getLabelValueValidations = exports.MAX_TARGET_REVISION_LENGTH = void 0;
|
|
3
|
+
exports.createMassResumeValidationSchema = exports.deviceApprovalValidationSchema = exports.deviceSystemdUnitsValidationSchema = exports.systemdUnitListValidationSchema = exports.validConfigTemplatesSchema = exports.validFleetDisruptionBudgetSchema = exports.validUpdatePolicySchema = exports.validFleetRolloutPolicySchema = exports.validApplicationsSchema = exports.validateMemoryLimit = exports.validateCPULimit = exports.isValidPortMapping = exports.isDuplicatePortMapping = exports.isValidPortNumber = exports.validatePortNumber = exports.validGroupLabelKeysSchema = exports.validLabelsSchema = exports.validHelmValuesFile = exports.validHelmNamespace = exports.validOsImage = exports.maxLengthString = exports.validImageBuildName = exports.getBuildNameValidations = exports.validApplicationAndVolumeName = exports.validKubernetesLabelValue = exports.validKubernetesDnsSubdomain = exports.getInvalidKubernetesLabels = exports.hasUniqueLabelKeys = exports.getKubernetesDnsSubdomainErrors = exports.getDnsSubdomainValidations = exports.getLabelValueValidations = exports.MAX_TARGET_REVISION_LENGTH = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Yup = tslib_1.__importStar(require("yup"));
|
|
6
6
|
const countBy_1 = tslib_1.__importDefault(require("lodash/countBy"));
|
|
@@ -19,9 +19,9 @@ const K8S_LABEL_VALUE_MAX_LENGTH = 63;
|
|
|
19
19
|
const K8S_DNS_SUBDOMAIN_START_END = /^[a-z0-9](.*[a-z0-9])?$/;
|
|
20
20
|
const K8S_DNS_SUBDOMAIN_ALLOWED_CHARACTERS = /^[a-z0-9.-]*$/;
|
|
21
21
|
const K8S_DNS_SUBDOMAIN_VALUE_MAX_LENGTH = 253;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
22
|
+
const OCI_IMAGE_FULL_REGEXP = /^(?![./_])[a-zA-Z0-9.\-\/:@_+]*$/;
|
|
23
|
+
// Accepts all characters from the above regex, but it rejects leading dot, slash, or underscore
|
|
24
|
+
const OCI_IMAGE_ALLOWED_CHARS_REGEXP = /^[a-zA-Z0-9.\-\/:@_+]*$/;
|
|
25
25
|
const APPLICATION_NAME_REGEXP = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/;
|
|
26
26
|
const APPLICATION_VAR_NAME_REGEXP = /^[a-zA-Z_]+[a-zA-Z0-9_]*$/;
|
|
27
27
|
const TEMPLATE_VARIABLES_REGEXP = /{{.+?}}/g;
|
|
@@ -35,6 +35,8 @@ const absolutePathRegex = /^\/.*$/;
|
|
|
35
35
|
const relativePathRegex = /^(?!\.\.\/|\.\.\$|\.\/)(\.\/)*[\w.-]+(?:\/[\w.-]+)*\/?$/;
|
|
36
36
|
exports.MAX_TARGET_REVISION_LENGTH = 244;
|
|
37
37
|
const MAX_FILE_PATH_LENGTH = 253;
|
|
38
|
+
const HELM_NAMESPACE_MAX_LENGTH = 63;
|
|
39
|
+
const HELM_VALUES_FILE_EXT_REGEXP = /\.(yaml|yml)$/i;
|
|
38
40
|
const isInteger = (val) => val === undefined || Number.isInteger(val);
|
|
39
41
|
const validComposeFileNames = [
|
|
40
42
|
'podman-compose.yaml',
|
|
@@ -170,6 +172,21 @@ const validKubernetesLabelValue = (t, { isRequired, fieldName }) => isRequired
|
|
|
170
172
|
exports.validKubernetesLabelValue = validKubernetesLabelValue;
|
|
171
173
|
const validApplicationAndVolumeName = (t) => Yup.string().matches(APPLICATION_NAME_REGEXP, t('Use lowercase alphanumeric characters, or dash (-). Must start and end with an alphanumeric character.'));
|
|
172
174
|
exports.validApplicationAndVolumeName = validApplicationAndVolumeName;
|
|
175
|
+
const getBuildNameValidations = (t) => [
|
|
176
|
+
{
|
|
177
|
+
key: 'imageBuildName',
|
|
178
|
+
message: t('Use lowercase alphanumeric characters, or dash (-). Must start and end with an alphanumeric character.'),
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
exports.getBuildNameValidations = getBuildNameValidations;
|
|
182
|
+
const validImageBuildName = (t) => Yup.string()
|
|
183
|
+
.required(t('Build name is required'))
|
|
184
|
+
.test('imageBuildName', function (value) {
|
|
185
|
+
if (!value)
|
|
186
|
+
return true;
|
|
187
|
+
return APPLICATION_NAME_REGEXP.test(value) || this.createError({ message: { imageBuildName: 'failed' } });
|
|
188
|
+
});
|
|
189
|
+
exports.validImageBuildName = validImageBuildName;
|
|
173
190
|
const maxLengthString = (t, props) => Yup.string().max(props.maxLength, t('{{ fieldName }} must not exceed {{ maxLength }} characters', props));
|
|
174
191
|
exports.maxLengthString = maxLengthString;
|
|
175
192
|
const validOsImage = (t, { isFleet }) => (0, exports.maxLengthString)(t, { fieldName: t('System image'), maxLength: 2048 }).test('osImageValidations', t('System image is invalid'), (osImage) => {
|
|
@@ -191,9 +208,39 @@ const validOsImage = (t, { isFleet }) => (0, exports.maxLengthString)(t, { field
|
|
|
191
208
|
validateOsImage = osImage.replace(TEMPLATE_VARIABLES_REGEXP, 'tv');
|
|
192
209
|
}
|
|
193
210
|
}
|
|
194
|
-
return
|
|
211
|
+
return OCI_IMAGE_FULL_REGEXP.test(validateOsImage);
|
|
195
212
|
});
|
|
196
213
|
exports.validOsImage = validOsImage;
|
|
214
|
+
const validHelmNamespace = (t) => Yup.string()
|
|
215
|
+
.max(HELM_NAMESPACE_MAX_LENGTH, t('Namespace must not exceed {{ max }} characters.', { max: HELM_NAMESPACE_MAX_LENGTH }))
|
|
216
|
+
.test('helm-namespace-format', t('Namespace must only include lowercase letters, numbers, and hyphens. It must start and end with a letter or number.'), (value) => {
|
|
217
|
+
return !value || APPLICATION_NAME_REGEXP.test(value);
|
|
218
|
+
});
|
|
219
|
+
exports.validHelmNamespace = validHelmNamespace;
|
|
220
|
+
const validHelmValuesFile = (t) => Yup.string().test('helm-values-file', function (filename) {
|
|
221
|
+
if (!filename) {
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
if (filename.length > MAX_FILE_PATH_LENGTH) {
|
|
225
|
+
return this.createError({
|
|
226
|
+
message: t('Values file path must not exceed {{ max }} characters.', {
|
|
227
|
+
max: MAX_FILE_PATH_LENGTH,
|
|
228
|
+
}),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (filename.startsWith('/') || filename.includes('..')) {
|
|
232
|
+
return this.createError({
|
|
233
|
+
message: t('Values file path must be relative and cannot contain parent directory references (..).'),
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (!HELM_VALUES_FILE_EXT_REGEXP.test(filename)) {
|
|
237
|
+
return this.createError({
|
|
238
|
+
message: t('Values file must have .yaml or .yml extension.'),
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
});
|
|
243
|
+
exports.validHelmValuesFile = validHelmValuesFile;
|
|
197
244
|
const validLabelsSchema = (t, forbiddenLabels) => Yup.array()
|
|
198
245
|
.of(Yup.object().shape({
|
|
199
246
|
key: Yup.string()
|
|
@@ -477,14 +524,23 @@ const validateMemoryLimit = (memory) => {
|
|
|
477
524
|
return true;
|
|
478
525
|
};
|
|
479
526
|
exports.validateMemoryLimit = validateMemoryLimit;
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
if (!value
|
|
484
|
-
return
|
|
527
|
+
const ociImageSchema = (t) => Yup.string().test('oci-image-format', (value, testContext) => {
|
|
528
|
+
if (!value)
|
|
529
|
+
return true;
|
|
530
|
+
if (!OCI_IMAGE_ALLOWED_CHARS_REGEXP.test(value)) {
|
|
531
|
+
return testContext.createError({
|
|
532
|
+
message: t('Image includes invalid characters.'),
|
|
533
|
+
});
|
|
485
534
|
}
|
|
486
|
-
|
|
535
|
+
if (!OCI_IMAGE_FULL_REGEXP.test(value)) {
|
|
536
|
+
return testContext.createError({
|
|
537
|
+
message: t('Image must not start with a dot (.), slash (/), or underscore (_).'),
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
return true;
|
|
487
541
|
});
|
|
542
|
+
const requiredOciImageSchema = (t, requiredMessage) => ociImageSchema(t).required(requiredMessage || t('Image is required.'));
|
|
543
|
+
const volumeNameSchema = (t) => (0, exports.validApplicationAndVolumeName)(t).required(t('Volume name is required'));
|
|
488
544
|
const imagePullPolicySchema = (t) => Yup.string()
|
|
489
545
|
.oneOf([types_1.ImagePullPolicy.PullAlways, types_1.ImagePullPolicy.PullIfNotPresent, types_1.ImagePullPolicy.PullNever], t('Pull policy must be one of: Always, IfNotPresent, or Never'))
|
|
490
546
|
.required(t('Pull policy is required'));
|
|
@@ -492,32 +548,29 @@ const mountPathSchema = (t, isRequired = true) => {
|
|
|
492
548
|
const schema = Yup.string().matches(absolutePathRegex, t('Mount path must be absolute.'));
|
|
493
549
|
return isRequired ? schema.required(t('Mount path is required for this volume type')) : schema;
|
|
494
550
|
};
|
|
495
|
-
// Volume validation schemas
|
|
496
551
|
const singleContainerVolumesSchema = (t) => Yup.array().of(Yup.object().shape({
|
|
497
552
|
name: volumeNameSchema(t),
|
|
498
|
-
imageRef:
|
|
553
|
+
imageRef: ociImageSchema(t),
|
|
499
554
|
imagePullPolicy: Yup.string(),
|
|
500
555
|
mountPath: mountPathSchema(t, true),
|
|
501
556
|
}));
|
|
502
557
|
const composeQuadletVolumesSchema = (t) => Yup.array().of(Yup.object().shape({
|
|
503
558
|
name: volumeNameSchema(t),
|
|
504
|
-
imageRef:
|
|
559
|
+
imageRef: requiredOciImageSchema(t, t('Image reference is required for this volume type')),
|
|
505
560
|
imagePullPolicy: imagePullPolicySchema(t),
|
|
506
561
|
}));
|
|
507
562
|
const validApplicationsSchema = (t) => {
|
|
508
563
|
return Yup.array()
|
|
509
564
|
.of(Yup.lazy((value) => {
|
|
510
565
|
// Container applications (image-based with ports and resources)
|
|
511
|
-
if (
|
|
566
|
+
if (value.appType === types_1.AppType.AppTypeContainer) {
|
|
512
567
|
return Yup.object().shape({
|
|
513
568
|
specType: Yup.string()
|
|
514
569
|
.oneOf([deviceSpec_1.AppSpecType.OCI_IMAGE])
|
|
515
570
|
.required(t('Definition source must be image for this type of applications')),
|
|
516
571
|
appType: Yup.string().oneOf([types_1.AppType.AppTypeContainer]).required(t('Application type is required')),
|
|
517
|
-
name: (0, exports.validApplicationAndVolumeName)(t)
|
|
518
|
-
image:
|
|
519
|
-
.required(t('Image is required.'))
|
|
520
|
-
.matches(APPLICATION_IMAGE_REGEXP, t('Application image includes invalid characters.')),
|
|
572
|
+
name: (0, exports.validApplicationAndVolumeName)(t),
|
|
573
|
+
image: requiredOciImageSchema(t),
|
|
521
574
|
ports: Yup.array().of(Yup.object()
|
|
522
575
|
.shape({
|
|
523
576
|
hostPort: Yup.string()
|
|
@@ -544,17 +597,15 @@ const validApplicationsSchema = (t) => {
|
|
|
544
597
|
});
|
|
545
598
|
}
|
|
546
599
|
// Helm applications
|
|
547
|
-
if (
|
|
600
|
+
if (value.appType === types_1.AppType.AppTypeHelm) {
|
|
548
601
|
return Yup.object().shape({
|
|
549
602
|
specType: Yup.string()
|
|
550
603
|
.oneOf([deviceSpec_1.AppSpecType.OCI_IMAGE])
|
|
551
604
|
.required(t('Definition source must be image for this type of applications')),
|
|
552
605
|
appType: Yup.string().oneOf([types_1.AppType.AppTypeHelm]).required(t('Application type is required')),
|
|
553
606
|
name: (0, exports.validApplicationAndVolumeName)(t),
|
|
554
|
-
image:
|
|
555
|
-
|
|
556
|
-
.matches(APPLICATION_IMAGE_REGEXP, t('Application image includes invalid characters.')),
|
|
557
|
-
namespace: Yup.string(),
|
|
607
|
+
image: requiredOciImageSchema(t),
|
|
608
|
+
namespace: (0, exports.validHelmNamespace)(t),
|
|
558
609
|
valuesYaml: Yup.string().test('valid-yaml', t('YAML content is invalid.'), (value) => {
|
|
559
610
|
if (!value || value.trim() === '') {
|
|
560
611
|
return true;
|
|
@@ -567,14 +618,11 @@ const validApplicationsSchema = (t) => {
|
|
|
567
618
|
}
|
|
568
619
|
return true;
|
|
569
620
|
}),
|
|
570
|
-
|
|
571
|
-
// Since the UX design has the first field added by default, we will ignore all empty values files.
|
|
572
|
-
// The user can't add more values files if any is empty (though they can clear existing ones).
|
|
573
|
-
valuesFiles: Yup.array().of(Yup.string()),
|
|
621
|
+
valuesFiles: Yup.array().of((0, exports.validHelmValuesFile)(t)),
|
|
574
622
|
});
|
|
575
623
|
}
|
|
576
624
|
// Image applications (Quadlet or Compose)
|
|
577
|
-
if (
|
|
625
|
+
if (value.specType === deviceSpec_1.AppSpecType.OCI_IMAGE) {
|
|
578
626
|
return Yup.object().shape({
|
|
579
627
|
specType: Yup.string()
|
|
580
628
|
.oneOf([deviceSpec_1.AppSpecType.OCI_IMAGE])
|
|
@@ -583,15 +631,13 @@ const validApplicationsSchema = (t) => {
|
|
|
583
631
|
.oneOf([types_1.AppType.AppTypeCompose, types_1.AppType.AppTypeQuadlet])
|
|
584
632
|
.required(t('Application type is required')),
|
|
585
633
|
name: (0, exports.validApplicationAndVolumeName)(t),
|
|
586
|
-
image:
|
|
587
|
-
.required(t('Image is required.'))
|
|
588
|
-
.matches(APPLICATION_IMAGE_REGEXP, t('Application image includes invalid characters.')),
|
|
634
|
+
image: requiredOciImageSchema(t),
|
|
589
635
|
volumes: composeQuadletVolumesSchema(t),
|
|
590
636
|
variables: appVariablesSchema(t),
|
|
591
637
|
});
|
|
592
638
|
}
|
|
593
639
|
// Inline quadlet applications
|
|
594
|
-
if (
|
|
640
|
+
if (value.appType === types_1.AppType.AppTypeQuadlet && value.specType === deviceSpec_1.AppSpecType.INLINE) {
|
|
595
641
|
return Yup.object().shape({
|
|
596
642
|
specType: appSpecTypeSchema(t),
|
|
597
643
|
appType: Yup.string().oneOf([types_1.AppType.AppTypeQuadlet]).required(t('Application type is required')),
|