| Index: appengine/sheriff_o_matic/ui/ct-results-panel.html
|
| diff --git a/appengine/sheriff_o_matic/ui/ct-results-panel.html b/appengine/sheriff_o_matic/ui/ct-results-panel.html
|
| index 6c2dd6297b5ba3276993c1f3022de4788093e1e9..8c99a9abb8501dd77d115a47bfbc89baccadce4b 100644
|
| --- a/appengine/sheriff_o_matic/ui/ct-results-panel.html
|
| +++ b/appengine/sheriff_o_matic/ui/ct-results-panel.html
|
| @@ -2,17 +2,33 @@
|
| Copyright 2014 The Chromium Authors. All rights reserved.
|
| Use of this source code is governed by a BSD-style license that can be
|
| found in the LICENSE file.
|
| --->
|
| -
|
| -<link rel="import" href="../bower_components/core-menu/core-menu.html">
|
| +--><html><head><link rel="import" href="../bower_components/paper-menu/paper-menu.html">
|
| <link rel="import" href="ct-results-by-builder.html">
|
| <link rel="import" href="ct-embedded-flakiness-dashboard.html">
|
| <link rel="import" href="ct-popout-iframe.html">
|
| <link rel="import" href="ct-commit-list.html">
|
|
|
| -<polymer-element name="ct-results-panel" attributes="group failureGroupKey tree">
|
| - <template>
|
| - <style>
|
| + <!--
|
| + TODO(polyup): unable to infer path to components
|
| + directory. This import path is probably incomplete.
|
| + -->
|
| + <link rel="import" href="iron-flex-layout/iron-flex-layout.html">
|
| +<dom-module id="ct-results-panel">
|
| + <style>
|
| + /* TODO(polyup): For speed, consider reworking these styles with .classes
|
| + and #ids rather than [attributes].
|
| + */
|
| + [layout] {
|
| + @apply(--layout);
|
| + }
|
| + [layout][vertical] {
|
| + @apply(--layout-vertical);
|
| + }
|
| + [layout][flex] {
|
| + @apply(--layout-flex);
|
| + }
|
| + </style>
|
| + <style>
|
| :host {
|
| display: flex;
|
| flex-direction: column;
|
| @@ -53,51 +69,85 @@ found in the LICENSE file.
|
| padding-top: 6px;
|
| }
|
| </style>
|
| + <template>
|
|
|
| - <template if="{{ !group.data.url && !group.data.failures.length }}">
|
| - <div class="message">{{ loading ? 'Loading...' : 'No results to display.' }}</div>
|
| + <template is="dom-if" if="{{computeIf(group)}}">
|
| + <div class="message">{{computeExpression1(loading)}}</div>
|
| </template>
|
|
|
| - <template if="{{ group.data.url }}">
|
| - <ct-popout-iframe src="{{ {url: group.data.url, useUber: $.userPrefs.values.useUberchromegw} | rewriteUrl }}"></ct-popout-iframe>
|
| + <template is="dom-if" if="{{ group.data.url }}">
|
| + <ct-popout-iframe src="{{computeSrc($, group)}}"></ct-popout-iframe>
|
| </template>
|
|
|
| - <template if="{{ group.data.failures }}">
|
| - <template if="{{ group.data.failures.length }}">
|
| - <core-menu selected="{{ selected }}">
|
| - <template repeat="{{ failure in group.data.failures }}">
|
| - <template if="{{ failure.testName }}">
|
| + <template is="dom-if" if="{{ group.data.failures }}">
|
| + <template is="dom-if" if="{{ group.data.failures.length }}">
|
| + <paper-menu selected="{{ selected }}">
|
| + <template is="dom-repeat" items="{{group.data.failures}}" as="failure">
|
| + <template is="dom-if" if="{{ failure.testName }}">
|
| <div>{{ failure.testName }}</div>
|
| </template>
|
| </template>
|
| - </core-menu>
|
| + </paper-menu>
|
| </template>
|
| - <div class="results" layout vertical>
|
| - <template if="{{ group.data.failures[selected].testName }}">
|
| - <ct-embedded-flakiness-dashboard flex layout vertical test="{{ group.data.failures[selected] }}"></ct-embedded-flakiness-dashboard>
|
| + <div class="results" layout="" vertical="">
|
| + <template is="dom-if" if="{{computeIf2(group, selected)}}">
|
| + <ct-embedded-flakiness-dashboard flex="" layout="" vertical="" test="{{computeTest(group, selected)}}"></ct-embedded-flakiness-dashboard>
|
| </template>
|
| - <ct-results-by-builder flex layout vertical failure="{{ group.data.failures[selected] }}"></ct-results-by-builder>
|
| - <ct-commit-list commitList="{{ group.data.commitList }}" detailed="true"></ct-commit-list>
|
| + <ct-results-by-builder flex="" layout="" vertical="" failure="{{computeTest(group, selected)}}"></ct-results-by-builder>
|
| + <ct-commit-list commitlist="{{ group.data.commitList }}" detailed="true"></ct-commit-list>
|
| </div>
|
| </template>
|
|
|
| </template>
|
| <script>
|
| Polymer({
|
| - group: null,
|
| - selected: 0,
|
| - loading: true,
|
| - rewriteUrl: function(props) {
|
| + is: 'ct-results-panel',
|
| + properties: {
|
| + failureGroupKey: { notify: true },
|
| + group: {
|
| + value: null,
|
| + notify: true,
|
| + observer: 'groupChanged'
|
| + },
|
| + loading: {
|
| + type: Boolean,
|
| + value: true
|
| + },
|
| + selected: {
|
| + type: Number,
|
| + value: 0
|
| + },
|
| + tree: { notify: true }
|
| + },
|
| + rewriteUrl: function (props) {
|
| if (this.$ && this.$.userPrefs) {
|
| return this.$.userPrefs.rewriteUrl(props.url);
|
| }
|
| return props.url;
|
| },
|
| - groupChanged: function() {
|
| + groupChanged: function () {
|
| if (this.group)
|
| this.loading = false;
|
| this.selected = 0;
|
| },
|
| + computeIf: function (group) {
|
| + return !group.data.url && !group.data.failures.length;
|
| + },
|
| + computeSrc: function ($, group) {
|
| + return this.rewriteUrl({
|
| + url: group.data.url,
|
| + useUber: $.userPrefs.values.useUberchromegw
|
| + });
|
| + },
|
| + computeIf2: function (group, selected) {
|
| + return group.data.failures[selected].testName;
|
| + },
|
| + computeTest: function (group, selected) {
|
| + return group.data.failures[selected];
|
| + },
|
| + computeExpression1: function (loading) {
|
| + return loading ? 'Loading...' : 'No results to display.';
|
| + }
|
| });
|
| </script>
|
| -</polymer-element>
|
| +</dom-module>
|
|
|