You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/02/18 16:49:20 UTC

[1/2] ambari git commit: AMBARI-9690 Install Wizard, step 1: redundant base URL check for unselected OSes. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 8ae21c8b7 -> c82eb0c8b


AMBARI-9690 Install Wizard, step 1: redundant base URL check for unselected OSes. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/34b629e3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/34b629e3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/34b629e3

Branch: refs/heads/trunk
Commit: 34b629e353d838010201e9a059bdd4048dd1e579
Parents: 8ae21c8
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Feb 18 15:50:12 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Feb 18 17:38:30 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/styles/stack_versions.less       |  6 ++++++
 ambari-web/app/templates/wizard/step1.hbs       |  2 +-
 ambari-web/app/views/wizard/step1_view.js       |  3 +++
 ambari-web/test/views/wizard/step1_view_test.js | 10 ++++++++--
 4 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/34b629e3/ambari-web/app/styles/stack_versions.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/stack_versions.less b/ambari-web/app/styles/stack_versions.less
index 5321a99..5c54ea3 100644
--- a/ambari-web/app/styles/stack_versions.less
+++ b/ambari-web/app/styles/stack_versions.less
@@ -80,6 +80,12 @@
               a {
                 cursor: pointer;
                 text-decoration: none;
+                &.disabled-clear-button {
+                  cursor: default;
+                  .icon-remove-sign {
+                    cursor: default;
+                  }
+                }
               }
               .icon-remove-sign {
                 color: #808080;

http://git-wip-us.apache.org/repos/asf/ambari/blob/34b629e3/ambari-web/app/templates/wizard/step1.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step1.hbs b/ambari-web/app/templates/wizard/step1.hbs
index da33fd2..bf3278e 100644
--- a/ambari-web/app/templates/wizard/step1.hbs
+++ b/ambari-web/app/templates/wizard/step1.hbs
@@ -75,7 +75,7 @@
                         </div>
                         <div class="clear-td">
                           {{#if repository.clearAll}}
-                            <a {{action "clearGroupLocalRepository" repository target="view" }}>
+                            <a {{action "clearGroupLocalRepository" repository target="view" }} {{bindAttr class="operatingSystem.isSelected::disabled-clear-button"}}>
                               <i class="icon-remove-sign"></i>
                             </a>
                           {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/34b629e3/ambari-web/app/views/wizard/step1_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step1_view.js b/ambari-web/app/views/wizard/step1_view.js
index d3d0c4b..1ae9e05 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -208,6 +208,9 @@ App.WizardStep1View = Em.View.extend({
    * @param {object} event
    */
   clearGroupLocalRepository: function (event) {
+    if (!event.context.get('isSelected')) {
+      return;
+    }
     event.context.set('baseUrl', '');
     event.context.set('validation', App.Repository.validation['PENDING']);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/34b629e3/ambari-web/test/views/wizard/step1_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/wizard/step1_view_test.js b/ambari-web/test/views/wizard/step1_view_test.js
index 9e0ed1e..2f6de84 100644
--- a/ambari-web/test/views/wizard/step1_view_test.js
+++ b/ambari-web/test/views/wizard/step1_view_test.js
@@ -590,12 +590,18 @@ describe('App.WizardStep1View', function () {
   });
 
   describe('#clearGroupLocalRepository', function () {
+    var context = {'group-number': 0, id: 'HDP-redhat5', repoId: 'HDP-redhat5', baseUrl: 'baseUrl', validation: 'validation'};
     it('should empty base url and validation', function () {
-      var event = {context: Em.Object.create({'group-number': 0, id: 'HDP-redhat5', repoId: 'HDP-redhat5', baseUrl: 'baseUrl', validation: 'validation'})};
+      var event = {context: Em.Object.create(context, {isSelected: true})};
       view.clearGroupLocalRepository(event);
       expect(event.context.get('baseUrl')).to.be.empty;
       expect(event.context.get('validation')).to.be.empty;
-
+    });
+    it('should do nothing if corresponding OS is not selected', function () {
+      var event = {context: Em.Object.create(context, {isSelected: false})};
+      view.clearGroupLocalRepository(event);
+      expect(event.context.get('baseUrl')).to.equal('baseUrl');
+      expect(event.context.get('validation')).to.equal('validation');
     });
   });
 


[2/2] ambari git commit: AMBARI-9692 Kerberos Wizard tries to delete ATS is it's not installed. (ababiichuk)

Posted by ab...@apache.org.
AMBARI-9692 Kerberos Wizard tries to delete ATS is it's not installed. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c82eb0c8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c82eb0c8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c82eb0c8

Branch: refs/heads/trunk
Commit: c82eb0c8bf692366d38c31697a8160c2f7bf9b9a
Parents: 34b629e
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Feb 18 16:19:44 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Feb 18 17:38:31 2015 +0200

----------------------------------------------------------------------
 .../main/admin/kerberos/step5_controller.js            |  3 ++-
 .../main/admin/kerberos/step5_controller_test.js       | 13 ++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c82eb0c8/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
index 5cc06bd..3b62cfd 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
@@ -45,7 +45,8 @@ App.KerberosWizardStep5Controller = App.KerberosProgressPageController.extend({
    * remove Application Timeline Server component if needed.
    */
   checkComponentsRemoval: function() {
-    if (App.Service.find().someProperty('serviceName', 'YARN') && !App.get('doesATSSupportKerberos') && !this.get('commands').contains('deleteATS')) {
+    if (App.Service.find().someProperty('serviceName', 'YARN') && !App.get('doesATSSupportKerberos')
+      && !this.get('commands').contains('deleteATS') && App.HostComponent.find().findProperty('componentName', 'APP_TIMELINE_SERVER')) {
       this.get('commands').pushObject('deleteATS');
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/c82eb0c8/ambari-web/test/controllers/main/admin/kerberos/step5_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step5_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step5_controller_test.js
index 93139fb..c6291a0 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step5_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step5_controller_test.js
@@ -19,13 +19,14 @@
 var App = require('app');
 
 describe('App.KerberosWizardStep5Controller', function() {
-  describe('checkComponentsRemoval', function() {
+  describe('#checkComponentsRemoval', function() {
 
     var tests = [
-      { yarnInstalled: true, doesATSSupportKerberos: false, commands: ['stopServices', 'deleteATS']},
-      { yarnInstalled: false, doesATSSupportKerberos: true, commands: ['stopServices']},
-      { yarnInstalled: false, doesATSSupportKerberos: false, commands: ['stopServices']},
-      { yarnInstalled: true, doesATSSupportKerberos: true, commands: ['stopServices']},
+      { yarnInstalled: true, doesATSSupportKerberos: false, commands: ['stopServices', 'deleteATS'], ATSInstalled: true},
+      { yarnInstalled: false, doesATSSupportKerberos: true, commands: ['stopServices'], ATSInstalled: true},
+      { yarnInstalled: false, doesATSSupportKerberos: false, commands: ['stopServices'], ATSInstalled: true},
+      { yarnInstalled: true, doesATSSupportKerberos: true, commands: ['stopServices'], ATSInstalled: false},
+      { yarnInstalled: true, doesATSSupportKerberos: true, commands: ['stopServices'], ATSInstalled: true}
     ];
 
     tests.forEach(function(test) {
@@ -33,9 +34,11 @@ describe('App.KerberosWizardStep5Controller', function() {
         var controller = App.KerberosWizardStep5Controller.create({ commands: ['stopServices'] });
         sinon.stub(App, 'get').withArgs('doesATSSupportKerberos').returns(test.doesATSSupportKerberos);
         sinon.stub(App.Service, 'find').returns(test.yarnInstalled ? [Em.Object.create({ serviceName: 'YARN'})] : []);
+        sinon.stub(App.HostComponent, 'find').returns(test.ATSInstalled ? [Em.Object.create({ componentName: 'APP_TIMELINE_SERVER'})] : []);
         controller.checkComponentsRemoval();
         App.get.restore();
         App.Service.find.restore();
+        App.HostComponent.find.restore();
         expect(controller.get('commands').toArray()).to.eql(test.commands);
       });
     });