Revert "Fix missing comments in diff-view"
This reverts commit c71814fa0c.
Reason for revert: multiple reports like https://imgur.com/ClTwpKw
Change-Id: Id2e22f7cfe875b294e140c35177368a5cdbd5756
This commit is contained in:
@@ -815,9 +815,10 @@
|
|||||||
// for each line from the start.
|
// for each line from the start.
|
||||||
let lastEl;
|
let lastEl;
|
||||||
for (const threadEl of addedThreadEls) {
|
for (const threadEl of addedThreadEls) {
|
||||||
|
const lineNumString = threadEl.getAttribute('line-num') || 'FILE';
|
||||||
const commentSide = threadEl.getAttribute('comment-side');
|
const commentSide = threadEl.getAttribute('comment-side');
|
||||||
const lineEl = this._getLineElement(threadEl,
|
const lineEl = this.$.diffBuilder.getLineElByNumber(
|
||||||
commentSide);
|
lineNumString, commentSide);
|
||||||
const contentText = this.$.diffBuilder.getContentByLineEl(lineEl);
|
const contentText = this.$.diffBuilder.getContentByLineEl(lineEl);
|
||||||
const contentEl = contentText.parentElement;
|
const contentEl = contentText.parentElement;
|
||||||
const threadGroupEl = this._getOrCreateThreadGroup(
|
const threadGroupEl = this._getOrCreateThreadGroup(
|
||||||
@@ -843,18 +844,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_getLineElement(threadEl, commentSide) {
|
|
||||||
const lineNumString = threadEl.getAttribute('line-num') || 'FILE';
|
|
||||||
const lineEl = this.$.diffBuilder.getLineElByNumber(
|
|
||||||
lineNumString, commentSide);
|
|
||||||
if (lineEl) {
|
|
||||||
return lineEl;
|
|
||||||
}
|
|
||||||
// It is possible to add comment to non-existing line via API
|
|
||||||
threadEl.invalidLineNumber = true;
|
|
||||||
return this.$.diffBuilder.getLineElByNumber('FILE', commentSide);
|
|
||||||
}
|
|
||||||
|
|
||||||
_unobserveIncrementalNodes() {
|
_unobserveIncrementalNodes() {
|
||||||
if (this._incrementalNodeObserver) {
|
if (this._incrementalNodeObserver) {
|
||||||
Polymer.dom(this).unobserveNodes(this._incrementalNodeObserver);
|
Polymer.dom(this).unobserveNodes(this._incrementalNodeObserver);
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ limitations under the License.
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<link rel="import" href="/bower_components/polymer/polymer.html">
|
<link rel="import" href="/bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="/bower_components/iron-icon/iron-icon.html">
|
|
||||||
<link rel="import" href="../../shared/gr-icons/gr-icons.html">
|
|
||||||
<link rel="import" href="../../../behaviors/fire-behavior/fire-behavior.html">
|
<link rel="import" href="../../../behaviors/fire-behavior/fire-behavior.html">
|
||||||
<link rel="import" href="../../../behaviors/gr-path-list-behavior/gr-path-list-behavior.html">
|
<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="../../../styles/shared-styles.html">
|
||||||
@@ -80,18 +78,6 @@ limitations under the License.
|
|||||||
margin-left: var(--spacing-m);
|
margin-left: var(--spacing-m);
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
.invalidLineNumber {
|
|
||||||
padding: var(--spacing-m);
|
|
||||||
}
|
|
||||||
.invalidLineNumberText {
|
|
||||||
color: var(--error-text-color);
|
|
||||||
}
|
|
||||||
.invalidLineNumberIcon {
|
|
||||||
color: var(--error-text-color);
|
|
||||||
vertical-align: top;
|
|
||||||
margin-right: var(--spacing-s);
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<template is="dom-if" if="[[showFilePath]]">
|
<template is="dom-if" if="[[showFilePath]]">
|
||||||
<div class="pathInfo">
|
<div class="pathInfo">
|
||||||
@@ -100,11 +86,6 @@ limitations under the License.
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div id="container" class$="[[_computeHostClass(unresolved, isRobotComment)]]">
|
<div id="container" class$="[[_computeHostClass(unresolved, isRobotComment)]]">
|
||||||
<template is="dom-if" if="[[invalidLineNumber]]">
|
|
||||||
<div class="invalidLineNumber">
|
|
||||||
<span class="invalidLineNumberText"><iron-icon icon="gr-icons:error" class="invalidLineNumberIcon"></iron-icon>This comment thread is attached to non-existing line [[lineNum]].</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template id="commentList" is="dom-repeat" items="[[_orderedComments]]"
|
<template id="commentList" is="dom-repeat" items="[[_orderedComments]]"
|
||||||
as="comment">
|
as="comment">
|
||||||
<gr-comment
|
<gr-comment
|
||||||
|
|||||||
@@ -124,11 +124,6 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: false,
|
value: false,
|
||||||
},
|
},
|
||||||
/** It is possible to add comment to non-existing line via API */
|
|
||||||
invalidLineNumber: {
|
|
||||||
type: Number,
|
|
||||||
reflectToAttribute: true,
|
|
||||||
},
|
|
||||||
/** Necessary only if showFilePath is true or when used with gr-diff */
|
/** Necessary only if showFilePath is true or when used with gr-diff */
|
||||||
lineNum: {
|
lineNum: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
|||||||
Reference in New Issue
Block a user