{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/comments/29371113","id":29371113,"diff_hunk":"@@ -32,66 +32,123 @@\n @homepage https://googlewebcomponents.github.io/google-analytics\n -->\n \n-<polymer-element\n-  name=\"google-analytics-dashboard\"\n-  extends=\"google-analytics-base\"\n-  on-analytics-dashboard-control-change=\"{{queryUpdated}}\">\n \n+<dom-module id=\"google-analytics-dashboard\">\n+  <style>\n+    .error {\n+      color: red;\n+      padding: 12px;\n+      background-color: #FBCCC9;\n+    }\n+  </style>\n   <template>\n-    <content></content>\n+    <template is=\"x-if\" if=\"{{hasError}}\">\n+      <div class=\"error\">{{parent.errorMessage}}</div>\n+    </template>\n+    <google-signin-aware \n+      on-google-signin-aware-success=\"signedIn\"\n+      on-google-signin-aware-signed-out=\"signedOut\"></google-signin-aware>\n+    <content id=\"content\"></content>\n   </template>\n-  <script>\n-\n-    Polymer('google-analytics-dashboard', {\n-\n-      ready: function() {\n-        /**\n-         * The `query` attribute represents the internal query object of this\n-         * dashboard. It is updated when control elements fire the\n-         * `analytics-dashboard-control-change` event and pass along query data.\n-         *\n-         * @attribute query\n-         * @type object\n-         */\n-        this.query = {};\n-\n-        this.updateChildren();\n+</dom-module>\n+<script>\n+\n+  Polymer({\n+\n+    is: 'google-analytics-dashboard', \n+\n+    properties: {\n+      query: {\n+        type: Object,\n+        value: function() { return {} }\n       },\n \n-      /**\n-       * The `queryUpdated` method is the callback for whenever the\n-       * `analytics-dashboard-control-change` event is fired. It updates the\n-       * query attribute, which is then sent to child charts.\n-       *\n-       * @method queryUpdated\n-       * @param {CustomEvent} event - The event with the query data.\n-       */\n-      queryUpdated: function(event) {\n-        // Update `this.query` with the passed event data.\n-        Object.keys(event.detail).forEach(function(key) {\n-          this.query[key] = event.detail[key];\n-        }.bind(this))\n+      authorized: {\n+        type: Boolean,\n+        value: false,\n+        reflectToAttribute: true\n+      },\n \n-        this.updateChildren();\n+      errorMessage: {\n+        type: String,\n+        value: ''\n       },\n \n+      hasError: {\n+        type: Boolean,\n+        computed: 'computeHasError(errorMessage)'\n+      }\n+    },\n+\n+    listeners: {\n+      'analytics-dashboard-control-change': 'queryUpdated',\n+      'analytics-query-error': 'handleQueryError'\n+    },\n+    ready: function() {\n       /**\n-       * The `updateChildren` method updates each of this dashboards\n-       * `<google-analytics-chart>` element with its current query value.\n+       * The `query` attribute represents the internal query object of this\n+       * dashboard. It is updated when control elements fire the\n+       * `analytics-dashboard-control-change` event and pass along query data.\n        *\n-       * @method updateChildren\n+       * @attribute query\n+       * @type object\n        */\n-      updateChildren: function() {\n-        var charts = this.querySelectorAll('google-analytics-chart');\n-        for (var i = 0, chart; chart = charts[i]; i++) {\n-          Object.keys(this.query).forEach(function(key) {\n-            chart[key] = this.query[key];\n-          }.bind(this));\n-        }\n-      }\n \n-    });\n-\n-  </script>\n-\n-</polymer-element>\n+     this.updateChildren();\n+    },\n+\n+    /**\n+     * The `queryUpdated` method is the callback for whenever the\n+     * `analytics-dashboard-control-change` event is fired. It updates the\n+     * query attribute, which is then sent to child charts.\n+     *\n+     * @method queryUpdated\n+     * @param {CustomEvent} event - The event with the query data.\n+     */\n+    queryUpdated: function(event) {\n+      // Update `this.query` with the passed event data.\n+      Object.keys(event.detail).forEach(function(key) {\n+        this.query[key] = event.detail[key];\n+      }.bind(this))\n+\n+      this.updateChildren();\n+    },\n+\n+    /**\n+     * The `updateChildren` method updates each of this dashboards\n+     * `<google-analytics-chart>` element with its current query value.\n+     *\n+     * @method updateChildren\n+     */\n+    updateChildren: function() {\n+      if (!this.authorized)\n+        return;\n+      var charts = Polymer.dom(this).querySelectorAll('google-analytics-chart');\n+      for (var i = 0, chart; chart = charts[i]; i++) {\n+        Object.keys(this.query).forEach(function(key) {\n+          chart[key] = this.query[key];\n+        }.bind(this));\n+      }\n+    },\n+    signedIn: function() {\n+      this.authorized = true;\n+      this.updateChildren();\n+    },\n+    signedOut: function() {\n+      this.authorized = false;\n+    },\n+    handleQueryError: function(ev) {","path":"google-analytics-dashboard.html","position":168,"original_position":168,"commit_id":"9ddb07d22dcb498976d399b2d8ba3c85a7862ab3","original_commit_id":"9ddb07d22dcb498976d399b2d8ba3c85a7862ab3","user":{"login":"atotic","id":127453,"avatar_url":"https://avatars.githubusercontent.com/u/127453?v=3","gravatar_id":"","url":"https://api.github.com/users/atotic","html_url":"https://github.com/atotic","followers_url":"https://api.github.com/users/atotic/followers","following_url":"https://api.github.com/users/atotic/following{/other_user}","gists_url":"https://api.github.com/users/atotic/gists{/gist_id}","starred_url":"https://api.github.com/users/atotic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atotic/subscriptions","organizations_url":"https://api.github.com/users/atotic/orgs","repos_url":"https://api.github.com/users/atotic/repos","events_url":"https://api.github.com/users/atotic/events{/privacy}","received_events_url":"https://api.github.com/users/atotic/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-04-29T19:25:38Z","updated_at":"2015-04-29T19:25:38Z","html_url":"https://github.com/GoogleWebComponents/google-analytics/pull/24#discussion_r29371113","pull_request_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/comments/29371113"},"html":{"href":"https://github.com/GoogleWebComponents/google-analytics/pull/24#discussion_r29371113"},"pull_request":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24","id":33726730,"html_url":"https://github.com/GoogleWebComponents/google-analytics/pull/24","diff_url":"https://github.com/GoogleWebComponents/google-analytics/pull/24.diff","patch_url":"https://github.com/GoogleWebComponents/google-analytics/pull/24.patch","issue_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/issues/24","number":24,"state":"open","locked":false,"title":"0.8 preview","user":{"login":"atotic","id":127453,"avatar_url":"https://avatars.githubusercontent.com/u/127453?v=3","gravatar_id":"","url":"https://api.github.com/users/atotic","html_url":"https://github.com/atotic","followers_url":"https://api.github.com/users/atotic/followers","following_url":"https://api.github.com/users/atotic/following{/other_user}","gists_url":"https://api.github.com/users/atotic/gists{/gist_id}","starred_url":"https://api.github.com/users/atotic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atotic/subscriptions","organizations_url":"https://api.github.com/users/atotic/orgs","repos_url":"https://api.github.com/users/atotic/repos","events_url":"https://api.github.com/users/atotic/events{/privacy}","received_events_url":"https://api.github.com/users/atotic/received_events","type":"User","site_admin":false},"body":"Lots of new code here. Removed google-analytics-base, because no inheritance.\r\ngoogle-analytics-setup is used instead.\r\ngoogle-dashboard is gone, replaced by x-autobind inside demo.html. It had fundamental event ordering isssues in 0.8, replacement was easier.\r\nEverything should work.","created_at":"2015-04-21T03:39:43Z","updated_at":"2015-04-29T19:25:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"547b49a518a41a854cc455719ec1307fb63cf6bd","assignee":{"login":"philipwalton","id":326742,"avatar_url":"https://avatars.githubusercontent.com/u/326742?v=3","gravatar_id":"","url":"https://api.github.com/users/philipwalton","html_url":"https://github.com/philipwalton","followers_url":"https://api.github.com/users/philipwalton/followers","following_url":"https://api.github.com/users/philipwalton/following{/other_user}","gists_url":"https://api.github.com/users/philipwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/philipwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipwalton/subscriptions","organizations_url":"https://api.github.com/users/philipwalton/orgs","repos_url":"https://api.github.com/users/philipwalton/repos","events_url":"https://api.github.com/users/philipwalton/events{/privacy}","received_events_url":"https://api.github.com/users/philipwalton/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24/commits","review_comments_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24/comments","review_comment_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/issues/24/comments","statuses_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/statuses/9ddb07d22dcb498976d399b2d8ba3c85a7862ab3","head":{"label":"atotic:0.8-preview","ref":"0.8-preview","sha":"9ddb07d22dcb498976d399b2d8ba3c85a7862ab3","user":{"login":"atotic","id":127453,"avatar_url":"https://avatars.githubusercontent.com/u/127453?v=3","gravatar_id":"","url":"https://api.github.com/users/atotic","html_url":"https://github.com/atotic","followers_url":"https://api.github.com/users/atotic/followers","following_url":"https://api.github.com/users/atotic/following{/other_user}","gists_url":"https://api.github.com/users/atotic/gists{/gist_id}","starred_url":"https://api.github.com/users/atotic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atotic/subscriptions","organizations_url":"https://api.github.com/users/atotic/orgs","repos_url":"https://api.github.com/users/atotic/repos","events_url":"https://api.github.com/users/atotic/events{/privacy}","received_events_url":"https://api.github.com/users/atotic/received_events","type":"User","site_admin":false},"repo":{"id":34009407,"name":"google-analytics","full_name":"atotic/google-analytics","owner":{"login":"atotic","id":127453,"avatar_url":"https://avatars.githubusercontent.com/u/127453?v=3","gravatar_id":"","url":"https://api.github.com/users/atotic","html_url":"https://github.com/atotic","followers_url":"https://api.github.com/users/atotic/followers","following_url":"https://api.github.com/users/atotic/following{/other_user}","gists_url":"https://api.github.com/users/atotic/gists{/gist_id}","starred_url":"https://api.github.com/users/atotic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atotic/subscriptions","organizations_url":"https://api.github.com/users/atotic/orgs","repos_url":"https://api.github.com/users/atotic/repos","events_url":"https://api.github.com/users/atotic/events{/privacy}","received_events_url":"https://api.github.com/users/atotic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/atotic/google-analytics","description":"Google Analytics web components","fork":true,"url":"https://api.github.com/repos/atotic/google-analytics","forks_url":"https://api.github.com/repos/atotic/google-analytics/forks","keys_url":"https://api.github.com/repos/atotic/google-analytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atotic/google-analytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atotic/google-analytics/teams","hooks_url":"https://api.github.com/repos/atotic/google-analytics/hooks","issue_events_url":"https://api.github.com/repos/atotic/google-analytics/issues/events{/number}","events_url":"https://api.github.com/repos/atotic/google-analytics/events","assignees_url":"https://api.github.com/repos/atotic/google-analytics/assignees{/user}","branches_url":"https://api.github.com/repos/atotic/google-analytics/branches{/branch}","tags_url":"https://api.github.com/repos/atotic/google-analytics/tags","blobs_url":"https://api.github.com/repos/atotic/google-analytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atotic/google-analytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atotic/google-analytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/atotic/google-analytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atotic/google-analytics/statuses/{sha}","languages_url":"https://api.github.com/repos/atotic/google-analytics/languages","stargazers_url":"https://api.github.com/repos/atotic/google-analytics/stargazers","contributors_url":"https://api.github.com/repos/atotic/google-analytics/contributors","subscribers_url":"https://api.github.com/repos/atotic/google-analytics/subscribers","subscription_url":"https://api.github.com/repos/atotic/google-analytics/subscription","commits_url":"https://api.github.com/repos/atotic/google-analytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/atotic/google-analytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/atotic/google-analytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/atotic/google-analytics/issues/comments{/number}","contents_url":"https://api.github.com/repos/atotic/google-analytics/contents/{+path}","compare_url":"https://api.github.com/repos/atotic/google-analytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atotic/google-analytics/merges","archive_url":"https://api.github.com/repos/atotic/google-analytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atotic/google-analytics/downloads","issues_url":"https://api.github.com/repos/atotic/google-analytics/issues{/number}","pulls_url":"https://api.github.com/repos/atotic/google-analytics/pulls{/number}","milestones_url":"https://api.github.com/repos/atotic/google-analytics/milestones{/number}","notifications_url":"https://api.github.com/repos/atotic/google-analytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atotic/google-analytics/labels{/name}","releases_url":"https://api.github.com/repos/atotic/google-analytics/releases{/id}","created_at":"2015-04-15T17:50:12Z","updated_at":"2015-04-15T17:50:12Z","pushed_at":"2015-04-29T18:24:44Z","git_url":"git://github.com/atotic/google-analytics.git","ssh_url":"git@github.com:atotic/google-analytics.git","clone_url":"https://github.com/atotic/google-analytics.git","svn_url":"https://github.com/atotic/google-analytics","homepage":null,"size":791,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleWebComponents:0.8-preview","ref":"0.8-preview","sha":"4ab5fd257459f34f1f3ed39b299c301b868d3169","user":{"login":"GoogleWebComponents","id":7328930,"avatar_url":"https://avatars.githubusercontent.com/u/7328930?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleWebComponents","html_url":"https://github.com/GoogleWebComponents","followers_url":"https://api.github.com/users/GoogleWebComponents/followers","following_url":"https://api.github.com/users/GoogleWebComponents/following{/other_user}","gists_url":"https://api.github.com/users/GoogleWebComponents/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleWebComponents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleWebComponents/subscriptions","organizations_url":"https://api.github.com/users/GoogleWebComponents/orgs","repos_url":"https://api.github.com/users/GoogleWebComponents/repos","events_url":"https://api.github.com/users/GoogleWebComponents/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleWebComponents/received_events","type":"Organization","site_admin":false},"repo":{"id":21027268,"name":"google-analytics","full_name":"GoogleWebComponents/google-analytics","owner":{"login":"GoogleWebComponents","id":7328930,"avatar_url":"https://avatars.githubusercontent.com/u/7328930?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleWebComponents","html_url":"https://github.com/GoogleWebComponents","followers_url":"https://api.github.com/users/GoogleWebComponents/followers","following_url":"https://api.github.com/users/GoogleWebComponents/following{/other_user}","gists_url":"https://api.github.com/users/GoogleWebComponents/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleWebComponents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleWebComponents/subscriptions","organizations_url":"https://api.github.com/users/GoogleWebComponents/orgs","repos_url":"https://api.github.com/users/GoogleWebComponents/repos","events_url":"https://api.github.com/users/GoogleWebComponents/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleWebComponents/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleWebComponents/google-analytics","description":"Google Analytics web components","fork":false,"url":"https://api.github.com/repos/GoogleWebComponents/google-analytics","forks_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/forks","keys_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/teams","hooks_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/hooks","issue_events_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/events","assignees_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/tags","blobs_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/languages","stargazers_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/stargazers","contributors_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/contributors","subscribers_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/subscribers","subscription_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/subscription","commits_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/merges","archive_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/downloads","issues_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/labels{/name}","releases_url":"https://api.github.com/repos/GoogleWebComponents/google-analytics/releases{/id}","created_at":"2014-06-20T06:05:00Z","updated_at":"2015-04-17T16:54:53Z","pushed_at":"2015-04-29T18:24:44Z","git_url":"git://github.com/GoogleWebComponents/google-analytics.git","ssh_url":"git@github.com:GoogleWebComponents/google-analytics.git","clone_url":"https://github.com/GoogleWebComponents/google-analytics.git","svn_url":"https://github.com/GoogleWebComponents/google-analytics","homepage":null,"size":1533,"stargazers_count":56,"watchers_count":56,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":6,"forks":23,"open_issues":6,"watchers":56,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24"},"html":{"href":"https://github.com/GoogleWebComponents/google-analytics/pull/24"},"issue":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/issues/24"},"comments":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleWebComponents/google-analytics/statuses/9ddb07d22dcb498976d399b2d8ba3c85a7862ab3"}}}}