-
Notifications
You must be signed in to change notification settings - Fork 916
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
[navigation]Refactor: flatten left nav in Analytics(all) use case #8332
[navigation]Refactor: flatten left nav in Analytics(all) use case #8332
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8332 +/- ##
==========================================
- Coverage 60.93% 60.93% -0.01%
==========================================
Files 3756 3759 +3
Lines 89225 89323 +98
Branches 13950 13970 +20
==========================================
+ Hits 54373 54432 +59
- Misses 31469 31494 +25
- Partials 3383 3397 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Expanded = 270, | ||
Collapsed = 48, // The Collasped width is supposed to be aligned with the hamburger icon on the top left navigation. |
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.
For later: Not a fan of having layout decisions made in JS. We should plan to move these to CSS, as classes that we toggle, or as CSS or SASS variables.
src/core/public/chrome/ui/header/collapsible_nav_group_enabled_top.tsx
Outdated
Show resolved
Hide resolved
src/plugins/management/public/components/feature_cards/feature_cards.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
// It means we are in a workspace, we should only use the visible use cases | ||
visibleUseCases.forEach((navGroup) => mapAppIdToNavGroup(navGroup)); | ||
} | ||
// It means we are in a workspace, we should only use the visible use cases |
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.
Couldn't quite get this comment, could you elaborate a bit please?
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.
Sure, updated.
|
||
// Append all the links that do not have use case info to keep backward compatible | ||
const linkIdsWithNavGroupInfo = Object.values(navGroupsMap).reduce((accumulator, navGroup) => { | ||
if (!navGroup.type) { |
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.
Maybe a comment for the if
condition here?
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.
Sure, updated.
@@ -1,33 +1,57 @@ | |||
.context-nav-wrapper { | |||
border: none !important; | |||
border-top-right-radius: $euiSizeL; | |||
border-bottom-right-radius: $euiSizeL; | |||
background-color: $euiColorLightShade; |
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.
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.
Thanks, fixed.
@@ -1,33 +1,57 @@ | |||
.context-nav-wrapper { | |||
border: none !important; | |||
border-top-right-radius: $euiSizeL; | |||
border-bottom-right-radius: $euiSizeL; | |||
background-color: $euiColorLightShade; |
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.
This background color doesn't look like the color in design, shall we use the color from design?
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.
There is not a token for left nav in OUI yet, I'd like to merge this version first. We can raise another PR to adjust background color if we have any new updates.
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.
It looks the background is one of the important change and affects the look & feel quite a bit, my comments below are also related, let me double check and ask UX to confirm.
If we'd like to merge this PR first, perhaps I'd rather prefer to use the color value from design first, then then replace it with the color defined in OUI color palettes when it's ready.
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.
Or maybe we can have the background color change in a separate PR so that we can get the other changes in this PR merged asap.
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.
@virajsanghvi has a PR to add the color to OUI https://github.com/opensearch-project/oui/pull/1430/files#diff-67cb04d06a675c67602ff65a876373033b16a759964be1b850bbfb4ca50bad6aR13
And confirmed with him that we can commit the changes and let him know so that he can update the color after the PR in OUI merged. @SuZhou-Joe
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.
Sure, makes sense. I will use the color from design in this PR to unblock review.
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.
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.
Sure, updated.
padding: calc($euiSize / 4) $euiSize; | ||
border-radius: $euiSize; | ||
padding: $euiSizeS; | ||
border-radius: $euiSizeS; |
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.
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.
Sure, by using the new background color value, it should be able to tell the difference.
/** | ||
* The href and onClick should both be undefined to make parent item rendered as accordion. | ||
*/ | ||
href: undefined, | ||
onClick: undefined, | ||
'data-test-subj': undefined, |
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.
'data-test-subj': undefined
by intention?
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.
Yes, added some comments.
Signed-off-by: SuZhou-Joe <[email protected]>
@@ -0,0 +1 @@ | |||
$ouiSideNavBackgroundColorTemp: lightOrDarkTheme(#ebe4df, #001c28); /* stylelint-disable-line */ |
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.
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.
It is. a intermedia state, will change to a variable in OUI theme after https://github.com/opensearch-project/oui/pull/1430/files#diff-67cb04d06a675c67602ff65a876373033b16a759964be1b850bbfb4ca50bad6aR13 get merged.
) * feat: move the logic to construct navLinks in all use case to nav_group_service Signed-off-by: SuZhou-Joe <[email protected]> * feat: change category Signed-off-by: SuZhou-Joe <[email protected]> * feat: register search overview to all use case Signed-off-by: SuZhou-Joe <[email protected]> * Changeset file for PR #8332 created/updated * feat: fix bootstrap Signed-off-by: SuZhou-Joe <[email protected]> * feat: show icon in category to expand or collapse Signed-off-by: SuZhou-Joe <[email protected]> * feat: merge fix/fit-finish Signed-off-by: SuZhou-Joe <[email protected]> * feat: finish whole refactor Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: style update Signed-off-by: SuZhou-Joe <[email protected]> * fix: unit test Signed-off-by: SuZhou-Joe <[email protected]> * fix: unit tets Signed-off-by: SuZhou-Joe <[email protected]> * Changeset file for PR #8332 created/updated * feat: remove useless code Signed-off-by: SuZhou-Joe <[email protected]> * feat: update snapshot Signed-off-by: SuZhou-Joe <[email protected]> * fix: i18n Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update style Signed-off-by: SuZhou-Joe <[email protected]> * feat: update style Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: remove useless scss Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: change icon color to text and update the style a little bit Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * feat: update naming Signed-off-by: SuZhou-Joe <[email protected]> * feat: optimize code Signed-off-by: SuZhou-Joe <[email protected]> * feat: optimize code Signed-off-by: SuZhou-Joe <[email protected]> * feat: optimize code Signed-off-by: SuZhou-Joe <[email protected]> * fix: warning Signed-off-by: SuZhou-Joe <[email protected]> * fix: bootstrap Signed-off-by: SuZhou-Joe <[email protected]> * feat: update Signed-off-by: SuZhou-Joe <[email protected]> * fix: unit test Signed-off-by: SuZhou-Joe <[email protected]> * feat: optimize code based on comments Signed-off-by: SuZhou-Joe <[email protected]> --------- Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 6677891) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
) (#8466) * feat: move the logic to construct navLinks in all use case to nav_group_service * feat: change category * feat: register search overview to all use case * Changeset file for PR #8332 created/updated * feat: fix bootstrap * feat: show icon in category to expand or collapse * feat: merge fix/fit-finish * feat: finish whole refactor * feat: update * feat: update * feat: style update * fix: unit test * fix: unit tets * Changeset file for PR #8332 created/updated * feat: remove useless code * feat: update snapshot * fix: i18n * feat: update * feat: update * feat: update * feat: update style * feat: update style * feat: update * feat: update * feat: update * feat: remove useless scss * feat: update * feat: change icon color to text and update the style a little bit * feat: update * feat: update * feat: update naming * feat: optimize code * feat: optimize code * feat: optimize code * fix: warning * fix: bootstrap * feat: update * fix: unit test * feat: optimize code based on comments --------- (cherry picked from commit 6677891) Signed-off-by: SuZhou-Joe <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
As the multi levels of left nav may lead to context missing and confusion, we will optimize the analytics(all) use case nav by flattening all the navigation. And in order to keep backward compatible, we will keep using
showInAllNavGroup
for those links within nav group category.Dependencies
Issues Resolved
Screenshot
Analytics(all)
Observability
Security analytics
Search
Essentials
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration