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

[Workspace] Enable workspace params in saved objects management page

Open SuZhou-Joe opened this issue 11 months ago • 4 comments

Description

Issues Resolved

closes #6028

Screenshot

When enter saved objects management page in workspace foo. The page shows nothing as no objects have been created in this workspace. image

After importing with the ndjson file, objects can be found only in workspace foo. image

image

By switching to another workspace bar, no objects can be found because the objects imported before was in workspace foo image

Testing the changes

  • Using the branch to bootstrap
  • Download the patch file test.patch
  • git apply ./test.patch, it will
    • enable workspace feature flag
    • switch to workspace foo manually as there is not a UI component to switch workspace for now
  • Start OSD by using yarn start --no-base-path to make sure no random base path will be appended
  • Navigate to devTools
  • Insert test workspaces by calling
PUT .kibana/_doc/workspace:foo
{
  "type": "workspace",
  "workspace": {
    "name": "foo"
  }
}

PUT .kibana/_doc/workspace:bar
{
  "type": "workspace",
  "workspace": {
    "name": "bar"
  }
}
  • Visit the saved objects management page: http://localhost:5601/app/management/opensearch-dashboards/objects
  • You will find nothing can be found in this workspace(After applying the patch file, you are in workspace foo)
  • Import by using the file, download the file and extract that to find the import file.
  • You will find some dashboards and visualizations are imported in the workspace.
  • Go to file src/plugins/workspace/public/plugin.ts, change the 'foo' workspace to 'bar'. Refresh the page. By doing so you are in workspace bar.
  • You will find the objects can not be found again.

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 Mar 05 '24 02:03 SuZhou-Joe

Codecov Report

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

Project coverage is 67.10%. Comparing base (4b89ad0) to head (0a844f5).

Files Patch % Lines
...d_objects_management/server/routes/scroll_count.ts 0.00% 3 Missing :warning:
...saved_objects_management/public/lib/import_file.ts 0.00% 0 Missing and 1 partial :warning:
...cts_management/public/lib/resolve_import_errors.ts 0.00% 0 Missing and 1 partial :warning:
...ins/saved_objects_management/server/routes/find.ts 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6026      +/-   ##
==========================================
- Coverage   67.14%   67.10%   -0.04%     
==========================================
  Files        3326     3331       +5     
  Lines       64394    64497     +103     
  Branches    10358    10369      +11     
==========================================
+ Hits        43237    43281      +44     
- Misses      18627    18684      +57     
- Partials     2530     2532       +2     
Flag Coverage Δ
Linux_1 31.95% <20.00%> (+0.21%) :arrow_up:
Linux_2 55.23% <ø> (ø)
Linux_3 44.72% <ø> (+0.01%) :arrow_up:
Linux_4 35.12% <72.72%> (+0.04%) :arrow_up:
Windows_1 31.97% <20.00%> (+0.21%) :arrow_up:
Windows_2 55.20% <ø> (ø)
Windows_3 44.73% <ø> (ø)
Windows_4 35.12% <72.72%> (+0.04%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 05 '24 02:03 codecov[bot]

What is this PR waiting on?

ashwin-pc avatar Mar 07 '24 19:03 ashwin-pc

@BionIT Migrate management related comment from #6014 to here and addressed them.

SuZhou-Joe avatar Mar 08 '24 09:03 SuZhou-Joe

What is this PR waiting on?

Change to ready for review. Was working on how to test the PR.

SuZhou-Joe avatar Mar 08 '24 16:03 SuZhou-Joe

change to draft as we are investigating if to add such logic in server side.

SuZhou-Joe avatar Mar 13 '24 04:03 SuZhou-Joe