From 56f509ac45b1a390fdbc5acd97a576135d3c1ab4 Mon Sep 17 00:00:00 2001 From: Evgeny Alaev Date: Thu, 25 Jan 2024 21:02:30 +0300 Subject: [PATCH 1/3] Add link to Yandex Documents in DialogAddDocument --- .../connections.yadocs.view/en.json | 3 +- .../connections.yadocs.view/ru.json | 3 +- .../DialogAddDocument/DialogAddDocument.scss | 6 +-- .../DialogAddDocument/DialogAddDocument.tsx | 37 +++++++++++++++---- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/i18n-keysets/connections.yadocs.view/en.json b/src/i18n-keysets/connections.yadocs.view/en.json index 4345fe9789..a711391856 100644 --- a/src/i18n-keysets/connections.yadocs.view/en.json +++ b/src/i18n-keysets/connections.yadocs.view/en.json @@ -8,6 +8,7 @@ "label_access-type": "Access type", "label_add-document": "Add document", "label_add-input-help": "It is forbidden to add links to or download files restricted by password. Use private files that are available after authentication.", + "label_add-input-link": "

Go to Yandex Documents", "label_add-input-private": "Path to file", "label_add-input-private-note": "Example: /path/to/document", "label_add-input-public": "Link to file", @@ -20,4 +21,4 @@ "label_radio-value-private": "Private", "label_radio-value-public": "Public", "label_workspace-placeholder": "To create a connection, add links to files in Yandex Documents. Supported formats: {{formats}}." -} +} \ No newline at end of file diff --git a/src/i18n-keysets/connections.yadocs.view/ru.json b/src/i18n-keysets/connections.yadocs.view/ru.json index b79e83f1e8..ea5f248be0 100644 --- a/src/i18n-keysets/connections.yadocs.view/ru.json +++ b/src/i18n-keysets/connections.yadocs.view/ru.json @@ -8,6 +8,7 @@ "label_access-type": "Доступ к файлу", "label_add-document": "Добавить документ", "label_add-input-help": "Добавлять ссылки на файлы, доступ к которым ограничен с помощью пароля, а также скачивать такие файлы запрещено. Используйте приватные файлы, доступные после аутентификации.", + "label_add-input-link": "

Перейти в Яндекс Документы", "label_add-input-private": "Путь до файла", "label_add-input-private-note": "Пример: /path/to/document", "label_add-input-public": "Ссылка на файл", @@ -20,4 +21,4 @@ "label_radio-value-private": "Приватный", "label_radio-value-public": "Публичный", "label_workspace-placeholder": "Чтобы создать подключение, добавьте ссылки на файлы в Яндекс Документах. Поддерживаемые форматы: {{formats}}." -} +} \ No newline at end of file diff --git a/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.scss b/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.scss index daa446876f..e9e834549b 100644 --- a/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.scss +++ b/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.scss @@ -9,11 +9,6 @@ display: grid; grid-template-columns: 152px auto; column-gap: 10px; - - // https://github.com/gravity-ui/uikit/issues/1223 - & .yc-outer-additional-content__note { - margin-left: 0; - } } &__add-dialog-row-label { @@ -21,6 +16,7 @@ } &__add-dialog-row-input-note { + margin-top: 5px; color: var(--g-color-text-hint); } } diff --git a/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx b/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx index 133ed2a75b..4aa3fac5c6 100644 --- a/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx +++ b/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx @@ -1,10 +1,12 @@ import React from 'react'; import {HelpPopover} from '@gravity-ui/components'; -import {Dialog, RadioButton, TextInput} from '@gravity-ui/uikit'; +import {ArrowUpRightFromSquare} from '@gravity-ui/icons'; +import {Dialog, Icon, Link, RadioButton, TextInput} from '@gravity-ui/uikit'; import type {ButtonProps} from '@gravity-ui/uikit'; import block from 'bem-cn-lite'; import {I18n} from 'i18n'; +import {Interpolate} from 'ui/components/Interpolate'; import DialogManager from '../../../../../../../components/DialogManager/DialogManager'; import {DataLensApiError} from '../../../../../../../typings'; @@ -116,13 +118,32 @@ const DialogAddYadoc = (props: DialogAddYadocProps) => { content={i18n('label_add-input-help')} /> - {inputNote}} - autoFocus={true} - disabled={loading} - onUpdate={handleInputUpdate} - /> +
+ +
+ {inputNote} +
, + link: (match) => ( + + + {match} + + + + ), + }} + /> +
+
+
Date: Fri, 26 Jan 2024 13:23:09 +0300 Subject: [PATCH 2/3] Translations update from Weblate Gravity for PR #530 (#533) * Translated using Weblate (Russian) Currently translated at 95.4% (21 of 22 strings) Translation: DataLens/connections.yadocs.view__530 Translate-URL: https://weblate.gravity-ui.com/projects/datalens/add-link-to-yadocs-530/connections-yadocs-view-530/ru/ * Translated using Weblate (English) Currently translated at 100.0% (22 of 22 strings) Translation: DataLens/connections.yadocs.view__530 Translate-URL: https://weblate.gravity-ui.com/projects/datalens/add-link-to-yadocs-530/connections-yadocs-view-530/en/ --------- Co-authored-by: Gravity addon Co-authored-by: Darya Tikhonova --- src/i18n-keysets/connections.yadocs.view/en.json | 2 +- src/i18n-keysets/connections.yadocs.view/ru.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n-keysets/connections.yadocs.view/en.json b/src/i18n-keysets/connections.yadocs.view/en.json index a711391856..bde087bd50 100644 --- a/src/i18n-keysets/connections.yadocs.view/en.json +++ b/src/i18n-keysets/connections.yadocs.view/en.json @@ -21,4 +21,4 @@ "label_radio-value-private": "Private", "label_radio-value-public": "Public", "label_workspace-placeholder": "To create a connection, add links to files in Yandex Documents. Supported formats: {{formats}}." -} \ No newline at end of file +} diff --git a/src/i18n-keysets/connections.yadocs.view/ru.json b/src/i18n-keysets/connections.yadocs.view/ru.json index ea5f248be0..4c41bc9c23 100644 --- a/src/i18n-keysets/connections.yadocs.view/ru.json +++ b/src/i18n-keysets/connections.yadocs.view/ru.json @@ -21,4 +21,4 @@ "label_radio-value-private": "Приватный", "label_radio-value-public": "Публичный", "label_workspace-placeholder": "Чтобы создать подключение, добавьте ссылки на файлы в Яндекс Документах. Поддерживаемые форматы: {{formats}}." -} \ No newline at end of file +} From a6433e9ed6189bea62866653e8c2ff9641d3762a Mon Sep 17 00:00:00 2001 From: Evgeny Alaev Date: Fri, 26 Jan 2024 18:13:16 +0300 Subject: [PATCH 3/3] marginy review fixes --- src/i18n-keysets/connections.yadocs.view/en.json | 2 +- src/i18n-keysets/connections.yadocs.view/ru.json | 2 +- .../Yadocs/components/DialogAddDocument/DialogAddDocument.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/i18n-keysets/connections.yadocs.view/en.json b/src/i18n-keysets/connections.yadocs.view/en.json index bde087bd50..ad432b0b06 100644 --- a/src/i18n-keysets/connections.yadocs.view/en.json +++ b/src/i18n-keysets/connections.yadocs.view/en.json @@ -8,7 +8,7 @@ "label_access-type": "Access type", "label_add-document": "Add document", "label_add-input-help": "It is forbidden to add links to or download files restricted by password. Use private files that are available after authentication.", - "label_add-input-link": "

Go to Yandex Documents", + "label_add-input-link": "Go to Yandex Documents", "label_add-input-private": "Path to file", "label_add-input-private-note": "Example: /path/to/document", "label_add-input-public": "Link to file", diff --git a/src/i18n-keysets/connections.yadocs.view/ru.json b/src/i18n-keysets/connections.yadocs.view/ru.json index 4c41bc9c23..0940d0fc20 100644 --- a/src/i18n-keysets/connections.yadocs.view/ru.json +++ b/src/i18n-keysets/connections.yadocs.view/ru.json @@ -8,7 +8,7 @@ "label_access-type": "Доступ к файлу", "label_add-document": "Добавить документ", "label_add-input-help": "Добавлять ссылки на файлы, доступ к которым ограничен с помощью пароля, а также скачивать такие файлы запрещено. Используйте приватные файлы, доступные после аутентификации.", - "label_add-input-link": "

Перейти в Яндекс Документы", + "label_add-input-link": "Перейти в Яндекс Документы", "label_add-input-private": "Путь до файла", "label_add-input-private-note": "Пример: /path/to/document", "label_add-input-public": "Ссылка на файл", diff --git a/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx b/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx index 4aa3fac5c6..995e900c26 100644 --- a/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx +++ b/src/ui/units/connections/components/custom-forms/Yadocs/components/DialogAddDocument/DialogAddDocument.tsx @@ -127,10 +127,10 @@ const DialogAddYadoc = (props: DialogAddYadocProps) => { />
{inputNote} +

, link: (match) => (