Skip to content

Commit 18dd954

Browse files
committed
use URL, take out baseRoute
1 parent 8399f0e commit 18dd954

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_intra_app_state.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ export const IntraAppStateProvider = memo<{
2727
children: React.ReactNode;
2828
}>(({ kibanaScopedHistory, children }) => {
2929
const internalAppToAppState = useMemo<IntraAppState>(() => {
30-
const intraAppState = kibanaScopedHistory.location.state as AnyIntraAppRouteState;
3130
return {
32-
forRoute: intraAppState && intraAppState.baseRoute ? intraAppState.baseRoute : '',
33-
routeState: intraAppState,
31+
forRoute: new URL(`${kibanaScopedHistory.location.hash.substr(1)}`, 'http://localhost')
32+
.pathname,
33+
routeState: kibanaScopedHistory.location.state as AnyIntraAppRouteState,
3434
};
35-
}, [kibanaScopedHistory.location.state]);
35+
}, [kibanaScopedHistory.location.state, kibanaScopedHistory.location.hash]);
3636
return (
3737
<IntraAppStateContext.Provider value={internalAppToAppState}>
3838
{children}

x-pack/plugins/ingest_manager/public/applications/ingest_manager/types/intra_app_route_state.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export interface CreateDatasourceRouteState {
1919
onCancelNavigateTo?: Parameters<ApplicationStart['navigateToApp']>;
2020
/** Url to be used on cancel links */
2121
onCancelUrl?: string;
22-
/** The base route */
23-
baseRoute?: string;
2422
}
2523

2624
/**
@@ -29,8 +27,6 @@ export interface CreateDatasourceRouteState {
2927
export interface AgentConfigDetailsDeployAgentAction {
3028
/** On done, navigate to the given app */
3129
onDoneNavigateTo?: Parameters<ApplicationStart['navigateToApp']>;
32-
/** The base route */
33-
baseRoute?: string;
3430
}
3531

3632
/**

x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ export const HostList = () => {
134134
'securitySolution:management',
135135
{ path: getEndpointListPath({ name: 'endpointList' }) },
136136
],
137-
baseRoute: `/integrations${
138-
endpointPackageVersion ? `/endpoint-${endpointPackageVersion}/add-datasource` : ''
139-
}`,
140137
},
141138
}
142139
);
@@ -150,7 +147,6 @@ export const HostList = () => {
150147
'securitySolution:management',
151148
{ path: getEndpointListPath({ name: 'endpointList' }) },
152149
],
153-
baseRoute: `/configs/${selectedPolicyId}`,
154150
},
155151
});
156152

x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ export const PolicyList = React.memo(() => {
156156
onCancelNavigateTo: ['securitySolution:management', { path: getPoliciesPath() }],
157157
onCancelUrl: formatUrl(getPoliciesPath()),
158158
onSaveNavigateTo: ['securitySolution:management', { path: getPoliciesPath() }],
159-
baseRoute: `/integrations${
160-
endpointPackageVersion ? `/endpoint-${endpointPackageVersion}/add-datasource` : ''
161-
}`,
162159
},
163160
}
164161
);

0 commit comments

Comments
 (0)