Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D15118CF2 for ; Wed, 18 Nov 2015 16:51:00 +0000 (UTC) Received: (qmail 52617 invoked by uid 500); 18 Nov 2015 16:51:00 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 52496 invoked by uid 500); 18 Nov 2015 16:51:00 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 50939 invoked by uid 99); 18 Nov 2015 16:50:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Nov 2015 16:50:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 67581DFBAB; Wed, 18 Nov 2015 16:50:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ncole@apache.org To: commits@ambari.apache.org Date: Wed, 18 Nov 2015 16:51:44 -0000 Message-Id: <04c7b13e056b4bf0931c0ae0d8242a5a@git.apache.org> In-Reply-To: <84d194f15d934b49a10e6f37996c1d51@git.apache.org> References: <84d194f15d934b49a10e6f37996c1d51@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/50] [abbrv] ambari git commit: AMBARI-13949. Apply created Em.computed macros to ambari-web views (onechiporenko) AMBARI-13949. Apply created Em.computed macros to ambari-web views (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/177a91f4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/177a91f4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/177a91f4 Branch: refs/heads/branch-dev-patch-upgrade Commit: 177a91f405b2cfd74bfa740c38fc643bde56049e Parents: 7059727 Author: Oleg Nechiporenko Authored: Wed Nov 18 18:37:05 2015 +0200 Committer: Oleg Nechiporenko Committed: Wed Nov 18 18:37:05 2015 +0200 ---------------------------------------------------------------------- .../common/ajax_default_error_popup_body.js | 4 +--- .../common/assign_master_components_view.js | 4 +--- .../views/common/configs/config_history_flow.js | 17 ++++--------- .../app/views/common/configs/controls_view.js | 16 ++++--------- .../notification_configs_view.js | 4 +--- .../configs/service_config_layout_tab_view.js | 4 +--- .../views/common/configs/service_config_view.js | 4 +--- .../configs/widgets/config_widget_view.js | 8 ++----- .../widgets/directory_config_widget_view.js | 4 +--- .../configs/widgets/plain_config_text_field.js | 4 +--- .../widgets/test_db_connection_widget_view.js | 4 +--- .../app/views/common/filter_combo_cleanable.js | 8 ++----- ambari-web/app/views/common/filter_combobox.js | 4 +--- .../common/form/manage_credentials_form_view.js | 14 +++-------- ambari-web/app/views/common/grid.js | 8 ++----- .../common/host_progress_popup_body_view.js | 4 +--- ambari-web/app/views/common/metric.js | 16 ++++--------- .../common/modal_popups/invalid_KDC_popup.js | 12 +++------- .../manage_kdc_credentials_popup.js | 4 +--- .../common/modal_popups/select_groups_popup.js | 4 +--- .../app/views/common/rolling_restart_view.js | 9 +++---- ambari-web/app/views/common/table_view.js | 12 +++------- .../views/common/widget/gauge_widget_view.js | 12 +++------- .../views/common/widget/graph_widget_view.js | 20 ++++------------ ambari-web/app/views/main/admin.js | 4 +--- .../app/views/main/admin/authentication.js | 9 +++---- .../nameNode/rollbackHA/step1_view.js | 8 ++----- .../highAvailability/nameNode/step3_view.js | 5 ++-- .../highAvailability/nameNode/step4_view.js | 6 +---- .../admin/stack_upgrade/upgrade_task_view.js | 4 +--- .../stack_upgrade/upgrade_version_box_view.js | 4 +--- .../admin/stack_upgrade/upgrade_wizard_view.js | 8 ++----- .../app/views/main/alert_definitions_view.js | 4 +--- .../main/alerts/manage_alert_groups_view.js | 5 +--- .../alerts/manage_alert_notifications_view.js | 8 ++----- ambari-web/app/views/main/dashboard.js | 4 +--- .../main/dashboard/widgets/flume_agent_live.js | 4 +--- .../dashboard/widgets/hbase_average_load.js | 13 ++++------ .../views/main/dashboard/widgets/hbase_links.js | 12 +++------- .../widgets/hbase_regions_in_transition.js | 12 +++------- .../main/dashboard/widgets/namenode_rpc.js | 8 ++----- .../dashboard/widgets/node_managers_live.js | 4 +--- .../main/dashboard/widgets/pie_chart_widget.js | 8 ++----- .../main/dashboard/widgets/supervisor_live.js | 12 +++------- .../views/main/dashboard/widgets/text_widget.js | 8 ++----- ambari-web/app/views/main/host.js | 20 ++++------------ ambari-web/app/views/main/host/configs.js | 4 +--- ambari-web/app/views/main/host/details.js | 8 ++----- .../main/host/details/host_component_view.js | 25 +++++--------------- .../app/views/main/host/host_alerts_view.js | 4 +--- .../app/views/main/host/stack_versions_view.js | 4 +--- ambari-web/app/views/main/host/summary.js | 4 +--- ambari-web/app/views/main/menu.js | 12 +++------- .../info/metrics/flume/flume_metric_graph.js | 4 +--- .../app/views/main/service/info/summary.js | 20 ++++------------ ambari-web/app/views/main/service/item.js | 12 +++------- ambari-web/app/views/main/service/menu.js | 24 +++++-------------- .../views/main/service/reassign/step3_view.js | 8 ++----- .../views/main/service/reassign/step4_view.js | 8 +------ .../views/main/service/reassign/step7_view.js | 16 ++++--------- .../app/views/main/service/reconfigure.js | 9 +++---- ambari-web/app/views/main/service/service.js | 16 ++++--------- .../app/views/main/service/services/hbase.js | 16 ++++--------- .../app/views/main/service/services/hdfs.js | 16 ++++--------- .../app/views/main/service/services/storm.js | 8 ++----- .../app/views/main/service/services/yarn.js | 4 +--- ambari-web/app/views/wizard/step1_view.js | 22 ++++++----------- ambari-web/app/views/wizard/step2_view.js | 16 ++++--------- .../views/wizard/step3/hostLogPopupBody_view.js | 8 ++----- .../wizard/step3/hostWarningPopupBody_view.js | 8 ++----- ambari-web/app/views/wizard/step3_view.js | 8 ++----- ambari-web/app/views/wizard/step5_view.js | 9 +++---- ambari-web/app/views/wizard/step6_view.js | 4 +--- .../views/wizard/step9/hostLogPopupBody_view.js | 8 ++----- ambari-web/app/views/wizard/step9_view.js | 16 ++++--------- 75 files changed, 176 insertions(+), 515 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/ajax_default_error_popup_body.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/ajax_default_error_popup_body.js b/ambari-web/app/views/common/ajax_default_error_popup_body.js index 616e69e..60bff17 100644 --- a/ambari-web/app/views/common/ajax_default_error_popup_body.js +++ b/ambari-web/app/views/common/ajax_default_error_popup_body.js @@ -59,9 +59,7 @@ App.AjaxDefaultErrorPopupBodyView = Em.View.extend({ * Indicates if error message should be displayed * @type {boolean} */ - showMessage: function () { - return !!this.get('message'); - }.property('message'), + showMessage: Em.computed.bool('message'), /** * HTTP response error description http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/assign_master_components_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/assign_master_components_view.js b/ambari-web/app/views/common/assign_master_components_view.js index f2c0ab0..7e97128 100644 --- a/ambari-web/app/views/common/assign_master_components_view.js +++ b/ambari-web/app/views/common/assign_master_components_view.js @@ -39,9 +39,7 @@ App.AssignMasterComponentsView = Em.View.extend({ * Otherwise - App.SelectHostView * @type {bool} */ - shouldUseInputs: function() { - return this.get('controller.hosts.length') > 25; - }.property('controller.hosts.length'), + shouldUseInputs: Em.computed.gt('controller.hosts.length', 25), didInsertElement: function () { this.get('controller').loadStep(); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/config_history_flow.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js index da748af..89f0c03 100644 --- a/ambari-web/app/views/common/configs/config_history_flow.js +++ b/ambari-web/app/views/common/configs/config_history_flow.js @@ -27,12 +27,8 @@ App.ConfigHistoryFlowView = Em.View.extend({ startIndex: 0, showLeftArrow: false, showRightArrow: false, - leftArrowTooltip: function () { - return this.get('showLeftArrow') ? Em.I18n.t('services.service.config.configHistory.leftArrow.tooltip') : null; - }.property('showLeftArrow'), - rightArrowTooltip: function () { - return this.get('showRightArrow') ? Em.I18n.t('services.service.config.configHistory.rightArrow.tooltip') : null; - }.property('showRightArrow'), + leftArrowTooltip: Em.computed.ifThenElse('showLeftArrow', Em.I18n.t('services.service.config.configHistory.leftArrow.tooltip'), null), + rightArrowTooltip: Em.computed.ifThenElse('showRightArrow', Em.I18n.t('services.service.config.configHistory.rightArrow.tooltip'), null), VERSIONS_IN_FLOW: 6, VERSIONS_IN_DROPDOWN: 6, /** @@ -77,9 +73,7 @@ App.ConfigHistoryFlowView = Em.View.extend({ return (this.get('controller.isSubmitDisabled') || !this.get('controller.versionLoaded') || !this.get('controller.isPropertiesChanged')) ; }.property('controller.isSubmitDisabled', 'controller.versionLoaded', 'controller.isPropertiesChanged'), - serviceName: function () { - return this.get('controller.selectedService.serviceName'); - }.property('controller.selectedService.serviceName'), + serviceName: Em.computed.alias('controller.selectedService.serviceName'), displayedServiceVersion: function () { return this.get('serviceVersions').findProperty('isDisplayed'); @@ -87,10 +81,7 @@ App.ConfigHistoryFlowView = Em.View.extend({ /** * identify whether to show link that open whole content of notes */ - showMoreLink: function () { - //100 is number of symbols that fit into label - return (this.get('displayedServiceVersion.notes.length') > 100); - }.property('displayedServiceVersion.notes.length'), + showMoreLink: Em.computed.gt('displayedServiceVersion.notes.length', 100), /** * formatted notes ready to display */ http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/controls_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/controls_view.js b/ambari-web/app/views/common/configs/controls_view.js index 21965a6..8096f64 100644 --- a/ambari-web/app/views/common/configs/controls_view.js +++ b/ambari-web/app/views/common/configs/controls_view.js @@ -33,25 +33,17 @@ App.ControlsView = Ember.View.extend({ return !this.get('serviceConfigProperty.isEditable') && this.get('serviceConfigProperty.group'); }.property('showActions', 'serviceConfigProperty.group'), - showIsFinal: function() { - return this.get('serviceConfigProperty.supportsFinal'); - }.property('serviceConfigProperty.supportsFinal'), + showIsFinal: Em.computed.alias('serviceConfigProperty.supportsFinal'), - showRemove: function() { - return this.get('showActions') && this.get('serviceConfigProperty.isRemovable'); - }.property('showActions', 'serviceConfigProperty.isRemovable'), + showRemove: Em.computed.and('showActions', 'serviceConfigProperty.isRemovable'), - showOverride: function() { - return this.get('showActions') && this.get('serviceConfigProperty.isPropertyOverridable'); - }.property('showActions', 'serviceConfigProperty.isPropertyOverridable'), + showOverride: Em.computed.and('showActions', 'serviceConfigProperty.isPropertyOverridable'), showUndo: function() { return this.get('showActions') && !this.get('serviceConfigProperty.cantBeUndone') && this.get('serviceConfigProperty.isNotDefaultValue'); }.property('showActions', 'serviceConfigProperty.cantBeUndone', 'serviceConfigProperty.isNotDefaultValue'), - showSetRecommended: function() { - return this.get('showActions') && this.get('serviceConfigProperty.recommendedValueExists'); - }.property('showActions', 'serviceConfigProperty.recommendedValueExists') + showSetRecommended: Em.computed.and('showActions', 'serviceConfigProperty.recommendedValueExists') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/custom_category_views/notification_configs_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/custom_category_views/notification_configs_view.js b/ambari-web/app/views/common/configs/custom_category_views/notification_configs_view.js index b8b50a5..9b8bb5f 100644 --- a/ambari-web/app/views/common/configs/custom_category_views/notification_configs_view.js +++ b/ambari-web/app/views/common/configs/custom_category_views/notification_configs_view.js @@ -34,9 +34,7 @@ App.NotificationsConfigsView = App.ServiceConfigsByCategoryView.extend({ */ createNotification: 'no', - categoryConfigsAll: function () { - return this.get('serviceConfigs').filterProperty('filename', 'alert_notification'); - }.property('serviceConfigs.@each').cacheable(), + categoryConfigsAll: Em.computed.filterBy('serviceConfigs', 'filename', 'alert_notification'), /** * @type {string} "tls|ssl" http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/service_config_layout_tab_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js index a2d768f..def75d1 100644 --- a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js +++ b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js @@ -39,9 +39,7 @@ App.ServiceConfigLayoutTabView = Em.View.extend(App.ConfigOverridable, { /** * @type {App.Service} */ - service: function () { - return this.get('controller.selectedService'); - }.property('controller.selectedService'), + service: Em.computed.alias('controller.selectedService'), templateName: require('templates/common/configs/service_config_layout_tab'), http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/service_config_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_config_view.js b/ambari-web/app/views/common/configs/service_config_view.js index 0ef2112..1c12217 100644 --- a/ambari-web/app/views/common/configs/service_config_view.js +++ b/ambari-web/app/views/common/configs/service_config_view.js @@ -62,9 +62,7 @@ App.ServiceConfigView = Em.View.extend({ * Determines if user is on the service configs page * @type {boolean} */ - isOnTheServicePage: function () { - return this.get('controller.name') === 'mainServiceInfoConfigsController'; - }.property('controller.name'), + isOnTheServicePage: Em.computed.equal('controller.name', 'mainServiceInfoConfigsController'), classNameBindings: ['isOnTheServicePage:serviceConfigs'], http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/widgets/config_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/widgets/config_widget_view.js b/ambari-web/app/views/common/configs/widgets/config_widget_view.js index f0499db..ec492af 100644 --- a/ambari-web/app/views/common/configs/widgets/config_widget_view.js +++ b/ambari-web/app/views/common/configs/widgets/config_widget_view.js @@ -63,18 +63,14 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo * if not, text-field with config value or label "Undefined" should be shown * @type {boolean} */ - doNotShowWidget: function() { - return this.get('isPropertyUndefined') || this.get('config.showAsTextBox'); - }.property('isPropertyUndefined', 'config.showAsTextBox'), + doNotShowWidget: Em.computed.or('isPropertyUndefined', 'config.showAsTextBox'), /** * defines if property in not defined in selected version * in this case "Undefined" should be shown instead of widget * @type {boolean} */ - isPropertyUndefined: function() { - return this.get('config.value') === "Undefined"; - }.property('config.value'), + isPropertyUndefined: Em.computed.equal('config.value', 'Undefined'), /** * Tab where current widget placed http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/widgets/directory_config_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/widgets/directory_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/directory_config_widget_view.js index 04af5ff..c698e03 100644 --- a/ambari-web/app/views/common/configs/widgets/directory_config_widget_view.js +++ b/ambari-web/app/views/common/configs/widgets/directory_config_widget_view.js @@ -24,9 +24,7 @@ App.DirectoryConfigWidgetView = App.ConfigWidgetView.extend({ templateName: require('templates/common/configs/widgets/directory_config_widget'), classNames: ['widget-config', 'directory-widget'], - disabled: function() { - return !this.get('config.isEditable'); - }.property('config.isEditable'), + disabled: Em.computed.not('config.isEditable'), /** * Control to edit value. http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js b/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js index 4d41b86..a6388e8 100644 --- a/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js +++ b/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js @@ -30,9 +30,7 @@ App.PlainConfigTextField = Ember.View.extend(App.SupportsDependentConfigs, App.W classNames: ['widget-config-plain-text-field'], placeholderBinding: 'config.savedValue', - disabled: function() { - return !this.get('config.isEditable'); - }.property('config.isEditable'), + disabled: Em.computed.not('config.isEditable'), configLabel: function() { return this.get('config.stackConfigProperty.displayName') || this.get('config.displayName') || this.get('config.name'); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js index 199aac6..5105e9a 100644 --- a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js +++ b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js @@ -25,9 +25,7 @@ App.TestDbConnectionWidgetView = App.ConfigWidgetView.extend({ classNames: ['widget'], /** @property {string} btnCaption - text for button **/ - btnCaption: function () { - return this.get('config.stackConfigProperty.widget.display-name'); - }.property('config.stackConfigProperty.widget.display-name'), + btnCaption: Em.computed.alias('config.stackConfigProperty.widget.display-name'), /** @property {string} responseCaption - text for status link **/ responseCaption: null, /** @property {boolean} isConnecting - is request to server activated **/ http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/filter_combo_cleanable.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/filter_combo_cleanable.js b/ambari-web/app/views/common/filter_combo_cleanable.js index 6f26ca5..b686000 100644 --- a/ambari-web/app/views/common/filter_combo_cleanable.js +++ b/ambari-web/app/views/common/filter_combo_cleanable.js @@ -52,18 +52,14 @@ App.FilterComboCleanableView = Ember.View.extend({ column.set('selected', !column.get('selected')); }, - filterNotEmpty: function(target){ - return (this.get('filter').length > 0); - }.property('filter'), + filterNotEmpty: Em.computed.gt('filter.length', 0), /** * true if any of filter columns is selected * in this case clear filter row should be shown * @type {boolean} */ - showClearFilter: function() { - return this.get('columns').someProperty('selected'); - }.property('columns.@each.selected'), + showClearFilter: Em.computed.someBy('columns', 'selected', true), /** * clears all filter columns. http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/filter_combobox.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/filter_combobox.js b/ambari-web/app/views/common/filter_combobox.js index 47a8485..897d65b 100644 --- a/ambari-web/app/views/common/filter_combobox.js +++ b/ambari-web/app/views/common/filter_combobox.js @@ -31,9 +31,7 @@ App.FilterComboboxView = Ember.View.extend({ //filter: '', binding outside //columns: [], binding outside - placeHolder: function(){ - return this.t('common.combobox.placeholder'); - }.property(), + placeHolder: Em.I18n.t('common.combobox.placeholder'), /** * Onclick handler for dropdown menu http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/form/manage_credentials_form_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/form/manage_credentials_form_view.js b/ambari-web/app/views/common/form/manage_credentials_form_view.js index 685051d..237b94d 100644 --- a/ambari-web/app/views/common/form/manage_credentials_form_view.js +++ b/ambari-web/app/views/common/form/manage_credentials_form_view.js @@ -45,7 +45,7 @@ App.ManageCredentialsFormView = Em.View.extend({ * * @type {boolean} */ - checkboxDisabled: Ember.computed.not('storePersisted'), + checkboxDisabled: Em.computed.not('storePersisted'), /** * Credentials can be removed, in case when they stored to persistent secure storage. @@ -133,22 +133,14 @@ App.ManageCredentialsFormView = Em.View.extend({ return credentialsUtils.STORE_TYPES.PERSISTENT; }.property('storeCredentials'), - formHeader: function() { - return this.get('isRemovable') ? - Em.I18n.t('admin.kerberos.credentials.form.header.stored') : - Em.I18n.t('admin.kerberos.credentials.form.header.not.stored'); - }.property('isRemovable'), + formHeader: Em.computed.ifThenElse('isRemovable', Em.I18n.t('admin.kerberos.credentials.form.header.stored'), Em.I18n.t('admin.kerberos.credentials.form.header.not.stored')), /** * Message to display in tooltip regarding persistent storage state. * * @type {string} */ - hintMessage: function() { - return this.get('storePersisted') ? - Em.I18n.t('admin.kerberos.credentials.store.hint.supported') : - Em.I18n.t('admin.kerberos.credentials.store.hint.not.supported'); - }.property('storePersisted'), + hintMessage: Em.computed.ifThenElse('storePersisted', Em.I18n.t('admin.kerberos.credentials.store.hint.supported'), Em.I18n.t('admin.kerberos.credentials.store.hint.not.supported')), /** * Observe changes for principal and password. http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/grid.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/grid.js b/ambari-web/app/views/common/grid.js index 39a738c..4a35770 100644 --- a/ambari-web/app/views/common/grid.js +++ b/ambari-web/app/views/common/grid.js @@ -31,9 +31,7 @@ App.GridFilter = Em.View.extend({ getHeader:function () { return this.get('header') }, - filters:function () { - return this.get('header._filters'); - }.property('header._filters') + filters:Em.computed.alias('header._filters') }); App.GridHeader = Em.View.extend({ @@ -108,9 +106,7 @@ App.GridRow = Em.View.extend({ }); App.GridPage = Em.Object.extend({ - activeClass:function () { - return this.get('active') ? "active" : ""; - }.property('active'), + activeClass:Em.computed.ifThenElse('active', 'active', ''), active:function () { return parseInt(this.get('number')) == parseInt(this.get('pager.grid.currentPage')); }.property('pager.grid.currentPage') http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/host_progress_popup_body_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/host_progress_popup_body_view.js b/ambari-web/app/views/common/host_progress_popup_body_view.js index 86e1fc8..840e678 100644 --- a/ambari-web/app/views/common/host_progress_popup_body_view.js +++ b/ambari-web/app/views/common/host_progress_popup_body_view.js @@ -197,9 +197,7 @@ App.HostProgressPopupBodyView = App.TableView.extend({ /** * @type {boolean} */ - isHostEmptyList: function () { - return !this.get('pageContent.length'); - }.property('pageContent.length'), + isHostEmptyList: Em.computed.empty('pageContent'), /** * @type {wrappedHost} http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/metric.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/metric.js b/ambari-web/app/views/common/metric.js index affe619..bee836b 100644 --- a/ambari-web/app/views/common/metric.js +++ b/ambari-web/app/views/common/metric.js @@ -108,23 +108,15 @@ App.MetricFilteringWidget = Em.View.extend({ itemView:Em.View.extend({ tagName:'li', classNameBindings:['disabled'], - disabled:function () { - return this.get('isActive') ? "disabled" : false; - }.property('isActive'), - isActive:function () { - return this.get('metric.value') == this.get('widget.chosenMetric'); - }.property('widget.chosenMetric'), - label:function () { - return this.get('metric.label'); - }.property('metric.label'), + disabled:Em.computed.ifThenElse('isActive', 'disabled', false), + isActive:Em.computed.equalProperties('metric.value', 'widget.chosenMetric'), + label:Em.computed.alias('metric.label'), template:Em.Handlebars.compile('{{unbound view.label}}') }), moreItemView:function () { return this.get('itemView').extend({ - label:function () { - return this.get('metric.value'); - }.property('metric.value') + label:Em.computed.alias('metric.value') }); }.property(), http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/modal_popups/invalid_KDC_popup.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/modal_popups/invalid_KDC_popup.js b/ambari-web/app/views/common/modal_popups/invalid_KDC_popup.js index 9de8537b..5309bf4 100644 --- a/ambari-web/app/views/common/modal_popups/invalid_KDC_popup.js +++ b/ambari-web/app/views/common/modal_popups/invalid_KDC_popup.js @@ -51,27 +51,21 @@ App.showInvalidKDCPopup = function (ajaxOpt, message) { * * @type {boolean} */ - checkboxDisabled: Ember.computed.not('storePersisted'), + checkboxDisabled: Em.computed.not('storePersisted'), /** * Returns storage type used to save credentials e.g. persistent, temporary (default) * * @type {string} */ - storageType: function() { - return this.get('storeCredentials') ? credentialsUtils.STORE_TYPES.PERSISTENT : credentialsUtils.STORE_TYPES.TEMPORARY; - }.property('storeCredentials'), + storageType: Em.computed.ifThenElse('storeCredentials', credentialsUtils.STORE_TYPES.PERSISTENT, credentialsUtils.STORE_TYPES.TEMPORARY), /** * Message to display in tooltip regarding persistent storage state. * * @type {string} */ - hintMessage: function() { - return this.get('storePersisted') ? - Em.I18n.t('admin.kerberos.credentials.store.hint.supported') : - Em.I18n.t('admin.kerberos.credentials.store.hint.not.supported'); - }.property('storePersisted'), + hintMessage: Em.computed.ifThenElse('storePersisted', Em.I18n.t('admin.kerberos.credentials.store.hint.supported'), Em.I18n.t('admin.kerberos.credentials.store.hint.not.supported')), bodyClass: Em.View.extend({ warningMsg: message + Em.I18n.t('popup.invalid.KDC.msg'), http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/modal_popups/manage_kdc_credentials_popup.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/modal_popups/manage_kdc_credentials_popup.js b/ambari-web/app/views/common/modal_popups/manage_kdc_credentials_popup.js index 87592aa..2839a7d 100644 --- a/ambari-web/app/views/common/modal_popups/manage_kdc_credentials_popup.js +++ b/ambari-web/app/views/common/modal_popups/manage_kdc_credentials_popup.js @@ -36,9 +36,7 @@ App.showManageCredentialsPopup = function () { isCredentialsRemoved: false, - disablePrimary: function() { - return this.get('formView.isSubmitDisabled'); - }.property('formView.isSubmitDisabled'), + disablePrimary: Em.computed.alias('formView.isSubmitDisabled'), formView: function() { return this.get('childViews').findProperty('viewName', 'manageCredentialsForm'); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/modal_popups/select_groups_popup.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/modal_popups/select_groups_popup.js b/ambari-web/app/views/common/modal_popups/select_groups_popup.js index 42251a9..264d7b1 100644 --- a/ambari-web/app/views/common/modal_popups/select_groups_popup.js +++ b/ambari-web/app/views/common/modal_popups/select_groups_popup.js @@ -45,9 +45,7 @@ App.showSelectGroupsPopup = function (selectedServiceName, selectedConfigGroup, didInsertElement: function() { this.set('selectedGroup', this.get('parentView.parentView.selectedConfigGroup.dependentConfigGroups')[this.get('serviceName')]); }, - serviceName: function() { - return this.get('content').get('serviceName'); - }.property('content'), + serviceName: Em.computed.alias('content.serviceName'), selectedGroup: null, updateGroup: function() { var dependentGroups = $.extend({},this.get('parentView.parentView.selectedConfigGroup.dependentConfigGroups')); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/rolling_restart_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/rolling_restart_view.js b/ambari-web/app/views/common/rolling_restart_view.js index d84f9c6..16477ea 100644 --- a/ambari-web/app/views/common/rolling_restart_view.js +++ b/ambari-web/app/views/common/rolling_restart_view.js @@ -174,17 +174,14 @@ App.RollingRestartView = Em.View.extend({ * List of host components without components in out-of-service state * @type {Array} */ - nonMaintainanceHostComponents : function() { - return this.get('allHostComponents').filterProperty('passiveState', 'OFF') - }.property('allHostComponents', 'allHostComponents.@each.passiveState'), + nonMaintainanceHostComponents : Em.computed.filterBy('allHostComponents', 'passiveState', 'OFF'), /** * List of host components with host in Maintenance mode * @type {Array} */ - componentsWithMaintenanceHost: function() { - return this.get('allHostComponents').filterProperty('hostPassiveState', 'ON'); - }.property('allHostComponents', 'allHostComponents.@each.hostPassiveState'), + componentsWithMaintenanceHost: Em.computed.filterBy('allHostComponents', 'hostPassiveState', 'ON'), + /** * List of host components without components in out-of-service state * If staleConfigsOnly is true, components with staleConfigs = false are also filtered http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/table_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/table_view.js b/ambari-web/app/views/common/table_view.js index fe433f6..cf0d761 100644 --- a/ambari-web/app/views/common/table_view.js +++ b/ambari-web/app/views/common/table_view.js @@ -62,16 +62,12 @@ App.TableView = Em.View.extend(App.UserPref, { /** * number of items in table after applying filters */ - filteredCount: function () { - return this.get('filteredContent.length'); - }.property('filteredContent.length'), + filteredCount: Em.computed.alias('filteredContent.length'), /** * total number of items in table before applying filters */ - totalCount: function () { - return this.get('content.length'); - }.property('content.length'), + totalCount: Em.computed.alias('content.length'), /** * Do filtering, using saved in the local storage filter conditions @@ -408,9 +404,7 @@ App.TableView = Em.View.extend(App.UserPref, { * Determine if filteredContent is empty or not * @type {Boolean} */ - hasFilteredItems: function() { - return !!this.get('filteredCount'); - }.property('filteredCount'), + hasFilteredItems: Em.computed.bool('filteredCount'), /** * Contains content to show on the current page of data page view http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/widget/gauge_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/widget/gauge_widget_view.js b/ambari-web/app/views/common/widget/gauge_widget_view.js index 60d636d..4a9ab25 100644 --- a/ambari-web/app/views/common/widget/gauge_widget_view.js +++ b/ambari-web/app/views/common/widget/gauge_widget_view.js @@ -77,22 +77,16 @@ App.GaugeWidgetView = Em.View.extend(App.WidgetMixin, { */ MAX_VALUE: 100, - warningThreshold: function(){ - return this.get('parentView.content.properties.warning_threshold'); - }.property('parentView.content.properties.warning_threshold'), + warningThreshold: Em.computed.alias('parentView.content.properties.warning_threshold'), - errorThreshold: function(){ - return this.get('parentView.content.properties.error_threshold'); - }.property('parentView.content.properties.error_threshold'), + errorThreshold: Em.computed.alias('parentView.content.properties.error_threshold'), id: function() { return 'gauge-widget-' + this.get('parentView.content.id'); }.property('parentView.content.id'), existCenterText: true, - centerTextColor: function () { - return this.get('contentColor'); - }.property('contentColor'), + centerTextColor: Em.computed.alias('contentColor'), palette: new Rickshaw.Color.Palette({ scheme: [ '#FFFFFF', '#D6DDDF'].reverse() http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/common/widget/graph_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/widget/graph_widget_view.js b/ambari-web/app/views/common/widget/graph_widget_view.js index 7fc4e76..4c8b72d 100644 --- a/ambari-web/app/views/common/widget/graph_widget_view.js +++ b/ambari-web/app/views/common/widget/graph_widget_view.js @@ -71,9 +71,7 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, App.ExportMetricsMixin, { */ data: [], - exportTargetView: function () { - return this.get('childViews.lastObject'); - }.property(), + exportTargetView: Em.computed.alias('childViews.lastObject'), drawWidget: function () { if (this.get('isLoaded')) { @@ -222,15 +220,9 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, App.ExportMetricsMixin, { noTitleUnderGraph: true, inWidget: true, - description: function () { - return this.get('parentView.content.description'); - }.property('parentView.content.description'), - isPreview: function () { - return this.get('parentView.isPreview'); - }.property('parentView.isPreview'), - displayUnit: function () { - return this.get('parentView.content.properties.display_unit'); - }.property('parentView.content.properties.display_unit'), + description: Em.computed.alias('parentView.content.description'), + isPreview: Em.computed.alias('parentView.isPreview'), + displayUnit: Em.computed.alias('parentView.content.properties.display_unit'), setYAxisFormatter: function () { var displayUnit = this.get('displayUnit'); if (displayUnit) { @@ -271,9 +263,7 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, App.ExportMetricsMixin, { return this.get('parentView.content.properties.graph_type') === 'STACK' ? 'area' : 'line'; }.property('parentView.content.properties.graph_type'), - title: function () { - return this.get('parentView.content.widgetName'); - }.property('parentView.content.widgetName'), + title: Em.computed.alias('parentView.content.widgetName'), transformToSeries: function (seriesData) { var seriesArray = []; http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js index 089d593..fb1c046 100644 --- a/ambari-web/app/views/main/admin.js +++ b/ambari-web/app/views/main/admin.js @@ -46,9 +46,7 @@ App.MainAdminView = Em.View.extend({ NavItemView: Ember.View.extend({ tagName: 'li', classNameBindings: 'isActive:active'.w(), - isActive: function () { - return this.get('item') === this.get('parentView.selected'); - }.property('item', 'parentView.selected') + isActive: Em.computed.equalProperties('item', 'parentView.selected') }), willDestroyElement: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin/authentication.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/authentication.js b/ambari-web/app/views/main/admin/authentication.js index c0a1d1e..28604d0 100644 --- a/ambari-web/app/views/main/admin/authentication.js +++ b/ambari-web/app/views/main/admin/authentication.js @@ -31,11 +31,8 @@ App.MainAdminAuthenticationView = Em.View.extend({ this.pushAuthenticationToForm(); }, - ldapChecked:function () { - return this.get('form.field.method.value'); - }.property('form.field.method.value'), + ldapChecked: Em.computed.alias('form.field.method.value'), + + useCredentials: Em.computed.alias('form.field.bindMethod.value') - useCredentials:function () { - return this.get('form.field.bindMethod.value'); - }.property('form.field.bindMethod.value') }); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin/highAvailability/nameNode/rollbackHA/step1_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/nameNode/rollbackHA/step1_view.js b/ambari-web/app/views/main/admin/highAvailability/nameNode/rollbackHA/step1_view.js index a3c01ef..485f815 100644 --- a/ambari-web/app/views/main/admin/highAvailability/nameNode/rollbackHA/step1_view.js +++ b/ambari-web/app/views/main/admin/highAvailability/nameNode/rollbackHA/step1_view.js @@ -64,13 +64,9 @@ App.RollbackHighAvailabilityWizardStep1View = Em.View.extend({ this.loadHostsName(); }, - tipAddNNHost: function () { - return this.get('controller.content.addNNHost'); - }.property('controller.content.addNNHost'), + tipAddNNHost: Em.computed.alias('controller.content.addNNHost'), - tipSNNHost: function () { - return this.get('controller.content.sNNHost'); - }.property('controller.content.sNNHost'), + tipSNNHost: Em.computed.alias('controller.content.sNNHost'), done: function () { this.get('controller.content').set('selectedSNNHost', this.get('selectedSNNHost')); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin/highAvailability/nameNode/step3_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/nameNode/step3_view.js b/ambari-web/app/views/main/admin/highAvailability/nameNode/step3_view.js index fdbea28..736ab00 100644 --- a/ambari-web/app/views/main/admin/highAvailability/nameNode/step3_view.js +++ b/ambari-web/app/views/main/admin/highAvailability/nameNode/step3_view.js @@ -34,8 +34,7 @@ App.HighAvailabilityWizardStep3View = Em.View.extend({ secondaryNameNode: function () { return this.get('controller.content.masterComponentHosts').findProperty('component', "SECONDARY_NAMENODE").hostName; }.property('controller.content.masterComponentHosts'), - journalNodes: function () { - return this.get('controller.content.masterComponentHosts').filterProperty('component', "JOURNALNODE"); - }.property('controller.content.masterComponentHosts') + + journalNodes: Em.computed.filterBy('controller.content.masterComponentHosts', 'component', 'JOURNALNODE') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin/highAvailability/nameNode/step4_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/nameNode/step4_view.js b/ambari-web/app/views/main/admin/highAvailability/nameNode/step4_view.js index f23e420..ba261f0 100644 --- a/ambari-web/app/views/main/admin/highAvailability/nameNode/step4_view.js +++ b/ambari-web/app/views/main/admin/highAvailability/nameNode/step4_view.js @@ -32,10 +32,6 @@ App.HighAvailabilityWizardStep4View = Em.View.extend({ return Em.I18n.t('admin.highAvailability.wizard.step4.body').format(this.get('controller.content.hdfsUser'), nN.hostName); }.property('controller.content.masterComponentHosts'), - nnCheckPointText: function () { - return (this.get('controller.isNextEnabled')) ? - Em.I18n.t('admin.highAvailability.wizard.step4.ckCreated') : - Em.I18n.t('admin.highAvailability.wizard.step4.ckNotCreated'); - }.property('controller.isNextEnabled') + nnCheckPointText: Em.computed.ifThenElse('controller.isNextEnabled', Em.I18n.t('admin.highAvailability.wizard.step4.ckCreated'), Em.I18n.t('admin.highAvailability.wizard.step4.ckNotCreated')) }); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js index b289ce1..2e4e45c 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js @@ -31,9 +31,7 @@ App.upgradeTaskView = Em.View.extend({ /** * @type {boolean} */ - showContent: function () { - return this.get('outsideView') || this.get('content.isExpanded'); - }.property('content.isExpanded', 'outsideView'), + showContent: Em.computed.or('outsideView', 'content.isExpanded'), /** * @type {boolean} http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js index 9699fdf..0f60337 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js @@ -68,9 +68,7 @@ App.UpgradeVersionBoxView = Em.View.extend({ /** * @type {boolean} */ - isOutOfSync: function () { - return this.get('content.status') === 'OUT_OF_SYNC'; - }.property('content.status'), + isOutOfSync: Em.computed.equal('content.status', 'OUT_OF_SYNC'), /** * map containing version (id, label) http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js index 73b13fd..8ebfff3 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js @@ -194,17 +194,13 @@ App.upgradeWizardView = Em.View.extend({ * manualItem: indicate whether the step is "Service check failures", a dialog with instructions will show up for manual steps * @type {boolean} */ - isServiceCheckFailuresItem: function () { - return this.get('manualItem.context') === this.get("controller.serviceCheckFailuresContext"); - }.property('manualItem.context'), + isServiceCheckFailuresItem: Em.computed.equalProperties('manualItem.context', 'controller.serviceCheckFailuresContext'), /** * manualItem: indicate whether the step is Finalize * @type {boolean} */ - isFinalizeItem: function () { - return this.get('manualItem.context') === this.get('controller.finalizeContext'); - }.property('manualItem.context'), + isFinalizeItem: Em.computed.equalProperties('manualItem.context', 'controller.finalizeContext'), /** * label of Upgrade status http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/alert_definitions_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/alert_definitions_view.js b/ambari-web/app/views/main/alert_definitions_view.js index 6b5e751..64c6f9b 100644 --- a/ambari-web/app/views/main/alert_definitions_view.js +++ b/ambari-web/app/views/main/alert_definitions_view.js @@ -75,9 +75,7 @@ App.MainAlertDefinitionsView = App.TableView.extend({ /** * @type {number} */ - totalCount: function () { - return this.get('content.length'); - }.property('content.length'), + totalCount: Em.computed.alias('content.length'), colPropAssoc: ['', 'label', 'summary', 'serviceName', 'type', 'lastTriggered', 'enabled', 'groups'], http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/alerts/manage_alert_groups_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/alerts/manage_alert_groups_view.js b/ambari-web/app/views/main/alerts/manage_alert_groups_view.js index 069d531..1872ad1 100644 --- a/ambari-web/app/views/main/alerts/manage_alert_groups_view.js +++ b/ambari-web/app/views/main/alerts/manage_alert_groups_view.js @@ -99,10 +99,7 @@ App.MainAlertsManageAlertGroupView = Em.View.extend({ * Tooltip for "Remove group"-button * @type {string} */ - removeButtonTooltip: function () { - return this.get('controller.isRemoveButtonDisabled') ? Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeButtonDisabled') : - Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeButton'); - }.property('controller.isRemoveButtonDisabled'), + removeButtonTooltip: Em.computed.ifThenElse('controller.isRemoveButtonDisabled', Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeButtonDisabled'), Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeButton')), /** * Tooltip for "Rename"-button http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js b/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js index 4672662..e6e2403 100644 --- a/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js +++ b/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js @@ -43,17 +43,13 @@ App.ManageAlertNotificationsView = Em.View.extend({ * Show EMAIL information if selected alert notification has type EMAIL * @type {boolean} */ - showEmailDetails: function () { - return this.get('controller.selectedAlertNotification.type') === 'EMAIL'; - }.property('controller.selectedAlertNotification.type'), + showEmailDetails: Em.computed.equal('controller.selectedAlertNotification.type', 'EMAIL'), /** * Show SNMP information if selected alert notification has type SNMP * @type {boolean} */ - showSNMPDetails: function () { - return this.get('controller.selectedAlertNotification.type') === 'SNMP'; - }.property('controller.selectedAlertNotification.type'), + showSNMPDetails: Em.computed.equal('controller.selectedAlertNotification.type', 'SNMP'), email: function () { return this.get('controller.selectedAlertNotification.properties')['ambari.dispatch.recipients']; http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard.js b/ambari-web/app/views/main/dashboard.js index 8448e2b..9694774 100644 --- a/ambari-web/app/views/main/dashboard.js +++ b/ambari-web/app/views/main/dashboard.js @@ -45,9 +45,7 @@ App.MainDashboardView = Em.View.extend({ NavItemView: Ember.View.extend({ tagName: 'li', classNameBindings: 'isActive:active'.w(), - isActive: function () { - return this.get('item') === this.get('parentView.selected'); - }.property('item', 'parentView.selected'), + isActive: Em.computed.equalProperties('item', 'parentView.selected'), elementId: Ember.computed(function(){ var label = Em.get(this, 'templateData.keywords.category.label'); return label ? 'dashboard-view-tab-' + label.toLowerCase().replace(/\s/g, '-') : ""; http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js b/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js index c775a7b..df4f62d 100644 --- a/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js @@ -40,9 +40,7 @@ App.FlumeAgentUpView = App.TextDashboardWidgetView.extend({ thresh2: 70, maxValue: 100, - flumeAgentComponents: function() { - return this.get('model.hostComponents').filterProperty('componentName', 'FLUME_HANDLER'); - }.property('model.hostComponents.length'), + flumeAgentComponents: Em.computed.filterBy('model.hostComponents', 'componentName', 'FLUME_HANDLER'), /** * @type {Array} http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js b/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js index f58e0bf..5f8d8aa 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js @@ -34,12 +34,9 @@ App.HBaseAverageLoadView = App.TextDashboardWidgetView.extend({ return result; }.property("model.averageLoad"), - isGreen: function () { - return this.get('data') <= this.get('thresh1'); - }.property('data','thresh1','thresh2'), - isRed: function () { - return this.get('data') > this.get('thresh2'); - }.property('data','thresh1','thresh2'), + isGreen: Em.computed.lteProperties('data', 'thresh1'), + isRed: Em.computed.gtProperties('data', 'thresh2'), + isNA: function (){ return this.get('data') === null || isNaN(this.get('data')); }.property('data'), @@ -48,9 +45,7 @@ App.HBaseAverageLoadView = App.TextDashboardWidgetView.extend({ thresh2: 2, maxValue: 'infinity', - data: function () { - return this.get('model.averageLoad'); - }.property("model.averageLoad"), + data: Em.computed.alias('model.averageLoad'), content: function (){ if(this.get('data') || this.get('data') == 0){ http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/hbase_links.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js index e0079b6..53ad59c 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_links.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_links.js @@ -33,21 +33,15 @@ App.HBaseLinksView = App.LinkDashboardWidgetView.extend({ /** * All master components */ - masters: function () { - return this.get('model.hostComponents').filterProperty('isMaster', true); - }.property('model.hostComponents.@each'), + masters: Em.computed.filterBy('model.hostComponents', 'isMaster', true), /** * Passive master components */ - passiveMasters: function () { - return this.get('masters').filterProperty('haStatus', 'false'); - }.property('masters'), + passiveMasters: Em.computed.filterBy('masters', 'haStatus', 'false'), /** * One(!) active master component */ - activeMaster: function () { - return this.get('masters').findProperty('haStatus', 'true'); - }.property('masters'), + activeMaster: Em.computed.findBy('masters', 'haStatus', 'true'), activeMasterTitle: function(){ return this.t('service.hbase.activeMaster'); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js b/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js index debbb1d..ec91ab6 100644 --- a/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js +++ b/ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js @@ -32,15 +32,11 @@ App.HBaseRegionsInTransitionView = App.TextDashboardWidgetView.extend({ }.property("model.regionsInTransition"), classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'], - isGreen: function () { - return this.get('data') <= this.get('thresh1'); - }.property('data','thresh1'), + isGreen: Em.computed.lteProperties('data', 'thresh1'), isOrange: function () { return (this.get('data') <= this.get('thresh2') && this.get('data') > this.get('thresh1') ); }.property('data','thresh1','thresh2'), - isRed: function () { - return this.get('data') > this.get('thresh2'); - }.property('data','thresh2'), + isRed: Em.computed.gtProperties('data', 'thresh2'), isNA: function () { return this.get('data') === null; }.property('data'), @@ -49,9 +45,7 @@ App.HBaseRegionsInTransitionView = App.TextDashboardWidgetView.extend({ thresh2: 2, maxValue: 'infinity', - data: function () { - return this.get('model.regionsInTransition'); - }.property("model.regionsInTransition"), + data: Em.computed.alias('model.regionsInTransition'), content: function (){ return this.get('data') + ""; http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js b/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js index 798e828..4826050 100644 --- a/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js +++ b/ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js @@ -35,13 +35,9 @@ App.NameNodeRpcView = App.TextDashboardWidgetView.extend({ thresh2: 2, maxValue: 'infinity', - isGreen: function () { - return (this.get('data') <= this.get('thresh1')); - }.property('data','thresh1'), + isGreen: Em.computed.lteProperties('data', 'thresh1'), - isRed: function () { - return (this.get('data') > this.get('thresh2')); - }.property('data','thresh2'), + isRed: Em.computed.gtProperties('data', 'thresh2'), data: function () { if (this.get('model.nameNodeRpc')) { http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js index 9b12abf..0817f27 100644 --- a/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/node_managers_live.js @@ -50,9 +50,7 @@ App.NodeManagersLiveView = App.TextDashboardWidgetView.extend({ return !this.get('model.metricsNotAvailable') && App.get('router.clusterController.isComponentsStateLoaded'); }.property('App.router.clusterController.isComponentsStateLoaded'), - nodeManagersLive: function () { - return this.get('model.nodeManagersCountActive'); - }.property('model.nodeManagersCountActive'), + nodeManagersLive: Em.computed.alias('model.nodeManagersCountActive'), data: function () { var nodeManagers = this.get('model.nodeManagersTotal'); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js b/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js index 83fc0f5..801dc6c 100644 --- a/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js +++ b/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js @@ -83,18 +83,14 @@ App.PieChartDashboardWidgetView = App.DashboardWidgetView.extend({ content: App.ChartPieView.extend({ model: null, //data bind here - id: function() { - return this.get('parentView.widgetHtmlId'); - }.property('parentView.widgetHtmlId'), // html id + id: Em.computed.alias('parentView.widgetHtmlId'), // html id stroke: '#D6DDDF', //light grey thresh1: null, //bind from parent thresh2: null, innerR: 25, existCenterText: true, - centerTextColor: function () { - return this.get('contentColor'); - }.property('contentColor'), + centerTextColor: Em.computed.alias('contentColor'), palette: new Rickshaw.Color.Palette({ scheme: [ '#FFFFFF', '#D6DDDF'].reverse() http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js index 4f33242..3b9e928 100644 --- a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js +++ b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js @@ -40,17 +40,11 @@ App.SuperVisorUpView = App.TextDashboardWidgetView.extend({ thresh2: 70, maxValue: 100, - superVisorsLive: function () { - return this.get('model.superVisorsStarted'); - }.property('model.superVisorsStarted'), + superVisorsLive: Em.computed.alias('model.superVisorsStarted'), - superVisorsDead: function () { - return this.get('model.superVisorsInstalled'); - }.property('model.superVisorsInstalled'), + superVisorsDead: Em.computed.alias('model.superVisorsInstalled'), - superVisorsTotal: function() { - return this.get('model.superVisorsTotal'); - }.property('model.superVisorsTotal'), + superVisorsTotal: Em.computed.alias('model.superVisorsTotal'), data: function () { if ( !this.get('superVisorsTotal') || Em.isNone(this.get('superVisorsLive'))) { http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/dashboard/widgets/text_widget.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/text_widget.js b/ambari-web/app/views/main/dashboard/widgets/text_widget.js index b51ca6e..dc5f484 100644 --- a/ambari-web/app/views/main/dashboard/widgets/text_widget.js +++ b/ambari-web/app/views/main/dashboard/widgets/text_widget.js @@ -25,17 +25,13 @@ App.TextDashboardWidgetView = App.DashboardWidgetView.extend({ classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'], - isRed: function () { - return (this.get('data') <= this.get('thresh1')); - }.property('data','thresh1'), + isRed: Em.computed.lteProperties('data', 'thresh1'), isOrange: function () { return (this.get('data') <= this.get('thresh2') && this.get('data') > this.get('thresh1')); }.property('data','thresh1','thresh2'), - isGreen: function () { - return (this.get('data') > this.get('thresh2')); - }.property('data','thresh2'), + isGreen: Em.computed.gtProperties('data', 'thresh2'), isNA: function () { return this.get('data') === null; http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/host.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js index 6f1f04b..f8e98f6 100644 --- a/ambari-web/app/views/main/host.js +++ b/ambari-web/app/views/main/host.js @@ -64,9 +64,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, { /** * flag to toggle displaying selected hosts counter */ - showSelectedFilter: function () { - return this.get('selectedHosts.length') > 0; - }.property('selectedHosts'), + showSelectedFilter: Em.computed.bool('selectedHosts.length'), /** * return filtered number of all content number information displayed on the page footer bar @@ -434,9 +432,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, { * true if host has no components * @returns {Boolean} */ - hasNoComponents: function() { - return !this.get('content.hostComponents.length'); - }.property('content.hostComponents.length'), + hasNoComponents: Em.computed.empty('content.hostComponents'), /** @@ -554,9 +550,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, { * Add "active" class for category span-wrapper if current category is selected * @type {String} */ - itemClass: function() { - return this.get('isActive') ? 'active' : ''; - }.property('isActive'), + itemClass: Em.computed.ifThenElse('isActive', 'active', ''), /** * Text shown on the right of category icon @@ -583,9 +577,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, { /** * Category for selected property of each App.Host */ - selectedCategory: function() { - return this.get('categories').findProperty('selected', true); - }.property('categories.@each.selected'), + selectedCategory: Em.computed.findBy('categories', 'selected', true), statusFilter: Em.View.extend({ column: 0, @@ -978,9 +970,7 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, { * associations between host property and column index * @type {Array} */ - colPropAssoc: function () { - return this.get('controller.colPropAssoc'); - }.property('controller.colPropAssoc'), + colPropAssoc: Em.computed.alias('controller.colPropAssoc'), /** * Run clearFilter in the each child filterView http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/host/configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/configs.js b/ambari-web/app/views/main/host/configs.js index 6a6803f..c9779a9 100644 --- a/ambari-web/app/views/main/host/configs.js +++ b/ambari-web/app/views/main/host/configs.js @@ -26,8 +26,6 @@ App.MainHostConfigsView = Em.View.extend({ return App.router.get('mainHostDetailsController.content'); }.property('App.router.mainHostDetailsController.content'), - isConfigAvailable: function () { - return !!this.get('content.hostComponents.length'); - }.property('content.hostComponents.length') + isConfigAvailable: Em.computed.bool('content.hostComponents.length') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details.js b/ambari-web/app/views/main/host/details.js index 838502f..53e4f94 100644 --- a/ambari-web/app/views/main/host/details.js +++ b/ambari-web/app/views/main/host/details.js @@ -31,9 +31,7 @@ App.MainHostDetailsView = Em.View.extend({ return App.router.get('mainHostDetailsController.content'); }.property('App.router.mainHostDetailsController.content'), - clients: function () { - return this.get('content.hostComponents').filterProperty('isClient'); - }.property('content.hostComponents.@each'), + clients: Em.computed.filterBy('content.hostComponents', 'isClient', true), clientsWithConfigs: function() { return this.get('content.hostComponents').filterProperty('isClient').filter(function(client) { @@ -41,9 +39,7 @@ App.MainHostDetailsView = Em.View.extend({ }); }.property('content.hostComponents.@each'), - isActive: function() { - return this.get('controller.content.passiveState') === "OFF"; - }.property('controller.content.passiveState'), + isActive: Em.computed.equal('controller.content.passiveState', 'OFF'), maintenance: function(){ var onOff = this.get('isActive') ? "On" : "Off"; http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/host/details/host_component_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details/host_component_view.js b/ambari-web/app/views/main/host/details/host_component_view.js index eba1691..cec9da4 100644 --- a/ambari-web/app/views/main/host/details/host_component_view.js +++ b/ambari-web/app/views/main/host/details/host_component_view.js @@ -130,33 +130,25 @@ App.HostComponentView = Em.View.extend({ * For Started and Starting states * @type {bool} */ - isStart: function () { - return [App.HostComponentStatus.started, App.HostComponentStatus.starting].contains(this.get('workStatus')); - }.property('workStatus'), + isStart: Em.computed.existsIn('workStatus', [App.HostComponentStatus.started, App.HostComponentStatus.starting]), /** * For Installed state * @type {bool} */ - isStop: function () { - return (this.get('workStatus') == App.HostComponentStatus.stopped); - }.property('workStatus'), + isStop: Em.computed.equal('workStatus', App.HostComponentStatus.stopped), /** * For Installing state * @type {bool} */ - isInstalling: function () { - return (this.get('workStatus') == App.HostComponentStatus.installing); - }.property('workStatus'), + isInstalling: Em.computed.equal('workStatus', App.HostComponentStatus.installing), /** * For Init state * @type {bool} */ - isInit: function() { - return this.get('workStatus') == App.HostComponentStatus.init; - }.property('workStatus'), + isInit: Em.computed.equal('workStatus', App.HostComponentStatus.init), /** * No action available while component is starting/stopping/unknown @@ -172,18 +164,13 @@ App.HostComponentView = Em.View.extend({ * For Stopping or Starting states * @type {bool} */ - isInProgress: function () { - return (this.get('workStatus') === App.HostComponentStatus.stopping || - this.get('workStatus') === App.HostComponentStatus.starting); - }.property('workStatus'), + isInProgress: Em.computed.existsIn('workStatus', [App.HostComponentStatus.stopping, App.HostComponentStatus.starting]), /** * For OFF passiveState of host component * @type {bool} */ - isActive: function () { - return (this.get('content.passiveState') == "OFF"); - }.property('content.passiveState'), + isActive: Em.computed.equal('content.passiveState', 'OFF'), /** * Shows whether we need to show Delete button http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/host/host_alerts_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/host_alerts_view.js b/ambari-web/app/views/main/host/host_alerts_view.js index 656787b..731212f 100644 --- a/ambari-web/app/views/main/host/host_alerts_view.js +++ b/ambari-web/app/views/main/host/host_alerts_view.js @@ -61,9 +61,7 @@ App.MainHostAlertsView = App.TableView.extend({ /** * @type {number} */ - totalCount: function () { - return this.get('content.length'); - }.property('content.length'), + totalCount: Em.computed.alias('content.length'), colPropAssoc: ['', 'serviceName', 'label', 'latestTimestamp', 'state', 'text'], http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/host/stack_versions_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/stack_versions_view.js b/ambari-web/app/views/main/host/stack_versions_view.js index df1e38f..94dd2f9 100644 --- a/ambari-web/app/views/main/host/stack_versions_view.js +++ b/ambari-web/app/views/main/host/stack_versions_view.js @@ -34,9 +34,7 @@ App.MainHostStackVersionsView = App.TableView.extend({ /** * @type {Ember.Array} */ - content: function () { - return this.get('host.stackVersions').filterProperty('isVisible', true); - }.property('host.stackVersions.length'), + content: Em.computed.filterBy('host.stackVersions', 'isVisible', true), /** * return filtered number of all content number information displayed on the page footer bar http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/host/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js index 6ce3529..dd5adab 100644 --- a/ambari-web/app/views/main/host/summary.js +++ b/ambari-web/app/views/main/host/summary.js @@ -230,9 +230,7 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, { * If host lost heartbeat, components can't be added on it * @type {bool} */ - isAddComponent: function () { - return this.get('content.healthClass') !== 'health-status-DEAD-YELLOW'; - }.property('content.healthClass'), + isAddComponent: Em.computed.notEqual('content.healthClass', 'health-status-DEAD-YELLOW'), /** * Disable "Add" button if components can't be added to the current host http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js index 115d839..d01aa67 100644 --- a/ambari-web/app/views/main/menu.js +++ b/ambari-web/app/views/main/menu.js @@ -94,12 +94,8 @@ App.MainMenuView = Em.CollectionView.extend({ var itemsWithDropdown = ['services', 'admin', 'views']; return itemsWithDropdown.contains(item); }.property(''), - isAdminItem: function () { - return this.get('content').routing == 'admin'; - }.property(''), - isServicesItem: function () { - return this.get('content').routing == 'services'; - }.property(''), + isAdminItem: Em.computed.equal('content.routing', 'admin'), + isServicesItem: Em.computed.equal('content.routing', 'services'), isViewsItem: function () { return this.get('content').routing.contains('views'); }.property(''), @@ -147,9 +143,7 @@ App.MainMenuView = Em.CollectionView.extend({ AdminDropdownItemView: Ember.View.extend({ tagName: 'li', classNameBindings: 'isActive:active'.w(), - isActive: function () { - return this.get('item') === this.get('parentView.selectedAdminItem'); - }.property('item', 'parentView.selectedAdminItem'), + isActive: Em.computed.equalProperties('item', 'parentView.selectedAdminItem'), goToCategory: function (event) { var itemName = this.get('parentView').get('content').routing; http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js b/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js index 43a9b51..0d9b382 100644 --- a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js +++ b/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js @@ -39,9 +39,7 @@ App.ChartServiceFlumeMetricGraph = App.ChartLinearTimeView.extend({ return "service-metrics-flume-metric-graph-" + this.get('metricType') + '-' + this.get('metricName'); }.property('metricType', 'metricName'), - title: function(){ - return this.get('metricName'); - }.property('metricName'), + title: Em.computed.alias('metricName'), ajaxIndex: 'host.host_component.flume.metrics.timeseries', http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/info/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js index e1ea6ac..4cda6a2 100644 --- a/ambari-web/app/views/main/service/info/summary.js +++ b/ambari-web/app/views/main/service/info/summary.js @@ -88,9 +88,7 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin return App.get('services.hasClient'); }.property('App.services.hasClient'), - hasManyServers: function () { - return this.get('servers').length > 1; - }.property('servers'), + hasManyServers: Em.computed.gt('servers.length', 1), clientsHostText: function () { if (this.get('controller.content.installedClients').length == 0) { @@ -102,9 +100,7 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin } }.property("hasManyClients"), - hasManyClients: function () { - return this.get('controller.content.installedClients').length > 1; - }.property('service.installedClients'), + hasManyClients: Em.computed.gt('controller.content.installedClients.length', 1), servers: function () { var result = []; @@ -274,9 +270,7 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin href:'javascript:void(null)' }), - serviceName:function () { - return this.get('service.serviceName'); - }.property('service'), + serviceName: Em.computed.alias('service.serviceName'), oldServiceName:'', @@ -286,13 +280,9 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin componentsCount: null, hostsCount: null, - alertsCount: function () { - return this.get('controller.content.alertsCount'); - }.property('controller.content.alertsCount'), + alertsCount: Em.computed.alias('controller.content.alertsCount'), - hasCriticalAlerts: function () { - return this.get('controller.content.hasCriticalAlerts'); - }.property('controller.content.alertsCount'), + hasCriticalAlerts: Em.computed.alias('controller.content.hasCriticalAlerts'), /** * Define if service has alert definitions defined http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/item.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js index d87e16b..edc5d59 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -21,17 +21,11 @@ var App = require('app'); App.MainServiceItemView = Em.View.extend({ templateName: require('templates/main/service/item'), - serviceName: function() { - return this.get('controller.content.serviceName'); - }.property('controller.content.serviceName'), + serviceName: Em.computed.alias('controller.content.serviceName'), - displayName: function() { - return this.get('controller.content.displayName'); - }.property('controller.content.displayName'), + displayName: Em.computed.alias('controller.content.displayName'), - isPassive: function() { - return this.get('controller.content.passiveState') === 'ON'; - }.property('controller.content.passiveState'), + isPassive: Em.computed.equal('controller.content.passiveState', 'ON'), /** * Some custom commands need custom logic to be executed http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/menu.js b/ambari-web/app/views/main/service/menu.js index a462ac1..524fde3 100644 --- a/ambari-web/app/views/main/service/menu.js +++ b/ambari-web/app/views/main/service/menu.js @@ -66,21 +66,15 @@ App.MainServiceMenuView = Em.CollectionView.extend({ templateName:require('templates/main/service/menu_item'), restartRequiredMessage: null, - shouldBeRestarted: function() { - return this.get('content.hostComponents').someProperty('staleConfigs', true); - }.property('content.hostComponents.@each.staleConfigs'), + shouldBeRestarted: Em.computed.someBy('content.hostComponents', 'staleConfigs', true), active:function () { return this.get('content.id') == this.get('parentView.activeServiceId') ? 'active' : ''; }.property('parentView.activeServiceId'), - alertsCount: function () { - return this.get('content.alertsCount'); - }.property('content.alertsCount'), + alertsCount: Em.computed.alias('content.alertsCount'), - hasCriticalAlerts: function () { - return this.get('content.hasCriticalAlerts'); - }.property('content.hasCriticalAlerts'), + hasCriticalAlerts: Em.computed.alias('content.hasCriticalAlerts'), isConfigurable: function () { return !App.get('services.noConfigTypes').contains(this.get('content.serviceName')); @@ -173,21 +167,15 @@ App.TopNavServiceMenuView = Em.CollectionView.extend({ templateName:require('templates/main/service/menu_item'), restartRequiredMessage: null, - shouldBeRestarted: function() { - return this.get('content.hostComponents').someProperty('staleConfigs', true); - }.property('content.hostComponents.@each.staleConfigs'), + shouldBeRestarted: Em.computed.someBy('content.hostComponents', 'staleConfigs', true), active:function () { return this.get('content.id') == this.get('parentView.activeServiceId') ? 'active' : ''; }.property('parentView.activeServiceId'), - alertsCount: function () { - return this.get('content.alertsCount'); - }.property('content.alertsCount'), + alertsCount: Em.computed.alias('content.alertsCount'), - hasCriticalAlerts: function () { - return this.get('content.hasCriticalAlerts'); - }.property('content.hasCriticalAlerts'), + hasCriticalAlerts: Em.computed.alias('content.hasCriticalAlerts'), isConfigurable: function () { return !App.get('services.noConfigTypes').contains(this.get('content.serviceName')); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/reassign/step3_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/reassign/step3_view.js b/ambari-web/app/views/main/service/reassign/step3_view.js index 90fc834..20d08d8 100644 --- a/ambari-web/app/views/main/service/reassign/step3_view.js +++ b/ambari-web/app/views/main/service/reassign/step3_view.js @@ -23,13 +23,9 @@ App.ReassignMasterWizardStep3View = Em.View.extend({ templateName: require('templates/main/service/reassign/step3'), - sourceHost: function(){ - return this.get('controller.content.reassignHosts.source'); - }.property('controller.content.reassignHosts.source'), + sourceHost: Em.computed.alias('controller.content.reassignHosts.source'), - targetHost: function(){ - return this.get('controller.content.reassignHosts.target'); - }.property('controller.content.reassignHosts.target'), + targetHost: Em.computed.alias('controller.content.reassignHosts.target'), printReview: function () { $("#step8-info").jqprint(); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/reassign/step4_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/reassign/step4_view.js b/ambari-web/app/views/main/service/reassign/step4_view.js index 132c29e..bd5950a 100644 --- a/ambari-web/app/views/main/service/reassign/step4_view.js +++ b/ambari-web/app/views/main/service/reassign/step4_view.js @@ -39,13 +39,7 @@ App.ReassignMasterWizardStep4View = App.HighAvailabilityProgressPageView.extend( } }.property('controller.content.reassign.component_name','controller.content.reassignHosts.source','controller.content.reassignHosts.target'), - submitButtonText: function () { - if (this.get('controller.content.hasManualSteps')) { - return Em.I18n.t('common.next') + ' →'; - } else { - return Em.I18n.t('common.complete'); - } - }.property('controller.content.hasManualSteps'), + submitButtonText: Em.computed.ifThenElse('controller.content.hasManualSteps', Em.I18n.t('common.next') + ' →', Em.I18n.t('common.complete')), templateName: require('templates/main/service/reassign/step4'), http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/reassign/step7_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/reassign/step7_view.js b/ambari-web/app/views/main/service/reassign/step7_view.js index 0eacb0c..60b357a 100644 --- a/ambari-web/app/views/main/service/reassign/step7_view.js +++ b/ambari-web/app/views/main/service/reassign/step7_view.js @@ -23,21 +23,13 @@ App.ReassignMasterWizardStep7View = App.HighAvailabilityProgressPageView.extend( headerTitle: Em.I18n.t('services.reassign.step7.header'), - noticeInProgress: function () { - return Em.I18n.t('services.reassign.step7.info'); - }.property(), + noticeInProgress: Em.I18n.t('services.reassign.step7.info'), - noticeFailed: function () { - return Em.I18n.t('services.reassign.step7.failed'); - }.property(), + noticeFailed: Em.I18n.t('services.reassign.step7.failed'), - noticeCompleted: function () { - return Em.I18n.t('services.reassign.step7.success'); - }.property(), + noticeCompleted: Em.I18n.t('services.reassign.step7.success'), - submitButtonText: function () { - return Em.I18n.t('common.complete') + ' →'; - }.property(), + submitButtonText: Em.I18n.t('common.complete') + ' →', templateName: require('templates/main/service/reassign/step7'), http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/reconfigure.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/reconfigure.js b/ambari-web/app/views/main/service/reconfigure.js index dd7a8d3..8838545 100644 --- a/ambari-web/app/views/main/service/reconfigure.js +++ b/ambari-web/app/views/main/service/reconfigure.js @@ -54,13 +54,10 @@ App.StageLabelView = Em.View.extend({ }) }, - isStarted: function () { - return (this.get('command') && this.get('command.isStarted')); - }.property('command.isStarted'), + isStarted: Em.computed.alias('command.isStarted'), + + showLink: Em.computed.alias('command.showLink') - showLink: function () { - return (this.get('command') && this.get('command.showLink')); - }.property('command.showLink') }); App.StageSuccessView = Em.View.extend({ http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/service.js b/ambari-web/app/views/main/service/service.js index 269f261..520fd75 100644 --- a/ambari-web/app/views/main/service/service.js +++ b/ambari-web/app/views/main/service/service.js @@ -135,9 +135,7 @@ App.MainDashboardServiceView = Em.View.extend(App.MainDashboardServiceViewWrappe App.tooltip($('[rel=SummaryComponentHealthTooltip]')); }, templateName: require('templates/main/service/info/summary/master_components'), - mastersComp: function () { - return this.get('parentView.parentView.mastersObj'); - }.property("parentView.parentView.mastersObj"), + mastersComp: Em.computed.alias('parentView.parentView.mastersObj'), willDestroyElement: function() { $('[rel=SummaryComponentHealthTooltip]').tooltip('destroy'); } @@ -147,13 +145,9 @@ App.MainDashboardServiceView = Em.View.extend(App.MainDashboardServiceViewWrappe return (value || value == 0) ? value : this.t('services.service.summary.notAvailable'); }, - alertsCount: function () { - return this.get('service.alertsCount'); - }.property('service.alertsCount'), + alertsCount: Em.computed.alias('service.alertsCount'), - hasCriticalAlerts: function () { - return this.get('service.hasCriticalAlerts'); - }.property('service.hasCriticalAlerts'), + hasCriticalAlerts: Em.computed.alias('service.hasCriticalAlerts'), isCollapsed: false, @@ -162,9 +156,7 @@ App.MainDashboardServiceView = Em.View.extend(App.MainDashboardServiceViewWrappe this.set('isCollapsed', !this.isCollapsed); }, - masters: function(){ - return this.get('service.hostComponents').filterProperty('isMaster', true); - }.property('service'), + masters: Em.computed.filterBy('service.hostComponents', 'isMaster', true), clients: function(){ var clients = this.get('service.hostComponents').filterProperty('isClient', true); http://git-wip-us.apache.org/repos/asf/ambari/blob/177a91f4/ambari-web/app/views/main/service/services/hbase.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/services/hbase.js b/ambari-web/app/views/main/service/services/hbase.js index 8b6b9f7..de0818d 100644 --- a/ambari-web/app/views/main/service/services/hbase.js +++ b/ambari-web/app/views/main/service/services/hbase.js @@ -25,15 +25,11 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ /** * All master components */ - masters: function () { - return this.get('service.hostComponents').filterProperty('isMaster', true); - }.property('service.hostComponents.length'), + masters: Em.computed.filterBy('service.hostComponents', 'isMaster', true), /** * Passive master components */ - passiveMasters: function () { - return this.get('masters').filterProperty('haStatus', 'false'); - }.property('masters'), + passiveMasters: Em.computed.filterBy('masters', 'haStatus', 'false'), regionServesText: function () { if (this.get('service.regionServersTotal') == 0) { @@ -55,16 +51,12 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ } }.property("service"), - showPhoenixInfo: function () { - return !!this.get('service.phoenixServersTotal'); - }.property("service.phoenixServersTotal"), + showPhoenixInfo: Em.computed.bool('service.phoenixServersTotal'), /** * One(!) active master component */ - activeMaster: function () { - return this.get('masters').findProperty('haStatus', 'true'); - }.property('masters'), + activeMaster: Em.computed.findBy('masters', 'haStatus', 'true'), activeMasterTitle: function(){ return this.t('service.hbase.activeMaster');