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

Conversation

Kapian1234
Copy link
Contributor

@Kapian1234 Kapian1234 commented Sep 25, 2024

Description

Redirect "Sample data" link to the page in the same workspace

Issues Resolved

Screenshot

workspace enabled

Screen.Recording.2024-09-29.at.17.17.55.mov

workspace disabled

Screen.Recording.2024-09-29.at.17.18.27.mov

Testing the changes

yarn test:jest src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx

Changelog

  • fix: Redirect sample data link to the page in the same workspace

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

@@ -60,11 +62,9 @@ export const getNoItemsMessage = (
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!

Signed-off-by: Kapian1234 <[email protected]>
…nSearch-Dashboards into sample_data_link_redirect
Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: Kapian1234 <[email protected]>
import { Observable } from 'rxjs';
import { RecursiveReadonly } from '@osd/utility-types';
import { EuiLink } from '@elastic/eui';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Seems these import changes are not necessary, prefer to keep the original code.

Signed-off-by: Kapian1234 <[email protected]>
@SuZhou-Joe
Copy link
Member

@Kapian1234 Can we post a record on 2 scenarios:

  1. Workspace enabled and click the sample data link inside workspace
  2. Workspace disabled and click the sample data link outside workspace.

Copy link

codecov bot commented Sep 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.92%. Comparing base (9fd0f0b) to head (131f45d).
Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8330      +/-   ##
==========================================
- Coverage   64.14%   60.92%   -3.22%     
==========================================
  Files        3743     3750       +7     
  Lines       88836    89055     +219     
  Branches    13852    13910      +58     
==========================================
- Hits        56981    54260    -2721     
- Misses      31240    31432     +192     
- Partials      615     3363    +2748     
Flag Coverage Δ
Linux_1 28.86% <0.00%> (-1.21%) ⬇️
Linux_2 56.35% <ø> (-2.51%) ⬇️
Linux_3 37.75% <100.00%> (-2.61%) ⬇️
Linux_4 29.96% <0.00%> (-1.63%) ⬇️
Windows_1 28.87% <0.00%> (-1.21%) ⬇️
Windows_2 56.30% <ø> (-2.51%) ⬇️
Windows_3 37.76% <100.00%> (-2.61%) ⬇️
Windows_4 29.96% <0.00%> (-1.63%) ⬇️

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.

@Kapian1234
Copy link
Contributor Author

Kapian1234 commented Sep 29, 2024

@Kapian1234 Can we post a record on 2 scenarios:

  1. Workspace enabled and click the sample data link inside workspace
  2. Workspace disabled and click the sample data link outside workspace.

ok

ruanyl
ruanyl previously approved these changes Sep 29, 2024
@ruanyl
Copy link
Member

ruanyl commented Sep 29, 2024

@Kapian1234 snapshot test failed, please take a look.

@Kapian1234
Copy link
Contributor Author

@Kapian1234 snapshot test failed, please take a look.

ok

@Kapian1234
Copy link
Contributor Author

@Kapian1234 snapshot test failed, please take a look.

But it runs successfully on my local

@ruanyl
Copy link
Member

ruanyl commented Sep 29, 2024

@Kapian1234 snapshot test failed, please take a look.

But it runs successfully on my local

Running this failed on my local

yarn test:jest src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx

Signed-off-by: Kapian1234 <[email protected]>
@SuZhou-Joe SuZhou-Joe merged commit 81cab73 into opensearch-project:main Sep 30, 2024
66 of 68 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 30, 2024
…pace (#8330)

* Redirect Sample data link to the page in the same workspace

Signed-off-by: Kapian1234 <[email protected]>

* Changeset file for PR #8330 created/updated

* Optimize the code

Signed-off-by: Kapian1234 <[email protected]>

* Update unit test

Signed-off-by: Kapian1234 <[email protected]>

* Update unit test

Signed-off-by: Kapian1234 <[email protected]>

* Update unit test

Signed-off-by: Kapian1234 <[email protected]>

* update snapshot

Signed-off-by: Kapian1234 <[email protected]>

---------

Signed-off-by: Kapian1234 <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 81cab73)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl pushed a commit that referenced this pull request Sep 30, 2024
…pace (#8330) (#8385)

* Redirect Sample data link to the page in the same workspace



* Changeset file for PR #8330 created/updated

* Optimize the code



* Update unit test



* Update unit test



* Update unit test



* update snapshot



---------



(cherry picked from commit 81cab73)

Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Oct 3, 2024
…pace (opensearch-project#8330) (opensearch-project#8385)

* Redirect Sample data link to the page in the same workspace



* Changeset file for PR opensearch-project#8330 created/updated

* Optimize the code



* Update unit test



* Update unit test



* Update unit test



* update snapshot



---------



(cherry picked from commit 81cab73)

Signed-off-by: Kapian1234 <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[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.

4 participants