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] Register a workspace dropdown menu at the top of left nav bar #6150

Merged

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Mar 15, 2024

Description

When workspace is enabled, the workspace plugin will register a workspace dropdown menu via chrome.registerCollapsibleNavHeader which displays a list of workspaces, links to create workspace page and workspace list page.

NOT IN THE SCOPE OF THIS PR

  1. workspace create page
  2. workspace list page
  3. workspace overview page when click a workspace from the list

Issues Resolved

#6149

Screenshot

workspace.dropdown.mov

Testing the changes

Update OSD config with workspace.enabled: true, and you will see the workspace dropdown menu on the top of the left nav bar.

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

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 3 lines in your changes missing coverage. Please review.

Project coverage is 67.33%. Comparing base (0cc91ab) to head (862ae3b).
Report is 576 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/workspace/public/plugin.ts 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6150      +/-   ##
==========================================
+ Coverage   67.31%   67.33%   +0.02%     
==========================================
  Files        3350     3351       +1     
  Lines       64993    65037      +44     
  Branches    10468    10474       +6     
==========================================
+ Hits        43750    43793      +43     
- Misses      18695    18697       +2     
+ Partials     2548     2547       -1     
Flag Coverage Δ
Linux_1 31.82% <94.11%> (+0.07%) ⬆️
Linux_2 55.57% <100.00%> (+0.01%) ⬆️
Linux_3 44.68% <100.00%> (+<0.01%) ⬆️
Linux_4 35.03% <100.00%> (+0.01%) ⬆️
Windows_1 31.85% <94.11%> (+0.07%) ⬆️
Windows_2 55.53% <100.00%> (+0.01%) ⬆️
Windows_3 44.69% <100.00%> (+0.01%) ⬆️
Windows_4 35.03% <100.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.

SuZhou-Joe
SuZhou-Joe previously approved these changes Mar 15, 2024
Copy link
Member

@SuZhou-Joe SuZhou-Joe left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -74,6 +74,7 @@ function createCoreSetupMock({
} = {}) {
const mock = {
application: applicationServiceMock.createSetupContract(),
chrome: chromeServiceMock.createSetupContract(),
Copy link
Member

@SuZhou-Joe SuZhou-Joe Mar 15, 2024

Choose a reason for hiding this comment

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

So nice to have this in core mock, have encountered type error in some test cases

src/plugins/workspace/public/render_workspace_menu.tsx Outdated Show resolved Hide resolved
SuZhou-Joe
SuZhou-Joe previously approved these changes Mar 15, 2024
@ruanyl ruanyl changed the title Register a workspace dropdown menu at the top of left nav bar [Workspace] Register a workspace dropdown menu at the top of left nav bar Mar 20, 2024
When workspace is enabled, the workspace plugin will register a
workspace dropdown menu via `chrome.registerCollapsibleNavHeader`
which displays a list of workspaces, links to create workspace page
and workspace list page.

Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
@ruanyl ruanyl force-pushed the workspace-dropdown-selector-in-left-nav branch from 8b8d7c7 to 862ae3b Compare March 21, 2024 00:23
@ruanyl ruanyl requested a review from xinruiba as a code owner March 21, 2024 00:23
@xinruiba
Copy link
Member

Thanks for the change, overall looks good to me.

@ruanyl ruanyl merged commit a2ed39f into opensearch-project:main Mar 21, 2024
70 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

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-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6150-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a2ed39f76c75bec843243ff85113485984102dbc
# Push it to GitHub
git push --set-upstream origin backport/backport-6150-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-6150-to-2.x.

ruanyl added a commit to ruanyl/OpenSearch-Dashboards that referenced this pull request Apr 17, 2024
… bar (opensearch-project#6150)

When workspace is enabled, the workspace plugin will register a
workspace dropdown menu via `chrome.registerCollapsibleNavHeader`
which displays a list of workspaces, links to create workspace page
and workspace list page.

---------

Signed-off-by: Yulong Ruan <[email protected]>
Flyingliuhub pushed a commit that referenced this pull request Apr 17, 2024
… bar (#6150) (#6505)

When workspace is enabled, the workspace plugin will register a
workspace dropdown menu via `chrome.registerCollapsibleNavHeader`
which displays a list of workspaces, links to create workspace page
and workspace list page.

---------

Signed-off-by: Yulong Ruan <[email protected]>
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.

6 participants