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

Unified Diff: golden/newui/res/imp/trybot-page-sk.html

Issue 1940743002: Migrate trybot support Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « golden/newui/res/imp/testdata.js ('k') | golden/newui/res/imp/trybot-page-sk-demo.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: golden/newui/res/imp/trybot-page-sk.html
diff --git a/golden/newui/res/imp/trybot-page-sk.html b/golden/newui/res/imp/trybot-page-sk.html
index dac69e44e72a1f94271ff54bfce1573f24877cc1..3d24a9ea48c6784a23ef7c35c2596b24dcd62c2b 100644
--- a/golden/newui/res/imp/trybot-page-sk.html
+++ b/golden/newui/res/imp/trybot-page-sk.html
@@ -1,20 +1,149 @@
<!--
- TODO(stephana): Place holder for old page to be ported over.
+ Renders a list of Rietveld issues that have trybot runs associated with them.
+
+ Attributes: None
+
+ Events: None
+
+ Methods: None
-->
+<link rel="import" href="bower_components/polymer/polymer.html">
+
+<link rel="import" href="../common/imp/9/paging.html">
+
<dom-module id="trybot-page-sk">
<template>
- TODO Trybot
+ <style type="text/css" media="screen">
+ .nameHeader,
+ .issueHeader,
+ .dateTimeHeader,
+ .subjectHeader,
+ .patchsetHeader {
+ font-weight: bold;
+ }
+
+ .nameHeader,
+ .nameValue {
+ width: 8em;
+ }
+
+ .dateTimeHeader,
+ .dateTimeValue {
+ width: 12em;
+ }
+
+ .subjectHeader,
+ .subjectValue {
+ min-width: 15em;
+ max-width: 35em;
+ }
+
+ .issueHeader,
+ .issueValue {
+ width: 6em;
+ }
+
+ .patchsetHeader,
+ .patchsetValue {
+ width: 7em;
+ }
+
+ .headerContainer {
+ padding-top: 2em;
+ }
+
+ tr.rowEntry:hover td {background:#DDDDDD}
+ </style>
+ <paging-sk pagination="{{pagination}}" on-pagechange="pageChangedHandler"></paging-sk>
+ <table class="headerContainer">
+ <thead>
+ <tr>
+ <td class="issueHeader">Issue</td>
+ <td class="patchsetHeader">Results<br>Up To</td>
+ <td class="nameHeader">Owner</td>
+ <td class="dateTimeHeader">Updated</td>
+ <td class="subjectHeader">Subject</td>
+ </tr>
+ <template is="dom-repeat" items="{{_trybotEntries}}">
+ <tr class="rowEntry">
+ <td class="issueValue"><a target="_blank" title="See codereview in a new window" href$="{{entry.url}}">{{entry.id}}</a></td>
+ <td class="patchsetValue">
+ <a title$="{{Results up to Patchset {{entry.patchsets.length}}}}"
+ href$="/search2?issue={{entry.id}}&unt=true&query={{_queryStr}}&master=false">
+ Patchset <span>{{entry.patchsets.length}}</span>
+ </a>
+ </td>
+ <td class="nameValue">{{entry.owner}}</td>
+ <td class="dateTimeValue">{{_toLocalDate(entry.updated)}}</td>
+ <td class="subjectValue">{{entry.subject}}</td>
+ </tr>
+ </template>
+ </thead>
+ </table>
</template>
+
<script>
- Polymer({
- is: "trybot-page-sk",
+ (function() {
+ var defaultPagination = {
+ size: 20,
+ offset: 0,
+ total: 0
+ };
+
+ var defaultState = {
+ size: defaultPagination.size,
+ offset: defaultPagination.offset,
+ details: false
+ };
+
+ Polymer({
+ is: "trybot-page-sk",
+
+ pageSelected: function(routeName) {
+ this.pagination = {
+ size: 100,
+ offset: 0
+ };
+ this.page = {
+ state: {},
+ query: { 'source_type': 'gm' }
+ };
+ // Note: This forces and immediate trigger of reload.
+ sk.stateReflector(this.page, this._reload.bind(this));
+ // Set up the paging change handler and load the data.
+ this.pageChangedHandler = this._reload.bind(this);
+ },
+
+ pageDeselected: function() {
+ },
+
+ // Load or reload the listing.
+ _reload: function () {
+ var URL = '_/trybot?query=' + this.queryStr(this.page.query);
+ if (this.pagination !== null) {
+ URL += '&' + sk.query.fromObject({
+ offset: this.pagination.offset,
+ size: this.pagination.size
+ });
+ }
+ this._handleServerResponse(sk.get(URL));
+ },
+
+ _handleServerResponse: function (promise) {
+ promise.then(JSON.parse).then(function (json) {
+ this.trybotEntries = json.data;
+ this.pagination = json.pagination;
+ }.bind(this)).catch(sk.errorMessage);
+ },
+
+ _toLocalDate: function (timeStampSec) {
+ return new Date(timeStampSec * 1000).toLocaleString();
+ }
+
+ });
- pageSelected: function(routeName) {
- },
+ })();
- pageDeselected: function() {
- }
- });
</script>
</dom-module>
« no previous file with comments | « golden/newui/res/imp/testdata.js ('k') | golden/newui/res/imp/trybot-page-sk-demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698