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] Refactor the UI of workspace picker #7045

Merged

Conversation

yubonluo
Copy link
Contributor

@yubonluo yubonluo commented Jun 17, 2024

Description

Refactor the UI of workspace picker. When workspace and new home page enabled, user can find the workspace menu button on the bottom of left navigation.

Issues Resolved

#7044

Screenshot

  • Out of workspace and user is dashboard admin
image
  • In a workspace and user is dashboard admin
image
  • When NewHomePage is disabled, the workspace picker menu will not be shown.
image
  • When user is not dashboard admin, the create workspace button will not been shown in workspace picker menu.

Testing the changes

  1. Clone the latest osd code and run yarn osd bootstrap
  2. Modify config/opensearch_dashboards.yml
workspace.enabled: true 
uiSettings:
  overrides:
    "home:useNewHomePage": true
  1. Run yarn start --no-base-path
  2. Click workspace picker

Changelog

  • feat: [Workspace] Refactor the UI of workspace picker

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

Signed-off-by: yubonluo <yubonluo@amazon.com>
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 67.69%. Comparing base (cc6949b) to head (4932cf3).
Report is 300 commits behind head on main.

Files with missing lines Patch % Lines
...ublic/components/workspace_menu/workspace_menu.tsx 97.14% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7045      +/-   ##
==========================================
+ Coverage   67.67%   67.69%   +0.01%     
==========================================
  Files        3516     3517       +1     
  Lines       69544    69567      +23     
  Branches    11349    11351       +2     
==========================================
+ Hits        47067    47093      +26     
+ Misses      19692    19689       -3     
  Partials     2785     2785              
Flag Coverage Δ
Linux_1 33.22% <98.00%> (+0.06%) ⬆️
Linux_2 55.46% <ø> (ø)
Linux_3 43.32% <ø> (+0.01%) ⬆️
Linux_4 34.69% <ø> (ø)
Windows_1 33.24% <98.00%> (+0.06%) ⬆️
Windows_2 55.41% <ø> (ø)
Windows_3 43.32% <ø> (ø)
Windows_4 34.69% <ø> (ø)

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: yubonluo <yubonluo@amazon.com>
…OpenSearch-Dashboards into 2.16-refactor-workspace-picker
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
@yubonluo yubonluo force-pushed the 2.16-refactor-workspace-picker branch from 1b78b64 to 16ab467 Compare July 19, 2024 12:17
Signed-off-by: yubonluo <yubonluo@amazon.com>
@yubonluo yubonluo force-pushed the 2.16-refactor-workspace-picker branch from 16ab467 to 125b43e Compare July 19, 2024 13:17
Signed-off-by: yubonluo <yubonluo@amazon.com>
ruanyl
ruanyl previously approved these changes Jul 20, 2024
SuZhou-Joe
SuZhou-Joe previously approved these changes Jul 20, 2024
Signed-off-by: yubonluo <yubonluo@amazon.com>
@yubonluo yubonluo dismissed stale reviews from SuZhou-Joe and ruanyl via 3cae370 July 20, 2024 03:17
Signed-off-by: yubonluo <yubonluo@amazon.com>
@SuZhou-Joe SuZhou-Joe merged commit 7f9bdd7 into opensearch-project:main Jul 20, 2024
70 of 72 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-7045-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7f9bdd739ea4a90e161e1efd512b053872d8b6c2
# Push it to GitHub
git push --set-upstream origin backport/backport-7045-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-7045-to-2.x.

@ruanyl
Copy link
Member

ruanyl commented Jul 20, 2024

@yubonluo the auto backport is failed, you may need a manual backport

@yubonluo
Copy link
Contributor Author

@yubonluo the auto backport is failed, you may need a manual backport

@wanglam After backporting this pr (#7318), my pr will can successfully auto backport to 2.x

@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-7045-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7f9bdd739ea4a90e161e1efd512b053872d8b6c2
# Push it to GitHub
git push --set-upstream origin backport/backport-7045-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-7045-to-2.x.

@AMoo-Miki
Copy link
Collaborator

This was successfully backported manually.

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.

7 participants