Unverified Commit 2264db1c authored by gaoyan's avatar gaoyan Committed by GitHub

[Bug] Fix fonted NPE on Upgrade (#3661)

parent b833ef04
...@@ -283,13 +283,6 @@ export default [ ...@@ -283,13 +283,6 @@ export default [
} }
] ]
}, },
{
path: '/metrics',
name: 'metrics',
icon: 'DashboardOutlined',
footerRender: false,
component: './Metrics'
},
{ {
path: '/dashboard', path: '/dashboard',
......
...@@ -257,7 +257,7 @@ export default (props: DashboardProps) => { ...@@ -257,7 +257,7 @@ export default (props: DashboardProps) => {
actions={[ actions={[
<Flex align={'center'} justify={'center'}> <Flex align={'center'} justify={'center'}>
<Segmented <Segmented
defaultValue={chartDatum[0].type} defaultValue={chartDatum[0]?.type}
onChange={(value) => { onChange={(value) => {
setChartData((v) => { setChartData((v) => {
v[l.i].chartData.forEach((x) => { v[l.i].chartData.forEach((x) => {
...@@ -275,7 +275,7 @@ export default (props: DashboardProps) => { ...@@ -275,7 +275,7 @@ export default (props: DashboardProps) => {
<ChartShow <ChartShow
chartTheme={chartTheme} chartTheme={chartTheme}
chartOptions={chartOptions} chartOptions={chartOptions}
value={chartDatum[0].data?.slice(-1)[0]?.value} value={chartDatum[0]?.data?.slice(-1)[0]?.value}
type={chartDatum[0]?.type} type={chartDatum[0]?.type}
fontSize={(l.h * config.rowHeight) / 4} fontSize={(l.h * config.rowHeight) / 4}
/> />
...@@ -288,7 +288,7 @@ export default (props: DashboardProps) => { ...@@ -288,7 +288,7 @@ export default (props: DashboardProps) => {
chartTheme={chartTheme} chartTheme={chartTheme}
chartOptions={chartOptions} chartOptions={chartOptions}
title={title} title={title}
value={chartDatum[0].data?.slice(-1)[0]?.value} value={chartDatum[0]?.data?.slice(-1)[0]?.value}
type={chartDatum[0]?.type} type={chartDatum[0]?.type}
fontSize={(l.h * config.rowHeight) / 4} fontSize={(l.h * config.rowHeight) / 4}
/> />
......
...@@ -72,7 +72,7 @@ export const JobConfigInfo: React.FC<JobDetailInfoModelProps> = (props) => { ...@@ -72,7 +72,7 @@ export const JobConfigInfo: React.FC<JobDetailInfoModelProps> = (props) => {
: l('pages.datastudio.label.history.clusterConfigurationId') : l('pages.datastudio.label.history.clusterConfigurationId')
} }
> >
{row?.clusterId ? row?.clusterId : row?.clusterConfigurationId ?? 'None'} {row?.clusterId ? row?.clusterId : (row?.clusterConfigurationId ?? 'None')}
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label={l('pages.datastudio.label.history.clusterName')}> <ProDescriptions.Item label={l('pages.datastudio.label.history.clusterName')}>
......
...@@ -106,7 +106,7 @@ const HeaderContainer = (props: connect) => { ...@@ -106,7 +106,7 @@ const HeaderContainer = (props: connect) => {
queryDsConfig, queryDsConfig,
queryTaskData, queryTaskData,
enabledDs, enabledDs,
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData }, selectCatalogueSortTypeData,
taskOwnerLockingStrategy taskOwnerLockingStrategy
} = props; } = props;
......
...@@ -66,7 +66,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => { ...@@ -66,7 +66,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
const { const {
project: { data: projectData, expandKeys, selectKey }, project: { data: projectData, expandKeys, selectKey },
catalogueSortType: { data: catalogueSortTypeData }, catalogueSortType: { data: catalogueSortTypeData },
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData }, selectCatalogueSortTypeData,
onNodeClick, onNodeClick,
style, style,
height, height,
...@@ -146,7 +146,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => { ...@@ -146,7 +146,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
// when sorted, change the icon display // when sorted, change the icon display
useEffect(() => { useEffect(() => {
if (selectCatalogueSortTypeData.sortValue && selectCatalogueSortTypeData.sortType) { if (selectCatalogueSortTypeData?.sortValue && selectCatalogueSortTypeData?.sortType) {
setSortState((prevState) => ({ setSortState((prevState) => ({
...prevState, ...prevState,
sortIconType: 'link' sortIconType: 'link'
......
...@@ -33,7 +33,7 @@ import React, { useState } from 'react'; ...@@ -33,7 +33,7 @@ import React, { useState } from 'react';
const ProjectTitle: React.FC<StateType & connect> = (props) => { const ProjectTitle: React.FC<StateType & connect> = (props) => {
const { const {
leftContainer: { selectKey }, leftContainer: { selectKey },
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData }, selectCatalogueSortTypeData,
dispatch dispatch
} = props; } = props;
......
...@@ -62,7 +62,7 @@ const Project: React.FC = (props: connect) => { ...@@ -62,7 +62,7 @@ const Project: React.FC = (props: connect) => {
dispatch, dispatch,
project: { expandKeys, selectKey }, project: { expandKeys, selectKey },
tabs: { panes, activeKey }, tabs: { panes, activeKey },
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData }, selectCatalogueSortTypeData,
tabs, tabs,
users users
} = props; } = props;
......
...@@ -70,7 +70,7 @@ const DataStudio: React.FC<connect> = (props: any) => { ...@@ -70,7 +70,7 @@ const DataStudio: React.FC<connect> = (props: any) => {
activeBreadcrumbTitle, activeBreadcrumbTitle,
updateSelectBottomSubKey, updateSelectBottomSubKey,
tabs: { panes, activeKey }, tabs: { panes, activeKey },
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData }, selectCatalogueSortTypeData,
queryUserData, queryUserData,
queryTaskOwnerLockingStrategy queryTaskOwnerLockingStrategy
} = props; } = props;
......
...@@ -61,6 +61,7 @@ import { Button, Empty, Radio, Table, Tree } from 'antd'; ...@@ -61,6 +61,7 @@ import { Button, Empty, Radio, Table, Tree } from 'antd';
import Search from 'antd/es/input/Search'; import Search from 'antd/es/input/Search';
import { Key, useContext, useEffect, useRef, useState } from 'react'; import { Key, useContext, useEffect, useRef, useState } from 'react';
import { history } from 'umi'; import { history } from 'umi';
import EllipsisMiddle from '@/components/Typography/EllipsisMiddle';
const { DirectoryTree } = Tree; const { DirectoryTree } = Tree;
...@@ -133,14 +134,19 @@ const JobList = (props: connect) => { ...@@ -133,14 +134,19 @@ const JobList = (props: connect) => {
}, },
{ {
title: l('global.table.firstLevelOwner'), title: l('global.table.firstLevelOwner'),
width: '5%',
hideInSearch: true, hideInSearch: true,
render: (_: any, row: Jobs.JobInstance) => showFirstLevelOwner(row?.firstLevelOwner, users) render: (_: any, row: Jobs.JobInstance) => showFirstLevelOwner(row?.firstLevelOwner, users)
}, },
{ {
width: '8%',
title: l('global.table.secondLevelOwners'), title: l('global.table.secondLevelOwners'),
hideInSearch: true, hideInSearch: true,
render: (_: any, row: Jobs.JobInstance) => render: (_: any, row: Jobs.JobInstance) => (
showSecondLevelOwners(row?.secondLevelOwners, users) <EllipsisMiddle maxCount={15} copyable={false}>
{showSecondLevelOwners(row?.secondLevelOwners, users)}
</EllipsisMiddle>
)
}, },
{ {
title: l('global.table.createTime'), title: l('global.table.createTime'),
......
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