summaryrefslogtreecommitdiffstats
path: root/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.html
diff options
context:
space:
mode:
Diffstat (limited to 'polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.html')
-rw-r--r--polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.html222
1 files changed, 125 insertions, 97 deletions
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.html b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.html
index b1f95e6d8e..127f6d8816 100644
--- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.html
+++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.html
@@ -14,11 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<link rel="import" href="../../../behaviors/rest-client-behavior/rest-client-behavior.html">
<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="../../../bower_components/iron-selector/iron-selector.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">
@@ -26,10 +30,12 @@ limitations under the License.
<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>
+ <style include="shared-styles">
:host {
display: block;
max-height: 90vh;
@@ -46,13 +52,19 @@ limitations under the License.
max-height: 90vh;
}
section {
- border-top: 1px solid #ddd;
- padding: .5em .75em;
+ border-top: 1px solid #cdcdcd;
+ padding: .5em 1.5em;
width: 100%;
}
+ .actions {
+ display: flex;
+ justify-content: space-between;
+ }
+ .actions .right gr-button {
+ margin-left: 1em;
+ }
.peopleContainer,
- .labelsContainer,
- .actionsContainer {
+ .labelsContainer {
flex-shrink: 0;
}
.peopleContainer {
@@ -60,6 +72,7 @@ limitations under the License.
}
.peopleList {
display: flex;
+ align-items: center;
padding-top: .1em;
}
.peopleListLabel {
@@ -71,6 +84,11 @@ limitations under the License.
display: flex;
flex-wrap: wrap;
flex: 1;
+ min-height: 1.8em;
+ --account-list-style: {
+ max-height: 12em;
+ overflow-y: auto;
+ }
}
#reviewerConfirmationOverlay {
padding: 1em;
@@ -80,20 +98,20 @@ limitations under the License.
margin-top: 1em;
}
.groupName {
- font-weight: bold;
+ font-family: var(--font-family-bold);
}
.groupSize {
font-style: italic;
}
.textareaContainer {
- display: flex;
- flex: 1;
min-height: 6em;
position: relative;
}
- iron-autogrow-textarea {
- padding: 0;
- font-family: var(--monospace-font-family);
+ .textareaContainer,
+ #textarea,
+ gr-endpoint-decorator {
+ display: flex;
+ width: 100%;
}
.previewContainer gr-formatted-text {
background: #f6f6f6;
@@ -101,42 +119,6 @@ limitations under the License.
overflow-y: scroll;
padding: 1em;
}
- .message {
- border: none;
- width: 100%;
- }
- .labelContainer:not(:first-of-type) {
- margin-top: .5em;
- }
- .labelName {
- display: inline-block;
- margin-right: .5em;
- min-width: 7em;
- text-align: right;
- white-space: nowrap;
- width: 25%;
- }
- .labelMessage {
- color: #666;
- }
- iron-selector {
- display: inline-flex;
- }
- iron-selector > gr-button {
- margin-right: .25em;
- min-width: 3.5em;
- }
- iron-selector > gr-button:first-of-type {
- border-top-left-radius: 2px;
- border-bottom-left-radius: 2px;
- }
- iron-selector > gr-button:last-of-type {
- border-top-right-radius: 2px;
- border-bottom-right-radius: 2px;
- }
- iron-selector > gr-button.iron-selected {
- background-color: #ddd;
- }
.draftsContainer {
flex: 1;
overflow-y: auto;
@@ -144,13 +126,23 @@ limitations under the License.
.draftsContainer h3 {
margin-top: .25em;
}
- .actionsContainer {
- display: flex;
- justify-content: space-between;
+ #checkingStatusLabel,
+ #notLatestLabel {
+ margin-left: 1em;
+ }
+ #checkingStatusLabel {
+ color: #444;
+ font-style: italic;
}
- .action:link,
- .action:visited {
- color: #00e;
+ #notLatestLabel,
+ #savingLabel {
+ color: red;
+ }
+ #savingLabel {
+ display: none;
+ }
+ #savingLabel.saving {
+ display: inline;
}
@media screen and (max-width: 50em) {
:host {
@@ -161,12 +153,11 @@ limitations under the License.
}
}
</style>
- <div class="container">
+ <div class="container" tabindex="-1">
<section class="peopleContainer">
<div class="peopleList">
<div class="peopleListLabel">Owner</div>
- <gr-account-chip account="[[_owner]]">
- <gr-account-chip>
+ <gr-account-chip account="[[_owner]]"></gr-account-chip>
</div>
</section>
<section class="peopleContainer">
@@ -189,8 +180,9 @@ limitations under the License.
id="ccs"
accounts="{{_ccs}}"
change="[[change]]"
- filter="[[filterReviewerSuggestion]]"
+ filter="[[filterCCSuggestion]]"
pending-confirmation="{{_ccPendingConfirmation}}"
+ allow-any-input
placeholder="Add CC...">
</gr-account-list>
</div>
@@ -219,17 +211,22 @@ limitations under the License.
</gr-overlay>
</section>
<section class="textareaContainer">
- <iron-autogrow-textarea
- id="textarea"
- class="message"
- autocomplete="on"
- placeholder="Say something nice..."
- disabled="{{disabled}}"
- rows="4"
- max-rows="15"
- bind-value="{{draft}}"
- on-bind-value-changed="_handleHeightChanged">
- </iron-autogrow-textarea>
+ <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"
+ max-rows="15"
+ text="{{draft}}"
+ on-bind-value-changed="_handleHeightChanged">
+ </gr-textarea>
+ </gr-endpoint-decorator>
</section>
<section class="previewContainer">
<label>
@@ -242,40 +239,71 @@ limitations under the License.
config="[[projectConfig.commentlinks]]"></gr-formatted-text>
</section>
<section class="labelsContainer">
- <template is="dom-repeat" items="[[_labels]]" as="label">
- <div class="labelContainer">
- <span class="labelName">[[label.name]]</span>
- <iron-selector data-label$="[[label.name]]"
- selected="[[_computeIndexOfLabelValue(change.labels, permittedLabels, label)]]"
- hidden$="[[!_computeAnyPermittedLabelValues(permittedLabels, label.name)]]">
- <template is="dom-repeat"
- items="[[_computePermittedLabelValues(permittedLabels, label.name)]]"
- as="value">
- <gr-button has-tooltip data-value$="[[value]]"
- title$="[[_computeLabelValueTitle(change.labels, label.name, value)]]">[[value]]</gr-button>
- </template>
- </iron-selector>
- <span class="labelMessage"
- hidden$="[[_computeAnyPermittedLabelValues(permittedLabels, label.name)]]">
- You don't have permission to edit this label.
- </span>
- </div>
- </template>
+ <gr-label-scores
+ id="labelScores"
+ account="[[_account]]"
+ change="[[change]]"
+ on-labels-changed="_handleLabelsChanged"
+ permitted-labels=[[permittedLabels]]></gr-label-scores>
</section>
<section class="draftsContainer" hidden$="[[_computeHideDraftList(diffDrafts)]]">
- <h3>[[_computeDraftsTitle(diffDrafts)]]</h3>
+ <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]]"></gr-comment-list>
+ patch-num="[[patchNum]]"
+ hidden$="[[!_includeComments]]"></gr-comment-list>
+ <span
+ id="savingLabel"
+ class$="[[_computeSavingLabelClass(_savingComments)]]">
+ Saving comments...
+ </span>
</section>
- <section class="actionsContainer">
- <gr-button primary class="action send" on-tap="_sendTapHandler">Send</gr-button>
- <gr-button
- id="cancelButton"
- class="action cancel"
- on-tap="_cancelTapHandler">Cancel</gr-button>
+ <section class="actions">
+ <div class="left">
+ <template is="dom-if" if="[[canBeStarted]]">
+ <gr-button
+ link
+ tertiary
+ 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')]]">
+ Patch [[patchNum]] is not latest.
+ <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
+ link
+ primary
+ disabled="[[_computeSendButtonDisabled(knownLatestState, _sendButtonLabel, diffDrafts, draft, _reviewersMutated, _labelsChanged, _includeComments)]]"
+ 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>