Skip to content

Commit aebdca9

Browse files
committed
Update routers
1 parent c49e004 commit aebdca9

4 files changed

Lines changed: 3 additions & 49 deletions

File tree

x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import { SourceAdded } from './views/content_sources/components/source_added';
4141
import { SourceSubNav } from './views/content_sources/components/source_sub_nav';
4242
import { ErrorState } from './views/error_state';
4343
import { GroupsRouter } from './views/groups';
44-
import { GroupSubNav } from './views/groups/components/group_sub_nav';
4544
import { Overview } from './views/overview';
4645
import { RoleMappings } from './views/role_mappings';
4746
import { Security } from './views/security';
@@ -64,7 +63,6 @@ export const WorkplaceSearchConfigured: React.FC<InitialAppData> = (props) => {
6463

6564
// We don't want so show the subnavs on the container root pages.
6665
const showSourcesSubnav = pathname !== SOURCES_PATH && pathname !== PERSONAL_SOURCES_PATH;
67-
const showGroupsSubnav = pathname !== GROUPS_PATH;
6866

6967
/**
7068
* Personal dashboard urls begin with /p/
@@ -132,13 +130,7 @@ export const WorkplaceSearchConfigured: React.FC<InitialAppData> = (props) => {
132130
</Layout>
133131
</Route>
134132
<Route path={GROUPS_PATH}>
135-
<Layout
136-
navigation={<WorkplaceSearchNav groupsSubNav={showGroupsSubnav && <GroupSubNav />} />}
137-
restrictWidth
138-
readOnlyMode={readOnlyMode}
139-
>
140-
<GroupsRouter />
141-
</Layout>
133+
<GroupsRouter />
142134
</Route>
143135
<Route path={ROLE_MAPPINGS_PATH}>
144136
<RoleMappings />

x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_router.test.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import { Route, Switch } from 'react-router-dom';
1515

1616
import { shallow } from 'enzyme';
1717

18-
import { FlashMessages } from '../../../shared/flash_messages';
19-
import { SetWorkplaceSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
20-
2118
import { GroupOverview } from './components/group_overview';
2219
import { GroupSourcePrioritization } from './components/group_source_prioritization';
2320
import { ManageUsersModal } from './components/manage_users_modal';
@@ -40,10 +37,10 @@ describe('GroupRouter', () => {
4037
resetGroup,
4138
});
4239
});
40+
4341
it('renders', () => {
4442
const wrapper = shallow(<GroupRouter />);
4543

46-
expect(wrapper.find(FlashMessages)).toHaveLength(1);
4744
expect(wrapper.find(Switch)).toHaveLength(1);
4845
expect(wrapper.find(Route)).toHaveLength(2);
4946
expect(wrapper.find(GroupOverview)).toHaveLength(1);
@@ -62,22 +59,4 @@ describe('GroupRouter', () => {
6259
expect(wrapper.find(ManageUsersModal)).toHaveLength(1);
6360
expect(wrapper.find(SharedSourcesModal)).toHaveLength(1);
6461
});
65-
66-
it('handles breadcrumbs while loading', () => {
67-
setMockValues({
68-
sharedSourcesModalVisible: false,
69-
manageUsersModalVisible: false,
70-
group: {},
71-
});
72-
73-
const loadingBreadcrumbs = ['Groups', '...'];
74-
75-
const wrapper = shallow(<GroupRouter />);
76-
77-
const firstBreadCrumb = wrapper.find(SetPageChrome).first();
78-
const lastBreadCrumb = wrapper.find(SetPageChrome).last();
79-
80-
expect(firstBreadCrumb.prop('trail')).toEqual([...loadingBreadcrumbs, 'Source Prioritization']);
81-
expect(lastBreadCrumb.prop('trail')).toEqual(loadingBreadcrumbs);
82-
});
8362
});

x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_router.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ import { Route, Switch, useParams } from 'react-router-dom';
1010

1111
import { useActions, useValues } from 'kea';
1212

13-
import { FlashMessages } from '../../../shared/flash_messages';
14-
import { SetWorkplaceSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
15-
import { SendWorkplaceSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
16-
import { NAV } from '../../constants';
1713
import { GROUP_SOURCE_PRIORITIZATION_PATH, GROUP_PATH } from '../../routes';
1814

1915
import { GroupOverview } from './components/group_overview';
@@ -26,11 +22,7 @@ export const GroupRouter: React.FC = () => {
2622
const { groupId } = useParams() as { groupId: string };
2723

2824
const { initializeGroup, resetGroup } = useActions(GroupLogic);
29-
const {
30-
sharedSourcesModalVisible,
31-
manageUsersModalVisible,
32-
group: { name },
33-
} = useValues(GroupLogic);
25+
const { sharedSourcesModalVisible, manageUsersModalVisible } = useValues(GroupLogic);
3426

3527
useEffect(() => {
3628
initializeGroup(groupId);
@@ -39,15 +31,11 @@ export const GroupRouter: React.FC = () => {
3931

4032
return (
4133
<>
42-
<FlashMessages />
4334
<Switch>
4435
<Route path={GROUP_SOURCE_PRIORITIZATION_PATH}>
45-
<SetPageChrome trail={[NAV.GROUPS, name || '...', NAV.SOURCE_PRIORITIZATION]} />
4636
<GroupSourcePrioritization />
4737
</Route>
4838
<Route path={GROUP_PATH}>
49-
<SetPageChrome trail={[NAV.GROUPS, name || '...']} />
50-
<SendTelemetry action="viewed" metric="group_overview" />
5139
<GroupOverview />
5240
</Route>
5341
</Switch>

x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_router.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import { Route, Switch } from 'react-router-dom';
1010

1111
import { useActions } from 'kea';
1212

13-
import { SetWorkplaceSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
14-
import { SendWorkplaceSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
15-
import { NAV } from '../../constants';
1613
import { GROUP_PATH, GROUPS_PATH } from '../../routes';
1714

1815
import { GroupRouter } from './group_router';
@@ -31,8 +28,6 @@ export const GroupsRouter: React.FC = () => {
3128
return (
3229
<Switch>
3330
<Route exact path={GROUPS_PATH}>
34-
<SetPageChrome trail={[NAV.GROUPS]} />
35-
<SendTelemetry action="viewed" metric="groups" />
3631
<Groups />
3732
</Route>
3833
<Route path={GROUP_PATH}>

0 commit comments

Comments
 (0)