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