From 8d6eafdff8566819acf407177b0221cc7c1e9a65 Mon Sep 17 00:00:00 2001 From: Qian Xia Date: Wed, 15 May 2024 11:43:38 +0800 Subject: [PATCH] [#3257] fix(web): add a default optional properties for fileset catalog (#3384) ### What changes were proposed in this pull request? Add a default optional properties for fileset catalog image Remove fix width of version component image image ### Why are the changes needed? Although the location property is optional, it is better to be there for ease of use The width of version component is should be flexible Fix: #3257 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? manual --- .../metalake/rightContent/CreateCatalogDialog.js | 4 ++-- web/src/app/rootLayout/VersionView.js | 2 +- web/src/lib/utils/initial.js | 9 ++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js b/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js index a6ff296de50..2e9b1ab24c4 100644 --- a/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js +++ b/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js @@ -236,7 +236,7 @@ const CreateCatalogDialog = props => { let properties = {} const prevProperties = innerProps - .filter(i => i.key.trim() !== '') + .filter(i => (typeSelect === 'fileset' && i.key === 'location' ? i.value.trim() !== '' : i.key.trim() !== '')) .reduce((acc, item) => { acc[item.key] = item.value @@ -363,7 +363,7 @@ const CreateCatalogDialog = props => { setProviderTypes(providersItems) const providerItem = providersItems.find(i => i.value === data.provider) - let propsItems = [...providerItem.defaultProps] + let propsItems = [...providerItem.defaultProps].filter(i => i.required) propsItems = propsItems.map((it, idx) => { let propItem = { diff --git a/web/src/app/rootLayout/VersionView.js b/web/src/app/rootLayout/VersionView.js index 8cde1aad75b..5831cff41b6 100644 --- a/web/src/app/rootLayout/VersionView.js +++ b/web/src/app/rootLayout/VersionView.js @@ -12,7 +12,7 @@ const VersionView = () => { const store = useAppSelector(state => state.sys) return ( - + {store.version} ) diff --git a/web/src/lib/utils/initial.js b/web/src/lib/utils/initial.js index 63c7f878969..035bb14601f 100644 --- a/web/src/lib/utils/initial.js +++ b/web/src/lib/utils/initial.js @@ -7,7 +7,14 @@ export const filesetProviders = [ { label: 'hadoop', value: 'hadoop', - defaultProps: [] + defaultProps: [ + { + key: 'location', + value: '', + required: false, + description: 'The storage location of the fileset' + } + ] } ]