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

Use embeddable v2 #39126

Merged

Conversation

stacey-gammon
Copy link
Contributor

@stacey-gammon stacey-gammon commented Jun 17, 2019

For reviewers

dashboard_state_manager used to be the primary way the redux store was synced with app state. Redux was essentially replaced with the dashboard embeddable container. However rather than put this in dashboard state manager, the logic is split up between dashboard state manager and dashboard_app_controller. It's pretty illogical atm, but given that this entire flow needs some serious clean up, and that app state is going away, as is angular, I simply took the path of least resistance.

Moving forward I could see some next steps being:

  • Adding a migration from SavedDashboardPanel to DashboardPanelState. The former is what is stored in the PanelsJSON, the latter is what the DashboardEmbeddableContainer expects. Any previous ad hoc migration logic that used to exist inside the dashboard grid has been moved into the dashboard app (so the new DashboardEmbeddableContainer expects data in a certain format, users of the system are required to make sure they send it over in that particular format).

Dev Docs

Any plugins written on the old embeddable infrastructure will need to be updated to use the new embeddable infrastructure. The Embeddables API allows you to add your own custom UI components to a dashboard, without having to go through the visualization plugin system. This infrastructure is highly unstable at the moment. Expect this API to change frequently over the ensuing months.

@stacey-gammon stacey-gammon force-pushed the 2019-06-17-use-embeddable-v2 branch 6 times, most recently from c9aac2c to ea2ee21 Compare June 19, 2019 19:04
@elastic elastic deleted a comment from elasticmachine Jun 19, 2019
@elastic elastic deleted a comment from elasticmachine Jun 19, 2019
@elastic elastic deleted a comment from elasticmachine Jun 19, 2019
@elastic elastic deleted a comment from elasticmachine Jun 19, 2019
@elastic elastic deleted a comment from elasticmachine Jun 19, 2019
@stacey-gammon stacey-gammon force-pushed the 2019-06-17-use-embeddable-v2 branch 2 times, most recently from 4f15202 to 2f7a378 Compare June 19, 2019 19:49
@stacey-gammon stacey-gammon force-pushed the 2019-06-17-use-embeddable-v2 branch 3 times, most recently from 995e141 to 5c2b3ef Compare June 20, 2019 14:29
@stacey-gammon stacey-gammon added the release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. label Jun 20, 2019
@stacey-gammon stacey-gammon force-pushed the 2019-06-17-use-embeddable-v2 branch 6 times, most recently from 9122dd6 to bb66683 Compare June 21, 2019 19:51
@elasticmachine
Copy link
Contributor

💔 Build Failed

@stacey-gammon stacey-gammon force-pushed the 2019-06-17-use-embeddable-v2 branch 4 times, most recently from 9a378a7 to 7d8a782 Compare June 25, 2019 13:49
if (!_.isEqual(this._embeddableConfig.openTOCDetails, openTOCDetails)) {
embeddableConfigChanged = true;
this._embeddableConfig.openTOCDetails = openTOCDetails;
if (!this.input.isLayerTOCOpen
Copy link
Contributor

@nreese nreese Jul 11, 2019

Choose a reason for hiding this comment

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

!this.input.isLayerTOCOpen is not needed in this check and will fire updateInput every time input.isLayerTOCOpen is false even if the value did not change.

Should just be
if (this.input.isLayerTOCOpen !== isLayerTOCOpen)

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

lgtm
code review, tested in chrome

@stacey-gammon
Copy link
Contributor Author

Failed on Code Explore Repository Explore a repository Click file/directory on the file tree. I just merged master so I'm thinking this is flaky, and looks like it's failing in other prs too.

Screen Shot 2019-07-12 at 9 36 14 AM

jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@stacey-gammon
Copy link
Contributor Author

I think the dashboard filtering before all hook is flaky.

-: dashboard filtering
[00:06:47]               └-> "before all" hook
[00:06:47]               └-> "before all" hook
[00:06:47]                 │ debg gotoDashboardLandingPage
[00:06:47]                 │ debg onDashboardLandingPage
[00:06:47]                 │ debg TestSubjects.exists(dashboardLandingPage)
[00:06:47]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="dashboardLandingPage"]') with timeout=5000
[00:06:47]               └-: adding a filter that excludes all data
[00:06:47]                 └-> "before all" hook
[00:06:47]                 └-> "before all" hook
[00:06:47]                   │ debg TestSubjects.exists(newItemButton)
[00:06:47]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="newItemButton"]') with timeout=2500
[00:06:50]                   │ debg TestSubjects.click(createDashboardPromptButton)
[00:06:50]                   │ debg Find.clickByCssSelector('[data-test-subj~="createDashboardPromptButton"]') with timeout=10000
[00:06:50]                   │ debg Find.findByCssSelector('[data-test-subj~="createDashboardPromptButton"]') with timeout=10000
[00:07:01]                   │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj~="createDashboardPromptButton"])
[00:07:01]                   │      Wait timed out after 10190ms
[00:07:01]                   │ debg Find.findByCssSelector('[data-test-subj~="createDashboardPromptButton"]') with timeout=10000
[00:07:11]                   │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj~="createDashboardPromptButton"])
[00:07:11]                   │      Wait timed out after 10020ms
[00:07:12]                   │ debg Find.findByCssSelector('[data-test-subj~="createDashboardPromptButton"]') with timeout=10000
[00:07:22]                   │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj~="createDashboardPromptButton"])
[00:07:22]                   │      Wait timed out after 10529ms
[00:07:23]                   │ debg Find.findByCssSelector('[data-test-subj~="createDashboardPromptButton"]') with timeout=10000
[00:07:33]                   │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj~="createDashboardPromptButton"])
[00:07:33]                   │      Wait timed out after 10400ms
[00:07:34]                   │ debg Find.findByCssSelector('[data-test-subj~="createDashboardPromptButton"]') with timeout=10000
[00:07:44]                   │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj~="createDashboardPromptButton"])

Screen Shot 2019-07-12 at 10 59 33 AM

not sure if this PR exacerbates the issue, but given the screenshot and output above I don't see why it would. I don't know why it's failing either, the screenshot looks like the createDashboardPromptButton should have been found.

@stacey-gammon
Copy link
Contributor Author

Actually I think I see why that test is flaky.

    async clickNewDashboard() {
      // newItemButton button is only visible when dashboard listing table is displayed
      // (at least one dashboard).
      const exists = await testSubjects.exists('newItemButton');
      if (exists) {
        return await testSubjects.click('newItemButton');
      }

      // If no dashboards exist, then newItemButton to create a new dashboard.
      return await this.clickCreateDashboardPrompt();
    }

the page probably didn't finish loading so newItemButton didn't exist, which meant it tried to click the create new dashboard from the prompt, not the button in the table. This can be fixed in another PR, it's unrelated.

@stacey-gammon
Copy link
Contributor Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@stacey-gammon stacey-gammon merged commit 66b99ec into elastic:master Jul 12, 2019
stacey-gammon added a commit to stacey-gammon/kibana that referenced this pull request Jul 12, 2019
* Final Embeddable API V2 PR

* fix: import discover embeddable scss file

* address code review comments

* Add a functional test that would have caught the bug... will look to add a unit version once I discover the error.

* Fix bug cause by async loading calls and changes to parent input while child is being created. added jest test

* remove outdated readme in dashboard folder

* need to always refresh dashboard container, not just when "dirty"

* add a wait, this issue started appearing right when I added this to the test

* Remove test that kills kibana ci so it's not a blocker. jest test was added for this scenario

* fix issues when panel is added then removed before it completes loading

* fix logic error with maps embeddable and isLayerTOCOpen
stacey-gammon added a commit to stacey-gammon/kibana that referenced this pull request Jul 12, 2019
* Final Embeddable API V2 PR

* fix: import discover embeddable scss file

* address code review comments

* Add a functional test that would have caught the bug... will look to add a unit version once I discover the error.

* Fix bug cause by async loading calls and changes to parent input while child is being created. added jest test

* remove outdated readme in dashboard folder

* need to always refresh dashboard container, not just when "dirty"

* add a wait, this issue started appearing right when I added this to the test

* Remove test that kills kibana ci so it's not a blocker. jest test was added for this scenario

* fix issues when panel is added then removed before it completes loading

* fix logic error with maps embeddable and isLayerTOCOpen
stacey-gammon added a commit that referenced this pull request Jul 12, 2019
* Final Embeddable API V2 PR

* fix: import discover embeddable scss file

* address code review comments

* Add a functional test that would have caught the bug... will look to add a unit version once I discover the error.

* Fix bug cause by async loading calls and changes to parent input while child is being created. added jest test

* remove outdated readme in dashboard folder

* need to always refresh dashboard container, not just when "dirty"

* add a wait, this issue started appearing right when I added this to the test

* Remove test that kills kibana ci so it's not a blocker. jest test was added for this scenario

* fix issues when panel is added then removed before it completes loading

* fix logic error with maps embeddable and isLayerTOCOpen
alexwizp added a commit to alexwizp/kibana that referenced this pull request Jul 16, 2019
alexwizp added a commit to alexwizp/kibana that referenced this pull request Jul 17, 2019
alexwizp added a commit to alexwizp/kibana that referenced this pull request Jul 17, 2019
alexwizp added a commit that referenced this pull request Jul 18, 2019
* Use embeddable v2 - fix regression of #39126

* fix PR comment
alexwizp added a commit to alexwizp/kibana that referenced this pull request Jul 18, 2019
* Use embeddable v2 - fix regression of elastic#39126

* fix PR comment
alexwizp added a commit that referenced this pull request Jul 18, 2019
* Use embeddable v2 - fix regression of #39126

* fix PR comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features Feature:Embedding Embedding content via iFrame release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. review v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants