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

[Workspace] Import sample data to specific workspace

Open wanglam opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe.

~~When workspace plugin enabled, current import sample data feature will be break if you're in a specific workspace. The sample data won't be import to current workspace. The imported index patterns and dashboards won't be displayed. The Add data button will be hidden and the Remove button will always be displayed if user import sample data before.~~

The import sample data page is a sub page under home application. For now the home application is not visible inside specific workspace. So there is no entry for importing sample data page after enter specific workspace. It's not convenient for user to experience workspace features. It would be very valuable to add an entry for importing data in the workspace overview page.

Describe the solution you'd like

~~1. Pass current workspace id to import sample data install / uninstall / list API 2. Refactor getDataSourceIntegratedDashboard to getDashboardWithPrefix, support passing workspace id when checking overviewDashboard id. 3. Add getWorkspaceIntegratedSavedObjects, generate sample data with workspace id when installing and uninstalling~~

  1. Register import sample data as a standalone application
  2. Add import sample data entry point to workspace overview page
  3. Get workspace id from import sample data list / uninstall / list API request
  4. Add workspace id parameter to getDataSourceIntegratedDashboard
  5. Add workspace id parameter to getDataSourceIntegratedDefaultIndex
  6. Overwrite saved object id with workspace id prefix for pending import sample datas

Describe alternatives you've considered

N/A

Additional context

#4944

wanglam avatar Mar 11 '24 10:03 wanglam

There are two parts for sample data

  1. generated data which ingested to sample-ecommerce, opensearch_dashboards_sample_data_logs, opensearch_dashboards_sample_data_flights
  2. dashboards, visualizations for above data.

could we elaborate a little bit, which part is broken

image

cc: @bandinib-amzn @BionIT @Flyingliuhub

seraphjiang avatar Mar 11 '24 16:03 seraphjiang

Hi @seraphjiang, my issue was not clear. I'm very apologize for this. I think the first part would be fine when workspace enabled and in a specific workspace. The index for sample-ecommerce, opensearch_dashboards_sample_data_logs and opensearch_dashboards_sample_data_flights will be deleted and re-upload after supporting import sample data to different workspaces. Since the public saved object client will add current workspace id to all the CRUD methods if options.workspaces doesn't exists. It only return saved objects in current workspace when call public saved object client find method in front end page. So for sample data we need to bulkCreate with current workspace id when install sample data in specific workspace. Beside this, since the saved object id is unique, we need to generate saved object id the with current workspace id. Or the saved objects id will be conflict after importing to different workspaces.

wanglam avatar Mar 12 '24 16:03 wanglam

@wanglam Can we resolve this issue?

ruanyl avatar Jun 06 '24 02:06 ruanyl

Sure, since import sample data to workspace has been added in #6105 . We can close this issue.

wanglam avatar Jun 06 '24 02:06 wanglam