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

[VisBuilder-Next] Migrate legacy visualizations to visbuilder by mapping the url #7529

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

SheyGao
Copy link
Contributor

@SheyGao SheyGao commented Jul 26, 2024

Description

In this PR, we aim to migrate legacy visualization objects compatible with VisBuilder to VisBuilder objects, enabling users to directly open these legacy objects in VisBuilder. The method involves constructing a URL that navigates directly to the VisBuilder page rendering the object. Key changes to the existing codebase include:

  1. Adding a new function, visbuilderEditItem, triggered when users click the Import to VisBuilder button. This function takes a legacy visualization item as input, migrating the states from the visualization object to those required in the VisBuilder URL by calling constructVisBuilderPath, and then navigates to the VisBuilder app with the constructed path to complete the migration.
  2. Modifying the existing user interface in Visualize, allowing users to click Editto open the object in its original format or Import to VisBuilder to open it in VisBuilder, instead of only having the Edit option previously.

Issues Resolved

Screenshot

  1. Migrating an existing area-type legacy visualization object.
Screen.Recording.2024-08-01.at.12.47.47.PM.mov
  1. Migrating a newly created line chart.
Screen.Recording.2024-07-31.at.6.42.50.PM.mov

Testing the changes

For testing purposes, we have added unit tests for two files: edit_action_dropdown.test.tsx to verify the updated UI changes, and migrate_url.test.tsx to validate the migration URL functionality. Additional functional tests will be included in a different repository.

Changelog

  • feat: [VisBuilder-Next] Migration of legacy visualizations to VisBuilder by constructing the URL.

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

Copy link
Contributor

ℹ️ Manual Changeset Creation Reminder

Please ensure manual commit for changeset file 7529.yml under folder changelogs/fragments to complete this PR.

If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link.

For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool.

@SheyGao SheyGao changed the title Url [Draft] Migrate legacy visualizations to visbuilder by mapping the url Jul 26, 2024
Copy link
Contributor

❌ Changeset File Not Added Yet

Please ensure manual commit for changeset file 7529.yml under folder changelogs/fragments to complete this PR. File still missing.

@SheyGao SheyGao force-pushed the url branch 2 times, most recently from 044f558 to 0bfcd1a Compare July 26, 2024 23:09
ananzh
ananzh previously approved these changes Aug 19, 2024
joshuali925
joshuali925 previously approved these changes Aug 19, 2024
Shey Gao added 2 commits August 22, 2024 22:36
Signed-off-by: Shey Gao <[email protected]>
Signed-off-by: Shey Gao <[email protected]>
Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

general question for core team, with force pushes i find it hard to tell what the delta is comparing to the last time i reviewed. Is there a good way to see what changed?

doing a direct .. comparison shows a lot more upstream changes through rebase rather than changes brought by this PR: https://github.com/opensearch-project/OpenSearch-Dashboards/compare/836974a163480915278a090fc0c955243b138d61..a5149689f199a2fabb19f02daf39674a7eea96d9

@LDrago27 LDrago27 merged commit 2313372 into opensearch-project:main Aug 23, 2024
66 of 67 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7529-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 231337231be2ad98f7086b154de43339205f9ca6
# Push it to GitHub
git push --set-upstream origin backport/backport-7529-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7529-to-2.x.

SheyGao added a commit to SheyGao/OpenSearch-Dashboards that referenced this pull request Aug 23, 2024
…ing the url (opensearch-project#7529)

* migration of visualization objects to visbuilder
Signed-off-by: Shey Gao <[email protected]>

* update layover

Signed-off-by: Shey Gao <[email protected]>

* fixed a bug

Signed-off-by: Shey Gao <[email protected]>

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

---------

Signed-off-by: Shey Gao <[email protected]>
Co-authored-by: Shey Gao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 2313372)
LDrago27 pushed a commit to SheyGao/OpenSearch-Dashboards that referenced this pull request Aug 26, 2024
…ing the url (opensearch-project#7529)

* migration of visualization objects to visbuilder
Signed-off-by: Shey Gao <[email protected]>

* update layover

Signed-off-by: Shey Gao <[email protected]>

* fixed a bug

Signed-off-by: Shey Gao <[email protected]>

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

---------

Signed-off-by: Shey Gao <[email protected]>
Co-authored-by: Shey Gao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 2313372)
ashwin-pc pushed a commit that referenced this pull request Aug 30, 2024
…ing the url (#7529) (#7832)

* migration of visualization objects to visbuilder
Signed-off-by: Shey Gao <[email protected]>

* update layover

Signed-off-by: Shey Gao <[email protected]>

* fixed a bug

Signed-off-by: Shey Gao <[email protected]>

* Changeset file for PR #7529 created/updated

---------

Signed-off-by: Shey Gao <[email protected]>
Co-authored-by: Shey Gao <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 2313372)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x enhancement New feature or request first-time-contributor v2.17.0 visbuilder-next visbuilder with vega integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants