2016-03-04 17:48:22 -05:00
|
|
|
<!--
|
2018-03-26 10:04:27 -04:00
|
|
|
@license
|
2016-03-04 17:48:22 -05:00
|
|
|
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">
|
2018-02-23 12:07:39 -08:00
|
|
|
<link rel="import" href="../../../behaviors/gr-path-list-behavior/gr-path-list-behavior.html">
|
|
|
|
<link rel="import" href="../../../styles/shared-styles.html">
|
|
|
|
<link rel="import" href="../../core/gr-navigation/gr-navigation.html">
|
2018-06-19 17:03:43 -07:00
|
|
|
<link rel="import" href="../../core/gr-reporting/gr-reporting.html">
|
2016-03-20 14:14:20 -04:00
|
|
|
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
|
2016-12-22 15:04:11 -08:00
|
|
|
<link rel="import" href="../../shared/gr-storage/gr-storage.html">
|
2016-03-04 17:48:22 -05:00
|
|
|
<link rel="import" href="../gr-diff-comment/gr-diff-comment.html">
|
|
|
|
|
|
|
|
<dom-module id="gr-diff-comment-thread">
|
|
|
|
<template>
|
2017-06-01 15:31:55 -07:00
|
|
|
<style include="shared-styles">
|
2017-10-16 16:22:50 -07:00
|
|
|
gr-button {
|
|
|
|
margin-left: .5em;
|
|
|
|
}
|
2017-02-03 10:50:28 -08:00
|
|
|
#actions {
|
2017-09-22 10:51:56 -07:00
|
|
|
margin-left: auto;
|
Move reply buttons to comment thread
Move all buttons that generate a reply of some sort (done, ack, reply,
quote) to the comment thread instead of the comment [1].
When there is a draft for a particular comment thread, all reply buttons
are hidden [2]. For example, if you click reply, you cannot click done
on the same thread, unless you remove the draft.
Each thread can have up to 1 draft. It's also worth noting that if a
thread has a draft, and the user clicks on the line or 'c' at the same
range, the existing draft will switch to 'editing' form.
[1] With the exception of "please fix" for robot comments.
[2] In this case, The please fix button will be disabled when other
reply buttons are hidden.
Feature: Issue 5410
Change-Id: Id847ee0cba0d0ce4e5b6476f58141866d41ffdad
2017-02-09 16:07:32 -08:00
|
|
|
padding: .5em .7em;
|
|
|
|
}
|
2017-01-04 16:45:21 -08:00
|
|
|
#container {
|
2018-04-17 16:23:08 +02:00
|
|
|
background-color: var(--comment-background-color);
|
|
|
|
border: 1px solid var(--border-color);
|
|
|
|
color: var(--comment-text-color);
|
2018-02-23 12:07:39 -08:00
|
|
|
display: block;
|
|
|
|
margin-bottom: 1px;
|
|
|
|
white-space: normal;
|
2017-01-04 16:45:21 -08:00
|
|
|
}
|
|
|
|
#container.unresolved {
|
2018-04-17 16:23:08 +02:00
|
|
|
background-color: var(--unresolved-comment-background-color);
|
2017-01-04 16:45:21 -08:00
|
|
|
}
|
2017-02-03 10:50:28 -08:00
|
|
|
#commentInfoContainer {
|
2018-04-17 16:23:08 +02:00
|
|
|
border-top: 1px dotted var(--border-color);
|
2017-02-03 10:50:28 -08:00
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
#unresolvedLabel {
|
|
|
|
font-family: var(--font-family);
|
2017-09-22 10:51:56 -07:00
|
|
|
margin: auto 0;
|
2017-02-03 10:50:28 -08:00
|
|
|
padding: .5em .7em;
|
|
|
|
}
|
2018-02-23 12:07:39 -08:00
|
|
|
.pathInfo {
|
|
|
|
display: flex;
|
|
|
|
align-items: baseline;
|
|
|
|
}
|
|
|
|
.descriptionText {
|
|
|
|
margin-left: .5rem;
|
|
|
|
font-style: italic;
|
|
|
|
}
|
2016-03-04 17:48:22 -05:00
|
|
|
</style>
|
2018-02-23 12:07:39 -08:00
|
|
|
<template is="dom-if" if="[[showFilePath]]">
|
|
|
|
<div class="pathInfo">
|
|
|
|
<a href$="[[_getDiffUrlForComment(projectName, changeNum, path, patchNum)]]">[[_computeDisplayPath(path)]]</a>
|
|
|
|
<span class="descriptionText">Patchset [[patchNum]]</span>
|
|
|
|
</div>
|
|
|
|
</template>
|
2018-02-05 17:16:30 -08:00
|
|
|
<div id="container" class$="[[_computeHostClass(unresolved)]]">
|
Move reply buttons to comment thread
Move all buttons that generate a reply of some sort (done, ack, reply,
quote) to the comment thread instead of the comment [1].
When there is a draft for a particular comment thread, all reply buttons
are hidden [2]. For example, if you click reply, you cannot click done
on the same thread, unless you remove the draft.
Each thread can have up to 1 draft. It's also worth noting that if a
thread has a draft, and the user clicks on the line or 'c' at the same
range, the existing draft will switch to 'editing' form.
[1] With the exception of "please fix" for robot comments.
[2] In this case, The please fix button will be disabled when other
reply buttons are hidden.
Feature: Issue 5410
Change-Id: Id847ee0cba0d0ce4e5b6476f58141866d41ffdad
2017-02-09 16:07:32 -08:00
|
|
|
<template id="commentList" is="dom-repeat" items="[[_orderedComments]]"
|
|
|
|
as="comment">
|
2016-03-04 17:48:22 -05:00
|
|
|
<gr-diff-comment
|
|
|
|
comment="{{comment}}"
|
Move reply buttons to comment thread
Move all buttons that generate a reply of some sort (done, ack, reply,
quote) to the comment thread instead of the comment [1].
When there is a draft for a particular comment thread, all reply buttons
are hidden [2]. For example, if you click reply, you cannot click done
on the same thread, unless you remove the draft.
Each thread can have up to 1 draft. It's also worth noting that if a
thread has a draft, and the user clicks on the line or 'c' at the same
range, the existing draft will switch to 'editing' form.
[1] With the exception of "please fix" for robot comments.
[2] In this case, The please fix button will be disabled when other
reply buttons are hidden.
Feature: Issue 5410
Change-Id: Id847ee0cba0d0ce4e5b6476f58141866d41ffdad
2017-02-09 16:07:32 -08:00
|
|
|
robot-button-disabled="[[_hideActions(_showActions, _lastComment)]]"
|
2016-03-04 17:48:22 -05:00
|
|
|
change-num="[[changeNum]]"
|
|
|
|
patch-num="[[patchNum]]"
|
2017-05-18 16:34:17 -07:00
|
|
|
draft="[[_isDraft(comment)]]"
|
2016-03-20 14:14:20 -04:00
|
|
|
show-actions="[[_showActions]]"
|
2017-01-30 12:03:13 -08:00
|
|
|
comment-side="[[comment.__commentSide]]"
|
2017-03-21 14:56:19 -07:00
|
|
|
side="[[comment.side]]"
|
2018-02-08 09:50:48 -08:00
|
|
|
root-id="[[rootId]]"
|
2017-07-31 14:33:16 -07:00
|
|
|
project-config="[[_projectConfig]]"
|
2016-12-07 13:36:49 -08:00
|
|
|
on-create-fix-comment="_handleCommentFix"
|
2018-03-08 13:45:28 -08:00
|
|
|
on-comment-discard="_handleCommentDiscard"
|
|
|
|
on-comment-save="_handleCommentSavedOrDiscarded"></gr-diff-comment>
|
2016-03-04 17:48:22 -05:00
|
|
|
</template>
|
2017-02-03 10:50:28 -08:00
|
|
|
<div id="commentInfoContainer"
|
Move reply buttons to comment thread
Move all buttons that generate a reply of some sort (done, ack, reply,
quote) to the comment thread instead of the comment [1].
When there is a draft for a particular comment thread, all reply buttons
are hidden [2]. For example, if you click reply, you cannot click done
on the same thread, unless you remove the draft.
Each thread can have up to 1 draft. It's also worth noting that if a
thread has a draft, and the user clicks on the line or 'c' at the same
range, the existing draft will switch to 'editing' form.
[1] With the exception of "please fix" for robot comments.
[2] In this case, The please fix button will be disabled when other
reply buttons are hidden.
Feature: Issue 5410
Change-Id: Id847ee0cba0d0ce4e5b6476f58141866d41ffdad
2017-02-09 16:07:32 -08:00
|
|
|
hidden$="[[_hideActions(_showActions, _lastComment)]]">
|
2018-02-05 17:16:30 -08:00
|
|
|
<span id="unresolvedLabel" hidden$="[[!unresolved]]">Unresolved</span>
|
2017-02-03 10:50:28 -08:00
|
|
|
<div id="actions">
|
2017-10-16 16:22:50 -07:00
|
|
|
<gr-button
|
|
|
|
id="replyBtn"
|
|
|
|
link
|
2018-04-17 09:08:47 +02:00
|
|
|
secondary
|
2017-10-16 16:22:50 -07:00
|
|
|
class="action reply"
|
2017-02-03 10:50:28 -08:00
|
|
|
on-tap="_handleCommentReply">Reply</gr-button>
|
2017-10-16 16:22:50 -07:00
|
|
|
<gr-button
|
|
|
|
id="quoteBtn"
|
|
|
|
link
|
2018-04-17 09:08:47 +02:00
|
|
|
secondary
|
2017-10-16 16:22:50 -07:00
|
|
|
class="action quote"
|
2017-02-03 10:50:28 -08:00
|
|
|
on-tap="_handleCommentQuote">Quote</gr-button>
|
2017-10-16 16:22:50 -07:00
|
|
|
<gr-button
|
|
|
|
id="ackBtn"
|
|
|
|
link
|
2018-04-17 09:08:47 +02:00
|
|
|
secondary
|
2017-10-16 16:22:50 -07:00
|
|
|
class="action ack"
|
|
|
|
on-tap="_handleCommentAck">Ack</gr-button>
|
|
|
|
<gr-button
|
|
|
|
id="doneBtn"
|
|
|
|
link
|
2018-04-17 09:08:47 +02:00
|
|
|
secondary
|
2017-10-16 16:22:50 -07:00
|
|
|
class="action done"
|
|
|
|
on-tap="_handleCommentDone">Done</gr-button>
|
2017-02-03 10:50:28 -08:00
|
|
|
</div>
|
Move reply buttons to comment thread
Move all buttons that generate a reply of some sort (done, ack, reply,
quote) to the comment thread instead of the comment [1].
When there is a draft for a particular comment thread, all reply buttons
are hidden [2]. For example, if you click reply, you cannot click done
on the same thread, unless you remove the draft.
Each thread can have up to 1 draft. It's also worth noting that if a
thread has a draft, and the user clicks on the line or 'c' at the same
range, the existing draft will switch to 'editing' form.
[1] With the exception of "please fix" for robot comments.
[2] In this case, The please fix button will be disabled when other
reply buttons are hidden.
Feature: Issue 5410
Change-Id: Id847ee0cba0d0ce4e5b6476f58141866d41ffdad
2017-02-09 16:07:32 -08:00
|
|
|
</div>
|
2016-03-04 17:48:22 -05:00
|
|
|
</div>
|
2018-06-19 17:03:43 -07:00
|
|
|
<gr-reporting id="reporting"></gr-reporting>
|
2016-03-20 14:14:20 -04:00
|
|
|
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
|
2016-12-22 15:04:11 -08:00
|
|
|
<gr-storage id="storage"></gr-storage>
|
2016-03-04 17:48:22 -05:00
|
|
|
</template>
|
|
|
|
<script src="gr-diff-comment-thread.js"></script>
|
|
|
|
</dom-module>
|