Skip to content

Commit

Permalink
Fix: application table view crash when app have no labels (#842)
Browse files Browse the repository at this point in the history
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
  • Loading branch information
chivalryq committed Jun 13, 2023
1 parent 2931e13 commit 04aa7e9
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { connect } from 'dva';
import type { MouseEvent } from 'react';
import React from 'react';
import './index.less';
import { Link } from 'dva/router';
Expand Down Expand Up @@ -57,15 +56,6 @@ class CardContent extends React.Component<Props, State> {
};
}

handleClick = (index: number, e: MouseEvent) => {
e.preventDefault();
const { extendDotVisible } = this.state;
this.setState({
extendDotVisible: !extendDotVisible,
choseIndex: index,
});
};

onDeleteAppPlan = (name: string) => {
this.props.deleteAppPlan(name);
};
Expand Down Expand Up @@ -191,6 +181,7 @@ class CardContent extends React.Component<Props, State> {
return <span>{v}</span>;
},
},

{
key: 'labels',
title: <Translation>Labels</Translation>,
Expand All @@ -202,8 +193,8 @@ class CardContent extends React.Component<Props, State> {
return (
<div>
<div className={more ? '' : 'table-content-label'}>
{Object.keys(label)?.map((key) => {
if (label && key.indexOf('ux.oam.dev') < 0 && key.indexOf('app.oam.dev')) {
{label && Object.keys(label)?.map((key) => {
if (label && key.indexOf('ux.oam.dev') < 0 && key.indexOf('app.oam.dev') < 0) {
displayLabels++;
return (
<div>
Expand Down

0 comments on commit 04aa7e9

Please sign in to comment.