From 0ba204bdc2dcf9c02fc2bbe1829957952c6c7777 Mon Sep 17 00:00:00 2001 From: Sander Philipse <94373878+sphilipse@users.noreply.github.com> Date: Wed, 9 Mar 2022 18:50:02 +0100 Subject: [PATCH] [Workplace Search] Connect button now displays correct copy (#127291) * [Workplace Search] Connect button now displays correct copy --- .../add_source/configured_sources_list.tsx | 17 +++++++++++++++-- .../components/add_source/constants.ts | 7 ------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configured_sources_list.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configured_sources_list.tsx index d4bb62901cdb60..d4157caae2d1b2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configured_sources_list.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configured_sources_list.tsx @@ -20,6 +20,8 @@ import { EuiToolTip, } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + import { EuiButtonEmptyTo } from '../../../../../shared/react_router_helpers'; import { SourceIcon } from '../../../../components/shared/source_icon'; import { getAddPath, getSourcesPath } from '../../../../routes'; @@ -29,7 +31,6 @@ import { hasMultipleConnectorOptions } from '../../../../utils'; import { CONFIGURED_SOURCES_LIST_UNCONNECTED_TOOLTIP, CONFIGURED_SOURCES_LIST_ACCOUNT_ONLY_TOOLTIP, - CONFIGURED_SOURCES_CONNECT_BUTTON, CONFIGURED_SOURCES_EMPTY_STATE, CONFIGURED_SOURCES_TITLE, CONFIGURED_SOURCES_EMPTY_BODY, @@ -112,7 +113,19 @@ export const ConfiguredSourcesList: React.FC = ({ hasMultipleConnectorOptions(sourceData) ? '' : 'connect' }`} > - {CONFIGURED_SOURCES_CONNECT_BUTTON} + {!connected + ? i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.configuredSources.connectButton', + { + defaultMessage: 'Connect', + } + ) + : i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.configuredSources.connectAnotherButton', + { + defaultMessage: 'Connect another', + } + )} )) || ( diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts index 3ce4f930b7a387..5963f4cb256358 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts @@ -223,13 +223,6 @@ export const CONFIGURED_SOURCES_LIST_ACCOUNT_ONLY_TOOLTIP = i18n.translate( } ); -export const CONFIGURED_SOURCES_CONNECT_BUTTON = i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.contentSource.configuredSources.connectButton', - { - defaultMessage: 'Connect another', - } -); - export const CONFIGURED_SOURCES_EMPTY_STATE = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.configuredSources.emptyState', {