| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2017 The LUCI Authors. All rights reserved. | 2 Copyright 2017 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="../../bower_components/app-layout/app-layout.html"> | 7 <link rel="import" href="../../bower_components/app-layout/app-layout.html"> |
| 8 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html"> | 8 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html"> |
| 9 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> | 9 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> |
| 10 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht
ml"> | 10 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht
ml"> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 }, | 126 }, |
| 127 | 127 |
| 128 query: { | 128 query: { |
| 129 type: String, | 129 type: String, |
| 130 observer: '_updateSearchResults' | 130 observer: '_updateSearchResults' |
| 131 }, | 131 }, |
| 132 | 132 |
| 133 searchResults: { | 133 searchResults: { |
| 134 type: Array, | 134 type: Array, |
| 135 value: () => [] | 135 value: () => [] |
| 136 }, |
| 137 |
| 138 signed_in: { |
| 139 type: Boolean, |
| 140 observer: '_onSignIn' |
| 136 } | 141 } |
| 137 }, | 142 }, |
| 138 | 143 |
| 139 ready: function() { | 144 ready: function() { |
| 140 document.addEventListener('fetch-configs', function() { | 145 if (!this.initialized) { |
| 146 document.addEventListener('fetch-configs', function() { |
| 147 this.$.requestConfigs.generateRequest(); |
| 148 }.bind(this)); |
| 149 } else { |
| 150 this.$.requestConfigs.generateRequest(); |
| 151 } |
| 152 }, |
| 153 |
| 154 _onSignIn: function() { |
| 155 if (this.signed_in) { |
| 141 this.isLoading = true; | 156 this.isLoading = true; |
| 142 this.$.requestConfigs.generateRequest(); | 157 this.$.requestConfigs.generateRequest(); |
| 143 }.bind(this)); | 158 } |
| 144 }, | 159 }, |
| 145 | 160 |
| 146 _formatName: function(name) { | 161 _formatName: function(name) { |
| 147 var tempName = name.substring(name.indexOf("/") + 1); | 162 var tempName = name.substring(name.indexOf("/") + 1); |
| 148 return tempName.includes("/") ? | 163 return tempName.includes("/") ? |
| 149 tempName.substring(0, tempName.indexOf("/")) : tempName; | 164 tempName.substring(0, tempName.indexOf("/")) : tempName; |
| 150 }, | 165 }, |
| 151 | 166 |
| 152 _getLastImportAttempt: function(lastImportAttempt) { | 167 _getLastImportAttempt: function(lastImportAttempt) { |
| 153 if (lastImportAttempt) { | 168 if (lastImportAttempt) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 var tempResults = this.configSetList.filter(e => e.config_set.includes(t
his.query)); | 207 var tempResults = this.configSetList.filter(e => e.config_set.includes(t
his.query)); |
| 193 tempResults.sort(function(a, b) { | 208 tempResults.sort(function(a, b) { |
| 194 return this._formatName(a.config_set).localeCompare(this._formatName(b
.config_set)); | 209 return this._formatName(a.config_set).localeCompare(this._formatName(b
.config_set)); |
| 195 }.bind(this)); | 210 }.bind(this)); |
| 196 this.searchResults = tempResults; | 211 this.searchResults = tempResults; |
| 197 }, | 212 }, |
| 198 | 213 |
| 199 }); | 214 }); |
| 200 </script> | 215 </script> |
| 201 </dom-module> | 216 </dom-module> |
| OLD | NEW |