Skip to content

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

[#1403] fix(UI): Remove unnecessary fields when creating a catalog in the web UI (#1404)

CHEYNE13703272ed58
diff --git a/web/app/metalakes/CreateCatalogDialog.js b/web/app/metalakes/CreateCatalogDialog.js
index 2db4916055..e2d9243854 100644
--- a/web/app/metalakes/CreateCatalogDialog.js
+++ b/web/app/metalakes/CreateCatalogDialog.js
@@ -172,12 +172,31 @@ const CreateCatalogDialog = props => {
schema
.validate(validData)
.then(() => {
- const properties = innerProps.reduce((acc, item) => {
+ let properties = {}
+
+ const prevProperties = innerProps.reduce((acc, item) => {
acc[item.key] = item.value
return acc
}, {})
+ const {
+ 'catalog-backend': catalogBackend,
+ 'jdbc-driver': jdbcDriver,
+ 'jdbc-user': jdbcUser,
+ 'jdbc-password': jdbcPwd,
+ ...others
+ } = prevProperties
+
+ if (catalogBackend && catalogBackend === 'hive') {
+ properties = {
+ 'catalog-backend': catalogBackend,
+ ...others
+ }
+ } else {
+ properties = prevProperties
+ }
+
const catalogData = {
...mainData,
properties
diff --git a/web/lib/provider/session.js b/web/lib/provider/session.js
index d60fdf0ee0..6c88623e3e 100644
--- a/web/lib/provider/session.js
+++ b/web/lib/provider/session.js
@@ -58,7 +58,6 @@ const AuthProvider = ({ children }) => {
if (authType === 'simple') {
dispatch(initialVersion())
- router.replace('/')
} else {
if (token) {
dispatch(setIntervalId())
diff --git a/web/lib/utils/axios/index.ts b/web/lib/utils/axios/index.ts
index 4c27ce6365..a9d91abb59 100644
--- a/web/lib/utils/axios/index.ts
+++ b/web/lib/utils/axios/index.ts
@@ -240,7 +240,10 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
// ** authentication schemes, e.g: Bearer
authenticationScheme: 'Bearer',
timeout: 0,
- headers: { 'Content-Type': ContentTypeEnum.JSON },
+ headers: {
+ 'Content-Type': ContentTypeEnum.JSON,
+ Accept: 'application/vnd.gravitino.v1+json'
+ },
transform: clone(transform),
// ** request configuration settings