From 5f40eaaf85fc33f74c82f9aecee29b649dd90345 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 7 Apr 2020 15:29:39 +0300 Subject: [PATCH 1/2] Updated changelog --- CHANGELOG.md | 1 + .../create-task-page/create-task-page.tsx | 49 ++++++++++++++++--- .../create-task-page/create-task-page.tsx | 1 + cvat-ui/src/reducers/interfaces.ts | 1 + cvat-ui/src/reducers/tasks-reducer.ts | 3 ++ 5 files changed, 48 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8a3778c9f99..4538e9367274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Increase preview size of a task till 256, 256 on the server +- Public ssh-keys are displayed in a dedicated window instead of console when create a task with a repository ### Deprecated - diff --git a/cvat-ui/src/components/create-task-page/create-task-page.tsx b/cvat-ui/src/components/create-task-page/create-task-page.tsx index 7961841016de..acbb4203dc0c 100644 --- a/cvat-ui/src/components/create-task-page/create-task-page.tsx +++ b/cvat-ui/src/components/create-task-page/create-task-page.tsx @@ -3,30 +3,65 @@ // SPDX-License-Identifier: MIT import './styles.scss'; -import React from 'react'; - -import { - Row, - Col, -} from 'antd'; - +import React, { useEffect } from 'react'; +import { Row, Col } from 'antd/lib/grid'; +import Modal from 'antd/lib/modal'; import Text from 'antd/lib/typography/Text'; +import Paragraph from 'antd/lib/typography/Paragraph'; +import TextArea from 'antd/lib/input/TextArea'; import CreateTaskContent, { CreateTaskData } from './create-task-content'; + interface Props { onCreate: (data: CreateTaskData) => void; status: string; + error: string; installedGit: boolean; } export default function CreateTaskPage(props: Props): JSX.Element { const { + error, status, onCreate, installedGit, } = props; + useEffect(() => { + if (error) { + let errorCopy = error; + const sshKeys: string[] = []; + while (errorCopy.length) { + const startIndex = errorCopy.search(/'ssh/); + if (startIndex === -1) break; + let sshKey = errorCopy.slice(startIndex + 1); + const stopIndex = sshKey.search(/'/); + sshKey = sshKey.slice(0, stopIndex); + sshKeys.push(sshKey); + errorCopy = errorCopy.slice(stopIndex + 1); + } + + if (sshKeys.length) { + Modal.error({ + width: 800, + title: 'Could not clone the repository', + content: ( + <> + + Please make sure it exists and you have access + + + Consider adding following public ssh keys to Git: + +