fix: Fix copy volume id in backup detail page && error hint
1. Fix copy volume id in backup detail page 2. Fix error hint display Change-Id: I6e6f482f13c891313a9ef853fb76699efffa1fea
This commit is contained in:
parent
608d9ef5f4
commit
9d438cdb77
@ -15,7 +15,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Row, Col, Skeleton, Tooltip, Typography, Popover } from 'antd';
|
import { Row, Col, Skeleton, Tooltip, Typography, Popover } from 'antd';
|
||||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
import { InfoCircleOutlined } from '@ant-design/icons';
|
||||||
import { has, get, isNumber } from 'lodash';
|
import { has, get, isNumber, isBoolean } from 'lodash';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { renderFilterMap } from 'utils/index';
|
import { renderFilterMap } from 'utils/index';
|
||||||
@ -39,7 +39,10 @@ const getContentValue = (value, dataIndex, data, copyable) => {
|
|||||||
(/_?id/g.test(dataIndex.toLowerCase()) && copyable !== false) ||
|
(/_?id/g.test(dataIndex.toLowerCase()) && copyable !== false) ||
|
||||||
copyable
|
copyable
|
||||||
) {
|
) {
|
||||||
return <Paragraph copyable>{value}</Paragraph>;
|
if (isBoolean(copyable)) {
|
||||||
|
return <Paragraph copyable>{value}</Paragraph>;
|
||||||
|
}
|
||||||
|
return <Paragraph copyable={copyable}>{value}</Paragraph>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return value || '-';
|
return value || '-';
|
||||||
|
@ -258,12 +258,13 @@ export default class BaseForm extends React.Component {
|
|||||||
callback(true, false);
|
callback(true, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(err) => {
|
(err = {}) => {
|
||||||
this.updateSumbitting(false);
|
this.updateSumbitting(false);
|
||||||
this.responseError = err;
|
this.responseError = err;
|
||||||
this.showNotice && Notify.errorWithDetail(err, this.errorText);
|
const { response: { data } = {} } = err;
|
||||||
|
this.showNotice && Notify.errorWithDetail(data, this.errorText);
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('err', err);
|
console.log('err', err, data);
|
||||||
if (callback && isFunction(callback)) {
|
if (callback && isFunction(callback)) {
|
||||||
callback(false, true);
|
callback(false, true);
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ class ActionButton extends Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { submitErrorMsg } = this.props.action;
|
const { submitErrorMsg } = this.props.action;
|
||||||
const { data: responseData } = error.response || error || {};
|
const { data: responseData } = (error || {}).response || error || {};
|
||||||
const realError = responseData || error;
|
const realError = responseData || error;
|
||||||
const message = submitErrorMsg
|
const message = submitErrorMsg
|
||||||
? submitErrorMsg(data, realError)
|
? submitErrorMsg(data, realError)
|
||||||
|
@ -32,6 +32,9 @@ export default class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Volume ID'),
|
label: t('Volume ID'),
|
||||||
dataIndex: 'volume_id',
|
dataIndex: 'volume_id',
|
||||||
|
copyable: {
|
||||||
|
text: this.detailData.volume_id,
|
||||||
|
},
|
||||||
render: (value) => (
|
render: (value) => (
|
||||||
<Link to={`${this.getUrl('/storage/volume')}/detail/${value}`}>
|
<Link to={`${this.getUrl('/storage/volume')}/detail/${value}`}>
|
||||||
{value}
|
{value}
|
||||||
|
Loading…
Reference in New Issue
Block a user