Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#6605] fix(web): fix model version alias to be optional (#6607)

Qian Xiacc103fc98fcc
diff --git a/web/web/src/app/metalakes/metalake/rightContent/LinkVersionDialog.js b/web/web/src/app/metalakes/metalake/rightContent/LinkVersionDialog.js
index cd8ab59ef5..dadb464c4b 100644
--- a/web/web/src/app/metalakes/metalake/rightContent/LinkVersionDialog.js
+++ b/web/web/src/app/metalakes/metalake/rightContent/LinkVersionDialog.js
@@ -64,12 +64,9 @@ const schema = yup.object().shape({
.array()
.of(
yup.object().shape({
- name: yup
- .string()
- .required('The alias is required')
- .test('not-number', 'Alias cannot be a number or a numeric string', value => {
- return value === undefined || isNaN(Number(value))
- })
+ name: yup.string().test('not-number', 'Alias cannot be a number or a numeric string', value => {
+ return (value && isNaN(Number(value))) || !value
+ })
})
)
.test('unique', 'Alias must be unique', (aliases, ctx) => {
@@ -214,7 +211,7 @@ const LinkVersionDialog = props => {
const schemaData = {
uri: data.uri,
- aliases: data.aliases.map(alias => alias.name),
+ aliases: data.aliases.map(alias => alias.name).filter(aliasName => aliasName),
comment: data.comment,
properties
}