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] Add workspace column to saved objects page #6225

Merged
merged 12 commits into from
Apr 3, 2024

Conversation

Hailong-am
Copy link
Contributor

@Hailong-am Hailong-am commented Mar 20, 2024

Description

This PR will add workspaces column to saved objects page when workspace feature enabled, the workspaces column will show the workspace names which the saved object belongs to.

Issues Resolved

partial of #6098 #4944

Screenshot

image

Testing the changes

  1. Start OpenSearch Dashboards with workspace feature enabled yarn start --workspace.enabled=true
  2. Create test workspace and import sample data
curl --request POST \
  --url http://localhost:5601/api/workspaces \
  --header 'Content-Type: application/json' \
  --header 'osd-xsrf: 1' \
  --data '{
 "attributes": {
  "name": "my-test-workspace",
  "features": ["*"]
 }
}'

# response
{
 "success": true,
 "result": {
  "id": "yRJbeT"
 }
}

Add existing saved objects to workspace just created

POST .kibana/_update_by_query
{
  "query": {
    "term": {
      "type": {
        "value": "dashboard"
      }
    }
  },
  "script": {
    "source": """
    ctx._source.workspaces = ['yRJbeT'];
    """,
    "lang": "painless"
  }
}
  1. Open saved objects page http://localhost:5601/app/management/opensearch-dashboards/objects to see the result

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

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

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

Project coverage is 67.48%. Comparing base (8810f08) to head (af597eb).

Files Patch % Lines
...ment_section/objects_table/saved_objects_table.tsx 72.72% 3 Missing ⚠️
...agement_section/objects_table/components/table.tsx 77.77% 0 Missing and 2 partials ⚠️
...c/components/workspace_column/workspace_column.tsx 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6225      +/-   ##
==========================================
+ Coverage   67.47%   67.48%   +0.01%     
==========================================
  Files        3368     3370       +2     
  Lines       65431    65465      +34     
  Branches    10560    10563       +3     
==========================================
+ Hits        44147    44177      +30     
- Misses      18713    18716       +3     
- Partials     2571     2572       +1     
Flag Coverage Δ
Linux_1 32.17% <77.77%> (+0.03%) ⬆️
Linux_2 55.58% <ø> (ø)
Linux_3 44.90% <ø> (ø)
Linux_4 35.12% <75.00%> (+0.04%) ⬆️
Windows_1 32.20% <77.77%> (+0.03%) ⬆️
Windows_2 55.55% <ø> (ø)
Windows_3 44.92% <ø> (ø)
Windows_4 35.12% <75.00%> (+0.04%) ⬆️

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: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
ruanyl
ruanyl previously approved these changes Mar 22, 2024
Signed-off-by: Hailong Cui <ihailong@amazon.com>
@seraphjiang
Copy link
Member

seraphjiang commented Mar 23, 2024

@Hailong-am @ruanyl @xluo-aws @kgcreative @zengyan-amazon

Got some questions

  1. Is it the plan to support make one saved object could be belong to multiple workspace. If so, it make sense we see one object could have multiple workspaces information.
  2. Another question, in the left nav menu, we plan to let cx select a workspace right, suppose that will set current workspace context to all content/page on right side. do we still need to show workspace info in each page?

image

image

@Hailong-am
Copy link
Contributor Author

  • Is it the plan to support make one saved object could be belong to multiple workspace. If so, it make sense we see one object could have multiple workspaces information.
  1. share saved object to different workspace is not in MVP scope, but we might support this in future.
  2. when cx in home workspace means not in any workspace, cx could see all saved objects which cx have access across different workspaces, to have this column is helpful.

@Hailong-am Hailong-am requested a review from ruanyl March 27, 2024 00:47
@Flyingliuhub
Copy link
Member

Flyingliuhub commented Mar 27, 2024

@Hailong-am Did you have a chance to add the feature flag data_source.enabled: true when you were testing? Workspaces should work with multiple data sources in the near future, so please make sure that the workspace functions properly with the multiple data source feature.

Signed-off-by: Hailong Cui <ihailong@amazon.com>
@Hailong-am
Copy link
Contributor Author

@Hailong-am Did you have a chance to add the feature flag data_source.enabled: true when you were testing? Workspaces should work with multiple data sources in the near future, so please make sure that the workspace functions properly with the multiple data source feature.

@Flyingliuhub Good suggestion. Did a quick testing for both workspace and data_source enabled case, data source/index pattern associated with workspace display correctly.

image

Signed-off-by: Hailong Cui <ihailong@amazon.com>
@xinruiba
Copy link
Member

@Hailong-am Did you have a chance to add the feature flag data_source.enabled: true when you were testing? Workspaces should work with multiple data sources in the near future, so please make sure that the workspace functions properly with the multiple data source feature.

@Flyingliuhub Good suggestion. Did a quick testing for both workspace and data_source enabled case, data source/index pattern associated with workspace display correctly.

image

Thanks for the testing @Hailong-am. Would be good to also test MD scenarios~

  1. Create a remote dataSource
  2. Add sample data
  3. Check dashboard
  4. Remove sample data
  5. Update remote dataSource.

Thanks~

@Hailong-am
Copy link
Contributor Author

Thanks for the testing @Hailong-am. Would be good to also test MD scenarios~

  1. Create a remote dataSource
  2. Add sample data
  3. Check dashboard
  4. Remove sample data
  5. Update remote dataSource.

Thanks~

@xinruiba upload the video about the test steps
https://github.com/opensearch-project/OpenSearch-Dashboards/assets/113890546/ade45329-c713-4a68-976c-04cb3a8ddf2e

@xinruiba
Copy link
Member

Thanks for the testing @Hailong-am. Would be good to also test MD scenarios~

  1. Create a remote dataSource
  2. Add sample data
  3. Check dashboard
  4. Remove sample data
  5. Update remote dataSource.

Thanks~

@xinruiba upload the video about the test steps https://github.com/opensearch-project/OpenSearch-Dashboards/assets/113890546/ade45329-c713-4a68-976c-04cb3a8ddf2e

Appreciate, looks good to me~

@SuZhou-Joe SuZhou-Joe merged commit 7352365 into opensearch-project:main Apr 3, 2024
58 of 59 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 18, 2024
* Add workspace column into saved objects page

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* fix unit test

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add workspaceStart

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* merge main

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add changelog

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* address review comments

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* address review comments

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* address review comments

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
(cherry picked from commit 7352365)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
SuZhou-Joe pushed a commit that referenced this pull request Apr 18, 2024
* Add workspace column into saved objects page

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* fix unit test

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add workspaceStart

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* merge main

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add changelog

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* address review comments

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* address review comments

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* address review comments

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
(cherry picked from commit 7352365)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@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.

None yet

6 participants