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 #1533

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

SheyGao
Copy link

@SheyGao SheyGao commented Aug 22, 2024

Description

Screenshots

  1. For non-compatible chart types (chart types other than 'Area', 'Line', 'Metric', 'Vertical Bar', and 'Table'), the 'Import to VisBuilder' option should not be shown on the panel after clicking the pencil icon.
Screen.Recording.2024-08-22.at.1.21.02.PM.mov
  1. For compatible chart types, the 'Import to VisBuilder' option should be shown on the panel after clicking the pencil icon.
Screen.Recording.2024-08-22.at.1.25.33.PM.mov
  1. After importing to VisBuilder, the breadcrumb should update to "New visualization."
Screen.Recording.2024-08-22.at.1.28.42.PM.mov
  1. Ensure the Save button is clickable and successfully saves the visualization after importing.
Screen.Recording.2024-08-22.at.1.33.33.PM.mov
  1. Confirm that filters, queries, chart types, configurations, and settings are successfully migrated after importing.
Screen.Recording.2024-08-22.at.1.42.18.PM.mov

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Shey Gao added 5 commits August 21, 2024 16:51
Signed-off-by: Shey Gao <[email protected]>
Signed-off-by: Shey Gao <[email protected]>
Signed-off-by: Shey Gao <[email protected]>
Signed-off-by: Shey Gao <[email protected]>
Signed-off-by: Shey Gao <[email protected]>
@@ -26,9 +26,15 @@ export const VB_LINE_VIS_TITLE = 'VB: Basic Line Chart';
export const VB_PATH_FIXTURE = 'dashboard/opensearch_dashboards/visBuilder/';
export const VB_PATH_INDEX_DATA = VB_PATH_FIXTURE + VB_INDEX_DATA;
export const VB_PATH_SO_DATA = VB_PATH_FIXTURE + VB_SO_DATA;
export const VISUALIZE_APP_PATH = '/app/visualize';
Copy link
Member

Choose a reason for hiding this comment

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

nit: should this go under

// App URL Paths section and the data paths here?

@@ -0,0 +1,4 @@
{"attributes":{"fields":"[{\"count\":0,\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"count\":0,\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"count\":0,\"name\":\"_score\",\"type\":\"number\",\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"_type\",\"type\":\"string\",\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"age\",\"type\":\"number\",\"esTypes\":[\"long\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"count\":0,\"name\":\"avatar\",\"type\":\"string\",\"esTypes\":[\"text\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"avatar.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"avatar\"}}},{\"count\":0,\"name\":\"birthdate\",\"type\":\"date\",\"esTypes\":[\"date\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"count\":0,\"name\":\"categories\",\"type\":\"string\",\"esTypes\":[\"text\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"categories.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"categories\"}}},{\"count\":0,\"name\":\"email\",\"type\":\"string\",\"esTypes\":[\"text\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"email.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"email\"}}},{\"count\":0,\"name\":\"password\",\"type\":\"string\",\"esTypes\":[\"text\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"password.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"password\"}}},{\"count\":0,\"name\":\"salary\",\"type\":\"number\",\"esTypes\":[\"long\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"count\":0,\"name\":\"timestamp\",\"type\":\"date\",\"esTypes\":[\"date\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"count\":0,\"name\":\"userId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"userId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"userId\"}}},{\"count\":0,\"name\":\"username\",\"type\":\"string\",\"esTypes\":[\"text\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"count\":0,\"name\":\"username.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"username\"}}}]","timeFieldName":"timestamp","title":"vis-builder"},"id":"a031e530-5a88-11ed-a595-f5e6ea9b3826","migrationVersion":{"index-pattern":"7.6.0"},"references":[],"type":"index-pattern","updated_at":"2022-11-02T08:30:36.803Z","version":"WzM3MCwxXQ=="}
Copy link
Member

@kavilla kavilla Aug 23, 2024

Choose a reason for hiding this comment

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

nit: do we think we should prepend legacy_ or something that gives more details sometimes in the future i imagine myself forgetting why we have two ndjson files in this folder and will help me distinguish the two without reading the test.

not a blocker

Copy link
Author

Choose a reason for hiding this comment

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

the other ndjson file is named vb_saved_objects.ndjson, which helps distinguish two files? visualization_saved_objects.ndjson is for legacy and vb_saved_objects.ndjson is for visbuilder

CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.deleteIndex(VB_INDEX_ID);
cy.bulkUploadDocs(VB_PATH_INDEX_DATA);
Copy link
Member

Choose a reason for hiding this comment

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

@LDrago27, i forget what was the suggestion with delete and insert? is this safe for runs with frequent write/deletes?

it('Show existing visualizations in Visualize and navigate to it', () => {
cy.visit(`${BASE_PATH}/app/visualize`);
cy.get('input[type="search"]').type(`${VB_METRIC_VIS_TITLE}{enter}`);
cy.get('.euiBasicTable-loading').should('not.exist'); // wait for the loading to stop
Copy link
Member

Choose a reason for hiding this comment

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

potential action item:

does euiBasicTable-loading have a test id in the page we use it? if not we could probably add one.

Copy link
Member

Choose a reason for hiding this comment

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

do we need to do a clean up after step?

@kavilla
Copy link
Member

kavilla commented Aug 23, 2024

lgtm! awesome thank you. just comments but none blockers.

Signed-off-by: Shey Gao <[email protected]>
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.

6 participants