Add a different color for robot comments

* If comment thread ends with robot comment change color

Change-Id: Idc0c29374fc5a2d500b865920c67a7f883a2094e
This commit is contained in:
Dhruv Srivastava
2019-11-27 22:40:08 +01:00
parent f7774b79b7
commit ec4b56677f
5 changed files with 16 additions and 2 deletions

View File

@@ -58,6 +58,9 @@ limitations under the License.
#container.unresolved {
background-color: var(--unresolved-comment-background-color);
}
#container.robotComment {
background-color: var(--robot-comment-background-color);
}
#commentInfoContainer {
border-top: 1px dotted var(--border-color);
display: flex;
@@ -82,7 +85,7 @@ limitations under the License.
<span class="descriptionText">Patchset [[patchNum]]</span>
</div>
</template>
<div id="container" class$="[[_computeHostClass(unresolved)]]">
<div id="container" class$="[[_computeHostClass(unresolved, isRobotComment)]]">
<template id="commentList" is="dom-repeat" items="[[_orderedComments]]"
as="comment">
<gr-comment

View File

@@ -137,6 +137,11 @@
_lastComment: Object,
_orderedComments: Array,
_projectConfig: Object,
isRobotComment: {
type: Boolean,
value: false,
reflectToAttribute: true,
},
};
}
@@ -221,6 +226,7 @@
this._lastComment = this._getLastComment();
this.unresolved = this._lastComment.unresolved;
this.hasDraft = this._lastComment.__draft;
this.isRobotComment = !!(this._lastComment.robot_id);
}
}
@@ -498,6 +504,9 @@
}
_computeHostClass(unresolved) {
if (this.isRobotComment) {
return 'robotComment';
}
return unresolved ? 'unresolved' : '';
}

View File

@@ -45,6 +45,7 @@ html {
--assignee-highlight-color: #fcfad6;
--chip-background-color: #eee;
--comment-background-color: #fcfad6;
--robot-comment-background-color: #e8f0fe;
--default-button-background-color: white;
--dialog-background-color: white;
--dropdown-background-color: white;

View File

@@ -45,6 +45,7 @@ limitations under the License.
--assignee-highlight-color: #3a361c;
--chip-background-color: #131416;
--comment-background-color: #0b162b;
--robot-comment-background-color: #e8f0fe;
--default-button-background-color: #3c4043;
--dialog-background-color: #131416;
--dropdown-background-color: #131416;