From 42079ec48eda81e6ce3ae07853ba4a20c01a2eb2 Mon Sep 17 00:00:00 2001 From: James Rucker Date: Mon, 29 Mar 2021 18:49:16 -0700 Subject: [PATCH] [Workplace Search] Send kibana_host when calling /reauth_prepare (#95529) * WIP almost there? * Fix server route validation * fix account route * Fix test expectations Co-authored-by: scottybollinger Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../components/add_source/add_source_logic.test.ts | 14 ++++++++++++-- .../components/add_source/add_source_logic.ts | 6 +++++- .../server/routes/workplace_search/sources.ts | 6 ++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts index 6c60cd74a9c9f..8ced90e7d7729 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts @@ -458,7 +458,12 @@ describe('AddSourceLogic', () => { AddSourceLogic.actions.getSourceReConnectData('github'); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/github/reauth_prepare' + '/api/workplace_search/org/sources/github/reauth_prepare', + { + query: { + kibana_host: '', + }, + } ); await nextTick(); expect(setSourceConnectDataSpy).toHaveBeenCalledWith(sourceConnectData); @@ -648,7 +653,12 @@ describe('AddSourceLogic', () => { AddSourceLogic.actions.getSourceReConnectData('123'); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/123/reauth_prepare' + '/api/workplace_search/account/sources/123/reauth_prepare', + { + query: { + kibana_host: '', + }, + } ); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts index ed63f82764f7e..6ca7f6fa72e24 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts @@ -418,8 +418,12 @@ export const AddSourceLogic = kea