This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch branch-0.8
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-0.8 by this push:
new d6fcf0158a [#6605] fix(web): fix model version alias to be optional
(#6610)
d6fcf0158a is described below
commit d6fcf0158a6e9a4a6c67b15f19560d6b4ec5fd19
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Mar 5 18:09:08 2025 +0800
[#6605] fix(web): fix model version alias to be optional (#6610)
### 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
Co-authored-by: Qian Xia <[email protected]>
---
.../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
}