OpenSearch-Dashboards
OpenSearch-Dashboards copied to clipboard
[Workspace]Import sample data to current workspace
Description
For now, the import sample data page is a sub page under home application. The home application is not visible inside specific workspace. This PR separate import sample data page and register it as a new standalone application. Then import sample data page can be used inside workspace. This PR added a new entry point for import sample data in workspace overview page. User can visit import sample data page by this link quickly.
Issues Resolved
#6106
Screenshot
The sample data can be imported to specific workspace.
Testing the changes
Since switch workspace by manually wasn't support in current main branch. We need to apply some patch to testing all the changes.
- Checkout the branch code and run
yarn osd bootstrap
- enable workspace and start OSD server
- add
workspace.enabled: true
andsavedObjects.permission.enabled: true
to theconfig/opensearch_dashboards.yml
to enable workspace feature flag - run
yarn start --no-base-path
start OSD server to make sure no random base path will be appended
-
Navigate to workspace creator page and create a test workspace
-
Click left dropdown switch to created workspace
-
Click "Discover pre-loaded datasets before adding your own." to visit workspace's Add sample data page
-
Click all
Add data
button, all sample data will be imported like below image
There will be four dashboards in current workspace.
-
Click
View data
to view imported dashboard like below image -
Create another workspace, and visit another workspace's add sample data page like step 4 & 5.
The sample data was not import in the new workspace.
- Switch back to the first workspace, click remove button, the sample data will be removed like below image
The
[Flights] Global Flight Dashboard
will be removed in this workspace like above image.
Changelog
- feat: [Workspace]Import sample data to current workspace
Check List
- [ ] All tests pass
- [x]
yarn test:jest
- [x]
yarn test:jest_integration
- [x]
- [ ] New functionality includes testing.
- [ ] New functionality has been documented.
- [ ] Update CHANGELOG.md
- [x] Commits are signed per the DCO using --signoff
Codecov Report
Attention: Patch coverage is 83.90805%
with 14 lines
in your changes are missing coverage. Please review.
Project coverage is 67.37%. Comparing base (
54b5eb5
) to head (9a2bd3e
).
Additional details and impacted files
@@ Coverage Diff @@
## main #6105 +/- ##
==========================================
- Coverage 67.55% 67.37% -0.19%
==========================================
Files 3428 3443 +15
Lines 67344 67762 +418
Branches 10996 11024 +28
==========================================
+ Hits 45497 45653 +156
- Misses 19177 19439 +262
Partials 2670 2670
Flag | Coverage Ξ | |
---|---|---|
Linux_1 | 33.04% <7.69%> (-0.01%) |
:arrow_down: |
Linux_2 | 55.13% <ΓΈ> (ΓΈ) |
|
Linux_3 | 45.15% <7.69%> (-0.01%) |
:arrow_down: |
Linux_4 | 34.81% <83.90%> (+0.08%) |
:arrow_up: |
Windows_1 | 33.06% <7.69%> (-0.01%) |
:arrow_down: |
Windows_2 | 55.10% <ΓΈ> (ΓΈ) |
|
Windows_3 | 45.16% <7.69%> (-0.02%) |
:arrow_down: |
Windows_4 | 34.81% <83.90%> (+0.08%) |
: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.
β Invalid Changelog Heading
The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.
β Invalid Changelog Heading
The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.
β Invalid Changelog Heading
The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.
β Invalid Changelog Heading
The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.
β Invalid Changelog Heading
The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.
β Invalid Prefix For Manual Changeset Creation
Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.
If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.
β Invalid Prefix For Manual Changeset Creation
Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.
If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.
β Changeset File Must Not Exist With Skip Entry
Changeset file 6105.yml under folder changelogs/fragments must not exist if ##Changelog section in PR description includes a "skip" entry option. Please remove the changeset file and try again.
β Changeset File Must Not Exist With Skip Entry
Changeset file 6105.yml under folder changelogs/fragments must not exist if ##Changelog section in PR description includes a "skip" entry option. Please remove the changeset file and try again.
β Invalid Prefix For Manual Changeset Creation
Invalid description prefix. Found "[Workspace]Import sample data to current workspace". Only "skip" entry option is permitted for manual commit of changeset files.
If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.
β Invalid Prefix For Manual Changeset Creation
Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.
If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.
Is it workspace.enabled: true
? maybe you need to update your test steps in above
add workspace.enabled=true to the config/opensearch_dashboards.yml to enable workspace feature flag
@wanglam do you have a chance to verify the all different cases for import sample data. And how to work with MDS to add sample data too
- user1 not link to any workspace, does user1 see the workspace sample indices from users who link to workspace and created sample indices?
- user2 create workspace and import sample data, does user2 can see the user1's sample data
- user3 create workspace and import sample data, and add user2 to user3's works space, does user2 can see user3's imported sample data? I tried to assign other users to the created workspace, but cannot find where to add, do you have any introduction for assign user to workspace?
Thanks
@wanglam do you have a chance to verify the all different cases for import sample data. And how to work with MDS to add sample data too
- user1 not link to any workspace, does user1 see the workspace sample indices from users who link to workspace and created sample indices?
- user2 create workspace and import sample data, does user2 can see the user1's sample data
- user3 create workspace and import sample data, and add user2 to user3's works space, does user2 can see user3's imported sample data? I tried to assign other users to the created workspace, but cannot find where to add, do you have any introduction for assign user to workspace?
Thanks
Sure. I think these three cases would work fine. I will test them. For add user to created workspace, you can follow the test steps of this PR. First of all we need to add savedObjects.permission.enabled: true
to the config/opensearch_dashboards.yml
file. Then the permission tab will be exists in the workspace create / update form.
For update existing workspace, we can go to the workspace list page. Then click the pencil icon, we will navigate to the workspace update page. Click the Users & Permissions
tab in the workspace update page, and then we can add new user to workspace by clicking "Add new" button under Users section like below image:
@wanglam do you have a chance to verify the all different cases for import sample data. And how to work with MDS to add sample data too
- user1 not link to any workspace, does user1 see the workspace sample indices from users who link to workspace and created sample indices?
- user2 create workspace and import sample data, does user2 can see the user1's sample data
- user3 create workspace and import sample data, and add user2 to user3's works space, does user2 can see user3's imported sample data? I tried to assign other users to the created workspace, but cannot find where to add, do you have any introduction for assign user to workspace?
Thanks
Hi @Flyingliuhub , I've tested these three scenarios in my local. Here are all the findings:
First of all, for all imported saved objects to specific workspace can be found in Dashboards Management -> Saved Objects
list. So for import sample data to workspace, it means these data can be displayed in the dashboards and visualizations list.
- For scenario 1, since all imported sample data share the same data index. The user1 can see the imported data indices whatever imported from workspace or out of workspace
- For scenario 2, user2 won't see user1 imported sample saved objects includes index patterns, visualizations and dashboards if user1 and user2 not in the same workspace. user2 can't see user1's workspace.
- For scenario 3, user3 will see user2 imported sample saved objects after user2 be assigned to the same workspace.