Revert "Fix editLoaded computation"
This reverts commit d5827d6bd3.
Reason for revert: Bandaid instead of fix
Change-Id: I7db3e97590a6261d9a8a7e4f84cb715841d1e59a
This commit is contained in:
@@ -197,7 +197,7 @@
|
||||
_sortedRevisions: Array,
|
||||
_editLoaded: {
|
||||
type: Boolean,
|
||||
computed: '_computeEditLoaded(_patchNum)',
|
||||
computed: '_computeEditLoaded(_patchRange.*)',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1287,8 +1287,9 @@
|
||||
return change.work_in_progress ? 'header wip' : 'header';
|
||||
},
|
||||
|
||||
_computeEditLoaded(patchNum) {
|
||||
return this.patchNumEquals(patchNum, this.EDIT_NAME);
|
||||
_computeEditLoaded(patchRangeRecord) {
|
||||
const patchRange = patchRangeRecord.base || {};
|
||||
return this.patchNumEquals(patchRange.patchNum, this.EDIT_NAME);
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -1149,9 +1149,11 @@ limitations under the License.
|
||||
});
|
||||
|
||||
test('_computeEditLoaded', () => {
|
||||
assert.isFalse(element._computeEditLoaded(1));
|
||||
assert.isFalse(element._computeEditLoaded(''));
|
||||
assert.isTrue(element._computeEditLoaded(element.EDIT_NAME));
|
||||
const callCompute = range => element._computeEditLoaded({base: range});
|
||||
assert.isFalse(callCompute({}));
|
||||
assert.isFalse(callCompute({basePatchNum: 'PARENT', patchNum: 1}));
|
||||
assert.isFalse(callCompute({basePatchNum: 'edit', patchNum: 1}));
|
||||
assert.isTrue(callCompute({basePatchNum: 1, patchNum: 'edit'}));
|
||||
});
|
||||
|
||||
test('_processEdit', () => {
|
||||
|
||||
Reference in New Issue
Block a user