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,
|
_sortedRevisions: Array,
|
||||||
_editLoaded: {
|
_editLoaded: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
computed: '_computeEditLoaded(_patchNum)',
|
computed: '_computeEditLoaded(_patchRange.*)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1287,8 +1287,9 @@
|
|||||||
return change.work_in_progress ? 'header wip' : 'header';
|
return change.work_in_progress ? 'header wip' : 'header';
|
||||||
},
|
},
|
||||||
|
|
||||||
_computeEditLoaded(patchNum) {
|
_computeEditLoaded(patchRangeRecord) {
|
||||||
return this.patchNumEquals(patchNum, this.EDIT_NAME);
|
const patchRange = patchRangeRecord.base || {};
|
||||||
|
return this.patchNumEquals(patchRange.patchNum, this.EDIT_NAME);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -1149,9 +1149,11 @@ limitations under the License.
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('_computeEditLoaded', () => {
|
test('_computeEditLoaded', () => {
|
||||||
assert.isFalse(element._computeEditLoaded(1));
|
const callCompute = range => element._computeEditLoaded({base: range});
|
||||||
assert.isFalse(element._computeEditLoaded(''));
|
assert.isFalse(callCompute({}));
|
||||||
assert.isTrue(element._computeEditLoaded(element.EDIT_NAME));
|
assert.isFalse(callCompute({basePatchNum: 'PARENT', patchNum: 1}));
|
||||||
|
assert.isFalse(callCompute({basePatchNum: 'edit', patchNum: 1}));
|
||||||
|
assert.isTrue(callCompute({basePatchNum: 1, patchNum: 'edit'}));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('_processEdit', () => {
|
test('_processEdit', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user