[Infra UI] Rename 'Snapshot' to 'Inventory'. (#36107)

* Rename 'Snapshot' to 'Inventory'.

* Use new route in functional tests.

* Internationalize tab titles.

* Add old route for bookmark compatibility.
This commit is contained in:
Sonja Krause-Harder 2019-05-09 13:18:13 +02:00 committed by GitHub
parent f57a167c03
commit b8b6ba395e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 9 deletions

View file

@ -46,18 +46,24 @@ export const InfrastructurePage = injectI18n(({ match, intl }: InfrastructurePag
<RoutedTabs
tabs={[
{
title: 'Snapshot',
path: `${match.path}/snapshot`,
title: intl.formatMessage({
id: 'xpack.infra.homePage.inventoryTabTitle',
defaultMessage: 'Inventory',
}),
path: `${match.path}/inventory`,
},
{
title: 'Metrics explorer',
title: intl.formatMessage({
id: 'xpack.infra.homePage.metricsExplorerTabTitle',
defaultMessage: 'Metrics explorer',
}),
path: `${match.path}/metrics-explorer`,
},
]}
/>
<Switch>
<Route path={`${match.path}/snapshot`} component={SnapshotPage} />
<Route path={`${match.path}/inventory`} component={SnapshotPage} />
<Route
path={`${match.path}/metrics-explorer`}
render={props => (

View file

@ -26,13 +26,16 @@ const PageRouterComponent: React.SFC<RouterProps> = ({ history, uiCapabilities }
<Router history={history}>
<Switch>
{uiCapabilities.infrastructure.show && (
<Redirect from="/" exact={true} to="/infrastructure/snapshot" />
<Redirect from="/" exact={true} to="/infrastructure/inventory" />
)}
{uiCapabilities.infrastructure.show && (
<Redirect from="/infrastructure" exact={true} to="/infrastructure/snapshot" />
<Redirect from="/infrastructure" exact={true} to="/infrastructure/inventory" />
)}
{uiCapabilities.infrastructure.show && (
<Redirect from="/home" exact={true} to="/infrastructure/snapshot" />
<Redirect from="/infrastructure/snapshot" exact={true} to="/infrastructure/inventory" />
)}
{uiCapabilities.infrastructure.show && (
<Redirect from="/home" exact={true} to="/infrastructure/inventory" />
)}
{uiCapabilities.logs.show && <Route path="/logs" component={LogsPage} />}
{uiCapabilities.infrastructure.show && (

View file

@ -449,7 +449,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
});
it(`infrastructure snapshot page renders not found page`, async () => {
await PageObjects.common.navigateToActualUrl('infraOps', 'infrastructure/snapshot', {
await PageObjects.common.navigateToActualUrl('infraOps', 'infrastructure/inventory', {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});

View file

@ -137,7 +137,7 @@ export default function({ getPageObjects, getService }: KibanaFunctionalTestDefa
});
it(`infrastructure snapshot page renders not found page`, async () => {
await PageObjects.common.navigateToActualUrl('infraOps', 'infrastructure/snapshot', {
await PageObjects.common.navigateToActualUrl('infraOps', 'infrastructure/inventory', {
basePath: '/s/custom_space',
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,