blob: 6890d53510676bd773b0aade201595d0bfaad2bb [file] [log] [blame]
Andrew Bonventre78792e82016-03-04 17:48:22 -05001<!--
Dave Borowitz8cdc76b2018-03-26 10:04:27 -04002@license
Andrew Bonventre78792e82016-03-04 17:48:22 -05003Copyright (C) 2015 The Android Open Source Project
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16-->
Paladox none8b0d0462017-03-31 14:37:00 +000017<link rel="import" href="../../../behaviors/base-url-behavior/base-url-behavior.html">
Becky Siegel1a44b342016-11-14 08:37:06 -080018<link rel="import" href="../../../behaviors/gr-change-table-behavior/gr-change-table-behavior.html">
Kasper Nilssone4202362018-02-15 13:02:34 -080019<link rel="import" href="../../../behaviors/gr-path-list-behavior/gr-path-list-behavior.html">
Kasper Nilssonf99ce6e2016-09-23 15:14:59 -070020<link rel="import" href="../../../behaviors/gr-url-encoding-behavior.html">
Paladox none8b0d0462017-03-31 14:37:00 +000021<link rel="import" href="../../../behaviors/rest-client-behavior/rest-client-behavior.html">
Andrew Bonventre78792e82016-03-04 17:48:22 -050022<link rel="import" href="../../../bower_components/polymer/polymer.html">
23<link rel="import" href="../../../styles/gr-change-list-styles.html">
Wyatt Allendb6afdc2017-08-15 15:03:51 -070024<link rel="import" href="../../core/gr-navigation/gr-navigation.html">
Andrew Bonventre78792e82016-03-04 17:48:22 -050025<link rel="import" href="../../shared/gr-account-link/gr-account-link.html">
26<link rel="import" href="../../shared/gr-change-star/gr-change-star.html">
Kasper Nilssone15afc92018-02-27 14:22:21 -080027<link rel="import" href="../../shared/gr-change-status/gr-change-status.html">
Andrew Bonventre78792e82016-03-04 17:48:22 -050028<link rel="import" href="../../shared/gr-date-formatter/gr-date-formatter.html">
Wyatt Allen8553bf42017-09-18 17:57:20 -070029<link rel="import" href="../../shared/gr-limited-text/gr-limited-text.html">
Kasper Nilsson8d76c792018-03-06 14:21:32 -080030<link rel="import" href="../../shared/gr-tooltip-content/gr-tooltip-content.html">
Becky Siegelb159a7f2017-06-01 15:31:55 -070031<link rel="import" href="../../../styles/shared-styles.html">
Andrew Bonventre78792e82016-03-04 17:48:22 -050032
33<dom-module id="gr-change-list-item">
34 <template>
Becky Siegelb159a7f2017-06-01 15:31:55 -070035 <style include="shared-styles">
Andrew Bonventre78792e82016-03-04 17:48:22 -050036 :host {
Becky Siegel7bc8c542017-01-25 14:09:28 -080037 display: table-row;
Andrew Bonventre78792e82016-03-04 17:48:22 -050038 }
Kasper Nilsson99598a12018-04-11 15:19:20 -070039 :host(:focus) {
Kasper Nilsson3fc3a5c2018-02-05 16:16:37 -080040 outline: none;
41 }
Logan Hanksdcb8f042017-05-11 10:34:54 -070042 :host(:hover) {
Kasper Nilsson6f72f032018-04-11 15:54:01 -070043 background-color: var(--hover-background-color);
Andrew Bonventre78792e82016-03-04 17:48:22 -050044 }
45 :host([needs-review]) {
Becky Siegel1a098202017-09-08 13:12:41 -070046 font-family: var(--font-family-bold);
Andrew Bonventre78792e82016-03-04 17:48:22 -050047 }
Wyatt Allenfc0c84f2018-03-02 10:52:46 -080048 :host([highlight]) {
Kasper Nilsson0db312d2018-05-10 09:17:56 -070049 background-color: var(--assignee-highlight-color);
Kasper Nilssonea683062017-01-13 12:59:39 -080050 }
Becky Siegel725982d2017-02-03 14:31:58 -080051 .container {
52 position: relative;
53 }
54 .content {
55 overflow: hidden;
56 position: absolute;
57 text-overflow: ellipsis;
58 white-space: nowrap;
59 width: 100%;
60 }
61 .content a {
62 display: block;
63 overflow: hidden;
64 text-overflow: ellipsis;
65 white-space: nowrap;
66 width: 100%;
67 }
68 .spacer {
69 height: 0;
70 overflow: hidden;
71 }
Kasper Nilssone15afc92018-02-27 14:22:21 -080072 .status {
73 align-items: center;
74 display: inline-flex;
75 }
76 .status .comma {
77 padding-right: .2rem;
78 }
79 /* Used to hide the leading separator comma for statuses. */
80 .status .comma:first-of-type {
81 display: none;
82 }
Kasper Nilsson8d76c792018-03-06 14:21:32 -080083 .size gr-tooltip-content {
Kasper Nilsson69de9f92018-03-15 11:22:15 -070084 margin: -.4rem -.6rem;
Kasper Nilsson8d76c792018-03-06 14:21:32 -080085 max-width: 2.5rem;
Kasper Nilsson69de9f92018-03-15 11:22:15 -070086 padding: .4rem .6rem;
Kasper Nilsson8d76c792018-03-06 14:21:32 -080087 }
Andrew Bonventre78792e82016-03-04 17:48:22 -050088 a {
Kasper Nilssone4efa8d2018-04-16 11:31:56 +020089 color: var(--primary-text-color);
Wyatt Allendb6afdc2017-08-15 15:03:51 -070090 cursor: pointer;
91 display: inline-block;
Andrew Bonventre78792e82016-03-04 17:48:22 -050092 text-decoration: none;
93 }
94 a:hover {
95 text-decoration: underline;
96 }
Andrew Bonventre78792e82016-03-04 17:48:22 -050097 .u-monospace {
98 font-family: var(--monospace-font-family);
99 }
100 .u-green {
Kasper Nilssonb33b2152018-07-13 19:14:27 +0000101 color: var(--vote-text-color-recommended);
Andrew Bonventre78792e82016-03-04 17:48:22 -0500102 }
103 .u-red {
Kasper Nilssonb33b2152018-07-13 19:14:27 +0000104 color: var(--vote-text-color-disliked);
Andrew Bonventre78792e82016-03-04 17:48:22 -0500105 }
Kasper Nilsson443ff3e2018-02-05 16:50:52 -0800106 .label.u-green:not(.u-monospace),
107 .label.u-red:not(.u-monospace) {
108 font-size: 1.2rem;
109 }
Urs Wolferde6620f2016-03-20 18:23:43 +0100110 .u-gray-background {
Kasper Nilssonac972422018-04-17 15:07:49 +0200111 background-color: var(--table-header-background-color);
Urs Wolferde6620f2016-03-20 18:23:43 +0100112 }
Kasper Nilssone15afc92018-02-27 14:22:21 -0800113 .comma,
Kasper Nilsson114c7762018-02-20 14:22:11 -0800114 .placeholder {
Kasper Nilssonb0d03d02018-04-16 17:04:22 +0200115 color: var(--deemphasized-text-color);
Kasper Nilsson114c7762018-02-20 14:22:11 -0800116 }
Becky Siegel7bc8c542017-01-25 14:09:28 -0800117 @media only screen and (max-width: 50em) {
118 :host {
119 display: flex;
120 }
121 }
Andrew Bonventre78792e82016-03-04 17:48:22 -0500122 </style>
123 <style include="gr-change-list-styles"></style>
Kasper Nilsson99598a12018-04-11 15:19:20 -0700124 <td class="cell leftPadding"></td>
Kasper Nilsson3fc3a5c2018-02-05 16:16:37 -0800125 <td class="cell star" hidden$="[[!showStar]]" hidden>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500126 <gr-change-star change="{{change}}"></gr-change-star>
Becky Siegel1a44b342016-11-14 08:37:06 -0800127 </td>
128 <td class="cell number" hidden$="[[!showNumber]]" hidden>
Kasper Nilsson114c7762018-02-20 14:22:11 -0800129 <a href$="[[changeURL]]">[[change._number]]</a>
Becky Siegel1a44b342016-11-14 08:37:06 -0800130 </td>
131 <td class="cell subject"
132 hidden$="[[isColumnHidden('Subject', visibleChangeTableColumns)]]">
Becky Siegel725982d2017-02-03 14:31:58 -0800133 <div class="container">
134 <div class="content">
135 <a title$="[[change.subject]]" href$="[[changeURL]]">
136 [[change.subject]]
137 </a>
138 </div>
139 <div class="spacer">
140 [[change.subject]]
141 </div>
142 <span>&nbsp;</span>
143 </div>
Becky Siegel1a44b342016-11-14 08:37:06 -0800144 </td>
145 <td class="cell status"
146 hidden$="[[isColumnHidden('Status', visibleChangeTableColumns)]]">
Kasper Nilssone15afc92018-02-27 14:22:21 -0800147 <template is="dom-repeat" items="[[statuses]]" as="status">
148 <div class="comma">,</div>
149 <gr-change-status flat status="[[status]]"></gr-change-status>
Kasper Nilsson114c7762018-02-20 14:22:11 -0800150 </template>
Kasper Nilssone15afc92018-02-27 14:22:21 -0800151 <template is="dom-if" if="[[!statuses.length]]">
Kasper Nilsson114c7762018-02-20 14:22:11 -0800152 <span class="placeholder">--</span>
153 </template>
Becky Siegel1a44b342016-11-14 08:37:06 -0800154 </td>
155 <td class="cell owner"
156 hidden$="[[isColumnHidden('Owner', visibleChangeTableColumns)]]">
Kasper Nilsson33e38552018-02-23 16:39:10 -0800157 <gr-account-link
158 account="[[change.owner]]"
159 additional-text="[[_computeAccountStatusString(change.owner)]]"></gr-account-link>
Becky Siegel1a44b342016-11-14 08:37:06 -0800160 </td>
Paladox none0cd5a412017-09-28 19:46:11 +0000161 <td class="cell assignee"
162 hidden$="[[isColumnHidden('Assignee', visibleChangeTableColumns)]]">
Logan Hanks738eb642017-10-02 05:43:48 -0700163 <template is="dom-if" if="[[change.assignee]]">
Kasper Nilsson33e38552018-02-23 16:39:10 -0800164 <gr-account-link
165 account="[[change.assignee]]"
166 additional-text="[[_computeAccountStatusString(change.owner)]]"></gr-account-link>
Logan Hanks738eb642017-10-02 05:43:48 -0700167 </template>
Kasper Nilsson114c7762018-02-20 14:22:11 -0800168 <template is="dom-if" if="[[!change.assignee]]">
169 <span class="placeholder">--</span>
170 </template>
Paladox none0cd5a412017-09-28 19:46:11 +0000171 </td>
Wyatt Allen06a7d0e2018-07-26 12:02:41 -0700172 <td class="cell repo"
173 hidden$="[[isColumnHidden('Repo', visibleChangeTableColumns)]]">
174 <a class="fullRepo" href$="[[_computeRepoUrl(change)]]">
175 [[_computeRepoDisplay(change)]]
Kasper Nilssone4202362018-02-15 13:02:34 -0800176 </a>
Kasper Nilsson6f898a72018-07-11 11:26:41 -0700177 <a
Wyatt Allen06a7d0e2018-07-26 12:02:41 -0700178 class="truncatedRepo"
179 href$="[[_computeRepoUrl(change)]]"
180 title$="[[_computeRepoDisplay(change)]]">
181 [[_computeRepoDisplay(change, 'true')]]
Kasper Nilssone4202362018-02-15 13:02:34 -0800182 </a>
Becky Siegel1a44b342016-11-14 08:37:06 -0800183 </td>
184 <td class="cell branch"
185 hidden$="[[isColumnHidden('Branch', visibleChangeTableColumns)]]">
Wyatt Allen06a7d0e2018-07-26 12:02:41 -0700186 <a href$="[[_computeRepoBranchURL(change)]]">
Wyatt Allendb6afdc2017-08-15 15:03:51 -0700187 [[change.branch]]
Becky Siegel1a44b342016-11-14 08:37:06 -0800188 </a>
Wyatt Allendb6afdc2017-08-15 15:03:51 -0700189 <template is="dom-if" if="[[change.topic]]">
Wyatt Allen8553bf42017-09-18 17:57:20 -0700190 (<a href$="[[_computeTopicURL(change)]]"><!--
Kasper Nilssone4202362018-02-15 13:02:34 -0800191 --><gr-limited-text limit="50" text="[[change.topic]]">
Wyatt Allen8553bf42017-09-18 17:57:20 -0700192 </gr-limited-text><!--
193 --></a>)
Wyatt Allendb6afdc2017-08-15 15:03:51 -0700194 </template>
Becky Siegel1a44b342016-11-14 08:37:06 -0800195 </td>
196 <td class="cell updated"
197 hidden$="[[isColumnHidden('Updated', visibleChangeTableColumns)]]">
Kasper Nilssonbdf43902017-02-28 14:58:20 -0800198 <gr-date-formatter
199 has-tooltip
200 date-str="[[change.updated]]"></gr-date-formatter>
Becky Siegel1a44b342016-11-14 08:37:06 -0800201 </td>
Viktar Donich5b9f7bc2018-02-14 12:00:41 -0800202 <td class="cell size"
Becky Siegel1a44b342016-11-14 08:37:06 -0800203 hidden$="[[isColumnHidden('Size', visibleChangeTableColumns)]]">
Kasper Nilsson8d76c792018-03-06 14:21:32 -0800204 <gr-tooltip-content
205 has-tooltip
206 title="[[_computeSizeTooltip(change)]]">
Kasper Nilssonffc011c2018-03-07 16:29:27 -0800207 <template is="dom-if" if="[[_changeSize]]">
208 <span>[[_changeSize]]</span>
209 </template>
210 <template is="dom-if" if="[[!_changeSize]]">
211 <span class="placeholder">--</span>
212 </template>
Kasper Nilsson8d76c792018-03-06 14:21:32 -0800213 </gr-tooltip-content>
Becky Siegel1a44b342016-11-14 08:37:06 -0800214 </td>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500215 <template is="dom-repeat" items="[[labelNames]]" as="labelName">
Becky Siegel1a44b342016-11-14 08:37:06 -0800216 <td title$="[[_computeLabelTitle(change, labelName)]]"
217 class$="[[_computeLabelClass(change, labelName)]]">
218 [[_computeLabelValue(change, labelName)]]
219 </td>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500220 </template>
221 </template>
222 <script src="gr-change-list-item.js"></script>
223</dom-module>