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] Import sample data to specific workspace #6106

Closed
Tracked by #6941
wanglam opened this issue Mar 11, 2024 · 4 comments
Closed
Tracked by #6941

[Workspace] Import sample data to specific workspace #6106

wanglam opened this issue Mar 11, 2024 · 4 comments
Labels
enhancement New feature or request v2.15.0

Comments

@wanglam
Copy link
Contributor

wanglam commented Mar 11, 2024

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

@seraphjiang
Copy link
Member

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

@wanglam
Copy link
Contributor Author

wanglam commented Mar 12, 2024

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.

@ruanyl
Copy link
Member

ruanyl commented Jun 6, 2024

@wanglam Can we resolve this issue?

@ruanyl ruanyl added the v2.15.0 label Jun 6, 2024
@wanglam
Copy link
Contributor Author

wanglam commented Jun 6, 2024

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

@wanglam wanglam closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.15.0
Projects
None yet
Development

No branches or pull requests

4 participants