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

[Workspace][Data Source] Support data source assignment in workspace

Open raintygao opened this issue 1 year ago • 1 comments

Description

  1. Add data source assignment in workspace create/update page.
  2. Add addToWorkspaces and deleteFromWorkspaces method in savedObject client.
  3. Update savedObject update/bulkUpdate in savedObject client and repository to support update workspace field.

Screenshot

https://github.com/opensearch-project/OpenSearch-Dashboards/assets/42465692/7e2a7b89-4d01-42d7-b6a3-dcac5e4adf18

image

Testing the changes

  1. Use find API to find any data sources and what workspaces they belong to. http://localhost:6601/w/${OSD_ID}/api/saved_objects/_find?fields=id&fields=title&fields=workspaces&per_page=10000&type=data-source&workspaces=*

  2. Enter workspace create/update page to create workspaces and assign data sources or update and assign data sources.

  3. Enter workspace update page or use find API to find that data source have been assigned to specific workspace. http://localhost:6601/w/${OSD_ID}/api/saved_objects/_find?fields=id&fields=title&fields=workspaces&per_page=10000&type=data-source&workspaces=${WORKSPACE_ID}

Changelog

  • feat: Support data source assignment in 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

raintygao avatar Jun 25 '24 09:06 raintygao

Codecov Report

Attention: Patch coverage is 89.31298% with 14 lines in your changes missing coverage. Please review.

Project coverage is 67.56%. Comparing base (417246b) to head (5004aee). Report is 351 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/workspace/server/routes/index.ts 22.22% 7 Missing :warning:
...onents/workspace_form/select_data_source_panel.tsx 91.30% 0 Missing and 2 partials :warning:
src/plugins/workspace/server/workspace_client.ts 91.30% 0 Missing and 2 partials :warning:
...rver/saved_objects/service/saved_objects_client.ts 94.44% 0 Missing and 1 partial :warning:
...components/workspace_creator/workspace_creator.tsx 80.00% 0 Missing and 1 partial :warning:
...components/workspace_updater/workspace_updater.tsx 90.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7101      +/-   ##
==========================================
+ Coverage   67.50%   67.56%   +0.06%     
==========================================
  Files        3468     3469       +1     
  Lines       68402    68508     +106     
  Branches    11117    11141      +24     
==========================================
+ Hits        46174    46287     +113     
+ Misses      19532    19515      -17     
- Partials     2696     2706      +10     
Flag Coverage Δ
Linux_1 33.17% <70.22%> (+0.12%) :arrow_up:
Linux_2 55.25% <96.15%> (+0.04%) :arrow_up:
Linux_3 45.31% <0.00%> (-0.04%) :arrow_down:
Linux_4 34.73% <7.69%> (-0.02%) :arrow_down:
Windows_1 33.19% <70.22%> (+0.12%) :arrow_up:
Windows_2 55.20% <96.15%> (+0.04%) :arrow_up:
Windows_3 45.32% <0.00%> (-0.03%) :arrow_down:
Windows_4 34.73% <7.69%> (-0.02%) :arrow_down:

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 Jun 25 '24 09:06 codecov[bot]