| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --><html><head><link rel="import" href="../bower_components/paper-menu/paper-men
u.html"> |
| 6 | |
| 7 <link rel="import" href="../bower_components/core-menu/core-menu.html"> | |
| 8 <link rel="import" href="ct-results-by-builder.html"> | 6 <link rel="import" href="ct-results-by-builder.html"> |
| 9 <link rel="import" href="ct-embedded-flakiness-dashboard.html"> | 7 <link rel="import" href="ct-embedded-flakiness-dashboard.html"> |
| 10 <link rel="import" href="ct-popout-iframe.html"> | 8 <link rel="import" href="ct-popout-iframe.html"> |
| 11 <link rel="import" href="ct-commit-list.html"> | 9 <link rel="import" href="ct-commit-list.html"> |
| 12 | 10 |
| 13 <polymer-element name="ct-results-panel" attributes="group failureGroupKey tree"
> | 11 <!-- |
| 14 <template> | 12 TODO(polyup): unable to infer path to components |
| 15 <style> | 13 directory. This import path is probably incomplete. |
| 14 --> |
| 15 <link rel="import" href="iron-flex-layout/iron-flex-layout.html"> |
| 16 <dom-module id="ct-results-panel"> |
| 17 <style> |
| 18 /* TODO(polyup): For speed, consider reworking these styles with .classes |
| 19 and #ids rather than [attributes]. |
| 20 */ |
| 21 [layout] { |
| 22 @apply(--layout); |
| 23 } |
| 24 [layout][vertical] { |
| 25 @apply(--layout-vertical); |
| 26 } |
| 27 [layout][flex] { |
| 28 @apply(--layout-flex); |
| 29 } |
| 30 </style> |
| 31 <style> |
| 16 :host { | 32 :host { |
| 17 display: flex; | 33 display: flex; |
| 18 flex-direction: column; | 34 flex-direction: column; |
| 19 } | 35 } |
| 20 | 36 |
| 21 core-menu > div { | 37 core-menu > div { |
| 22 padding: 5px 10px; | 38 padding: 5px 10px; |
| 23 } | 39 } |
| 24 | 40 |
| 25 core-menu > div.core-selected { | 41 core-menu > div.core-selected { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 46 z-index: 1; | 62 z-index: 1; |
| 47 } | 63 } |
| 48 | 64 |
| 49 .results { | 65 .results { |
| 50 flex: 1; | 66 flex: 1; |
| 51 overflow: auto; | 67 overflow: auto; |
| 52 /* Stay below the box shadow of the core-menu. */ | 68 /* Stay below the box shadow of the core-menu. */ |
| 53 padding-top: 6px; | 69 padding-top: 6px; |
| 54 } | 70 } |
| 55 </style> | 71 </style> |
| 72 <template> |
| 56 | 73 |
| 57 <template if="{{ !group.data.url && !group.data.failures.length }}"> | 74 <template is="dom-if" if="{{computeIf(group)}}"> |
| 58 <div class="message">{{ loading ? 'Loading...' : 'No results to display.'
}}</div> | 75 <div class="message">{{computeExpression1(loading)}}</div> |
| 59 </template> | 76 </template> |
| 60 | 77 |
| 61 <template if="{{ group.data.url }}"> | 78 <template is="dom-if" if="{{ group.data.url }}"> |
| 62 <ct-popout-iframe src="{{ {url: group.data.url, useUber: $.userPrefs.value
s.useUberchromegw} | rewriteUrl }}"></ct-popout-iframe> | 79 <ct-popout-iframe src="{{computeSrc($, group)}}"></ct-popout-iframe> |
| 63 </template> | 80 </template> |
| 64 | 81 |
| 65 <template if="{{ group.data.failures }}"> | 82 <template is="dom-if" if="{{ group.data.failures }}"> |
| 66 <template if="{{ group.data.failures.length }}"> | 83 <template is="dom-if" if="{{ group.data.failures.length }}"> |
| 67 <core-menu selected="{{ selected }}"> | 84 <paper-menu selected="{{ selected }}"> |
| 68 <template repeat="{{ failure in group.data.failures }}"> | 85 <template is="dom-repeat" items="{{group.data.failures}}" as="failure"
> |
| 69 <template if="{{ failure.testName }}"> | 86 <template is="dom-if" if="{{ failure.testName }}"> |
| 70 <div>{{ failure.testName }}</div> | 87 <div>{{ failure.testName }}</div> |
| 71 </template> | 88 </template> |
| 72 </template> | 89 </template> |
| 73 </core-menu> | 90 </paper-menu> |
| 74 </template> | 91 </template> |
| 75 <div class="results" layout vertical> | 92 <div class="results" layout="" vertical=""> |
| 76 <template if="{{ group.data.failures[selected].testName }}"> | 93 <template is="dom-if" if="{{computeIf2(group, selected)}}"> |
| 77 <ct-embedded-flakiness-dashboard flex layout vertical test="{{ group.d
ata.failures[selected] }}"></ct-embedded-flakiness-dashboard> | 94 <ct-embedded-flakiness-dashboard flex="" layout="" vertical="" test="{
{computeTest(group, selected)}}"></ct-embedded-flakiness-dashboard> |
| 78 </template> | 95 </template> |
| 79 <ct-results-by-builder flex layout vertical failure="{{ group.data.failu
res[selected] }}"></ct-results-by-builder> | 96 <ct-results-by-builder flex="" layout="" vertical="" failure="{{computeT
est(group, selected)}}"></ct-results-by-builder> |
| 80 <ct-commit-list commitList="{{ group.data.commitList }}" detailed="true"
></ct-commit-list> | 97 <ct-commit-list commitlist="{{ group.data.commitList }}" detailed="true"
></ct-commit-list> |
| 81 </div> | 98 </div> |
| 82 </template> | 99 </template> |
| 83 | 100 |
| 84 </template> | 101 </template> |
| 85 <script> | 102 <script> |
| 86 Polymer({ | 103 Polymer({ |
| 87 group: null, | 104 is: 'ct-results-panel', |
| 88 selected: 0, | 105 properties: { |
| 89 loading: true, | 106 failureGroupKey: { notify: true }, |
| 90 rewriteUrl: function(props) { | 107 group: { |
| 108 value: null, |
| 109 notify: true, |
| 110 observer: 'groupChanged' |
| 111 }, |
| 112 loading: { |
| 113 type: Boolean, |
| 114 value: true |
| 115 }, |
| 116 selected: { |
| 117 type: Number, |
| 118 value: 0 |
| 119 }, |
| 120 tree: { notify: true } |
| 121 }, |
| 122 rewriteUrl: function (props) { |
| 91 if (this.$ && this.$.userPrefs) { | 123 if (this.$ && this.$.userPrefs) { |
| 92 return this.$.userPrefs.rewriteUrl(props.url); | 124 return this.$.userPrefs.rewriteUrl(props.url); |
| 93 } | 125 } |
| 94 return props.url; | 126 return props.url; |
| 95 }, | 127 }, |
| 96 groupChanged: function() { | 128 groupChanged: function () { |
| 97 if (this.group) | 129 if (this.group) |
| 98 this.loading = false; | 130 this.loading = false; |
| 99 this.selected = 0; | 131 this.selected = 0; |
| 100 }, | 132 }, |
| 133 computeIf: function (group) { |
| 134 return !group.data.url && !group.data.failures.length; |
| 135 }, |
| 136 computeSrc: function ($, group) { |
| 137 return this.rewriteUrl({ |
| 138 url: group.data.url, |
| 139 useUber: $.userPrefs.values.useUberchromegw |
| 140 }); |
| 141 }, |
| 142 computeIf2: function (group, selected) { |
| 143 return group.data.failures[selected].testName; |
| 144 }, |
| 145 computeTest: function (group, selected) { |
| 146 return group.data.failures[selected]; |
| 147 }, |
| 148 computeExpression1: function (loading) { |
| 149 return loading ? 'Loading...' : 'No results to display.'; |
| 150 } |
| 101 }); | 151 }); |
| 102 </script> | 152 </script> |
| 103 </polymer-element> | 153 </dom-module> |
| OLD | NEW |