-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Serverless Chrome] Polish of home logo and project switcher #158523
[Serverless Chrome] Polish of home logo and project switcher #158523
Conversation
393890f
to
34a6336
Compare
Pinging @elastic/appex-sharedux (Team:SharedUX) |
34a6336
to
ae61074
Compare
I wonder if we can wait for the "v2" UI to be merged (#158297) before this one as most of the changes will have re-done. |
6c54ecc
to
6727a4a
Compare
6727a4a
to
2e904ff
Compare
@@ -9,7 +9,7 @@ | |||
import React from 'react'; | |||
import { FormattedMessage } from '@kbn/i18n-react'; | |||
import { BehaviorSubject, combineLatest, merge, type Observable, of, ReplaySubject } from 'rxjs'; | |||
import { flatMap, map, takeUntil } from 'rxjs/operators'; | |||
import { mergeMap, map, takeUntil } from 'rxjs/operators'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flatMap
is deprecated
@@ -177,25 +177,23 @@ export class ChromeService { | |||
chromeStyle$.next(style); | |||
}; | |||
|
|||
const setProjectSideNavComponent = (component: ISideNavComponent | null) => { | |||
const validateChromeStyle = () => { | |||
const chromeStyle = chromeStyle$.getValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the validation into a helper function
}, | ||
nav: { | ||
toggleNavButton: css` | ||
border-right: 1px solid #d3dae6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there is a cleaner way to do this in CSS. It may be better to leave the header style alone for now since changes will be coming to this area in an EUI update.
cc @cee-chen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to use the useEuiTheme
hook to get the JS theme variables for border width/colors. But yeah I'll be working on EuiCollapsibleNav updates next week here, which will include this styling, so if you want you could leave this out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cee-chen thanks for the updates! I'm tempted to update this PR to use useEuiTheme
and ensure the border for this header item (the nav show/hide button) is the right color, even if temporarily.
This discussion probably belongs here: elastic/eui#6759 (comment)
<EuiHeaderSection side="right"> | ||
<EuiHeaderSectionItem> | ||
<HeaderNavControls navControls$={observables.navControlsCenter$} /> | ||
<HeaderNavControls navControls$={observables.navControlsRight$} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{/* TODO: This puts a group of nav menu items on the right edge of the screen, | ||
but it should be possible for apps customize the layout in a grid and use spacers between items. | ||
https://github.com/elastic/kibana/issues/158034 */} | ||
<EuiHeaderSection /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this comment since we won't focus on more work here in the short-term, and the design may change once we get to it.
@@ -53,22 +53,23 @@ export class ServerlessPlugin | |||
if (developer && developer.projectSwitcher && developer.projectSwitcher.enabled) { | |||
const { currentType } = developer.projectSwitcher; | |||
|
|||
core.chrome.navControls.registerRight({ | |||
core.chrome.navControls.registerLeft({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moves the project switcher to a left-side slot of the header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Observability changes LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ent-search changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security Solution LGTM!
I received feedback from @clintandrewhall the "project switcher" component was mistakenly moved in this PR. I'm working on resolving the fix and will hold off on merging for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Just resolve your conflicts, and you should be g2g. Thanks!
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @tsullivan |
## Summary This PR adjusts the `data-test-subj` for the global loading indicator in serverless projects such that at matches the stateful version. This makes sure that functional tests and corresponding test helper methods continue to work the same in stateful and serverless environments when comes to waiting for global loading to finish, which is a key mechanism to avoid test flakiness. ### Additional information - The serverless project specific global loading indicator was introduced with #158523 - The stateful loading indicator `data-test-subj` naming is implemented here: https://github.com/elastic/kibana/blob/main/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx#L61 Co-authored-by: Tim Sullivan <[email protected]>
…163697) ## Summary This PR adjusts the `data-test-subj` for the global loading indicator in serverless projects such that at matches the stateful version. This makes sure that functional tests and corresponding test helper methods continue to work the same in stateful and serverless environments when comes to waiting for global loading to finish, which is a key mechanism to avoid test flakiness. ### Additional information - The serverless project specific global loading indicator was introduced with elastic#158523 - The stateful loading indicator `data-test-subj` naming is implemented here: https://github.com/elastic/kibana/blob/main/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx#L61 Co-authored-by: Tim Sullivan <[email protected]> (cherry picked from commit fd08c62)
…63697) (#163745) # Backport This will backport the following commits from `main` to `8.9`: - [Adjust global loading indicator data-test-subj for projects (#163697)](#163697) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Robert Oskamp","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-11T17:40:26Z","message":"Adjust global loading indicator data-test-subj for projects (#163697)\n\n## Summary\r\n\r\nThis PR adjusts the `data-test-subj` for the global loading indicator in\r\nserverless projects such that at matches the stateful version. This\r\nmakes sure that functional tests and corresponding test helper methods\r\ncontinue to work the same in stateful and serverless environments when\r\ncomes to waiting for global loading to finish, which is a key mechanism\r\nto avoid test flakiness.\r\n\r\n### Additional information\r\n\r\n- The serverless project specific global loading indicator was\r\nintroduced with #158523\r\n- The stateful loading indicator `data-test-subj` naming is implemented\r\nhere:\r\nhttps://github.com/elastic/kibana/blob/main/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx#L61\r\n\r\nCo-authored-by: Tim Sullivan <[email protected]>","sha":"fd08c62f052d065e677b670a381840ae80dc9724","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v8.10.0","v8.9.1"],"number":163697,"url":"https://github.com/elastic/kibana/pull/163697","mergeCommit":{"message":"Adjust global loading indicator data-test-subj for projects (#163697)\n\n## Summary\r\n\r\nThis PR adjusts the `data-test-subj` for the global loading indicator in\r\nserverless projects such that at matches the stateful version. This\r\nmakes sure that functional tests and corresponding test helper methods\r\ncontinue to work the same in stateful and serverless environments when\r\ncomes to waiting for global loading to finish, which is a key mechanism\r\nto avoid test flakiness.\r\n\r\n### Additional information\r\n\r\n- The serverless project specific global loading indicator was\r\nintroduced with #158523\r\n- The stateful loading indicator `data-test-subj` naming is implemented\r\nhere:\r\nhttps://github.com/elastic/kibana/blob/main/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx#L61\r\n\r\nCo-authored-by: Tim Sullivan <[email protected]>","sha":"fd08c62f052d065e677b670a381840ae80dc9724"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163697","number":163697,"mergeCommit":{"message":"Adjust global loading indicator data-test-subj for projects (#163697)\n\n## Summary\r\n\r\nThis PR adjusts the `data-test-subj` for the global loading indicator in\r\nserverless projects such that at matches the stateful version. This\r\nmakes sure that functional tests and corresponding test helper methods\r\ncontinue to work the same in stateful and serverless environments when\r\ncomes to waiting for global loading to finish, which is a key mechanism\r\nto avoid test flakiness.\r\n\r\n### Additional information\r\n\r\n- The serverless project specific global loading indicator was\r\nintroduced with #158523\r\n- The stateful loading indicator `data-test-subj` naming is implemented\r\nhere:\r\nhttps://github.com/elastic/kibana/blob/main/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx#L61\r\n\r\nCo-authored-by: Tim Sullivan <[email protected]>","sha":"fd08c62f052d065e677b670a381840ae80dc9724"}},{"branch":"8.9","label":"v8.9.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Robert Oskamp <[email protected]>
Closes #157810
Closes #158879
Summary
serverless.setProjectHome
API since the home link is no longer in the side navlinkToCloud
prop from the Navigation component since design is still TBD.Checklist
Delete any items that are not applicable to this PR.
Screenshots
Default
Global search (not yet collapsed by default)
Collapsed side nav