Skip to content

Commit 7672ca7

Browse files
[Workplace Search] Hide Kibana chrome on 3rd party connector redirects
1 parent 47065ac commit 7672ca7

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_added.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import '../../../../__mocks__/shallow_useeffect.mock';
99

10-
import { setMockActions } from '../../../../__mocks__';
10+
import { setMockActions, setMockValues } from '../../../../__mocks__';
1111

1212
import React from 'react';
1313
import { useLocation } from 'react-router-dom';
@@ -20,9 +20,11 @@ import { SourceAdded } from './source_added';
2020

2121
describe('SourceAdded', () => {
2222
const saveSourceParams = jest.fn();
23+
const setChromeIsVisible = jest.fn();
2324

2425
beforeEach(() => {
2526
setMockActions({ saveSourceParams });
27+
setMockValues({ setChromeIsVisible });
2628
});
2729

2830
it('renders', () => {
@@ -32,5 +34,6 @@ describe('SourceAdded', () => {
3234

3335
expect(wrapper.find(Loading)).toHaveLength(1);
3436
expect(saveSourceParams).toHaveBeenCalled();
37+
expect(setChromeIsVisible).toHaveBeenCalled();
3538
});
3639
});

x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_added.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import React, { useEffect } from 'react';
99
import { useLocation } from 'react-router-dom';
1010

1111
import { Location } from 'history';
12-
import { useActions } from 'kea';
12+
import { useActions, useValues } from 'kea';
1313

1414
import { EuiPage, EuiPageBody } from '@elastic/eui';
1515

16+
import { KibanaLogic } from '../../../../shared/kibana';
1617
import { Loading } from '../../../../shared/loading';
1718

1819
import { AddSourceLogic } from './add_source/add_source_logic';
@@ -24,8 +25,12 @@ import { AddSourceLogic } from './add_source/add_source_logic';
2425
*/
2526
export const SourceAdded: React.FC = () => {
2627
const { search } = useLocation() as Location;
28+
const { setChromeIsVisible } = useValues(KibanaLogic);
2729
const { saveSourceParams } = useActions(AddSourceLogic);
2830

31+
// We don't want the personal dashboard to flash the Kibana chrome, so we hide it.
32+
setChromeIsVisible(false);
33+
2934
useEffect(() => {
3035
saveSourceParams(search);
3136
}, []);

0 commit comments

Comments
 (0)