Allow convergent comment saves
Formerly, the save button would be disabled when attempting to edit a comment to have the same content as what's already been saved. This can be a confusing UX where it isn't clear why a comment cannot be saved. Allow saving comments even when the text has not been changed. Bug: Issue 8128 Change-Id: I615c38e0cc109ea87f58c9b8a9b7de28ec459b88
This commit is contained in:
@@ -298,7 +298,6 @@
|
||||
_computeSaveDisabled(draft, comment, resolved) {
|
||||
// If resolved state has changed and a msg exists, save should be enabled.
|
||||
if (comment.unresolved === resolved && draft) { return false; }
|
||||
if (comment.message) { return draft === comment.message; }
|
||||
return !draft || draft.trim() === '';
|
||||
},
|
||||
|
||||
|
||||
@@ -520,9 +520,9 @@ limitations under the License.
|
||||
const msgComment = {message: 'test', unresolved: true};
|
||||
assert.equal(element._computeSaveDisabled('', comment, false), true);
|
||||
assert.equal(element._computeSaveDisabled('test', comment, false), false);
|
||||
assert.equal(element._computeSaveDisabled('', msgComment, false), false);
|
||||
assert.equal(element._computeSaveDisabled('', msgComment, false), true);
|
||||
assert.equal(
|
||||
element._computeSaveDisabled('test', msgComment, false), true);
|
||||
element._computeSaveDisabled('test', msgComment, false), false);
|
||||
assert.equal(
|
||||
element._computeSaveDisabled('test2', msgComment, false), false);
|
||||
assert.equal(element._computeSaveDisabled('test', comment, true), false);
|
||||
|
||||
Reference in New Issue
Block a user