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

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

Issue 2990713002: config_service: change error message for error 403. (Closed)
Patch Set: Nit: change tests for config-set page. Created 3 years, 4 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
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="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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 <div class="center"> 164 <div class="center">
165 <p>[[errorMessage]]</p> 165 <p>[[errorMessage]]</p>
166 </div> 166 </div>
167 </template> 167 </template>
168 </template> 168 </template>
169 <script> 169 <script>
170 Polymer({ 170 Polymer({
171 is: "config-set", 171 is: "config-set",
172 172
173 properties: { 173 properties: {
174
175 frontPageIsActive: { 174 frontPageIsActive: {
176 type: Boolean, 175 type: Boolean,
177 observer: '_frontPageIsActive' 176 observer: '_frontPageIsActive'
178 }, 177 },
179 178
180 category: { 179 category: {
181 type: String 180 type: String
182 }, 181 },
183 182
184 files: { 183 files: {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 219
221 _forceRefresh: function() { 220 _forceRefresh: function() {
222 this.refreshMessage = null; 221 this.refreshMessage = null;
223 this.$.refreshConfigs.generateRequest(); 222 this.$.refreshConfigs.generateRequest();
224 this.isRefreshing = true; 223 this.isRefreshing = true;
225 }, 224 },
226 225
227 _frontPageIsActive: function() { 226 _frontPageIsActive: function() {
228 if (this.frontPageIsActive === false) { 227 if (this.frontPageIsActive === false) {
229 this.isLoading = true; 228 this.isLoading = true;
230 this.$.requestConfigs.generateRequest(); 229 if (!this.initialized) {
230 document.addEventListener('fetch-configs', function() {
231 this.$.requestConfigs.generateRequest();
232 }.bind(this));
233 } else {
234 this.$.requestConfigs.generateRequest();
235 }
231 } 236 }
232 }, 237 },
233 238
234 ready: function() {
235 this.isLoading = true;
236 },
237
238 _isEmpty: function(list) { 239 _isEmpty: function(list) {
239 return list.length === 0; 240 return list.length === 0;
240 }, 241 },
241 242
242 _formatCategory: function(category) { 243 _formatCategory: function(category) {
243 if (category === "projects") return "Project"; 244 if (category === "projects") return "Project";
244 if (category === "services") return "Service"; 245 if (category === "services") return "Service";
245 }, 246 },
246 247
247 _onCompleteRefresh: function() { 248 _onCompleteRefresh: function() {
(...skipping 19 matching lines...) Expand all
267 _onRefreshError: function() { 268 _onRefreshError: function() {
268 this.isRefreshing = false; 269 this.isRefreshing = false;
269 this.refreshMessage = "Error: Files could not be refreshed."; 270 this.refreshMessage = "Error: Files could not be refreshed.";
270 this.fire('refreshError'); 271 this.fire('refreshError');
271 }, 272 },
272 273
273 _onRequestError: function(event) { 274 _onRequestError: function(event) {
274 var error = parseInt(event.detail.error.message.match(/\d+/g)); 275 var error = parseInt(event.detail.error.message.match(/\d+/g));
275 this.isLoading = false; 276 this.isLoading = false;
276 if (error === 403) { 277 if (error === 403) {
277 this.errorMessage = "Authorization required to view this config set. " + 278 if (!this.auth_headers) {
278 "Please sign in."; 279 this.errorMessage = "Access denied, please sign in.";
280 } else {
281 this.errorMessage = "Access denied, " + this.profile.email +
282 " is not authorized to access this config set." +
283 " Request access or sign in as a different user.";
284 }
279 } else if (500 <= error && error < 600) { 285 } else if (500 <= error && error < 600) {
280 this.errorMessage = "Internal server error."; 286 this.errorMessage = "Internal server error.";
281 } else { 287 } else {
282 this.errorMessage = "Error occured. Try again later."; 288 this.errorMessage = "Error occured. Try again later.";
283 } 289 }
284 this.fire('fetchError'); 290 this.fire('fetchError');
285 } 291 }
286 292
287 }); 293 });
288 </script> 294 </script>
289 </dom-module> 295 </dom-module>
OLDNEW
« no previous file with comments | « appengine/config_service/ui/common/auth-signin.html ('k') | appengine/config_service/ui/src/config-ui/config-ui.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698