From 86a1eaadf188b0879ae41a5fa125649ad51f0118 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 28 Jun 2016 11:30:55 -0700 Subject: [PATCH 1/3] Enforce 30 character limit on wallet name. --- CHANGELOG.md | 1 + ui/app/components/editable-label.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 113bf1ab7..86671c9cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed bug where MetaMask interfered with PDF loading. - Moved switch account icon into menu bar. +- Now enforce 30 character limit on wallet names. ## 2.4.4 2016-06-23 diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 3d7ca17d4..6b3e8cb28 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -18,6 +18,7 @@ EditableLabel.prototype.render = function () { return h('div.editable-label', [ h('input.sizing-input', { defaultValue: props.textValue, + maxLength: "30", onKeyPress: (event) => { this.saveIfEnter(event) }, From a69882df720afd47fda4f238a77d97c81aaa0cdf Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 28 Jun 2016 11:34:30 -0700 Subject: [PATCH 2/3] Additional length check just in case. --- ui/app/components/editable-label.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 6b3e8cb28..34fd7e3e0 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -45,6 +45,7 @@ EditableLabel.prototype.saveIfEnter = function (event) { EditableLabel.prototype.saveText = function () { var container = findDOMNode(this) var text = container.querySelector('.editable-label input').value - this.props.saveText(text) - this.setState({ isEditingLabel: false, textLabel: text }) + var truncatedText = text.substring(0,30) + this.props.saveText(truncatedText) + this.setState({ isEditingLabel: false, textLabel: truncatedText }) } From abcf7621847220f0709eb37cca0fd93cd0632bd5 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 28 Jun 2016 12:49:17 -0700 Subject: [PATCH 3/3] Code style fix. --- ui/app/components/editable-label.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 34fd7e3e0..05ffd4c92 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -18,7 +18,7 @@ EditableLabel.prototype.render = function () { return h('div.editable-label', [ h('input.sizing-input', { defaultValue: props.textValue, - maxLength: "30", + maxLength: '30', onKeyPress: (event) => { this.saveIfEnter(event) }, @@ -45,7 +45,7 @@ EditableLabel.prototype.saveIfEnter = function (event) { EditableLabel.prototype.saveText = function () { var container = findDOMNode(this) var text = container.querySelector('.editable-label input').value - var truncatedText = text.substring(0,30) + var truncatedText = text.substring(0, 30) this.props.saveText(truncatedText) this.setState({ isEditingLabel: false, textLabel: truncatedText }) }