-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect enterprise_search to elasticsearch Urls
- Loading branch information
1 parent
4af2706
commit b8c0e33
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
x-pack/plugins/enterprise_search/public/applications/enterprise_search_redirect/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { Redirect, useLocation } from 'react-router-dom'; | ||
|
||
import { Routes, Route } from '@kbn/shared-ux-router'; | ||
|
||
import { NotFound } from '../applications/components/not_found'; | ||
|
||
const RedirectWithReplace = () => { | ||
const location = useLocation(); | ||
const newPath = location.pathname.replace('/enterprise_search', '/elasticsearch'); | ||
return <Redirect to={newPath} />; | ||
}; | ||
|
||
export const Applications = () => { | ||
return ( | ||
<Routes> | ||
<Route path="/enterprise_search/*" component={RedirectWithReplace} /> | ||
<Route> | ||
<NotFound /> | ||
</Route> | ||
</Routes> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters