{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/187994137","pull_request_review_id":119883795,"id":187994137,"diff_hunk":"@@ -65,31 +53,45 @@ export class VisualizeEmbeddable extends Embeddable  {\n         this.uiState.set(key, customization[key]);\n       });\n       this.customization = customization;\n-      isDirty = true;\n       this.uiState.on('change', this._uiStateChangeHandler);\n     }\n+  }\n \n+  /**\n+   * Retrieve the panel title for this panel from the container state.\n+   * This will either return the overwritten panel title or the visualization title.\n+   */\n+  getPanelTitle(containerState) {\n     let derivedPanelTitle = '';\n     if (!containerState.hidePanelTitles) {\n       derivedPanelTitle = containerState.customTitle !== undefined ?\n         containerState.customTitle :\n         this.savedVisualization.title;\n     }\n+    return derivedPanelTitle;\n+  }\n+\n+  onContainerStateChanged(containerState) {\n+    this.transferCustomizationsToUiState(containerState);\n+\n+    const updatedParams = {};\n+\n+    // Check if timerange has changed\n+    if (containerState.timeRange !== this.timeRange) {\n+      updatedParams.timeRange = containerState.timeRange;\n+      this.timeRange = containerState.timeRange;\n+    }\n \n+    const derivedPanelTitle = this.getPanelTitle(containerState);\n     if (this.panelTitle !== derivedPanelTitle) {\n+      updatedParams.dataAttrs = {\n+        title: derivedPanelTitle,\n+      };\n       this.panelTitle = derivedPanelTitle;\n-      isDirty = true;\n     }\n \n-    if (isDirty && this.handler && this.domNode) {\n-      // TODO: We need something like this in the handler\n-      // this.handler.update(this.getHandlerParams());\n-      // For now:\n-      this.destroy();\n-      this.handler = this.loader.embedVisualizationWithSavedObject(\n-        this.domNode,\n-        this.savedVisualization,\n-        this.getHandlerParams());\n+    if (this.handler && Object.keys(updatedParams).length > 0) {","path":"src/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable.js","position":88,"original_position":88,"commit_id":"c04ee640f13ec715e400f3d4ba0dd016bfd20f1b","original_commit_id":"c04ee640f13ec715e400f3d4ba0dd016bfd20f1b","user":{"login":"chrisdavies","id":833377,"avatar_url":"https://avatars0.githubusercontent.com/u/833377?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisdavies","html_url":"https://github.com/chrisdavies","followers_url":"https://api.github.com/users/chrisdavies/followers","following_url":"https://api.github.com/users/chrisdavies/following{/other_user}","gists_url":"https://api.github.com/users/chrisdavies/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdavies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdavies/subscriptions","organizations_url":"https://api.github.com/users/chrisdavies/orgs","repos_url":"https://api.github.com/users/chrisdavies/repos","events_url":"https://api.github.com/users/chrisdavies/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdavies/received_events","type":"User","site_admin":false},"body":"Possibly better expression of intent: `if (this.handler && !_.isEmpty(updatedParams)) {`","created_at":"2018-05-14T15:21:49Z","updated_at":"2018-05-14T15:34:33Z","html_url":"https://github.com/elastic/kibana/pull/19030#discussion_r187994137","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/19030","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/187994137"},"html":{"href":"https://github.com/elastic/kibana/pull/19030#discussion_r187994137"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/19030"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/19030","id":187783859,"html_url":"https://github.com/elastic/kibana/pull/19030","diff_url":"https://github.com/elastic/kibana/pull/19030.diff","patch_url":"https://github.com/elastic/kibana/pull/19030.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/19030","number":19030,"state":"open","locked":false,"title":"Add a update function to visualize loader","user":{"login":"timroes","id":877229,"avatar_url":"https://avatars0.githubusercontent.com/u/877229?v=4","gravatar_id":"","url":"https://api.github.com/users/timroes","html_url":"https://github.com/timroes","followers_url":"https://api.github.com/users/timroes/followers","following_url":"https://api.github.com/users/timroes/following{/other_user}","gists_url":"https://api.github.com/users/timroes/gists{/gist_id}","starred_url":"https://api.github.com/users/timroes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timroes/subscriptions","organizations_url":"https://api.github.com/users/timroes/orgs","repos_url":"https://api.github.com/users/timroes/repos","events_url":"https://api.github.com/users/timroes/events{/privacy}","received_events_url":"https://api.github.com/users/timroes/received_events","type":"User","site_admin":false},"body":"This adds a `update` method to the loader, so you can change some properties after embedding without needing to recreate the visualization.\r\n\r\nIt also makes use of this method inside the `visualize_embeddable` for the dashboard.","created_at":"2018-05-14T10:32:03Z","updated_at":"2018-05-14T15:34:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca2a950d623c2131241ab284dce1d9cb7c0a56f9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ppisljar","id":13629809,"avatar_url":"https://avatars2.githubusercontent.com/u/13629809?v=4","gravatar_id":"","url":"https://api.github.com/users/ppisljar","html_url":"https://github.com/ppisljar","followers_url":"https://api.github.com/users/ppisljar/followers","following_url":"https://api.github.com/users/ppisljar/following{/other_user}","gists_url":"https://api.github.com/users/ppisljar/gists{/gist_id}","starred_url":"https://api.github.com/users/ppisljar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppisljar/subscriptions","organizations_url":"https://api.github.com/users/ppisljar/orgs","repos_url":"https://api.github.com/users/ppisljar/repos","events_url":"https://api.github.com/users/ppisljar/events{/privacy}","received_events_url":"https://api.github.com/users/ppisljar/received_events","type":"User","site_admin":false},{"login":"Stacey-Gammon","id":16563603,"avatar_url":"https://avatars3.githubusercontent.com/u/16563603?v=4","gravatar_id":"","url":"https://api.github.com/users/Stacey-Gammon","html_url":"https://github.com/Stacey-Gammon","followers_url":"https://api.github.com/users/Stacey-Gammon/followers","following_url":"https://api.github.com/users/Stacey-Gammon/following{/other_user}","gists_url":"https://api.github.com/users/Stacey-Gammon/gists{/gist_id}","starred_url":"https://api.github.com/users/Stacey-Gammon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stacey-Gammon/subscriptions","organizations_url":"https://api.github.com/users/Stacey-Gammon/orgs","repos_url":"https://api.github.com/users/Stacey-Gammon/repos","events_url":"https://api.github.com/users/Stacey-Gammon/events{/privacy}","received_events_url":"https://api.github.com/users/Stacey-Gammon/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":357010813,"url":"https://api.github.com/repos/elastic/kibana/labels/:Dashboard","name":":Dashboard","color":"009800","default":false},{"id":764613366,"url":"https://api.github.com/repos/elastic/kibana/labels/:Vis%20Loader","name":":Vis Loader","color":"0e8a16","default":false},{"id":462161355,"url":"https://api.github.com/repos/elastic/kibana/labels/:Visualizations","name":":Visualizations","color":"fef2c0","default":false},{"id":836553987,"url":"https://api.github.com/repos/elastic/kibana/labels/enhancement","name":"enhancement","color":"04874c","default":true},{"id":883958396,"url":"https://api.github.com/repos/elastic/kibana/labels/v6.4.0","name":"v6.4.0","color":"ffffff","default":false},{"id":654061976,"url":"https://api.github.com/repos/elastic/kibana/labels/v7.0.0","name":"v7.0.0","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/19030/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/19030/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/19030/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/c04ee640f13ec715e400f3d4ba0dd016bfd20f1b","head":{"label":"timroes:update-loader","ref":"update-loader","sha":"c04ee640f13ec715e400f3d4ba0dd016bfd20f1b","user":{"login":"timroes","id":877229,"avatar_url":"https://avatars0.githubusercontent.com/u/877229?v=4","gravatar_id":"","url":"https://api.github.com/users/timroes","html_url":"https://github.com/timroes","followers_url":"https://api.github.com/users/timroes/followers","following_url":"https://api.github.com/users/timroes/following{/other_user}","gists_url":"https://api.github.com/users/timroes/gists{/gist_id}","starred_url":"https://api.github.com/users/timroes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timroes/subscriptions","organizations_url":"https://api.github.com/users/timroes/orgs","repos_url":"https://api.github.com/users/timroes/repos","events_url":"https://api.github.com/users/timroes/events{/privacy}","received_events_url":"https://api.github.com/users/timroes/received_events","type":"User","site_admin":false},"repo":{"id":30105345,"name":"kibana","full_name":"timroes/kibana","owner":{"login":"timroes","id":877229,"avatar_url":"https://avatars0.githubusercontent.com/u/877229?v=4","gravatar_id":"","url":"https://api.github.com/users/timroes","html_url":"https://github.com/timroes","followers_url":"https://api.github.com/users/timroes/followers","following_url":"https://api.github.com/users/timroes/following{/other_user}","gists_url":"https://api.github.com/users/timroes/gists{/gist_id}","starred_url":"https://api.github.com/users/timroes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timroes/subscriptions","organizations_url":"https://api.github.com/users/timroes/orgs","repos_url":"https://api.github.com/users/timroes/repos","events_url":"https://api.github.com/users/timroes/events{/privacy}","received_events_url":"https://api.github.com/users/timroes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timroes/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/timroes/kibana","forks_url":"https://api.github.com/repos/timroes/kibana/forks","keys_url":"https://api.github.com/repos/timroes/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timroes/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timroes/kibana/teams","hooks_url":"https://api.github.com/repos/timroes/kibana/hooks","issue_events_url":"https://api.github.com/repos/timroes/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/timroes/kibana/events","assignees_url":"https://api.github.com/repos/timroes/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/timroes/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/timroes/kibana/tags","blobs_url":"https://api.github.com/repos/timroes/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timroes/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timroes/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/timroes/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timroes/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/timroes/kibana/languages","stargazers_url":"https://api.github.com/repos/timroes/kibana/stargazers","contributors_url":"https://api.github.com/repos/timroes/kibana/contributors","subscribers_url":"https://api.github.com/repos/timroes/kibana/subscribers","subscription_url":"https://api.github.com/repos/timroes/kibana/subscription","commits_url":"https://api.github.com/repos/timroes/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/timroes/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/timroes/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/timroes/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/timroes/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/timroes/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timroes/kibana/merges","archive_url":"https://api.github.com/repos/timroes/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timroes/kibana/downloads","issues_url":"https://api.github.com/repos/timroes/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/timroes/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/timroes/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/timroes/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timroes/kibana/labels{/name}","releases_url":"https://api.github.com/repos/timroes/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/timroes/kibana/deployments","created_at":"2015-01-31T07:05:20Z","updated_at":"2016-12-17T07:34:21Z","pushed_at":"2018-05-14T14:53:28Z","git_url":"git://github.com/timroes/kibana.git","ssh_url":"git@github.com:timroes/kibana.git","clone_url":"https://github.com/timroes/kibana.git","svn_url":"https://github.com/timroes/kibana","homepage":"http://www.elasticsearch.org/overview/kibana/","size":364518,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"0f8a00304b42909a6154950ac6704a97a6246eb9","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2018-05-14T14:38:37Z","pushed_at":"2018-05-14T15:24:45Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":384951,"stargazers_count":9340,"watchers_count":9340,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3627,"mirror_url":null,"archived":false,"open_issues_count":3099,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":3627,"open_issues":3099,"watchers":9340,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/19030"},"html":{"href":"https://github.com/elastic/kibana/pull/19030"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/19030"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/19030/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/19030/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/19030/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/c04ee640f13ec715e400f3d4ba0dd016bfd20f1b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chrisdavies"}}