Skip to content

Commit

Permalink
[Bug] Fix fonted NPE on Upgrade (DataLinkDC#3661)
Browse files Browse the repository at this point in the history
Co-authored-by: gaoyan1998 <[email protected]>
  • Loading branch information
gaoyan1998 and gaoyan1998 authored Jul 21, 2024
1 parent b833ef0 commit 2264db1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 19 deletions.
7 changes: 0 additions & 7 deletions dinky-web/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,6 @@ export default [
}
]
},
{
path: '/metrics',
name: 'metrics',
icon: 'DashboardOutlined',
footerRender: false,
component: './Metrics'
},

{
path: '/dashboard',
Expand Down
6 changes: 3 additions & 3 deletions dinky-web/src/pages/Dashboard/DashboardLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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}
/>
Expand All @@ -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}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')}>
Expand Down
2 changes: 1 addition & 1 deletion dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const HeaderContainer = (props: connect) => {
queryDsConfig,
queryTaskData,
enabledDs,
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData },
selectCatalogueSortTypeData,
taskOwnerLockingStrategy
} = props;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Project: React.FC = (props: connect) => {
dispatch,
project: { expandKeys, selectKey },
tabs: { panes, activeKey },
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData },
selectCatalogueSortTypeData,
tabs,
users
} = props;
Expand Down
2 changes: 1 addition & 1 deletion dinky-web/src/pages/DataStudio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const DataStudio: React.FC<connect> = (props: any) => {
activeBreadcrumbTitle,
updateSelectBottomSubKey,
tabs: { panes, activeKey },
selectCatalogueSortTypeData: { data: selectCatalogueSortTypeData },
selectCatalogueSortTypeData,
queryUserData,
queryTaskOwnerLockingStrategy
} = props;
Expand Down
10 changes: 8 additions & 2 deletions dinky-web/src/pages/DevOps/JobList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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'),
Expand Down

0 comments on commit 2264db1

Please sign in to comment.