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

Unified Diff: dashboard/dashboard/pinpoint/elements/change-info.html

Issue 3013013002: [pinpoint] Change refactor. (Closed)
Patch Set: UI Created 3 years, 3 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: dashboard/dashboard/pinpoint/elements/change-info.html
diff --git a/dashboard/dashboard/pinpoint/elements/change-info.html b/dashboard/dashboard/pinpoint/elements/change-info.html
index 019be393787d82f5d03d7a81efc40369d0dc50e0..4056ec5c7b69c6c320570a2478c4222ede97c58e 100644
--- a/dashboard/dashboard/pinpoint/elements/change-info.html
+++ b/dashboard/dashboard/pinpoint/elements/change-info.html
@@ -8,7 +8,7 @@ found in the LICENSE file.
<link rel="import" href="/dashboard/pinpoint/elements/base-style.html">
<link rel="import" href="/dashboard/pinpoint/elements/loading-wrapper.html">
-<dom-module id="dep-info">
+<dom-module id="change-info">
<template>
<style include="base-style">
h3 {
@@ -20,7 +20,7 @@ found in the LICENSE file.
<div>
<loading-wrapper id="loader">
<h3>
- <a href="[[dep.url]]" target="_blank">[[subject]]</a>
+ <a href="[[url(change)]]" target="_blank">[[subject]]</a>
</h3>
<p class="byline">
By [[author]]<span class="middle-dot"></span>[[time]]
@@ -32,19 +32,28 @@ found in the LICENSE file.
<script>
'use strict';
Polymer({
- is: 'dep-info',
+ is: 'change-info',
properties: {
- dep: {
+ change: {
type: Object,
- observer: '_depChanged'
- },
+ observer: '_changeChanged'
+ }
+ },
+
+ lastCommit(change) {
+ return change.commits[change.commits.length - 1];
+ },
+
+ url(change) {
+ return this.lastCommit(change).url;
},
- async _depChanged() {
+ async _changeChanged() {
+ const commit = this.lastCommit(this.change);
const params = {
- repository: this.dep.repository,
- git_hash_1: this.dep.git_hash
+ repository: commit.repository,
+ git_hash_1: commit.git_hash
};
const response = await this.$.loader.load('/api/gitiles', params);
if (response) {
@@ -52,29 +61,7 @@ found in the LICENSE file.
this.author = response.author.email;
this.time = new Date(response.committer.time + 'Z').toLocaleString();
}
- }
- });
- </script>
-</dom-module>
-
-<dom-module id="change-info">
- <template>
- <dep-info dep="[[change.base_commit]]"></dep-info>
- <template is="dom-repeat" items="[[change.deps]]">
- <dep-info dep="[[item]]"></dep-info>
- </template>
- </template>
-
- <script>
- 'use strict';
- Polymer({
- is: 'change-info',
-
- properties: {
- change: {
- type: Object,
- }
- }
+ },
});
</script>
</dom-module>

Powered by Google App Engine
This is Rietveld 408576698