[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:
parent
f57a167c03
commit
b8b6ba395e
|
@ -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 => (
|
||||
|
|
|
@ -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 && (
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue