From 1fc7e45f51f638d3b4497d92dbf00f5b7f237e22 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Mon, 9 Dec 2019 10:10:40 +0300 Subject: [PATCH 1/4] Copy JOB info to clibpard --- cvat-ui/src/components/task-page/job-list.tsx | 32 +++++++++++++++++-- cvat-ui/src/stylesheet.css | 8 +++++ cvat-ui/src/utils/copy-to-clipboard.ts | 8 +++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 cvat-ui/src/utils/copy-to-clipboard.ts diff --git a/cvat-ui/src/components/task-page/job-list.tsx b/cvat-ui/src/components/task-page/job-list.tsx index ad13707d..ab738b38 100644 --- a/cvat-ui/src/components/task-page/job-list.tsx +++ b/cvat-ui/src/components/task-page/job-list.tsx @@ -3,16 +3,19 @@ import React from 'react'; import { Row, Col, + Icon, Table, + Button, + Tooltip, } from 'antd'; import Text from 'antd/lib/typography/Text'; -import Title from 'antd/lib/typography/Title'; import moment from 'moment'; import UserSelector from './user-selector'; import getCore from '../../core'; +import copyToClipboard from '../../utils/copy-to-clipboard'; const core = getCore(); @@ -123,7 +126,32 @@ export default function JobListComponent(props: Props): JSX.Element {
- Jobs + Jobs + + + diff --git a/cvat-ui/src/stylesheet.css b/cvat-ui/src/stylesheet.css index 4c3c2b34..e8772391 100644 --- a/cvat-ui/src/stylesheet.css +++ b/cvat-ui/src/stylesheet.css @@ -435,6 +435,12 @@ background: white; } +.cvat-task-job-list > div:nth-child(1) > div:nth-child(1) { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + .cvat-task-top-bar { margin-top: 20px; margin-bottom: 10px; @@ -590,6 +596,8 @@ textarea.ant-input.cvat-raw-labels-viewer { .ant-typography.cvat-jobs-header { margin-bottom: 0px; + font-size: 20px; + font-weight: bold; } /* Pagination in center */ diff --git a/cvat-ui/src/utils/copy-to-clipboard.ts b/cvat-ui/src/utils/copy-to-clipboard.ts new file mode 100644 index 00000000..561b25d1 --- /dev/null +++ b/cvat-ui/src/utils/copy-to-clipboard.ts @@ -0,0 +1,8 @@ +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); +} From 83215b34cfee0d2d6ef818bd26b1ec5f2f76fb5b Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 10 Dec 2019 11:39:35 +0300 Subject: [PATCH 2/4] Added padding --- cvat-ui/src/components/cvat-app.tsx | 2 +- cvat-ui/src/components/task-page/job-list.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cvat-ui/src/components/cvat-app.tsx b/cvat-ui/src/components/cvat-app.tsx index d9dcc8a3..15190f34 100644 --- a/cvat-ui/src/components/cvat-app.tsx +++ b/cvat-ui/src/components/cvat-app.tsx @@ -139,7 +139,7 @@ export default class CVATApplication extends React.PureComponent { /> ), duration: null, - description: error.length > 200 ? '' : error, + description: error.length > 200 ? 'Open console to details (F12, Console tab)' : error, }); console.error(error); diff --git a/cvat-ui/src/components/task-page/job-list.tsx b/cvat-ui/src/components/task-page/job-list.tsx index ab738b38..77f75b4a 100644 --- a/cvat-ui/src/components/task-page/job-list.tsx +++ b/cvat-ui/src/components/task-page/job-list.tsx @@ -136,7 +136,7 @@ export default function JobListComponent(props: Props): JSX.Element { for (const job of taskInstance.jobs) { serialized += `Job #${job.id}`.padEnd(`${latestJob.id}`.length + 6, ' '); serialized += `: ${baseURL}/?id=${job.id}` - .padEnd(`${latestJob.id}`.length + baseURL.length + 7, ' '); + .padEnd(`${latestJob.id}`.length + baseURL.length + 8, ' '); serialized += `: [${job.startFrame}-${job.stopFrame}]` .padEnd(`${latestJob.startFrame}${latestJob.stopFrame}`.length + 5, ' '); From 4bac697cb168f14cca8e25fb617f7455dd916856 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 10 Dec 2019 12:24:52 +0300 Subject: [PATCH 3/4] Updated message --- cvat-ui/src/components/cvat-app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat-ui/src/components/cvat-app.tsx b/cvat-ui/src/components/cvat-app.tsx index 15190f34..2c642fee 100644 --- a/cvat-ui/src/components/cvat-app.tsx +++ b/cvat-ui/src/components/cvat-app.tsx @@ -139,7 +139,7 @@ export default class CVATApplication extends React.PureComponent { /> ), duration: null, - description: error.length > 200 ? 'Open console to details (F12, Console tab)' : error, + description: error.length > 200 ? 'Open browser console to get details' : error, }); console.error(error); From 8f77b6b1852b45723fa31d9c594ac1f96b54bb84 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 10 Dec 2019 13:43:23 +0300 Subject: [PATCH 4/4] Added 3rdparty library to clipboard --- cvat-ui/package.json | 1 + cvat-ui/src/components/cvat-app.tsx | 2 +- cvat-ui/src/components/task-page/job-list.tsx | 5 +++-- cvat-ui/src/utils/copy-to-clipboard.ts | 8 -------- 4 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 cvat-ui/src/utils/copy-to-clipboard.ts diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 59b3196f..84c8c2da 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -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", diff --git a/cvat-ui/src/components/cvat-app.tsx b/cvat-ui/src/components/cvat-app.tsx index 2c642fee..4da7a460 100644 --- a/cvat-ui/src/components/cvat-app.tsx +++ b/cvat-ui/src/components/cvat-app.tsx @@ -139,7 +139,7 @@ export default class CVATApplication extends React.PureComponent { /> ), 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); diff --git a/cvat-ui/src/components/task-page/job-list.tsx b/cvat-ui/src/components/task-page/job-list.tsx index 77f75b4a..bf2d1a88 100644 --- a/cvat-ui/src/components/task-page/job-list.tsx +++ b/cvat-ui/src/components/task-page/job-list.tsx @@ -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); }} > diff --git a/cvat-ui/src/utils/copy-to-clipboard.ts b/cvat-ui/src/utils/copy-to-clipboard.ts deleted file mode 100644 index 561b25d1..00000000 --- a/cvat-ui/src/utils/copy-to-clipboard.ts +++ /dev/null @@ -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); -}