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 { Row, Col, Skeleton, Tooltip, Typography, Popover } from 'antd';
|
||||
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 classnames from 'classnames';
|
||||
import { renderFilterMap } from 'utils/index';
|
||||
@ -39,8 +39,11 @@ const getContentValue = (value, dataIndex, data, copyable) => {
|
||||
(/_?id/g.test(dataIndex.toLowerCase()) && copyable !== false) ||
|
||||
copyable
|
||||
) {
|
||||
if (isBoolean(copyable)) {
|
||||
return <Paragraph copyable>{value}</Paragraph>;
|
||||
}
|
||||
return <Paragraph copyable={copyable}>{value}</Paragraph>;
|
||||
}
|
||||
}
|
||||
return value || '-';
|
||||
};
|
||||
|
@ -258,12 +258,13 @@ export default class BaseForm extends React.Component {
|
||||
callback(true, false);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
(err = {}) => {
|
||||
this.updateSumbitting(false);
|
||||
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
|
||||
console.log('err', err);
|
||||
console.log('err', err, data);
|
||||
if (callback && isFunction(callback)) {
|
||||
callback(false, true);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ class ActionButton extends Component {
|
||||
return;
|
||||
}
|
||||
const { submitErrorMsg } = this.props.action;
|
||||
const { data: responseData } = error.response || error || {};
|
||||
const { data: responseData } = (error || {}).response || error || {};
|
||||
const realError = responseData || error;
|
||||
const message = submitErrorMsg
|
||||
? submitErrorMsg(data, realError)
|
||||
|
@ -32,6 +32,9 @@ export default class BaseDetail extends Base {
|
||||
{
|
||||
label: t('Volume ID'),
|
||||
dataIndex: 'volume_id',
|
||||
copyable: {
|
||||
text: this.detailData.volume_id,
|
||||
},
|
||||
render: (value) => (
|
||||
<Link to={`${this.getUrl('/storage/volume')}/detail/${value}`}>
|
||||
{value}
|
||||
|
Loading…
Reference in New Issue
Block a user