ambari git commit: AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko)
Repository: ambari Updated Branches: refs/heads/trunk 4e689afe5 -> b55ba18ed AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b55ba18e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b55ba18e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b55ba18e Branch: refs/heads/trunk Commit: b55ba18edd107a9439e24aafbe2167a76916b07f Parents: 4e689af Author: Oleg Nechiporenko Authored: Wed Feb 1 11:43:37 2017 +0200 Committer: Oleg Nechiporenko Committed: Wed Feb 1 13:15:45 2017 +0200 -- ambari-web/app/mixins.js| 1 + .../configs/widgets/unique/num_llap_nodes.js| 70 .../common/configs/widgets/controls.hbs | 2 + .../configs/service_config_layout_tab_view.js | 23 ++- 4 files changed, 93 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b55ba18e/ambari-web/app/mixins.js -- diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js index 7b4d6b4..9d833b5 100644 --- a/ambari-web/app/mixins.js +++ b/ambari-web/app/mixins.js @@ -53,6 +53,7 @@ require('mixins/wizard/addSecurityConfigs'); require('mixins/wizard/wizard_menu_view'); require('mixins/wizard/assign_master_components'); require('mixins/wizard/wizardHostsLoading'); +require('mixins/common/configs/widgets/unique/num_llap_nodes'); require('mixins/common/configs/config_recommendations'); require('mixins/common/configs/config_recommendation_parser'); require('mixins/common/configs/config_with_override_recommendation_parser'); http://git-wip-us.apache.org/repos/asf/ambari/blob/b55ba18e/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js -- diff --git a/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js new file mode 100644 index 000..a2df0fa --- /dev/null +++ b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +var App = require('app'); + +/** + * Slider for `num_llap_nodes` should have unique widget + * + * @type {Em.Mixin} + */ +App.NumLlapNodesWidgetMixin = Em.Mixin.create({ + + /** + * @type {boolean} + */ + readOnly: Em.computed.alias('config.stackConfigProperty.valueAttributes.read_only'), + + /** + * @type {boolean} + */ + doNotShowWidget: function () { +if (this.get('readOnly')) { + return false; +} +return this.get('isPropertyUndefined') || this.get('config.showAsTextBox'); + }.property('isPropertyUndefined', 'config.showAsTextBox', 'readOnly'), + + handleReadOnlyAttribute: function () { +var readOnly = this.get('readOnly'); +this.set('disabled', readOnly); +this.set('supportSwitchToTextBox', !readOnly); +if (readOnly) { + this.toggleSlider('disable'); +} + }.observes('readOnly'), + + toggleWidgetView: function() { +this._super(); +var action = !this.get('config.showAsTextBox') && this.get('readOnly') ? 'disable' : 'enable'; +this.toggleSlider(action); + }, + + toggleWidgetState: function () { +this.set('disabled', !this.get('config.isEditable')); + }.observes('config.isEditable'), + + toggleSlider: function (action) { +var self = this; +Em.run.next(function () { + self.get('slider')[action](); +}); + } + +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/b55ba18e/ambari-web/app/templates/common/configs/widgets/controls.hbs -- diff --git a/ambari-web/app/templates/common/configs/widgets/controls.hbs b/ambari-web/app/templates/common/configs/widgets/controls.hbs index 351d8ed..b7aff8e 100644 --- a/am
ambari git commit: AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko)
Repository: ambari Updated Branches: refs/heads/branch-2.5 575d55251 -> 0f4775bf6 AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0f4775bf Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0f4775bf Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0f4775bf Branch: refs/heads/branch-2.5 Commit: 0f4775bf6a8ec6fa99c12ec6fb3aee670808d97b Parents: 575d552 Author: Oleg Nechiporenko Authored: Wed Feb 1 13:22:48 2017 +0200 Committer: Oleg Nechiporenko Committed: Wed Feb 1 13:22:48 2017 +0200 -- ambari-web/app/mixins.js| 1 + .../configs/widgets/unique/num_llap_nodes.js| 70 .../common/configs/widgets/controls.hbs | 2 + .../configs/service_config_layout_tab_view.js | 23 ++- 4 files changed, 93 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0f4775bf/ambari-web/app/mixins.js -- diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js index ad682d7..72fd961 100644 --- a/ambari-web/app/mixins.js +++ b/ambari-web/app/mixins.js @@ -52,6 +52,7 @@ require('mixins/wizard/addSecurityConfigs'); require('mixins/wizard/wizard_menu_view'); require('mixins/wizard/assign_master_components'); require('mixins/wizard/wizardHostsLoading'); +require('mixins/common/configs/widgets/unique/num_llap_nodes'); require('mixins/common/configs/config_recommendations'); require('mixins/common/configs/config_recommendation_parser'); require('mixins/common/configs/config_with_override_recommendation_parser'); http://git-wip-us.apache.org/repos/asf/ambari/blob/0f4775bf/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js -- diff --git a/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js new file mode 100644 index 000..a2df0fa --- /dev/null +++ b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +var App = require('app'); + +/** + * Slider for `num_llap_nodes` should have unique widget + * + * @type {Em.Mixin} + */ +App.NumLlapNodesWidgetMixin = Em.Mixin.create({ + + /** + * @type {boolean} + */ + readOnly: Em.computed.alias('config.stackConfigProperty.valueAttributes.read_only'), + + /** + * @type {boolean} + */ + doNotShowWidget: function () { +if (this.get('readOnly')) { + return false; +} +return this.get('isPropertyUndefined') || this.get('config.showAsTextBox'); + }.property('isPropertyUndefined', 'config.showAsTextBox', 'readOnly'), + + handleReadOnlyAttribute: function () { +var readOnly = this.get('readOnly'); +this.set('disabled', readOnly); +this.set('supportSwitchToTextBox', !readOnly); +if (readOnly) { + this.toggleSlider('disable'); +} + }.observes('readOnly'), + + toggleWidgetView: function() { +this._super(); +var action = !this.get('config.showAsTextBox') && this.get('readOnly') ? 'disable' : 'enable'; +this.toggleSlider(action); + }, + + toggleWidgetState: function () { +this.set('disabled', !this.get('config.isEditable')); + }.observes('config.isEditable'), + + toggleSlider: function (action) { +var self = this; +Em.run.next(function () { + self.get('slider')[action](); +}); + } + +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/0f4775bf/ambari-web/app/templates/common/configs/widgets/controls.hbs -- diff --git a/ambari-web/app/templates/common/configs/widgets/controls.hbs b/ambari-web/app/templates/common/configs/widgets/controls.hbs index af5a56a..52cccd4 10064
ambari git commit: AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko)
Repository: ambari Updated Branches: refs/heads/branch-2.5 7bf4ecb38 -> 35a618ff4 AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/35a618ff Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/35a618ff Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/35a618ff Branch: refs/heads/branch-2.5 Commit: 35a618ff4e912883376beb186153ba4080bf4cae Parents: 7bf4ecb Author: Oleg Nechiporenko Authored: Fri Feb 10 12:07:51 2017 +0200 Committer: Oleg Nechiporenko Committed: Mon Feb 13 13:53:31 2017 +0200 -- .../mixins/common/configs/widgets/unique/num_llap_nodes.js| 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/35a618ff/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js -- diff --git a/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js index a2df0fa..781a40a 100644 --- a/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js +++ b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js @@ -45,9 +45,8 @@ App.NumLlapNodesWidgetMixin = Em.Mixin.create({ var readOnly = this.get('readOnly'); this.set('disabled', readOnly); this.set('supportSwitchToTextBox', !readOnly); -if (readOnly) { - this.toggleSlider('disable'); -} +var action = readOnly ? 'disable' : 'enable'; +this.toggleSlider(action); }.observes('readOnly'), toggleWidgetView: function() { @@ -63,7 +62,7 @@ App.NumLlapNodesWidgetMixin = Em.Mixin.create({ toggleSlider: function (action) { var self = this; Em.run.next(function () { - self.get('slider')[action](); + Em.tryInvoke(self.get('slider'), action); }); }
ambari git commit: AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko)
Repository: ambari Updated Branches: refs/heads/trunk eb1b9cfaa -> e9e0a438a AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e9e0a438 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e9e0a438 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e9e0a438 Branch: refs/heads/trunk Commit: e9e0a438a142ec9560ec9a5d8134d40a34efdacc Parents: eb1b9cf Author: Oleg Nechiporenko Authored: Fri Feb 10 12:07:51 2017 +0200 Committer: Oleg Nechiporenko Committed: Tue Feb 14 10:54:05 2017 +0200 -- .../mixins/common/configs/widgets/unique/num_llap_nodes.js| 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e9e0a438/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js -- diff --git a/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js index a2df0fa..781a40a 100644 --- a/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js +++ b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js @@ -45,9 +45,8 @@ App.NumLlapNodesWidgetMixin = Em.Mixin.create({ var readOnly = this.get('readOnly'); this.set('disabled', readOnly); this.set('supportSwitchToTextBox', !readOnly); -if (readOnly) { - this.toggleSlider('disable'); -} +var action = readOnly ? 'disable' : 'enable'; +this.toggleSlider(action); }.observes('readOnly'), toggleWidgetView: function() { @@ -63,7 +62,7 @@ App.NumLlapNodesWidgetMixin = Em.Mixin.create({ toggleSlider: function (action) { var self = this; Em.run.next(function () { - self.get('slider')[action](); + Em.tryInvoke(self.get('slider'), action); }); }
[07/50] [abbrv] ambari git commit: AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko)
AMBARI-19814. 'num_llap_nodes' should show up as non-editable property when non-ambari managed queue is selected (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b55ba18e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b55ba18e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b55ba18e Branch: refs/heads/branch-dev-patch-upgrade Commit: b55ba18edd107a9439e24aafbe2167a76916b07f Parents: 4e689af Author: Oleg Nechiporenko Authored: Wed Feb 1 11:43:37 2017 +0200 Committer: Oleg Nechiporenko Committed: Wed Feb 1 13:15:45 2017 +0200 -- ambari-web/app/mixins.js| 1 + .../configs/widgets/unique/num_llap_nodes.js| 70 .../common/configs/widgets/controls.hbs | 2 + .../configs/service_config_layout_tab_view.js | 23 ++- 4 files changed, 93 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b55ba18e/ambari-web/app/mixins.js -- diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js index 7b4d6b4..9d833b5 100644 --- a/ambari-web/app/mixins.js +++ b/ambari-web/app/mixins.js @@ -53,6 +53,7 @@ require('mixins/wizard/addSecurityConfigs'); require('mixins/wizard/wizard_menu_view'); require('mixins/wizard/assign_master_components'); require('mixins/wizard/wizardHostsLoading'); +require('mixins/common/configs/widgets/unique/num_llap_nodes'); require('mixins/common/configs/config_recommendations'); require('mixins/common/configs/config_recommendation_parser'); require('mixins/common/configs/config_with_override_recommendation_parser'); http://git-wip-us.apache.org/repos/asf/ambari/blob/b55ba18e/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js -- diff --git a/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js new file mode 100644 index 000..a2df0fa --- /dev/null +++ b/ambari-web/app/mixins/common/configs/widgets/unique/num_llap_nodes.js @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +var App = require('app'); + +/** + * Slider for `num_llap_nodes` should have unique widget + * + * @type {Em.Mixin} + */ +App.NumLlapNodesWidgetMixin = Em.Mixin.create({ + + /** + * @type {boolean} + */ + readOnly: Em.computed.alias('config.stackConfigProperty.valueAttributes.read_only'), + + /** + * @type {boolean} + */ + doNotShowWidget: function () { +if (this.get('readOnly')) { + return false; +} +return this.get('isPropertyUndefined') || this.get('config.showAsTextBox'); + }.property('isPropertyUndefined', 'config.showAsTextBox', 'readOnly'), + + handleReadOnlyAttribute: function () { +var readOnly = this.get('readOnly'); +this.set('disabled', readOnly); +this.set('supportSwitchToTextBox', !readOnly); +if (readOnly) { + this.toggleSlider('disable'); +} + }.observes('readOnly'), + + toggleWidgetView: function() { +this._super(); +var action = !this.get('config.showAsTextBox') && this.get('readOnly') ? 'disable' : 'enable'; +this.toggleSlider(action); + }, + + toggleWidgetState: function () { +this.set('disabled', !this.get('config.isEditable')); + }.observes('config.isEditable'), + + toggleSlider: function (action) { +var self = this; +Em.run.next(function () { + self.get('slider')[action](); +}); + } + +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/b55ba18e/ambari-web/app/templates/common/configs/widgets/controls.hbs -- diff --git a/ambari-web/app/templates/common/configs/widgets/controls.hbs b/ambari-web/app/templates/common/configs/widgets/controls.hbs index 351d8ed..b7aff8e 100644 --- a/ambari-web/app/templates/common/configs/widgets/controls.hbs +++