From 5a36210801de1565fefbfc540783bd8bb1b86c9a Mon Sep 17 00:00:00 2001 From: Iukou Siarhei <45054016+BlazarQSO@users.noreply.github.com> Date: Thu, 14 Sep 2023 13:42:06 +0300 Subject: [PATCH] EPMRPP-85843 || Add API Key Link to documentation on Profile page (#3587) * EPMRPP-85843 || Add API Key Link to documentation on Profile page * refactor: create a link using createExternalLink --- app/localization/translated/be.json | 3 ++- app/localization/translated/ru.json | 3 ++- app/localization/translated/uk.json | 3 ++- app/localization/translated/zh.json | 3 ++- app/src/common/utils/referenceDictionary.js | 2 ++ .../apiKeys/apiKeysBlock/apiKeysBlock.jsx | 15 ++++++++++++--- .../apiKeys/apiKeysBlock/apiKeysBlock.scss | 11 +++++++++++ .../apiKeys/noApiKeysBlock/noApiKeysBlock.jsx | 14 ++++++++++++++ .../apiKeys/noApiKeysBlock/noApiKeysBlock.scss | 14 ++++++++++++++ 9 files changed, 61 insertions(+), 7 deletions(-) diff --git a/app/localization/translated/be.json b/app/localization/translated/be.json index 6bb118047d..40e427f87a 100644 --- a/app/localization/translated/be.json +++ b/app/localization/translated/be.json @@ -160,12 +160,13 @@ "ApiKeyGeneratedModal.header": "Створаны ключ API", "ApiKeyGeneratedModal.loaderText": "ГЕНЕРЫРУЮЦЬ", "ApiKeyGeneratedModal.successNotification": "Ключ API быў паспяхова скапіраваны", - "ApiKeys.ApiKeysBlock.description": "Каб забяспечыць бяспеку пароля вашага ўласнага дамена, вы можаце выкарыстоўваць ключ карыстальніка — каб пацвердзіць свой уліковы запіс і мець магчымасць адпраўляць вынікі пры дапамозе агента.", + "ApiKeys.ApiKeysBlock.description": "Каб забяспечыць бяспеку пароля вашага ўласнага дамена, вы можаце выкарыстоўваць ключ карыстальніка — каб пацвердзіць свой уліковы запіс і мець магчымасць увайсці ў сістэму пры дапамозе агента. Больш падрабязную інфармацыю аб ключах API вы можаце прачытаць у Дакументацыі", "ApiKeys.ApiKeysBlock.generateButton": "Стварыць ключ API", "ApiKeys.ApiKeysBlock.headerDateCol": "створаны", "ApiKeys.ApiKeysBlock.headerNameCol": "Назва ключа API", "ApiKeys.ApiKeysBlock.revoke": "Адклікаць", "ApiKeys.noApiKeys.description": "Каб забяспечыць бяспеку пароля вашага ўласнага дамена, вы можаце выкарыстоўваць ключ карыстальніка — каб пацвердзіць свой уліковы запіс і мець магчымасць адпраўляць вынікі пры дапамозе агента.", + "ApiKeys.noApiKeys.documentation": "Дакументацыя", "ApiKeys.noApiKeys.generateButton": "Стварыць ключ API", "ApiKeys.noApiKeys.header": "Няма ключоў API", "ApiPage.title": "Дакументацыя API", diff --git a/app/localization/translated/ru.json b/app/localization/translated/ru.json index 46aca246f8..8f37846db7 100644 --- a/app/localization/translated/ru.json +++ b/app/localization/translated/ru.json @@ -160,12 +160,13 @@ "ApiKeyGeneratedModal.header": "Ключ API сгенерирован", "ApiKeyGeneratedModal.loaderText": "ГЕНЕРАЦИЯ", "ApiKeyGeneratedModal.successNotification": "Ключ API успешно скопирован", - "ApiKeys.ApiKeysBlock.description": "Чтобы обеспечить безопасность вашего собственного доменного пароля, вы можете использовать ключ пользователя — чтобы подтвердить свою учетную запись, чтобы иметь возможность отправлять результаты при помощи агента.", + "ApiKeys.ApiKeysBlock.description": "Чтобы обеспечить безопасность вашего собственного доменного пароля, вы можете использовать ключ пользователя — чтобы подтвердить свою учетную запись, чтобы иметь возможность войти в систему при помощи агента. Более подробную информацию о ключах API вы можете прочитать в Документации", "ApiKeys.ApiKeysBlock.generateButton": "Создать ключ API", "ApiKeys.ApiKeysBlock.headerDateCol": "создан", "ApiKeys.ApiKeysBlock.headerNameCol": "Имя ключа API", "ApiKeys.ApiKeysBlock.revoke": "Отозвать", "ApiKeys.noApiKeys.description": "Чтобы обеспечить безопасность вашего собственного доменного пароля, вы можете использовать ключ пользователя — чтобы подтвердить свою учетную запись, чтобы иметь возможность отправлять результаты при помощи агента.", + "ApiKeys.noApiKeys.documentation": "Документация", "ApiKeys.noApiKeys.generateButton": "Сгенерировать API-ключ", "ApiKeys.noApiKeys.header": "Нет ключей API", "ApiPage.title": "Документация API", diff --git a/app/localization/translated/uk.json b/app/localization/translated/uk.json index 282c0acc09..88945900c5 100644 --- a/app/localization/translated/uk.json +++ b/app/localization/translated/uk.json @@ -160,12 +160,13 @@ "ApiKeyGeneratedModal.header": "Ключ API створено", "ApiKeyGeneratedModal.loaderText": "ГЕНЕРУЮЧИЙ", "ApiKeyGeneratedModal.successNotification": "Ключ API успішно скопійовано", - "ApiKeys.ApiKeysBlock.description": "Щоб забезпечити безпеку власного пароля домену, ви можете використовувати ключ користувача — щоб підтвердити свій обліковий запис і мати можливість надсилати результати за допомогою агента.", + "ApiKeys.ApiKeysBlock.description": "Щоб забезпечити безпеку власного пароля домену, ви можете використовувати ключ користувача — щоб підтвердити свій обліковий запис і мати можливість увійти за допомогою агента. Більш детальну інформацію про ключі API ви можете прочитати в Документації", "ApiKeys.ApiKeysBlock.generateButton": "Створити ключ API", "ApiKeys.ApiKeysBlock.headerDateCol": "створений", "ApiKeys.ApiKeysBlock.headerNameCol": "Назва ключа API", "ApiKeys.ApiKeysBlock.revoke": "Відкликати", "ApiKeys.noApiKeys.description": "Щоб забезпечити безпеку власного пароля домену, ви можете використовувати ключ користувача — щоб підтвердити свій обліковий запис і мати можливість надсилати результати за допомогою агента.", + "ApiKeys.noApiKeys.documentation": "Документація", "ApiKeys.noApiKeys.generateButton": "Створити ключ API", "ApiKeys.noApiKeys.header": "Немає ключів API", "ApiPage.title": "Документація API", diff --git a/app/localization/translated/zh.json b/app/localization/translated/zh.json index 87dfe15f50..1c69554ee9 100644 --- a/app/localization/translated/zh.json +++ b/app/localization/translated/zh.json @@ -159,12 +159,13 @@ "ApiKeyGeneratedModal.header": "API key generated", "ApiKeyGeneratedModal.loaderText": "GENERATING", "ApiKeyGeneratedModal.successNotification": "API Key has been copied successfully", - "ApiKeys.ApiKeysBlock.description": "In order to provide security for your own domain password, you can use a user key — to verify your account to be able to report with agent.", + "ApiKeys.ApiKeysBlock.description": "In order to provide security for your own domain password, you can use a user key — to verify your account to be able to log with agent. More information about API Keys you can read in Documentation", "ApiKeys.ApiKeysBlock.generateButton": "Generate API Key", "ApiKeys.ApiKeysBlock.headerDateCol": "created", "ApiKeys.ApiKeysBlock.headerNameCol": "API key name", "ApiKeys.ApiKeysBlock.revoke": "Revoke", "ApiKeys.noApiKeys.description": "In order to provide security for your own domain password, you can use a user key — to verify your account to be able to report with agent.", + "ApiKeys.noApiKeys.documentation": "文档", "ApiKeys.noApiKeys.generateButton": "Generate API Key", "ApiKeys.noApiKeys.header": "No API Keys", "ApiPage.title": "接口文档", diff --git a/app/src/common/utils/referenceDictionary.js b/app/src/common/utils/referenceDictionary.js index 3db17c518c..bef0c0028a 100644 --- a/app/src/common/utils/referenceDictionary.js +++ b/app/src/common/utils/referenceDictionary.js @@ -45,4 +45,6 @@ export const docsReferences = { 'https://reportportal.io/docs/reportportal-configuration/ProjectConfiguration#e-mail-notifications', emptyStateIntegrationsDocs: 'https://reportportal.io/docs/reportportal-configuration/IntegrationViaPlugin', + authorizationWithUsersApiKeyForAgents: + 'https://reportportal.io/docs/reportportal-configuration/HowToGetAnAccessTokenInReportPortal/#2-authorization-with-users-api-key-for-agents', }; diff --git a/app/src/pages/inside/profilePage/apiKeys/apiKeysBlock/apiKeysBlock.jsx b/app/src/pages/inside/profilePage/apiKeys/apiKeysBlock/apiKeysBlock.jsx index 49d667fce0..704036772c 100644 --- a/app/src/pages/inside/profilePage/apiKeys/apiKeysBlock/apiKeysBlock.jsx +++ b/app/src/pages/inside/profilePage/apiKeys/apiKeysBlock/apiKeysBlock.jsx @@ -15,6 +15,7 @@ */ import React from 'react'; +import Parser from 'html-react-parser'; import { useIntl, defineMessages } from 'react-intl'; import PropTypes from 'prop-types'; import classNames from 'classnames/bind'; @@ -22,8 +23,9 @@ import { useDispatch } from 'react-redux'; import { showModalAction } from 'controllers/modal'; import { BlockContainerBody, BlockContainerHeader } from 'pages/inside/profilePage/blockContainer'; import { ScrollWrapper } from 'components/main/scrollWrapper'; -import { daysFromNow } from 'common/utils'; +import { daysFromNow, createExternalLink } from 'common/utils'; import { GhostButton } from 'components/buttons/ghostButton'; +import { docsReferences } from 'common/utils/referenceDictionary'; import styles from './apiKeysBlock.scss'; const cx = classNames.bind(styles); @@ -35,7 +37,7 @@ const messages = defineMessages({ description: { id: 'ApiKeys.ApiKeysBlock.description', defaultMessage: - 'In order to provide security for your own domain password, you can use a user key — to verify your account to be able to report with agent.', + 'In order to provide security for your own domain password, you can use a user key — to verify your account to be able to log with agent. More information about API Keys you can read in Documentation', }, headerNameCol: { id: 'ApiKeys.ApiKeysBlock.headerNameCol', @@ -60,7 +62,14 @@ export const ApiKeysBlock = ({ apiKeys }) => { return (