OpenSearch-Dashboards icon indicating copy to clipboard operation
OpenSearch-Dashboards copied to clipboard

[Workspace] feat: comply recent items with workspace

Open SuZhou-Joe opened this issue 1 year ago • 3 comments

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

https://github.com/opensearch-project/OpenSearch-Dashboards/assets/13493605/c3ae85c3-84ed-47c6-b9e8-72014c4e7219

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

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

SuZhou-Joe avatar Jun 27 '24 02:06 SuZhou-Joe