-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Workspace][Feature] Left navigation menu adjustment #192
[Workspace][Feature] Left navigation menu adjustment #192
Conversation
Codecov Report
@@ Coverage Diff @@
## workspace-pr-integr #192 +/- ##
=======================================================
+ Coverage 66.11% 66.55% +0.43%
=======================================================
Files 3392 3419 +27
Lines 65038 65439 +401
Branches 10496 10507 +11
=======================================================
+ Hits 43000 43553 +553
+ Misses 19461 19271 -190
- Partials 2577 2615 +38
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 93 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@yuye-aws A lot tests failed, please take a look. And please also add PR descriptions |
); | ||
}, | ||
|
||
setNavLinks: (filteredNavLinks: ReadonlyMap<string, ChromeNavLink>) => { |
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.
setNavLinks: (filteredNavLinks: ReadonlyMap<string, ChromeNavLink>) => { | |
setNavLinks: (navLinks: ReadonlyMap<string, ChromeNavLink>) => { |
@@ -132,36 +145,49 @@ export class NavLinksService { | |||
// manual link modifications to be able to re-apply then after every | |||
// availableApps$ changes. | |||
const linkUpdaters$ = new BehaviorSubject<LinksUpdater[]>([]); | |||
const navLinks$ = new BehaviorSubject<ReadonlyMap<string, NavLinkWrapper>>(new Map()); | |||
const allNavLinks$ = new BehaviorSubject<ReadonlyMap<string, NavLinkWrapper>>(new Map()); |
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.
We can move navLinks$
here so it align with existing pattern.
const navLinks$ = new BehaviorSubject<ReadonlyMap<string, ChromeNavLink> | undefined>(
undefined
);
}); | ||
|
||
const forceAppSwitcherNavigation$ = new BehaviorSubject(false); | ||
|
||
return { | ||
getNavLinks$: () => { | ||
return navLinks$.pipe(map(sortNavLinks), takeUntil(this.stop$)); | ||
return combineLatest([allNavLinks$, this.navLinks$]).pipe( |
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.
Is this.navLinks$
the filtered links which will be displayed? If so, can we give it a precise name for readability? Something like displayedLinks
?
function sortChromeNavLinks(chromeNavLinks: ReadonlyMap<string, ChromeNavLink>) { | ||
return sortBy( | ||
[...chromeNavLinks.values()].map((link) => link as Readonly<ChromeNavLink>), | ||
'order' | ||
); | ||
} |
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.
I may combine sortNavLinks
and sortChromeNavLinks
like this:
function sortLinks(navLinks: ReadonlyMap<string, NavLinkWrapper | ChromeNavLink>) {
return sortBy(
[...navLinks.values()].map((link) => 'properties' in link ? link.properties : link),
'order'
);
}
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-workspace workspace
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-workspace
# Create a new branch
git switch --create backport/backport-192-to-workspace
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c271e741f8bb2aee06aeff1976249cb37813f3cd
# Push it to GitHub
git push --set-upstream origin backport/backport-192-to-workspace
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-workspace Then, create a pull request where the |
* [Workspace][Feature] Left navigation menu adjustment (#192) * add util function to filter workspace feature by wildcard Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * resolve conflict Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update tests and snapshots Signed-off-by: yuye-aws <yuyezhu@amazon.com> * small adjustment to left menu Signed-off-by: yuye-aws <yuyezhu@amazon.com> * resolve git conflict Signed-off-by: yuye-aws <yuyezhu@amazon.com> * rename nav link service function Signed-off-by: yuye-aws <yuyezhu@amazon.com> * unit test for workspace plugin.ts Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update snapshots Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> --------- Signed-off-by: Yulong Ruan <ruanyl@amazon.com> Signed-off-by: yuye-aws <yuyezhu@amazon.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com> * resolve conflict Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update snapshots Signed-off-by: yuye-aws <yuyezhu@amazon.com> * resolve conflicts Signed-off-by: yuye-aws <yuyezhu@amazon.com> * restore snapshot Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update tests Signed-off-by: yuye-aws <yuyezhu@amazon.com> --------- Signed-off-by: Yulong Ruan <ruanyl@amazon.com> Signed-off-by: yuye-aws <yuyezhu@amazon.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com>
* add util function to filter workspace feature by wildcard Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * resolve conflict Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update tests and snapshots Signed-off-by: yuye-aws <yuyezhu@amazon.com> * small adjustment to left menu Signed-off-by: yuye-aws <yuyezhu@amazon.com> * resolve git conflict Signed-off-by: yuye-aws <yuyezhu@amazon.com> * rename nav link service function Signed-off-by: yuye-aws <yuyezhu@amazon.com> * unit test for workspace plugin.ts Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update snapshots Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> --------- Signed-off-by: Yulong Ruan <ruanyl@amazon.com> Signed-off-by: yuye-aws <yuyezhu@amazon.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com>
* add util function to filter workspace feature by wildcard Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * resolve conflict Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update tests and snapshots Signed-off-by: yuye-aws <yuyezhu@amazon.com> * small adjustment to left menu Signed-off-by: yuye-aws <yuyezhu@amazon.com> * resolve git conflict Signed-off-by: yuye-aws <yuyezhu@amazon.com> * rename nav link service function Signed-off-by: yuye-aws <yuyezhu@amazon.com> * unit test for workspace plugin.ts Signed-off-by: yuye-aws <yuyezhu@amazon.com> * update snapshots Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> * optimize code Signed-off-by: yuye-aws <yuyezhu@amazon.com> --------- Signed-off-by: Yulong Ruan <ruanyl@amazon.com> Signed-off-by: yuye-aws <yuyezhu@amazon.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com>
Description
The main changes of this PR are about left navigation menu:
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr