This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new cc103fc98f [#6605] fix(web): fix model version alias to be optional 
(#6607)
cc103fc98f is described below

commit cc103fc98fcc86e78bf6c394a3abf187a22d3cc4
Author: Qian Xia <[email protected]>
AuthorDate: Wed Mar 5 16:20:16 2025 +0800

    [#6605] fix(web): fix model version alias to be optional (#6607)
    
    ### What changes were proposed in this pull request?
    click submit button to trigger verification of version form, and no
    required info for alias form item.
    <img width="751" alt="image"
    
src="https://github.com/user-attachments/assets/0ac3a6b0-d626-47fe-add3-783e59d0b9b6";
    />
    
    
    ### Why are the changes needed?
    Model version alias should be optional
    
    Fix: #6605
    
    ### Does this PR introduce _any_ user-facing change?
    N/A
    
    ### How was this patch tested?
    manually
---
 .../app/metalakes/metalake/rightContent/LinkVersionDialog.js  | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

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
         }

Reply via email to