blob: 6d638b40fb38db7d45f40d5db70023cc13d2255c [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">
Wyatt Allen292d0132018-07-30 17:14:49 -070020<link rel="import" href="../../../behaviors/gr-url-encoding-behavior/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">
Ole Rehmsen31640742019-05-16 11:24:47 +020022<link rel="import" href="/bower_components/polymer/polymer.html">
Andrew Bonventre78792e82016-03-04 17:48:22 -050023<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;
Tao Zhou9619d1d2019-08-28 15:38:48 +020038 color: var(--reviewed-text-color);
Andrew Bonventre78792e82016-03-04 17:48:22 -050039 }
Kasper Nilsson99598a12018-04-11 15:19:20 -070040 :host(:focus) {
Kasper Nilsson3fc3a5c2018-02-05 16:16:37 -080041 outline: none;
42 }
Logan Hanksdcb8f042017-05-11 10:34:54 -070043 :host(:hover) {
Kasper Nilsson6f72f032018-04-11 15:54:01 -070044 background-color: var(--hover-background-color);
Andrew Bonventre78792e82016-03-04 17:48:22 -050045 }
46 :host([needs-review]) {
Thomas Shaferbc443852018-10-01 09:08:55 -070047 font-weight: var(--font-weight-bold);
Tao Zhou9619d1d2019-08-28 15:38:48 +020048 color: var(--primary-text-color);
Andrew Bonventre78792e82016-03-04 17:48:22 -050049 }
Wyatt Allenfc0c84f2018-03-02 10:52:46 -080050 :host([highlight]) {
Kasper Nilsson0db312d2018-05-10 09:17:56 -070051 background-color: var(--assignee-highlight-color);
Kasper Nilssonea683062017-01-13 12:59:39 -080052 }
Becky Siegel725982d2017-02-03 14:31:58 -080053 .container {
54 position: relative;
55 }
56 .content {
57 overflow: hidden;
58 position: absolute;
59 text-overflow: ellipsis;
60 white-space: nowrap;
61 width: 100%;
62 }
63 .content a {
64 display: block;
65 overflow: hidden;
66 text-overflow: ellipsis;
67 white-space: nowrap;
68 width: 100%;
69 }
70 .spacer {
71 height: 0;
72 overflow: hidden;
73 }
Kasper Nilssone15afc92018-02-27 14:22:21 -080074 .status {
75 align-items: center;
76 display: inline-flex;
77 }
78 .status .comma {
79 padding-right: .2rem;
80 }
81 /* Used to hide the leading separator comma for statuses. */
82 .status .comma:first-of-type {
83 display: none;
84 }
Kasper Nilsson8d76c792018-03-06 14:21:32 -080085 .size gr-tooltip-content {
Kasper Nilsson69de9f92018-03-15 11:22:15 -070086 margin: -.4rem -.6rem;
Kasper Nilsson8d76c792018-03-06 14:21:32 -080087 max-width: 2.5rem;
Kasper Nilsson69de9f92018-03-15 11:22:15 -070088 padding: .4rem .6rem;
Kasper Nilsson8d76c792018-03-06 14:21:32 -080089 }
Andrew Bonventre78792e82016-03-04 17:48:22 -050090 a {
Tao Zhou9619d1d2019-08-28 15:38:48 +020091 color: inherit;
Wyatt Allendb6afdc2017-08-15 15:03:51 -070092 cursor: pointer;
93 display: inline-block;
Andrew Bonventre78792e82016-03-04 17:48:22 -050094 text-decoration: none;
95 }
96 a:hover {
97 text-decoration: underline;
98 }
Andrew Bonventre78792e82016-03-04 17:48:22 -050099 .u-monospace {
100 font-family: var(--monospace-font-family);
101 }
102 .u-green {
Kasper Nilssonb33b2152018-07-13 19:14:27 +0000103 color: var(--vote-text-color-recommended);
Andrew Bonventre78792e82016-03-04 17:48:22 -0500104 }
105 .u-red {
Kasper Nilssonb33b2152018-07-13 19:14:27 +0000106 color: var(--vote-text-color-disliked);
Andrew Bonventre78792e82016-03-04 17:48:22 -0500107 }
Kasper Nilsson443ff3e2018-02-05 16:50:52 -0800108 .label.u-green:not(.u-monospace),
109 .label.u-red:not(.u-monospace) {
110 font-size: 1.2rem;
111 }
Urs Wolferde6620f2016-03-20 18:23:43 +0100112 .u-gray-background {
Kasper Nilssonac972422018-04-17 15:07:49 +0200113 background-color: var(--table-header-background-color);
Urs Wolferde6620f2016-03-20 18:23:43 +0100114 }
Kasper Nilssone15afc92018-02-27 14:22:21 -0800115 .comma,
Kasper Nilsson114c7762018-02-20 14:22:11 -0800116 .placeholder {
Kasper Nilssonb0d03d02018-04-16 17:04:22 +0200117 color: var(--deemphasized-text-color);
Kasper Nilsson114c7762018-02-20 14:22:11 -0800118 }
Kasper Nilssonded7dce2018-10-09 14:07:27 -0700119 .cell.label {
120 font-weight: normal;
121 }
Becky Siegel7bc8c542017-01-25 14:09:28 -0800122 @media only screen and (max-width: 50em) {
123 :host {
124 display: flex;
125 }
126 }
Andrew Bonventre78792e82016-03-04 17:48:22 -0500127 </style>
128 <style include="gr-change-list-styles"></style>
Kasper Nilsson99598a12018-04-11 15:19:20 -0700129 <td class="cell leftPadding"></td>
Kasper Nilsson3fc3a5c2018-02-05 16:16:37 -0800130 <td class="cell star" hidden$="[[!showStar]]" hidden>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500131 <gr-change-star change="{{change}}"></gr-change-star>
Becky Siegel1a44b342016-11-14 08:37:06 -0800132 </td>
133 <td class="cell number" hidden$="[[!showNumber]]" hidden>
Kasper Nilsson114c7762018-02-20 14:22:11 -0800134 <a href$="[[changeURL]]">[[change._number]]</a>
Becky Siegel1a44b342016-11-14 08:37:06 -0800135 </td>
136 <td class="cell subject"
137 hidden$="[[isColumnHidden('Subject', visibleChangeTableColumns)]]">
Becky Siegel725982d2017-02-03 14:31:58 -0800138 <div class="container">
139 <div class="content">
140 <a title$="[[change.subject]]" href$="[[changeURL]]">
141 [[change.subject]]
142 </a>
143 </div>
144 <div class="spacer">
145 [[change.subject]]
146 </div>
147 <span>&nbsp;</span>
148 </div>
Becky Siegel1a44b342016-11-14 08:37:06 -0800149 </td>
150 <td class="cell status"
151 hidden$="[[isColumnHidden('Status', visibleChangeTableColumns)]]">
Kasper Nilssone15afc92018-02-27 14:22:21 -0800152 <template is="dom-repeat" items="[[statuses]]" as="status">
153 <div class="comma">,</div>
154 <gr-change-status flat status="[[status]]"></gr-change-status>
Kasper Nilsson114c7762018-02-20 14:22:11 -0800155 </template>
Kasper Nilssone15afc92018-02-27 14:22:21 -0800156 <template is="dom-if" if="[[!statuses.length]]">
Kasper Nilsson114c7762018-02-20 14:22:11 -0800157 <span class="placeholder">--</span>
158 </template>
Becky Siegel1a44b342016-11-14 08:37:06 -0800159 </td>
160 <td class="cell owner"
161 hidden$="[[isColumnHidden('Owner', visibleChangeTableColumns)]]">
Kasper Nilsson33e38552018-02-23 16:39:10 -0800162 <gr-account-link
Paladox none92710af2019-09-25 13:50:26 +0000163 account="[[change.owner]]"></gr-account-link>
Becky Siegel1a44b342016-11-14 08:37:06 -0800164 </td>
Paladox none0cd5a412017-09-28 19:46:11 +0000165 <td class="cell assignee"
166 hidden$="[[isColumnHidden('Assignee', visibleChangeTableColumns)]]">
Logan Hanks738eb642017-10-02 05:43:48 -0700167 <template is="dom-if" if="[[change.assignee]]">
Kasper Nilsson33e38552018-02-23 16:39:10 -0800168 <gr-account-link
Paladox none95f61c62018-11-26 22:53:54 +0000169 id="assigneeAccountLink"
Paladox none92710af2019-09-25 13:50:26 +0000170 account="[[change.assignee]]"></gr-account-link>
Logan Hanks738eb642017-10-02 05:43:48 -0700171 </template>
Kasper Nilsson114c7762018-02-20 14:22:11 -0800172 <template is="dom-if" if="[[!change.assignee]]">
173 <span class="placeholder">--</span>
174 </template>
Paladox none0cd5a412017-09-28 19:46:11 +0000175 </td>
Wyatt Allen06a7d0e2018-07-26 12:02:41 -0700176 <td class="cell repo"
177 hidden$="[[isColumnHidden('Repo', visibleChangeTableColumns)]]">
178 <a class="fullRepo" href$="[[_computeRepoUrl(change)]]">
179 [[_computeRepoDisplay(change)]]
Kasper Nilssone4202362018-02-15 13:02:34 -0800180 </a>
Kasper Nilsson6f898a72018-07-11 11:26:41 -0700181 <a
Wyatt Allen06a7d0e2018-07-26 12:02:41 -0700182 class="truncatedRepo"
183 href$="[[_computeRepoUrl(change)]]"
184 title$="[[_computeRepoDisplay(change)]]">
185 [[_computeRepoDisplay(change, 'true')]]
Kasper Nilssone4202362018-02-15 13:02:34 -0800186 </a>
Becky Siegel1a44b342016-11-14 08:37:06 -0800187 </td>
188 <td class="cell branch"
189 hidden$="[[isColumnHidden('Branch', visibleChangeTableColumns)]]">
Wyatt Allen06a7d0e2018-07-26 12:02:41 -0700190 <a href$="[[_computeRepoBranchURL(change)]]">
Wyatt Allendb6afdc2017-08-15 15:03:51 -0700191 [[change.branch]]
Becky Siegel1a44b342016-11-14 08:37:06 -0800192 </a>
Wyatt Allendb6afdc2017-08-15 15:03:51 -0700193 <template is="dom-if" if="[[change.topic]]">
Wyatt Allen8553bf42017-09-18 17:57:20 -0700194 (<a href$="[[_computeTopicURL(change)]]"><!--
Kasper Nilssone4202362018-02-15 13:02:34 -0800195 --><gr-limited-text limit="50" text="[[change.topic]]">
Wyatt Allen8553bf42017-09-18 17:57:20 -0700196 </gr-limited-text><!--
197 --></a>)
Wyatt Allendb6afdc2017-08-15 15:03:51 -0700198 </template>
Becky Siegel1a44b342016-11-14 08:37:06 -0800199 </td>
200 <td class="cell updated"
201 hidden$="[[isColumnHidden('Updated', visibleChangeTableColumns)]]">
Kasper Nilssonbdf43902017-02-28 14:58:20 -0800202 <gr-date-formatter
203 has-tooltip
204 date-str="[[change.updated]]"></gr-date-formatter>
Becky Siegel1a44b342016-11-14 08:37:06 -0800205 </td>
Viktar Donich5b9f7bc2018-02-14 12:00:41 -0800206 <td class="cell size"
Becky Siegel1a44b342016-11-14 08:37:06 -0800207 hidden$="[[isColumnHidden('Size', visibleChangeTableColumns)]]">
Kasper Nilsson8d76c792018-03-06 14:21:32 -0800208 <gr-tooltip-content
209 has-tooltip
210 title="[[_computeSizeTooltip(change)]]">
Kasper Nilssonffc011c2018-03-07 16:29:27 -0800211 <template is="dom-if" if="[[_changeSize]]">
212 <span>[[_changeSize]]</span>
213 </template>
214 <template is="dom-if" if="[[!_changeSize]]">
215 <span class="placeholder">--</span>
216 </template>
Kasper Nilsson8d76c792018-03-06 14:21:32 -0800217 </gr-tooltip-content>
Becky Siegel1a44b342016-11-14 08:37:06 -0800218 </td>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500219 <template is="dom-repeat" items="[[labelNames]]" as="labelName">
Becky Siegel1a44b342016-11-14 08:37:06 -0800220 <td title$="[[_computeLabelTitle(change, labelName)]]"
221 class$="[[_computeLabelClass(change, labelName)]]">
222 [[_computeLabelValue(change, labelName)]]
223 </td>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500224 </template>
Thomas Shafer03275862019-02-26 15:39:16 -0800225 <template is="dom-repeat" items="[[_dynamicCellEndpoints]]"
226 as="pluginEndpointName">
227 <td class="cell endpoint">
228 <gr-endpoint-decorator name$="[[pluginEndpointName]]">
229 <gr-endpoint-param name="change" value="[[change]]">
230 </gr-endpoint-param>
231 </gr-endpoint-decorator>
232 </td>
233 </template>
Andrew Bonventre78792e82016-03-04 17:48:22 -0500234 </template>
235 <script src="gr-change-list-item.js"></script>
236</dom-module>