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

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

Issue 2991013002: config_service: Added revision and timestamp to config-set-cards and config-set pages (Closed)
Patch Set: Refactored test to give each function its own suite 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/front-page.html
diff --git a/appengine/config_service/ui/src/config-ui/front-page.html b/appengine/config_service/ui/src/config-ui/front-page.html
index a2f4597c8311ec005c582867a48fe9e2b65b54da..e63755ea8a723890893a281d4f03810d5ab4588b 100644
--- a/appengine/config_service/ui/src/config-ui/front-page.html
+++ b/appengine/config_service/ui/src/config-ui/front-page.html
@@ -11,6 +11,7 @@
<link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html">
<link rel="import" href="../../bower_components/paper-styles/shadow.html">
<link rel="import" href="../../bower_components/polymer/polymer.html">
+<link rel="import" href="../../common/common-behaviors.html">
<link rel="import" href="config-set-card.html">
@@ -94,7 +95,10 @@
<div class="center config-card">
<config-set-card
name="[[config.config_set]]"
- last-import-attempt="[[_getLastImportAttempt(config.last_import_attempt)]]">
+ last-import-attempt="[[_getLastImportAttempt(config.last_import_attempt)]]"
+ revision="[[_getRevision(config.revision)]]"
+ link="[[_getURL(config)]]"
+ timestamp="[[_getTimestamp(config.last_import_attempt, config.revision)]]">
</config-set-card>
</div>
</template>
@@ -110,6 +114,8 @@
Polymer({
is: 'front-page',
+ behaviors: [ConfigUIBehaviors.CommonBehavior],
+
properties: {
configSetList: {
type: Array,
@@ -169,19 +175,17 @@
},
_getLastImportAttempt: function(lastImportAttempt) {
- if (lastImportAttempt) {
- return lastImportAttempt;
- } else {
- return null;
- }
+ return lastImportAttempt || null;
},
- _isEmpty: function(array) {
- return array.length === 0;
- },
-
- _not: function(b) {
- return !b;
+ _getURL: function(config) {
+ if (config.last_import_attempt && config.last_import_attempt.success) {
+ return config.last_import_attempt.revision.url;
+ } else if (config.revision && config.revision.url) {
+ return config.revision.url;
+ } else {
+ return config.location;
+ }
},
_onGotConfigSets: function(event) {

Powered by Google App Engine
This is Rietveld 408576698