AMBARI-20334 - Yarn Queue manager capacity field allows entering invalid values. (Anita Jebaraj via sangeetar)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ae5c17ed Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ae5c17ed Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ae5c17ed Branch: refs/heads/branch-3.0-perf Commit: ae5c17eddac8f0ac9f14ef76704c790712383bb1 Parents: c1f9aba Author: Sangeeta Ravindran <[email protected]> Authored: Thu Apr 20 12:28:30 2017 -0700 Committer: Andrew Onishuk <[email protected]> Committed: Mon Apr 24 14:59:56 2017 +0300 ---------------------------------------------------------------------- .../src/main/resources/ui/app/components/capacityInput.js | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ae5c17ed/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/capacityInput.js ---------------------------------------------------------------------- diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/capacityInput.js b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/capacityInput.js index b6c419a..0646b79 100644 --- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/capacityInput.js +++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/components/capacityInput.js @@ -257,6 +257,8 @@ App.DecimalCapacityInputComponent = Ember.TextField.extend({ } else { this.set('value', (parseFloat(val) > maxVal)? parseFloat(maxVal) : parseFloat(val)); } + } else { + this.set('value', (!Em.isBlank(this.get('value')) && !isNaN(parseFloat(this.get('value')))) ? parseFloat(val) : null); } }.observes('value').on('change') });
