mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[CLOUD] fix defaultRoute for app/cloud/onboarding (#221029)
## Summary The uiSettings client need to have the Kibana request to send back the defaultRoute for a space. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
This commit is contained in:
parent
28cc698f04
commit
6f41f41626
3 changed files with 11 additions and 1 deletions
|
@ -249,7 +249,7 @@ export class CloudPlugin implements Plugin<CloudSetup, CloudStart> {
|
|||
},
|
||||
async (context, request, response) => {
|
||||
const { uiSettings, savedObjects } = await context.core;
|
||||
const defaultRoute = await uiSettings.client.get<string>('defaultRoute');
|
||||
const defaultRoute = await uiSettings.client.get<string>('defaultRoute', { request });
|
||||
const nextCandidateRoute = parseNextURL(request.url.href);
|
||||
|
||||
const route = nextCandidateRoute === '/' ? defaultRoute : nextCandidateRoute;
|
||||
|
|
|
@ -69,6 +69,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
'--xpack.security.authc.providers.saml.saml1.realm=saml1',
|
||||
'--xpack.security.authc.providers.basic.basic1.order=1',
|
||||
'--server.restrictInternalApis=false',
|
||||
'--uiSettings.overrides.defaultRoute=/app/observability/landing',
|
||||
],
|
||||
},
|
||||
uiSettings: {
|
||||
|
|
|
@ -55,6 +55,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await deleteSavedObject();
|
||||
});
|
||||
|
||||
it('Only redirect', async () => {
|
||||
await browser.get(deployment.getHostPort() + `/app/cloud/onboarding`);
|
||||
await find.byCssSelector('[data-test-subj="userMenuButton"]', 20000);
|
||||
|
||||
// We need to make sure that both path and hash are respected.
|
||||
const currentURL = parse(await browser.getCurrentUrl());
|
||||
expect(currentURL.pathname).to.eql('/app/observability/landing');
|
||||
});
|
||||
|
||||
it('Redirect and save token', async () => {
|
||||
await browser.get(
|
||||
deployment.getHostPort() +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue