Skip to content

Commit

Permalink
[#1391] fix(UI): Fix update metalake error in the web UI (#1394)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Fix update metalake error in the web UI.

The reason for the error is that the existing metalake is not set with
`properties`, causing an error unable to find properties when
deconstructing the `properties` of metalake.

The solution is to set an empty object to the `properties`.

1. existed metalake without `properties`
<img width="389" alt="no-props"
src="https://github.com/datastrato/gravitino/assets/17310559/42478741-3163-49c8-8ac5-54116abcc035">

2. click `update metalake` icon button, and now the update pop-up will
display correctly.
<img width="596" alt="update-metalake"
src="https://github.com/datastrato/gravitino/assets/17310559/7fc99516-abb9-4412-a032-326765357023">



### Why are the changes needed?

Fix: #1391
Fix: #1397

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

N/A
  • Loading branch information
ch3yne authored and web-flow committed Jan 9, 2024
1 parent b656ca8 commit 9babb96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/app/(home)/CreateMetalakeDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const CreateMetalakeDialog = props => {
useEffect(() => {
if (open && JSON.stringify(data) !== '{}') {
setCacheData(data)
const { properties } = data
const { properties = {} } = data

const propsArr = Object.keys(properties).map(item => {
return {
Expand Down
2 changes: 1 addition & 1 deletion web/app/metalakes/CreateCatalogDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const CreateCatalogDialog = props => {
useEffect(() => {
if (open && JSON.stringify(data) !== '{}') {
setCacheData(data)
const { properties } = data
const { properties = {} } = data

const propsArr = Object.keys(properties).map(item => {
return {
Expand Down

0 comments on commit 9babb96

Please sign in to comment.