1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
<!--
@license
Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../behaviors/base-url-behavior/base-url-behavior.html">
<link rel="import" href="../../../behaviors/gr-patch-set-behavior/gr-patch-set-behavior.html">
<link rel="import" href="../../../behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.html">
<link rel="import" href="../../../behaviors/rest-client-behavior/rest-client-behavior.html">
<link rel="import" href="../../../bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html">
<link rel="import" href="../../core/gr-reporting/gr-reporting.html">
<link rel="import" href="../../plugins/gr-endpoint-decorator/gr-endpoint-decorator.html">
<link rel="import" href="../../shared/gr-account-chip/gr-account-chip.html">
<link rel="import" href="../../shared/gr-textarea/gr-textarea.html">
<link rel="import" href="../../shared/gr-button/gr-button.html">
<link rel="import" href="../../shared/gr-formatted-text/gr-formatted-text.html">
<link rel="import" href="../../shared/gr-js-api-interface/gr-js-api-interface.html">
<link rel="import" href="../../shared/gr-overlay/gr-overlay.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../../shared/gr-storage/gr-storage.html">
<link rel="import" href="../gr-account-list/gr-account-list.html">
<link rel="import" href="../gr-label-scores/gr-label-scores.html">
<link rel="import" href="../../../styles/shared-styles.html">
<dom-module id="gr-reply-dialog">
<template>
<style include="shared-styles">
:host {
background-color: var(--dialog-background-color);
display: block;
max-height: 100%;
}
:host([disabled]) {
pointer-events: none;
}
:host([disabled]) .container {
opacity: .5;
}
.container {
display: flex;
flex-direction: column;
max-height: 100%;
}
section {
border-top: 1px solid var(--border-color);
flex-shrink: 0;
padding: .5em 1.5em;
width: 100%;
}
.actions {
background-color: var(--dialog-background-color);
bottom: 0;
display: flex;
justify-content: space-between;
position: sticky;
/* @see Issue 8602 */
z-index: 1;
}
.actions .right gr-button {
margin-left: 1em;
}
.peopleContainer,
.labelsContainer {
flex-shrink: 0;
}
.peopleContainer {
border-top: none;
display: table;
}
.peopleList {
display: flex;
padding-top: .1em;
}
.peopleListLabel {
color: var(--deemphasized-text-color);
margin-top: .2em;
min-width: 7em;
padding-right: .5em;
}
gr-account-list {
display: flex;
flex-wrap: wrap;
flex: 1;
min-height: 1.8em;
}
#reviewerConfirmationOverlay {
padding: 1em;
text-align: center;
}
.reviewerConfirmationButtons {
margin-top: 1em;
}
.groupName {
font-weight: var(--font-weight-bold);
}
.groupSize {
font-style: italic;
}
.textareaContainer {
min-height: 12em;
position: relative;
}
.textareaContainer,
#textarea,
gr-endpoint-decorator {
display: flex;
width: 100%;
}
gr-endpoint-decorator[name="reply-label-scores"] {
display: block;
}
.previewContainer gr-formatted-text {
background: var(--table-header-background-color);
padding: 1em;
}
.draftsContainer h3 {
margin-top: .25em;
}
#checkingStatusLabel,
#notLatestLabel {
margin-left: 1em;
}
#checkingStatusLabel {
color: var(--deemphasized-text-color);
font-style: italic;
}
#notLatestLabel,
#savingLabel {
color: var(--error-text-color);
}
#savingLabel {
display: none;
}
#savingLabel.saving {
display: inline;
}
#pluginMessage {
color: var(--deemphasized-text-color);
margin-left: 1em;
margin-bottom: .5em;
}
#pluginMessage:empty {
display: none;
}
</style>
<div class="container" tabindex="-1">
<section class="peopleContainer">
<div class="peopleList">
<div class="peopleListLabel">Reviewers</div>
<gr-account-list
id="reviewers"
accounts="{{_reviewers}}"
removable-values="[[change.removable_reviewers]]"
change="[[change]]"
filter="[[filterReviewerSuggestion]]"
pending-confirmation="{{_reviewerPendingConfirmation}}"
placeholder="Add reviewer..."
on-account-text-changed="_handleAccountTextEntry">
</gr-account-list>
</div>
<template is="dom-if" if="[[serverConfig.note_db_enabled]]">
<div class="peopleList">
<div class="peopleListLabel">CC</div>
<gr-account-list
id="ccs"
accounts="{{_ccs}}"
change="[[change]]"
filter="[[filterCCSuggestion]]"
pending-confirmation="{{_ccPendingConfirmation}}"
allow-any-input
placeholder="Add CC..."
on-account-text-changed="_handleAccountTextEntry">
</gr-account-list>
</div>
</template>
<gr-overlay
id="reviewerConfirmationOverlay"
on-iron-overlay-canceled="_cancelPendingReviewer">
<div class="reviewerConfirmation">
Group
<span class="groupName">
[[_pendingConfirmationDetails.group.name]]
</span>
has
<span class="groupSize">
[[_pendingConfirmationDetails.count]]
</span>
members.
<br>
Are you sure you want to add them all?
</div>
<div class="reviewerConfirmationButtons">
<gr-button on-tap="_confirmPendingReviewer">Yes</gr-button>
<gr-button on-tap="_cancelPendingReviewer">No</gr-button>
</div>
</gr-overlay>
</section>
<section class="textareaContainer">
<gr-endpoint-decorator name="reply-text">
<gr-textarea
id="textarea"
class="message"
autocomplete="on"
placeholder=[[_messagePlaceholder]]
fixed-position-dropdown
hide-border="true"
monospace="true"
disabled="{{disabled}}"
rows="4"
text="{{draft}}"
on-bind-value-changed="_handleHeightChanged">
</gr-textarea>
</gr-endpoint-decorator>
</section>
<section class="previewContainer">
<label>
<input type="checkbox" checked="{{_previewFormatting::change}}">
Preview formatting
</label>
<gr-formatted-text
content="[[draft]]"
hidden$="[[!_previewFormatting]]"
config="[[projectConfig.commentlinks]]"></gr-formatted-text>
</section>
<section class="labelsContainer">
<gr-endpoint-decorator name="reply-label-scores">
<gr-label-scores
id="labelScores"
account="[[_account]]"
change="[[change]]"
on-labels-changed="_handleLabelsChanged"
permitted-labels=[[permittedLabels]]></gr-label-scores>
</gr-endpoint-decorator>
<div id="pluginMessage">[[_pluginMessage]]</div>
</section>
<section class="draftsContainer" hidden$="[[_computeHideDraftList(diffDrafts)]]">
<div class="includeComments">
<input type="checkbox" id="includeComments"
checked="{{_includeComments::change}}">
<label for="includeComments">Publish [[_computeDraftsTitle(diffDrafts)]]</label>
</div>
<gr-comment-list
id="commentList"
comments="[[diffDrafts]]"
change-num="[[change._number]]"
project-config="[[projectConfig]]"
patch-num="[[patchNum]]"
hidden$="[[!_includeComments]]"></gr-comment-list>
<span
id="savingLabel"
class$="[[_computeSavingLabelClass(_savingComments)]]">
Saving comments...
</span>
</section>
<section class="actions">
<div class="left">
<template is="dom-if" if="[[canBeStarted]]">
<gr-button
link
secondary
disabled="[[_isState(knownLatestState, 'not-latest')]]"
class="action save"
has-tooltip
title="[[_saveTooltip]]"
on-tap="_saveTapHandler">Save</gr-button>
</template>
<span
id="checkingStatusLabel"
hidden$="[[!_isState(knownLatestState, 'checking')]]">
Checking whether patch [[patchNum]] is latest...
</span>
<span
id="notLatestLabel"
hidden$="[[!_isState(knownLatestState, 'not-latest')]]">
[[_computePatchSetWarning(patchNum, _labelsChanged)]]
<gr-button link on-tap="_reload">Reload</gr-button>
</span>
</div>
<div class="right">
<gr-button
link
id="cancelButton"
class="action cancel"
on-tap="_cancelTapHandler">Cancel</gr-button>
<gr-button
id="sendButton"
link
primary
disabled="[[_sendDisabled]]"
class="action send"
has-tooltip
title$="[[_computeSendButtonTooltip(canBeStarted)]]"
on-tap="_sendTapHandler">[[_sendButtonLabel]]</gr-button>
</div>
</section>
</div>
<gr-js-api-interface id="jsAPI"></gr-js-api-interface>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
<gr-storage id="storage"></gr-storage>
<gr-reporting id="reporting"></gr-reporting>
</template>
<script src="gr-reply-dialog.js"></script>
</dom-module>
|