Merge "fix: Fix copyable and delete lb"

This commit is contained in:
Zuul 2022-06-02 10:02:23 +00:00 committed by Gerrit Code Review
commit 66fa2cc51a
5 changed files with 17 additions and 11 deletions

View File

@ -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, isBoolean } from 'lodash';
import { has, get, isNumber } from 'lodash';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { renderFilterMap } from 'utils/index';
@ -39,9 +39,6 @@ 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>;
}
}
@ -51,7 +48,11 @@ const getContentValue = (value, dataIndex, data, copyable) => {
const getContent = (data, option) => {
const { content, dataIndex, render, valueRender, copyable } = option;
if (has(option, 'content')) {
return copyable ? <Paragraph copyable>{content}</Paragraph> : content;
return copyable ? (
<Paragraph copyable={copyable}>{content}</Paragraph>
) : (
content
);
}
let value = get(data, dataIndex);
if (!render) {

View File

@ -356,7 +356,7 @@ export default class DetailBase extends React.Component {
dataIndex.toLowerCase().indexOf('_id') >= 0
) {
desc = (
<Paragraph style={{ margin: 0 }} copyable>
<Paragraph style={{ margin: 0 }} copyable={copyable}>
{desc}
</Paragraph>
);

View File

@ -38,7 +38,9 @@ export class BaseDetail extends Base {
const options = [
{
content: <pre>{secret_info.payload}</pre>,
copyable: true,
copyable: {
text: secret_info.payload,
},
},
];
return {
@ -56,7 +58,9 @@ export class BaseDetail extends Base {
const options = [
{
content: <pre>{secret_info.payload}</pre>,
copyable: true,
copyable: {
text: secret_info.payload,
},
},
];
return {

View File

@ -33,7 +33,9 @@ export class BaseDetail extends Base {
const options = [
{
content: <pre>{payload}</pre>,
copyable: true,
copyable: {
text: payload,
},
},
];
return {

View File

@ -55,8 +55,7 @@ export default class DeleteAction extends ConfirmAction {
return true;
}
return (
(this.isCurrentProject(item) &&
['ACTIVE', 'PENDING_UPDATE'].includes(item.provisioning_status)) ||
(this.isCurrentProject(item) && item.provisioning_status === 'ACTIVE') ||
item.provisioning_status === 'ERROR'
);
};