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] Redirect "Sample data" link to the page in the same workspace #8330

Merged
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/8330.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Redirect sample data link to the page in the same workspace ([#8330](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8330))

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('dashboard listing table with no item', () => {

expect(component).toMatchSnapshot();
component.find(EuiLink).simulate('click');
expect(application.navigateToApp).toHaveBeenCalledTimes(1);

expect(application.navigateToApp).toHaveBeenCalledWith('import_sample_data');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,7 @@
defaultMessage="New to OpenSearch Dashboards? {sampleDataInstallLink} to take a test drive."
values={{
sampleDataInstallLink: (
<EuiLink
onClick={() =>
application.navigateToApp('home', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about call application.navigationToApp('import_sample_data') directly? Then we won't need so much modifications.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't know that. It's a much better way to do that, thanks!

path: '#/tutorial_directory/sampleData',
})
}
>
<EuiLink onClick={() => application.navigateToApp('import_sample_data')}>

Check warning on line 62 in src/plugins/dashboard/public/application/utils/get_no_items_message.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/dashboard/public/application/utils/get_no_items_message.tsx#L62

Added line #L62 was not covered by tests
<FormattedMessage
id="dashboard.listing.createNewDashboard.sampleDataInstallLinkText"
defaultMessage="Install some sample data"
Expand Down
Loading