From 31247b36d9ac1eb0c3738cbf057730d4c839dd2b Mon Sep 17 00:00:00 2001 From: Sander Philipse Date: Wed, 9 Mar 2022 12:45:48 +0100 Subject: [PATCH] [Workplace Search] Connect button now displays correct copy --- .../add_source/configured_sources_list.tsx | 16 +++++++++++++++- .../components/add_source/constants.ts | 7 ------- 2 files changed, 15 insertions(+), 8 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..879382f90f77ff 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'; @@ -112,7 +114,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', {