AMBARI-20609 Fix Install Wizard data attribute. (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d13e6fa3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d13e6fa3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d13e6fa3 Branch: refs/heads/branch-3.0-perf Commit: d13e6fa3e7fa59073d4cc222477d48d8d9073aa2 Parents: b9d9612 Author: Aleksandr Kovalenko <[email protected]> Authored: Fri Mar 31 18:49:25 2017 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Sat Apr 1 10:07:36 2017 +0300 ---------------------------------------------------------------------- .../templates/common/configs/overriddenProperty.hbs | 4 ++-- .../common/configs/service_config_category.hbs | 16 ++++++++-------- .../templates/common/configs/services_config.hbs | 6 +++--- ambari-web/app/templates/common/modal_popup.hbs | 4 ++-- ambari-web/app/templates/wizard/step7.hbs | 4 ++-- .../configs/service_configs_by_category_view.js | 6 +++++- ambari-web/app/views/common/controls_view.js | 5 ++--- 7 files changed, 24 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d13e6fa3/ambari-web/app/templates/common/configs/overriddenProperty.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/configs/overriddenProperty.hbs b/ambari-web/app/templates/common/configs/overriddenProperty.hbs index ff3e812..3c34d70 100644 --- a/ambari-web/app/templates/common/configs/overriddenProperty.hbs +++ b/ambari-web/app/templates/common/configs/overriddenProperty.hbs @@ -16,7 +16,7 @@ * limitations under the License. }} {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }} -<div {{bindAttr class="view.overriddenSCP.errorMessage:has-error: :form-group :overrideField"}}> +<div {{bindAttr class="view.overriddenSCP.errorMessage:has-error: :form-group :overrideField"}} {{QAAttr "override-field"}}> <div class="row"> <div class="col-md-9"> {{view view.overriddenSCP.viewClass serviceConfigBinding="view.overriddenSCP" categoryConfigsBinding="view.parentView.categoryConfigs"}} @@ -51,7 +51,7 @@ </a> {{/isAuthorized}} {{#if view.overriddenSCP.errorMessage}} - <span class="help-block validation-block pull-right">{{view.overriddenSCP.errorMessage}}</span> + <span class="help-block validation-block pull-right" {{QAAttr "validation-block"}}>{{view.overriddenSCP.errorMessage}}</span> {{/if}} {{else}} <a class="action">{{view.overriddenSCP.group.switchGroupTextShort}}</a> http://git-wip-us.apache.org/repos/asf/ambari/blob/d13e6fa3/ambari-web/app/templates/common/configs/service_config_category.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs index 0a4bf7f..87a716c 100644 --- a/ambari-web/app/templates/common/configs/service_config_category.hbs +++ b/ambari-web/app/templates/common/configs/service_config_category.hbs @@ -19,8 +19,8 @@ <div class="panel-heading" {{action "onToggleBlock" category target="view"}}> <h3 class="panel-title"> <i {{bindAttr class=":pull-right :panel-toggle view.category.isCollapsed:icon-angle-down:icon-angle-up"}}></i> - <a class="panel-toggle category-header"> - <span class="category-name">{{view.category.displayName}}</span> + <a class="panel-toggle category-header" {{QAAttr "category-header"}}> + <span class="category-name" {{QAAttr "category-name"}}>{{view.category.displayName}}</span> {{#if view.category.errorCount}} <span class="badge badge-important">{{view.category.errorCount}}</span> {{/if}} @@ -28,16 +28,16 @@ </h3> </div> - <div class="panel-body collapse in" {{bindAttr style="view.isCategoryBodyVisible"}}> + <div class="panel-body collapse in" {{bindAttr style="view.isCategoryBodyVisible"}} {{QAAttr "panel-body"}}> <div class="service-config-section"> <form class="form-horizontal" autocomplete="off"> {{#each view.categoryConfigs}} {{#unless widget}} {{! configs with widgets should be shown only on the EnhancedConfigs tabs }} - <div {{bindAttr class=":entry-row :form-group isHiddenByFilter:hide isOverridden:overridden-property hasCompareDiffs:overridden-property"}}> + <div {{bindAttr class=":entry-row :form-group isHiddenByFilter:hide isOverridden:overridden-property hasCompareDiffs:overridden-property"}} {{QAAttr "property-row"}}> {{#if showLabel}} {{#unless rightSideLabel}} <span {{bindAttr class="errorMessage:has-error: :form-group :control-label-span :col-md-3"}}> - <label class="control-label"> + <label class="control-label" {{QAAttr "control-label"}}> {{formatWordBreak displayName}} {{#if isSecureConfig}} <a href="javascript:void(null);"><i class="glyphicon glyphicon-lock" rel="tooltip" data-toggle="tooltip" @@ -52,7 +52,7 @@ <div class="col-md-9"> {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }} {{#if this.isOriginalSCP}} - <div {{bindAttr class="errorMessage:has-error: warnMessage:has-warning: :form-group"}}> + <div {{bindAttr class="errorMessage:has-error: warnMessage:has-warning: :form-group"}} {{QAAttr "property-form-group"}}> {{view viewClass serviceConfigBinding="this" categoryConfigsAllBinding="view.categoryConfigsAll" }} {{#if rightSideLabel}} <span {{bindAttr class="isEditable::muted"}}>{{formatWordBreak displayName}}</span> @@ -75,11 +75,11 @@ {{/if}} {{view App.ControlsView serviceConfigPropertyBinding="this"}} {{#if errorMessage}} - <span class="help-block validation-block">{{errorMessage}}</span> + <span class="help-block validation-block" {{QAAttr "validation-block"}}>{{errorMessage}}</span> {{/if}} {{#if warnMessage}} <span class="has-warning"> - <span class="help-block validation-block">{{warnMessage}}</span> + <span class="help-block validation-block" {{QAAttr "validation-block"}}>{{warnMessage}}</span> </span> {{/if}} </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/d13e6fa3/ambari-web/app/templates/common/configs/services_config.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/configs/services_config.hbs b/ambari-web/app/templates/common/configs/services_config.hbs index d052424..914a1dc 100644 --- a/ambari-web/app/templates/common/configs/services_config.hbs +++ b/ambari-web/app/templates/common/configs/services_config.hbs @@ -16,14 +16,14 @@ * limitations under the License. }} {{#if controller.isRecommendedLoaded}} - <ul class="nav nav-tabs"> + <ul class="nav nav-tabs" {{QAAttr "config-tabs"}}> {{#each service in controller.stepConfigs}} {{#if service.showConfig}} {{#view App.ServiceConfigTab}} <a href="#{{unbound service.serviceName}}" {{bindAttr class=":active service.selected:new"}} data-toggle="tab" {{action selectService service target="view"}}> {{service.displayName}}{{#if service.errorCount}}<span - class="badge badge-important">{{service.errorCount}}</span>{{/if}}</a> + class="badge badge-important" {{QAAttr "error-badge"}}>{{service.errorCount}}</span>{{/if}}</a> {{/view}} {{/if}} {{/each}} @@ -46,7 +46,7 @@ <p class="loading align-center"></p> {{#unless controller.transitionInProgress}} {{#if controller.hasStepConfigIssues}} - <div class="alert alert-warning"> + <div class="alert alert-warning" {{QAAttr "warning-alert"}}> <span class="glyphicon glyphicon-warning-sign"></span> {{t installer.step7.attentionNeeded}}<br /> {{issuesFilterText}} <a href="#" {{action toggleIssuesFilter target="controller"}}>{{issuesFilterLinkText}}</a> </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/d13e6fa3/ambari-web/app/templates/common/modal_popup.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/modal_popup.hbs b/ambari-web/app/templates/common/modal_popup.hbs index 476d331..afc5d9f 100644 --- a/ambari-web/app/templates/common/modal_popup.hbs +++ b/ambari-web/app/templates/common/modal_popup.hbs @@ -18,11 +18,11 @@ <div class="modal-backdrop in"></div> -<div {{bindAttr class=":modal view.showFooter:with-footer:no-footer"}} id="modal" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true"> +<div {{bindAttr class=":modal view.showFooter:with-footer:no-footer"}} id="modal" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true" {{QAAttr "modal"}}> <div {{bindAttr class="view.modalDialogClassesStr :modal-dialog"}}> <div class="modal-content"> {{! Modal header }} - <div class="modal-header"> + <div class="modal-header" {{QAAttr "modal-header"}}> {{#if view.showCloseButton}} <a {{QAAttr "close-modal"}} class="close" {{action onClose target="view"}}>×</a> {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/d13e6fa3/ambari-web/app/templates/wizard/step7.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/wizard/step7.hbs b/ambari-web/app/templates/wizard/step7.hbs index a939e27..aecaf82 100644 --- a/ambari-web/app/templates/wizard/step7.hbs +++ b/ambari-web/app/templates/wizard/step7.hbs @@ -16,8 +16,8 @@ * limitations under the License. }} -<div id="serviceConfig" class="wizard-content col-md-9"> - <h4 class="step-title">{{t installer.step7.header}}{{controller.finnalyLoaded}}</h4> +<div id="serviceConfig" class="wizard-content col-md-9" {{QAAttr "service-configs"}}> + <h4 class="step-title" {{QAAttr "step-title"}}>{{t installer.step7.header}}{{controller.finnalyLoaded}}</h4> <p class="step-description">{{t installer.step7.body}}</p> <div class="panel panel-default"> http://git-wip-us.apache.org/repos/asf/ambari/blob/d13e6fa3/ambari-web/app/views/common/configs/service_configs_by_category_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_configs_by_category_view.js b/ambari-web/app/views/common/configs/service_configs_by_category_view.js index 68bf22c..16c828c 100644 --- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js +++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js @@ -27,7 +27,11 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri classNames: ['panel-group', 'common-config-category'], - classNameBindings: ['category.name', 'isShowBlock::hidden'], + classNameBindings: ['isShowBlock::hidden'], + + 'data-qa': function () { + return this.get('category.name') + ' ' + 'panel-group'; + }.property('category.name'), content: null, http://git-wip-us.apache.org/repos/asf/ambari/blob/d13e6fa3/ambari-web/app/views/common/controls_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js index da886ed..edeaf0a 100644 --- a/ambari-web/app/views/common/controls_view.js +++ b/ambari-web/app/views/common/controls_view.js @@ -199,15 +199,14 @@ App.WidgetValueObserver = Em.Mixin.create(App.ValueObserver, { * id not used in order to avoid collision with ember ids */ App.ServiceConfigCalculateId = Ember.Mixin.create({ - idClass: Ember.computed(function () { + 'data-qa': Ember.computed(function () { var config = this.get('config') && this.get('config.widget') ? this.get('config') : this.get('serviceConfig') || {}; var label = Em.get(config, 'name') ? Em.get(config, 'name').toLowerCase().replace(/\./g, '-') : '', fileName = Em.get(config, 'filename') ? Em.get(config, 'filename').toLowerCase().replace(/\./g, '-') : '', group = Em.get(config, 'group.name') || 'default', isOrigin = Em.getWithDefault(config, 'compareConfigs.length', 0) > 0 ? '-origin' : ''; return 'service-config-' + label + '-' + fileName + '-' + group + isOrigin; - }), - classNameBindings: 'idClass' + }) }); /**
