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

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

Issue 2991013002: config_service: Added revision and timestamp to config-set-cards and config-set pages (Closed)
Patch Set: Nit: forgot to add launch icon to config set page 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 side-by-side diff with in-line comments
Download patch
Index: appengine/config_service/ui/src/config-ui/config-set.html
diff --git a/appengine/config_service/ui/src/config-ui/config-set.html b/appengine/config_service/ui/src/config-ui/config-set.html
index f442d03437c8394bfa2e31a3158507d341092cd5..4c7dc7499ee776eb0c8684faefc1ef882fc5d714 100644
--- a/appengine/config_service/ui/src/config-ui/config-set.html
+++ b/appengine/config_service/ui/src/config-ui/config-set.html
@@ -12,6 +12,7 @@
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-icons/maps-icons.html">
<link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html">
+<link rel="import" href="../../common/common-behaviors.html">
<dom-module id="config-set">
<template>
@@ -22,6 +23,11 @@
}
}
+ a {
+ text-decoration: none;
+ color: inherit;
+ }
+
.category {
font-size: 100%;
font-family: sans-serif;
@@ -90,6 +96,15 @@
<div class="name">
[[name]][[route.path]]
<template is="dom-if" if="[[_not(isLoading)]]">
+ <a href="[[url]]">
+ <iron-icon id="launch"
+ icon="icons:launch"
+ class="paper-grey">
+ </iron-icon>
+ <paper-tooltip for="launch" offset="0">
+ [[url]]
+ </paper-tooltip>
+ </a>
<template is="dom-if" if="[[lastImportAttempt]]">
<template is="dom-if" if="[[lastImportAttempt.success]]">
<iron-icon id="valid" icon="icons:check-circle" class="paper-green"></iron-icon>
@@ -126,6 +141,8 @@
<template is="dom-if" if="[[_not(lastImportAttempt)]]">
Last import attempt info not available.
</template>
+ <p>Revision: [[_getRevision(revision)]]</p>
Sergey Berezin 2017/07/31 20:21:18 I'd try to fit it all in one line, see comment in
cwpayton 2017/07/31 23:40:53 Done.
+ <p>Timestamp: [[_getTimestamp(lastImportAttempt, revision)]]</p>
</template>
<p id="refreshStatus">[[refreshMessage]]</p>
</div>
@@ -170,6 +187,8 @@
Polymer({
is: "config-set",
+ behaviors: [ConfigUIBehaviors.CommonBehavior],
+
properties: {
frontPageIsActive: {
type: Boolean,
@@ -211,6 +230,11 @@
value: null
},
+ revision: {
+ type: String,
+ value: null
+ },
+
errorMessage: {
type: String,
value: null
@@ -223,23 +247,6 @@
this.isRefreshing = true;
},
- _frontPageIsActive: function() {
- if (this.frontPageIsActive === false) {
- this.isLoading = true;
- if (!this.initialized) {
- document.addEventListener('fetch-configs', function() {
- this.$.requestConfigs.generateRequest();
- }.bind(this));
- } else {
- this.$.requestConfigs.generateRequest();
- }
- }
- },
-
- _isEmpty: function(list) {
- return list.length === 0;
- },
-
_formatCategory: function(category) {
if (category === "projects") return "Project";
if (category === "services") return "Service";
@@ -251,16 +258,16 @@
this.fire('refreshComplete');
},
- _not: function(b) {
- return !b;
- },
-
_onGotConfigFiles: function(event) {
var config_set = event.detail.response.config_sets[0];
this.files = config_set.files || [];
this.lastImportAttempt = config_set.last_import_attempt || null;
- if (config_set.revision && config_set.revision.url) {
- this.url = config_set.revision.url;
+ if (this.lastImportAttempt && this.lastImportAttempt.success) {
+ this.url = config_set.last_import_attempt.revision.url;
+ this.revision = config_set.last_import_attempt.revision;
+ } else if (config_set.revision) {
+ this.url = config_set.revision.url || config_set.location;
+ this.revision = config_set.revision;
} else {
this.url = config_set.location;
}

Powered by Google App Engine
This is Rietveld 408576698