Added 3rdparty library to clipboard

main
Boris Sekachev 6 years ago
parent 4bac697cb1
commit 8f77b6b185

@ -41,6 +41,7 @@
"@types/react-router-dom": "^5.1.0",
"@types/react-share": "^3.0.1",
"antd": "^3.25.2",
"copy-to-clipboard": "^3.2.0",
"dotenv-webpack": "^1.7.0",
"moment": "^2.24.0",
"prop-types": "^15.7.2",

@ -139,7 +139,7 @@ export default class CVATApplication extends React.PureComponent<CVATAppProps> {
/>
),
duration: null,
description: error.length > 200 ? 'Open browser console to get details' : error,
description: error.length > 200 ? 'Open the Browser Console to get details' : error,
});
console.error(error);

@ -12,10 +12,11 @@ import {
import Text from 'antd/lib/typography/Text';
import moment from 'moment';
import copy from 'copy-to-clipboard';
import UserSelector from './user-selector';
import getCore from '../../core';
import copyToClipboard from '../../utils/copy-to-clipboard';
const core = getCore();
@ -145,7 +146,7 @@ export default function JobListComponent(props: Props): JSX.Element {
}
serialized += '\n';
}
copyToClipboard(serialized);
copy(serialized);
}}
>
<Icon type='copy' theme='twoTone' />

@ -1,8 +0,0 @@
export default function copyToClipboard(str: string): void {
const el = document.createElement('textarea');
el.value = str;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
}
Loading…
Cancel
Save