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] feat: comply recent items with workspace #7115

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Jun 27, 2024

Description

Recent items storage is using basePath as the partition of its storage.

Before workspace feature is introduced, it works well because the only factor of basePath is serverBasePath, which is defined in opensearch_dashboards.yml file.

After workspace feature is enabled, things get weird because workspace will modify basePath service so that basePath consists of two parts: 1. serverBasePath 2. currentWorkspaceId. As a result, recent items storage is distinct by workspace, and user can not see all the recent items in any of the page or workspace.

This PR is fixing this issue by only take serverBasePath into consideration when generating the storage key of recent items.

Issues Resolved

closes #7116

Screenshot

You can see all the recent items in home or inside workspace

image image

Redirect when clicking items in recent items section

20240627105211509.mp4

Testing the changes

  1. Enable workspace feature in opensearch_dashboards.yml file
  2. Create a visualization outside workspace
  3. Create a workspace
  4. Create a visualization inside a workspace
  5. Clicking the one outside workspace in recent sections of left navigation, you should find yourself being redirect out of workspace.
  6. Clicking the one inside workspace in recent sections of left navigation, you should find yourself being redirect inside the workspace the visualization sits in.

Changelog

  • feat: comply recent items with workspace

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: SuZhou-Joe <suzhou@amazon.com>
Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.56%. Comparing base (901e39f) to head (031bf0b).
Report is 347 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7115   +/-   ##
=======================================
  Coverage   67.56%   67.56%           
=======================================
  Files        3469     3469           
  Lines       68499    68502    +3     
  Branches    11138    11140    +2     
=======================================
+ Hits        46280    46283    +3     
  Misses      19514    19514           
  Partials     2705     2705           
Flag Coverage Δ
Linux_1 33.15% <0.00%> (-0.01%) ⬇️
Linux_2 55.26% <100.00%> (+<0.01%) ⬆️
Linux_3 45.30% <0.00%> (-0.02%) ⬇️
Linux_4 34.72% <0.00%> (-0.01%) ⬇️
Windows_1 33.17% <0.00%> (-0.01%) ⬇️
Windows_2 55.21% <100.00%> (+<0.01%) ⬆️
Windows_3 45.31% <0.00%> (-0.01%) ⬇️
Windows_4 34.72% <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: SuZhou-Joe <suzhou@amazon.com>
@opensearch-project opensearch-project deleted a comment from github-actions bot Jun 27, 2024
@opensearch-project opensearch-project deleted a comment from github-actions bot Jun 27, 2024
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
@SuZhou-Joe
Copy link
Member Author

SuZhou-Joe commented Jun 27, 2024

The test snapshot is updated by intention because previous result is wrong that it does not reflect the basePath info when generating the final jumping href for the recent items.

@SuZhou-Joe SuZhou-Joe marked this pull request as ready for review June 27, 2024 09:02
ruanyl
ruanyl previously approved these changes Jul 2, 2024
Copy link
Member

@ruanyl ruanyl left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me!

@SuZhou-Joe SuZhou-Joe changed the base branch from main to feature/navigation-next July 2, 2024 09:37
@SuZhou-Joe SuZhou-Joe changed the base branch from feature/navigation-next to main July 2, 2024 09:38
@SuZhou-Joe SuZhou-Joe dismissed ruanyl’s stale review July 2, 2024 09:38

The base branch was changed.

@SuZhou-Joe
Copy link
Member Author

@ruanyl I changed the base branch by mistake and dismissed your approval. Could you please re-approve?

@ZilongX
Copy link
Collaborator

ZilongX commented Jul 5, 2024

pick the latest main and re-run all checkings

@SuZhou-Joe SuZhou-Joe merged commit d0a844f into opensearch-project:main Jul 8, 2024
67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 8, 2024
* feat: comply recent items with workspace

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Changeset file for PR #7115 created/updated

* feat: comply recent items with workspace

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: comply recent items with workspace

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update snapshot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

---------

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com>
(cherry picked from commit d0a844f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Jul 9, 2024
* feat: comply recent items with workspace



* Changeset file for PR #7115 created/updated

* feat: comply recent items with workspace



* feat: comply recent items with workspace



* feat: update snapshot



---------




(cherry picked from commit d0a844f)

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
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>
Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.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.

[Workspace] Comply recentAccessed service with workspace
5 participants