From 4767477cd67ea1e6eb7218c880afb9401ff60f34 Mon Sep 17 00:00:00 2001 From: zhangjingwei Date: Tue, 10 Aug 2021 14:21:55 +0800 Subject: [PATCH] fix: Fix download csv 1. Fix download security goup rule 2. Fix export for SetGateway && RouterPortDetail Change-Id: I07ea1f8aa683c64116fbb6da373b1d52a25bff60 --- src/components/Tables/Base/index.jsx | 3 ++- src/pages/network/containers/Router/Port/Detail/index.jsx | 6 +++--- src/pages/network/containers/Router/actions/SetGateway.jsx | 6 +++--- src/resources/security-group-rule.jsx | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/Tables/Base/index.jsx b/src/components/Tables/Base/index.jsx index 571b715e..78cd3957 100644 --- a/src/components/Tables/Base/index.jsx +++ b/src/components/Tables/Base/index.jsx @@ -553,7 +553,8 @@ export default class BaseTable extends React.Component { const downloadColumns = columns .filter((it) => !it.hidden) .map((it) => { - if (it.title.includes('/')) { + const { title, splitColumnForDownload = true } = it; + if (title.includes('/') && splitColumnForDownload) { const [fTitle, sTitle] = it.title.split('/'); let sName = sTitle; if (fTitle.length > 2) { diff --git a/src/pages/network/containers/Router/Port/Detail/index.jsx b/src/pages/network/containers/Router/Port/Detail/index.jsx index dff267af..821e78fc 100644 --- a/src/pages/network/containers/Router/Port/Detail/index.jsx +++ b/src/pages/network/containers/Router/Port/Detail/index.jsx @@ -18,9 +18,7 @@ import Base from 'containers/TabDetail'; import { portStatus } from 'resources/port'; import BaseDetail from './BaseDetail'; -@inject('rootStore') -@observer -export default class PortDetail extends Base { +export class PortDetail extends Base { get name() { return t('port'); } @@ -80,3 +78,5 @@ export default class PortDetail extends Base { this.store = new PortStore(); } } + +export default inject('rootStore')(observer(PortDetail)); diff --git a/src/pages/network/containers/Router/actions/SetGateway.jsx b/src/pages/network/containers/Router/actions/SetGateway.jsx index 6b85ebab..beded33c 100644 --- a/src/pages/network/containers/Router/actions/SetGateway.jsx +++ b/src/pages/network/containers/Router/actions/SetGateway.jsx @@ -18,9 +18,7 @@ import { NetworkStore } from 'stores/neutron/network'; import { ModalAction } from 'containers/Action'; import { networkStatus, networkSortProps } from 'resources/network'; -@inject('rootStore') -@observer -export default class SetGateway extends ModalAction { +export class SetGateway extends ModalAction { static id = 'set-gateway'; static title = t('Open External Gateway'); @@ -100,3 +98,5 @@ export default class SetGateway extends ModalAction { return this.store.edit({ id }, body); }; } + +export default inject('rootStore')(observer(SetGateway)); diff --git a/src/resources/security-group-rule.jsx b/src/resources/security-group-rule.jsx index 526f9f57..f720ca1d 100644 --- a/src/resources/security-group-rule.jsx +++ b/src/resources/security-group-rule.jsx @@ -108,6 +108,7 @@ export const getSelfColumns = (self) => [ dataIndex: 'icmpTypeCode', valueRender: 'noValue', isHideable: true, + splitColumnForDownload: false, }, ];