Hotfix for browser bug
Some browsers crash when allowed to have extremely long options in a dropdown. This change truncates the user-supplied field of patch set descriptions to 500 chars to prevent these crashes. Bug: Issue 5085 Change-Id: I1fa5df3badb4ceca90519dfcd89369376992c432
This commit is contained in:
@@ -305,7 +305,7 @@ limitations under the License.
|
||||
[[patchNum.num]]
|
||||
/
|
||||
[[_computeLatestPatchNum(_allPatchSets)]]
|
||||
[[patchNum.desc]]
|
||||
[[_computePatchSetDescription(_change, patchNum.num)]]
|
||||
</option>
|
||||
</template>
|
||||
</select>
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Maximum length for patch set descriptions.
|
||||
var PATCH_DESC_MAX_LENGTH = 500;
|
||||
|
||||
Polymer({
|
||||
is: 'gr-change-view',
|
||||
|
||||
@@ -839,7 +842,8 @@
|
||||
|
||||
_computePatchSetDescription: function(change, patchNum) {
|
||||
var rev = this.getRevisionByPatchNum(change.revisions, patchNum);
|
||||
return (rev && rev.description) ? rev.description : '';
|
||||
return (rev && rev.description) ?
|
||||
rev.description.substring(0, PATCH_DESC_MAX_LENGTH) : '';
|
||||
},
|
||||
|
||||
_computeDescriptionPlaceholder: function(readOnly) {
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Maximum length for patch set descriptions.
|
||||
var PATCH_DESC_MAX_LENGTH = 500;
|
||||
|
||||
var COMMIT_MESSAGE_PATH = '/COMMIT_MSG';
|
||||
|
||||
Polymer({
|
||||
@@ -624,7 +627,8 @@
|
||||
|
||||
_computePatchSetDescription: function(revisions, patchNum) {
|
||||
var rev = this.getRevisionByPatchNum(revisions, patchNum);
|
||||
return (rev && rev.description) ? rev.description : '';
|
||||
return (rev && rev.description) ?
|
||||
rev.description.substring(0, PATCH_DESC_MAX_LENGTH) : '';
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Maximum length for patch set descriptions.
|
||||
var PATCH_DESC_MAX_LENGTH = 500;
|
||||
|
||||
Polymer({
|
||||
is: 'gr-patch-range-select',
|
||||
|
||||
@@ -73,7 +76,8 @@
|
||||
|
||||
_computePatchSetDescription: function(revisions, patchNum) {
|
||||
var rev = this.getRevisionByPatchNum(revisions, patchNum);
|
||||
return (rev && rev.description) ? rev.description : '';
|
||||
return (rev && rev.description) ?
|
||||
rev.description.substring(0, PATCH_DESC_MAX_LENGTH) : '';
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user