Skip to content
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 left nav bar #286

Merged
merged 3 commits into from
Mar 8, 2024
Merged

Conversation

ruanyl
Copy link
Owner

@ruanyl ruanyl commented Mar 7, 2024

Description

This PR revert changes to NavLinksService and CollapsibleNav component.

New feature added to NavLinksService: refactor nav link updater so that the displayed links can be customized, this is majority required by workspace as with workspace, user would be able to config what features(plugins) then want to see for a workspace, this requires to filter out those links that are not configured by the user.

Issues Resolved

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

refactor nav link updater so that the displayed links can be customized,
this is majority required by workspace as with workspace, user would be
able to config what features(plugins) then want to see for a workspace,
this requires to filter out those links that are not configured by the
user.

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 67.30769% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 66.91%. Comparing base (77ef493) to head (f29b6da).
Report is 1 commits behind head on workspace-pr-integr.

Files Patch % Lines
src/plugins/workspace/public/plugin.ts 36.84% 12 Missing ⚠️
src/core/public/chrome/ui/header/nav_link.tsx 40.00% 2 Missing and 1 partial ⚠️
.../core/public/chrome/nav_links/nav_links_service.ts 87.50% 1 Missing ⚠️
...c/core/public/chrome/ui/header/collapsible_nav.tsx 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           workspace-pr-integr     #286      +/-   ##
=======================================================
- Coverage                66.99%   66.91%   -0.08%     
=======================================================
  Files                     3323     3323              
  Lines                    64476    64529      +53     
  Branches                 10390    10398       +8     
=======================================================
- Hits                     43195    43181      -14     
- Misses                   18741    18809      +68     
+ Partials                  2540     2539       -1     
Flag Coverage Δ
Linux_ 66.25% <67.30%> (-0.08%) ⬇️
_1 32.15% <13.46%> (-0.05%) ⬇️
_2 55.32% <84.84%> (-0.04%) ⬇️
_3 43.32% <0.00%> (+0.01%) ⬆️
_4 35.09% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@ruanyl ruanyl force-pushed the workspace-left-nav-bar branch from efc9053 to ba53768 Compare March 7, 2024 12:30
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Copy link
Collaborator

@wanglam wanglam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Nice refactor!

return item;
private filterNavLinks(core: CoreStart) {
const currentWorkspace$ = core.workspaces.currentWorkspace$;
let filterLinksByWorkspace: LinksUpdater;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this filterLinksByWorkspace always be undefined, if switch to another workspace and whole page get refreshed?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's always undefined if page get refreshed. But this implementation should handle both refresh and non-refresh cases.

Copy link
Collaborator

@Hailong-am Hailong-am left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor!

@ruanyl ruanyl merged commit 09cfe94 into workspace-pr-integr Mar 8, 2024
78 checks passed
SuZhou-Joe pushed a commit that referenced this pull request Mar 18, 2024
* revert unnecessary changes to recently viewed component

refactor nav link updater so that the displayed links can be customized,
this is majority required by workspace as with workspace, user would be
able to config what features(plugins) then want to see for a workspace,
this requires to filter out those links that are not configured by the
user.

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>

* fix test snapshot

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>

* tweak comments

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>

---------

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants