Make Elastic logo click open custom home page in solution view#241571
Conversation
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
| }: LogoProps) => { | ||
| const loadingCount = useObservable(loadingCount$.pipe(debounceTime(LOADING_DEBOUNCE_TIME)), 0); | ||
| const homeHref = useObservable(homeHref$, '/app/home'); | ||
| const homeRoute = uiSettings.get('defaultRoute') || homeHref; |
There was a problem hiding this comment.
Have you considered doing in the service?
--private projectHome$ = new BehaviorSubject<string | undefined>(undefined);
++private projectHome$ = new BehaviorSubject<string | undefined>(uiSettings.get('defaultRoute') || '/app/home');I think if there is no good reason not to, having this in the service would be better.
There was a problem hiding this comment.
I was trying to make it simple but sure I will move it to the service.
There was a problem hiding this comment.
@Dosant I changed my implementation but the proposed one didn't really work as setProjectHome from solutions kept overriding the value so I put the uiSettings.get inside setProjectHome.
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
|
a811dcc to
3a70628
Compare
Dosant
left a comment
There was a problem hiding this comment.
thx, I see that it should work but I'd then just fallback on getter level
|
|
||
| private setProjectHome(homeHref: string) { | ||
| this.projectHome$.next(homeHref); | ||
| this.projectHome$.next(this.uiSettings?.get('defaultRoute') || homeHref); |
There was a problem hiding this comment.
another option then is to make it default on getProjectHome$ level
getProjectHome$: () => {
return this.projectHome$.pipe(map(home => home || this.uiSettings?.get('defaultRoute')));
},
I think it would be better because now if setProjectHome never called then we never set the default
There was a problem hiding this comment.
Right. I moved the logic to getProjectHome$, but I had to make the order different, so this.uiSettings?.get('defaultRoute') || home instead of home || this.uiSettings?.get('defaultRoute').
I think this is fine because we want to the uiSetting to have priority.
|
Starting backport for target branches: 9.2 |
…ic#241571) ## Summary This PR makes Elastic logo in solution view use advanced setting `defaultRoute` to determine what URL is opened when clicking on it. https://github.com/user-attachments/assets/8dc402f5-9184-4f4b-be9a-e8a886f6234e Closes: elastic#233886 (cherry picked from commit 4f80854)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…241571) (#241606) # Backport This will backport the following commits from `main` to `9.2`: - [Make Elastic logo click open custom home page in solution view (#241571)](#241571) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Krzysztof Kowalczyk","email":"krzysztof.kowalczyk@elastic.co"},"sourceCommit":{"committedDate":"2025-11-03T12:12:59Z","message":"Make Elastic logo click open custom home page in solution view (#241571)\n\n## Summary\n\nThis PR makes Elastic logo in solution view use advanced setting\n`defaultRoute` to determine what URL is opened when clicking on it.\n\n\nhttps://github.com/user-attachments/assets/8dc402f5-9184-4f4b-be9a-e8a886f6234e\n\nCloses: https://github.com/elastic/kibana/issues/233886","sha":"4f8085433dae8c9868e0f9b56633b02a2d64114d","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:SharedUX","backport:version","v9.3.0","v9.2.1"],"title":"Make Elastic logo click open custom home page in solution view","number":241571,"url":"https://github.com/elastic/kibana/pull/241571","mergeCommit":{"message":"Make Elastic logo click open custom home page in solution view (#241571)\n\n## Summary\n\nThis PR makes Elastic logo in solution view use advanced setting\n`defaultRoute` to determine what URL is opened when clicking on it.\n\n\nhttps://github.com/user-attachments/assets/8dc402f5-9184-4f4b-be9a-e8a886f6234e\n\nCloses: https://github.com/elastic/kibana/issues/233886","sha":"4f8085433dae8c9868e0f9b56633b02a2d64114d"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241571","number":241571,"mergeCommit":{"message":"Make Elastic logo click open custom home page in solution view (#241571)\n\n## Summary\n\nThis PR makes Elastic logo in solution view use advanced setting\n`defaultRoute` to determine what URL is opened when clicking on it.\n\n\nhttps://github.com/user-attachments/assets/8dc402f5-9184-4f4b-be9a-e8a886f6234e\n\nCloses: https://github.com/elastic/kibana/issues/233886","sha":"4f8085433dae8c9868e0f9b56633b02a2d64114d"}},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Krzysztof Kowalczyk <krzysztof.kowalczyk@elastic.co>
Summary
This PR makes Elastic logo in solution view use advanced setting
defaultRouteto determine what URL is opened when clicking on it.Screen.Recording.2025-11-02.at.21.29.10.mov
Closes: #233886