| 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="config-file-card.html"> | 7 <link rel="import" href="config-file-card.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/iron-icons/iron-icons.html"> | 9 <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"> |
| 10 <link rel="import" href="../../bower_components/paper-item/paper-item.html"> | 10 <link rel="import" href="../../bower_components/paper-item/paper-item.html"> |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 <paper-icon-button id="force-refresh" | 106 <paper-icon-button id="force-refresh" |
| 107 icon="icons:refresh" | 107 icon="icons:refresh" |
| 108 on-tap="_forceRefresh"> | 108 on-tap="_forceRefresh"> |
| 109 </paper-icon-button> | 109 </paper-icon-button> |
| 110 <paper-tooltip for="force-refresh" offset="0"> | 110 <paper-tooltip for="force-refresh" offset="0"> |
| 111 Re-import the config-set from the repository. | 111 Re-import the config-set from the repository. |
| 112 </paper-tooltip> | 112 </paper-tooltip> |
| 113 </template> | 113 </template> |
| 114 </div> | 114 </div> |
| 115 <div class="category"> | 115 <div class="category"> |
| 116 <p>[[_formatCategory(category)]]</p> | 116 <p>[[_formatCategory(category, route.path)]]</p> |
| 117 <template is="dom-if" if="[[_not(isLoading)]]"> | 117 <template is="dom-if" if="[[_not(isLoading)]]"> |
| 118 <template is="dom-if" if="[[lastImportAttempt]]"> | 118 <template is="dom-if" if="[[lastImportAttempt]]"> |
| 119 <template is="dom-if" if="[[_not(lastImportAttempt.success)]]"> | 119 <template is="dom-if" if="[[_not(lastImportAttempt.success)]]"> |
| 120 Last import attempt failed: [[lastImportAttempt.message]] | 120 Last import attempt failed: [[lastImportAttempt.message]] |
| 121 </template> | 121 </template> |
| 122 <template is="dom-if" if="[[lastImportAttempt.success]]"> | 122 <template is="dom-if" if="[[lastImportAttempt.success]]"> |
| 123 Last import succeeded. | 123 Last import succeeded. |
| 124 </template> | 124 </template> |
| 125 </template> | 125 </template> |
| 126 <template is="dom-if" if="[[_not(lastImportAttempt)]]"> | 126 <template is="dom-if" if="[[_not(lastImportAttempt)]]"> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } else { | 233 } else { |
| 234 this.$.requestConfigs.generateRequest(); | 234 this.$.requestConfigs.generateRequest(); |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 }, | 237 }, |
| 238 | 238 |
| 239 _isEmpty: function(list) { | 239 _isEmpty: function(list) { |
| 240 return list.length === 0; | 240 return list.length === 0; |
| 241 }, | 241 }, |
| 242 | 242 |
| 243 _formatCategory: function(category) { | 243 _formatCategory: function(category, name) { |
| 244 if (name.includes("/refs")) return "Ref"; |
| 244 if (category === "projects") return "Project"; | 245 if (category === "projects") return "Project"; |
| 245 if (category === "services") return "Service"; | 246 if (category === "services") return "Service"; |
| 246 }, | 247 }, |
| 247 | 248 |
| 248 _onCompleteRefresh: function() { | 249 _onCompleteRefresh: function() { |
| 249 this.isRefreshing = false; | 250 this.isRefreshing = false; |
| 250 this.refreshMessage = "Refresh successful."; | 251 this.refreshMessage = "Refresh successful."; |
| 251 this.fire('refreshComplete'); | 252 this.fire('refreshComplete'); |
| 252 }, | 253 }, |
| 253 | 254 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 this.errorMessage = "Internal server error."; | 291 this.errorMessage = "Internal server error."; |
| 291 } else { | 292 } else { |
| 292 this.errorMessage = "Error occured. Try again later."; | 293 this.errorMessage = "Error occured. Try again later."; |
| 293 } | 294 } |
| 294 this.fire('fetchError'); | 295 this.fire('fetchError'); |
| 295 } | 296 } |
| 296 | 297 |
| 297 }); | 298 }); |
| 298 </script> | 299 </script> |
| 299 </dom-module> | 300 </dom-module> |
| OLD | NEW |