Skip to content

Commit 0123be6

Browse files
[8.19] [CLOUD] fix defaultRoute for app/cloud/onboarding (#221029) (#221174)
# Backport This will backport the following commits from `main` to `8.19`: - [[CLOUD] fix defaultRoute for app/cloud/onboarding (#221029)](#221029) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Xavier Mouligneau","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-05-21T18:32:00Z","message":"[CLOUD] fix defaultRoute for app/cloud/onboarding (#221029)\n\n## Summary\n\nThe uiSettings client need to have the Kibana request to send back the\ndefaultRoute for a space.\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"6f41f416262e5368d12c5f8deab64fe28af9a890","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Cloud","release_note:skip","backport:version","v9.1.0","v8.19.0","v8.18.2","v9.0.2"],"title":"[CLOUD] fix defaultRoute for app/cloud/onboarding","number":221029,"url":"https://github.com/elastic/kibana/pull/221029","mergeCommit":{"message":"[CLOUD] fix defaultRoute for app/cloud/onboarding (#221029)\n\n## Summary\n\nThe uiSettings client need to have the Kibana request to send back the\ndefaultRoute for a space.\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"6f41f416262e5368d12c5f8deab64fe28af9a890"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/221029","number":221029,"mergeCommit":{"message":"[CLOUD] fix defaultRoute for app/cloud/onboarding (#221029)\n\n## Summary\n\nThe uiSettings client need to have the Kibana request to send back the\ndefaultRoute for a space.\n\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"6f41f416262e5368d12c5f8deab64fe28af9a890"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Xavier Mouligneau <[email protected]>
1 parent 4bce759 commit 0123be6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

x-pack/platform/plugins/shared/cloud/server/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export class CloudPlugin implements Plugin<CloudSetup, CloudStart> {
249249
},
250250
async (context, request, response) => {
251251
const { uiSettings, savedObjects } = await context.core;
252-
const defaultRoute = await uiSettings.client.get<string>('defaultRoute');
252+
const defaultRoute = await uiSettings.client.get<string>('defaultRoute', { request });
253253
const nextCandidateRoute = parseNextURL(request.url.href);
254254

255255
const route = nextCandidateRoute === '/' ? defaultRoute : nextCandidateRoute;

x-pack/test/functional_cloud/saml.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
6969
'--xpack.security.authc.providers.saml.saml1.realm=saml1',
7070
'--xpack.security.authc.providers.basic.basic1.order=1',
7171
'--server.restrictInternalApis=false',
72+
'--uiSettings.overrides.defaultRoute=/app/observability/landing',
7273
],
7374
},
7475
uiSettings: {

x-pack/test/functional_cloud/tests/onboarding.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
5555
await deleteSavedObject();
5656
});
5757

58+
it('Only redirect', async () => {
59+
await browser.get(deployment.getHostPort() + `/app/cloud/onboarding`);
60+
await find.byCssSelector('[data-test-subj="userMenuButton"]', 20000);
61+
62+
// We need to make sure that both path and hash are respected.
63+
const currentURL = parse(await browser.getCurrentUrl());
64+
expect(currentURL.pathname).to.eql('/app/observability/landing');
65+
});
66+
5867
it('Redirect and save token', async () => {
5968
await browser.get(
6069
deployment.getHostPort() +

0 commit comments

Comments
 (0)