diff --git a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.html b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.html index a50f9f72cf..ead95921b4 100644 --- a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.html +++ b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.html @@ -151,7 +151,7 @@ limitations under the License. if (states.length || !opt_options) { return states; } // If no missing requirements, either active or ready to submit. - if (opt_options.readyToSubmit) { + if (change.submittable) { states.push('Ready to submit'); } else { // Otherwise it is active. diff --git a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html index b1da281c77..06acd945d5 100644 --- a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html +++ b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html @@ -93,28 +93,33 @@ limitations under the License. assert.deepEqual(statuses, []); assert.equal(statusString, ''); + change.submittable = false; statuses = element.changeStatuses(change, - {readyToSubmit: false, includeDerived: true}); + {includeDerived: true}); assert.deepEqual(statuses, ['Active']); // With no missing labels + change.submittable = true; statuses = element.changeStatuses(change, - {readyToSubmit: true, includeDerived: true}); + {includeDerived: true}); statusString = element.changeStatusString(change); assert.deepEqual(statuses, ['Ready to submit']); change.mergeable = false; + change.submittable = true; statuses = element.changeStatuses(change, - {readyToSubmit: true, includeDerived: true}); + {includeDerived: true}); assert.deepEqual(statuses, ['Merge Conflict']); delete change.mergeable; + change.submittable = true; statuses = element.changeStatuses(change, - {readyToSubmit: true, includeDerived: true, mergeable: true}); + {includeDerived: true, mergeable: true}); assert.deepEqual(statuses, ['Ready to submit']); + change.submittable = true; statuses = element.changeStatuses(change, - {readyToSubmit: true, includeDerived: true, mergeable: false}); + {includeDerived: true, mergeable: false}); assert.deepEqual(statuses, ['Merge Conflict']); }); diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js index 5c6859d2d5..ebce59459f 100644 --- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js +++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js @@ -203,8 +203,7 @@ }, _changeStatuses: { type: String, - computed: '_computeChangeStatusChips(_change, _missingLabels, ' + - '_mergeable)', + computed: '_computeChangeStatusChips(_change, _mergeable)', }, _commitCollapsed: { type: Boolean, @@ -396,16 +395,11 @@ return missingLabels; }, - _readyToSubmit(missingLabels) { - return missingLabels.length === 0; - }, - - _computeChangeStatusChips(change, missingLabels, mergeable) { + _computeChangeStatusChips(change, mergeable) { // Show no chips until mergeability is loaded. if (mergeable === null || mergeable === undefined) { return []; } const options = { - readyToSubmit: this._readyToSubmit(missingLabels), includeDerived: true, mergeable: !!mergeable, };