mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-24 17:08:28 +00:00
GEN-2073: Not able to copy full logs from log viewer (#18771)
This commit is contained in:
parent
151c1bbdb3
commit
e6cc1ac48c
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
import { InfoCircleOutlined } from '@ant-design/icons';
|
||||||
import Icon from '@ant-design/icons/lib/components/Icon';
|
import Icon from '@ant-design/icons/lib/components/Icon';
|
||||||
import { Collapse, Divider, Space, Tooltip, Typography } from 'antd';
|
import { Button, Collapse, Divider, Space, Tooltip, Typography } from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isUndefined } from 'lodash';
|
import { isUndefined } from 'lodash';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@ -20,9 +20,11 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { LazyLog } from 'react-lazylog';
|
import { LazyLog } from 'react-lazylog';
|
||||||
import { ReactComponent as AttentionIcon } from '../../../../assets/svg/attention.svg';
|
import { ReactComponent as AttentionIcon } from '../../../../assets/svg/attention.svg';
|
||||||
import { ReactComponent as FailIcon } from '../../../../assets/svg/fail-badge.svg';
|
import { ReactComponent as FailIcon } from '../../../../assets/svg/fail-badge.svg';
|
||||||
|
import { ReactComponent as CopyIcon } from '../../../../assets/svg/icon-copy.svg';
|
||||||
import { ReactComponent as SuccessIcon } from '../../../../assets/svg/success-badge.svg';
|
import { ReactComponent as SuccessIcon } from '../../../../assets/svg/success-badge.svg';
|
||||||
import { TestConnectionStepResult } from '../../../../generated/entity/automations/workflow';
|
import { TestConnectionStepResult } from '../../../../generated/entity/automations/workflow';
|
||||||
import { TestConnectionStep } from '../../../../generated/entity/services/connections/testConnectionDefinition';
|
import { TestConnectionStep } from '../../../../generated/entity/services/connections/testConnectionDefinition';
|
||||||
|
import { useClipboard } from '../../../../hooks/useClipBoard';
|
||||||
import { requiredField } from '../../../../utils/CommonUtils';
|
import { requiredField } from '../../../../utils/CommonUtils';
|
||||||
import './connection-step-card.less';
|
import './connection-step-card.less';
|
||||||
|
|
||||||
@ -53,6 +55,16 @@ const ConnectionStepCard = ({
|
|||||||
testConnectionStepResult?.errorLog ??
|
testConnectionStepResult?.errorLog ??
|
||||||
t('label.no-entity', { entity: t('label.log-plural') });
|
t('label.no-entity', { entity: t('label.log-plural') });
|
||||||
|
|
||||||
|
const { onCopyToClipBoard } = useClipboard(logs ?? '');
|
||||||
|
|
||||||
|
const handleCopyToClipBoard = (
|
||||||
|
event: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
||||||
|
) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
onCopyToClipBoard();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames('connection-step-card', {
|
className={classNames('connection-step-card', {
|
||||||
@ -142,6 +154,16 @@ const ConnectionStepCard = ({
|
|||||||
<Panel
|
<Panel
|
||||||
className="connection-step-card-content-logs"
|
className="connection-step-card-content-logs"
|
||||||
data-testid="lazy-log"
|
data-testid="lazy-log"
|
||||||
|
extra={
|
||||||
|
<Tooltip title={t('message.copy-to-clipboard')}>
|
||||||
|
<Button
|
||||||
|
className="flex-center bg-white"
|
||||||
|
data-testid="query-entity-copy-button"
|
||||||
|
icon={<CopyIcon height={16} width={16} />}
|
||||||
|
onClick={handleCopyToClipBoard}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
}
|
||||||
header={t('label.show-log-plural')}
|
header={t('label.show-log-plural')}
|
||||||
key="show-log">
|
key="show-log">
|
||||||
<LazyLog
|
<LazyLog
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid @border-color;
|
border: 1px solid @border-color;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
margin-top: 16px;
|
||||||
&.success {
|
&.success {
|
||||||
border-color: #28a7454d;
|
border-color: #28a7454d;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user