Unverified Commit 346d051e authored by gaoyan's avatar gaoyan Committed by GitHub

[Fix-2793] Fix Catalog NPE (#3004)

parent cf37b0bf
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package org.dinky.data.dto; package org.dinky.data.dto;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -41,12 +42,12 @@ public class AbstractStatementDTO { ...@@ -41,12 +42,12 @@ public class AbstractStatementDTO {
private Integer envId; private Integer envId;
@ApiModelProperty(value = "Fragment Flag", dataType = "boolean", example = "false", notes = "是否为片段") @ApiModelProperty(value = "Fragment Flag", dataType = "boolean", example = "false", notes = "是否为片段")
private Boolean fragment; private Boolean fragment = false;
@ApiModelProperty( @ApiModelProperty(
value = "Variables", value = "Variables",
dataType = "Map<String, String>", dataType = "Map<String, String>",
example = "{\"key\": \"value\"}", example = "{\"key\": \"value\"}",
notes = "变量集合") notes = "变量集合")
private Map<String, String> variables; private Map<String, String> variables = new HashMap<>();
} }
...@@ -366,8 +366,7 @@ const HeaderContainer = (props: connect) => { ...@@ -366,8 +366,7 @@ const HeaderContainer = (props: connect) => {
// 发布按钮 // 发布按钮
icon: isOnline(currentData) ? <MergeCellsOutlined /> : <FundOutlined />, icon: isOnline(currentData) ? <MergeCellsOutlined /> : <FundOutlined />,
title: isOnline(currentData) ? l('button.offline') : l('button.publish'), title: isOnline(currentData) ? l('button.offline') : l('button.publish'),
isShow: isShow: currentTab?.type == TabsPageType.project,
(currentTab?.type == TabsPageType.project),
click: () => handleChangeJobLife() click: () => handleChangeJobLife()
}, },
{ {
......
...@@ -29,7 +29,7 @@ import { Key, ProForm, ProFormSelect } from '@ant-design/pro-components'; ...@@ -29,7 +29,7 @@ import { Key, ProForm, ProFormSelect } from '@ant-design/pro-components';
import { connect } from '@umijs/max'; import { connect } from '@umijs/max';
import { Spin, Tag } from 'antd'; import { Spin, Tag } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { StateType, STUDIO_MODEL } from '../../model'; import { StateType, STUDIO_MODEL, TabsPageType } from '../../model';
import { clearDataSourceTable, getDataSourceList, showDataSourceTable } from './service'; import { clearDataSourceTable, getDataSourceList, showDataSourceTable } from './service';
const DataSource = (props: any) => { const DataSource = (props: any) => {
...@@ -161,7 +161,7 @@ const DataSource = (props: any) => { ...@@ -161,7 +161,7 @@ const DataSource = (props: any) => {
breadcrumbLabel: [selectDb.type, selectDb.name].join('/'), breadcrumbLabel: [selectDb.type, selectDb.name].join('/'),
label: schemaName + '.' + tableName, label: schemaName + '.' + tableName,
params: { queryParams: queryParams, tableInfo: fullInfo }, params: { queryParams: queryParams, tableInfo: fullInfo },
type: 'metadata' type: TabsPageType.metadata
} }
}); });
}; };
......
...@@ -84,7 +84,7 @@ const ColumnInfo: React.FC<ColumnInfoProps> = (props) => { ...@@ -84,7 +84,7 @@ const ColumnInfo: React.FC<ColumnInfoProps> = (props) => {
{ {
title: l('rc.ds.length'), title: l('rc.ds.length'),
dataIndex: 'length', dataIndex: 'length',
width: '4%' width: '6%'
}, },
{ {
title: l('rc.ds.precision'), title: l('rc.ds.precision'),
......
...@@ -25,8 +25,8 @@ import { Empty } from 'antd'; ...@@ -25,8 +25,8 @@ import { Empty } from 'antd';
import React from 'react'; import React from 'react';
type SchemaDescProps = { type SchemaDescProps = {
tableInfo: Partial<DataSources.Table>; tableInfo?: Partial<DataSources.Table>;
tableColumns: Partial<DataSources.Column[]>; tableColumns?: Partial<DataSources.Column[]>;
}; };
const SchemaDesc: React.FC<SchemaDescProps> = (props) => { const SchemaDesc: React.FC<SchemaDescProps> = (props) => {
...@@ -34,12 +34,9 @@ const SchemaDesc: React.FC<SchemaDescProps> = (props) => { ...@@ -34,12 +34,9 @@ const SchemaDesc: React.FC<SchemaDescProps> = (props) => {
return ( return (
<> <>
{!(Object.keys(tableInfo).length === 0 && tableColumns.length === 0) ? ( {tableInfo && <TableInfo tableInfo={tableInfo} />}
<> {tableColumns && <ColumnInfo columnInfo={tableColumns} />}
<TableInfo tableInfo={tableInfo} /> {!tableInfo && !tableColumns && (
<ColumnInfo columnInfo={tableColumns} />
</>
) : (
<Empty className={'code-content-empty'} description={l('rc.ds.detail.tips')} /> <Empty className={'code-content-empty'} description={l('rc.ds.detail.tips')} />
)} )}
</> </>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment