From 51767e7cb9746d2a7a64e9f9aeabd8242d41b40b Mon Sep 17 00:00:00 2001 From: Vadim Yakhin Date: Tue, 29 Jun 2021 11:39:04 -0300 Subject: [PATCH] Use the user-provided source name in SourceInfoCard (#103542) --- .../content_sources/components/source_layout.test.tsx | 6 ++++++ .../content_sources/components/source_layout.tsx | 11 ++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.test.tsx index 7c7d77ec418e7..944a54169f0b8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.test.tsx @@ -44,6 +44,12 @@ describe('SourceLayout', () => { expect(wrapper.find('.testChild')).toHaveLength(1); }); + it('passes a source name to SourceInfoCard', () => { + const wrapper = shallow(); + + expect(wrapper.find(SourceInfoCard).prop('sourceName')).toEqual('Jira'); + }); + it('renders the default Workplace Search layout when on an organization view', () => { setMockValues({ ...mockValues, isOrganization: true }); const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.tsx index 446e93e0c61f3..663088f797c18 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_layout.tsx @@ -35,19 +35,12 @@ export const SourceLayout: React.FC = ({ const { contentSource, dataLoading } = useValues(SourceLogic); const { isOrganization } = useValues(AppLogic); - const { - name, - createdAt, - serviceType, - serviceName, - isFederatedSource, - supportedByLicense, - } = contentSource; + const { name, createdAt, serviceType, isFederatedSource, supportedByLicense } = contentSource; const pageHeader = ( <>