Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: appengine/config_service/ui/src/config-ui/front-page.html

Issue 2980973002: config_service: Fixed multiple ajax requests in the front page while the page determines whether a … (Closed)
Patch Set: Cleaned up unnecessary code Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/config_service/ui/src/config-ui/config-ui.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 paper-search-bar { 48 paper-search-bar {
49 @apply --shadow-elevation-4dp; 49 @apply --shadow-elevation-4dp;
50 width: 40%; 50 width: 40%;
51 height: 100%; 51 height: 100%;
52 margin: auto; 52 margin: auto;
53 } 53 }
54 </style> 54 </style>
55 55
56 <iron-ajax 56 <iron-ajax
57 auto
58 id="requestConfigs" 57 id="requestConfigs"
59 url="/_ah/api/config/v1/config-sets?include_last_import_attempt=true" 58 url="/_ah/api/config/v1/config-sets?include_last_import_attempt=true"
60 handle-as="json" 59 handle-as="json"
61 on-response="_onGotConfigSets" 60 on-response="_onGotConfigSets"
62 headers="[[auth_headers]]"> 61 headers="[[auth_headers]]">
63 </iron-ajax> 62 </iron-ajax>
64 63
65 <div class="search-bar"> 64 <div class="search-bar">
66 <paper-search-bar 65 <paper-search-bar
67 query="{{query}}" 66 query="{{query}}"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 type: String, 109 type: String,
111 observer: '_updateSearchResults' 110 observer: '_updateSearchResults'
112 }, 111 },
113 112
114 searchResults: { 113 searchResults: {
115 type: Array, 114 type: Array,
116 value: () => [] 115 value: () => []
117 } 116 }
118 }, 117 },
119 118
119 ready: function() {
120 document.addEventListener('fetch-configs', function() {
121 this.isLoading = true;
122 this.$.requestConfigs.generateRequest();
123 }.bind(this));
124 },
125
120 _formatName: function(name) { 126 _formatName: function(name) {
121 var tempName = name.substring(name.indexOf("/") + 1); 127 var tempName = name.substring(name.indexOf("/") + 1);
122 return tempName.includes("/") ? 128 return tempName.includes("/") ?
123 tempName.substring(0, tempName.indexOf("/")) : tempName; 129 tempName.substring(0, tempName.indexOf("/")) : tempName;
124 }, 130 },
125 131
126 _getLastImportAttempt: function(lastImportAttempt) { 132 _getLastImportAttempt: function(lastImportAttempt) {
127 if (lastImportAttempt) { 133 if (lastImportAttempt) {
128 return lastImportAttempt; 134 return lastImportAttempt;
129 } else { 135 } else {
(...skipping 22 matching lines...) Expand all
152 var tempResults = this.configSetList.filter(e => e.config_set.includes(t his.query)); 158 var tempResults = this.configSetList.filter(e => e.config_set.includes(t his.query));
153 tempResults.sort(function(a, b) { 159 tempResults.sort(function(a, b) {
154 return this._formatName(a.config_set).localeCompare(this._formatName(b .config_set)); 160 return this._formatName(a.config_set).localeCompare(this._formatName(b .config_set));
155 }.bind(this)); 161 }.bind(this));
156 this.searchResults = tempResults; 162 this.searchResults = tempResults;
157 }, 163 },
158 164
159 }); 165 });
160 </script> 166 </script>
161 </dom-module> 167 </dom-module>
OLDNEW
« no previous file with comments | « appengine/config_service/ui/src/config-ui/config-ui.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698