ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-21183. Removal of INIT Repository State from Web Client (alexantonenko)
Date Wed, 26 Jul 2017 12:02:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-21450 54c57662b -> 863343ad3


AMBARI-21183. Removal of INIT Repository State from Web Client (alexantonenko)


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

Branch: refs/heads/branch-feature-AMBARI-21450
Commit: 863343ad31a950cd9ebeac88f4c8fe852f1f4fad
Parents: 54c5766
Author: Alex Antonenko <aantonenko@hortonworks.com>
Authored: Wed Jul 26 15:01:41 2017 +0300
Committer: Alex Antonenko <aantonenko@hortonworks.com>
Committed: Wed Jul 26 15:01:41 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/app.js                           |  8 +++---
 .../main/admin/stack_and_upgrade_controller.js  |  6 ++---
 ambari-web/app/data/controller_route.js         |  2 +-
 .../models/stack_version/repository_version.js  |  2 +-
 .../stack_upgrade/upgrade_version_box_view.js   | 12 ++++-----
 .../admin/stack_upgrade/upgrade_wizard_view.js  |  2 +-
 .../main/admin/stack_upgrade/versions_view.js   |  2 +-
 ambari-web/test/app_test.js                     | 10 +++----
 .../admin/stack_and_upgrade_controller_test.js  | 18 ++++++-------
 .../upgrade_version_box_view_test.js            | 28 ++++++++++----------
 .../stack_upgrade/upgrade_wizard_view_test.js   |  2 +-
 .../admin/stack_upgrade/version_view_test.js    |  6 ++---
 12 files changed, 49 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 1c73550..8fecd5c 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -52,7 +52,7 @@ module.exports = Em.Application.create({
   /**
    * state of stack upgrade process
    * states:
-   *  - INIT
+   *  - NOT_REQUIRED
    *  - PENDING
    *  - IN_PROGRESS
    *  - HOLDING
@@ -62,14 +62,14 @@ module.exports = Em.Application.create({
    *  - HOLDING_TIMEDOUT
    * @type {String}
    */
-  upgradeState: 'INIT',
+  upgradeState: 'NOT_REQUIRED',
 
   /**
    * Check if upgrade is in INIT state
    * 'INIT' is set on upgrade start and when it's finished
    * @type {boolean}
    */
-  upgradeInit: Em.computed.equal('upgradeState', 'INIT'),
+  upgradeInit: Em.computed.equal('upgradeState', 'NOT_REQUIRED'),
 
   /**
    * flag is true when upgrade process is running
@@ -142,7 +142,7 @@ module.exports = Em.Application.create({
     // When Upgrade running(not suspended) only operations related to upgrade should be allowed
     if ((!this.get('upgradeSuspended') && !authRoles.contains('CLUSTER.UPGRADE_DOWNGRADE_STACK'))
&&
         !App.get('supports.opsDuringRollingUpgrade') &&
-        !['INIT', 'COMPLETED'].contains(this.get('upgradeState')) ||
+        !['NOT_REQUIRED', 'COMPLETED'].contains(this.get('upgradeState')) ||
         !App.auth){
       return false;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index ec01fa9..372a811 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -1709,14 +1709,14 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
   },
 
   /**
-   * reset upgradeState to INIT when upgrade is COMPLETED
+   * reset upgradeState to NOT_REQUIRED when upgrade is COMPLETED
    * and clean auxiliary data
    */
   finish: function () {
     var upgradeVersion = this.get('upgradeVersion') && this.get('upgradeVersion').match(/[a-zA-Z]+\-\d+\.\d+/);
     this.setDBProperties({
       upgradeId: undefined,
-      upgradeState: 'INIT',
+      upgradeState: 'NOT_REQUIRED',
       upgradeVersion: undefined,
       currentVersion: undefined,
       upgradeTypeDisplayName: undefined,
@@ -1732,7 +1732,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     if (upgradeVersion && upgradeVersion[0]) {
       App.set('currentStackVersion', upgradeVersion[0]);
     }
-    App.set('upgradeState', 'INIT');
+    App.set('upgradeState', 'NOT_REQUIRED');
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/app/data/controller_route.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/controller_route.js b/ambari-web/app/data/controller_route.js
index 5f7c499..13d0380 100644
--- a/ambari-web/app/data/controller_route.js
+++ b/ambari-web/app/data/controller_route.js
@@ -71,7 +71,7 @@ module.exports = [
   },
   {
     wizardControllerName: App.router.get('mainAdminStackAndUpgradeController.name'),
-    route: App.db.get('MainAdminStackAndUpgrade', 'upgradeState') == 'INIT' ? 'main.admin.stackAndUpgrade.index'
: 'main.admin.stackAndUpgrade.versions'
+    route: App.db.get('MainAdminStackAndUpgrade', 'upgradeState') === 'NOT_REQUIRED' ? 'main.admin.stackAndUpgrade.index'
: 'main.admin.stackAndUpgrade.versions'
   },
   {
     wizardControllerName: App.router.get('widgetWizardController.name'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/app/models/stack_version/repository_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_version/repository_version.js b/ambari-web/app/models/stack_version/repository_version.js
index d5bc64d..5ecfdd1 100644
--- a/ambari-web/app/models/stack_version/repository_version.js
+++ b/ambari-web/app/models/stack_version/repository_version.js
@@ -38,7 +38,7 @@ App.RepositoryVersion = DS.Model.extend({
    * status used until corresponding stack version get created
    * @type {string}
    */
-  defaultStatus: 'INIT',
+  defaultStatus: 'NOT_REQUIRED',
 
   /**
    * @type {boolean}

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/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 c1d5f38..c48003e 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
@@ -55,7 +55,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
    * @type {boolean}
    */
   isUpgrading: function () {
-    return (this.get('controller.upgradeVersion') === this.get('content.displayName') &&
App.get('upgradeState') !== 'INIT');
+    return (this.get('controller.upgradeVersion') === this.get('content.displayName') &&
App.get('upgradeState') !== 'NOT_REQUIRED');
   }.property('App.upgradeState', 'content.displayName', 'controller.upgradeVersion'),
 
   isRepoUrlsEditDisabled: function () {
@@ -117,7 +117,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
       text: Em.I18n.t('common.current'),
       class: 'label label-success'
     },
-    'INIT': {
+    'NOT_REQUIRED': {
       isButton: true,
       text: Em.I18n.t('common.install'),
       action: 'installRepoVersionConfirmation'
@@ -172,7 +172,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
     if (['INSTALLING', 'CURRENT'].contains(status)) {
       element.setProperties(statePropertiesMap[status]);
     }
-    else if (status === 'INIT') {
+    else if (status === 'NOT_REQUIRED') {
       requestInProgressRepoId && requestInProgressRepoId == this.get('content.id')
? element.setProperties(statePropertiesMap['LOADING']) : element.setProperties(statePropertiesMap[status]);
       element.set('isDisabled', this.isDisabledOnInit());
       if (this.addRemoveIopSelectButton(element, this.isDisabledOnInit())) {
@@ -271,7 +271,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
   },
 
   /**
-   * check if actions of INIT stack version disabled
+   * check if actions of NOT_REQUIRED stack version disabled
    * @returns {boolean}
    */
   isDisabledOnInit: function() {
@@ -339,7 +339,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
    * @param App.RepositoryVersion
    * */
   getStackVersionNumber: function(repository){
-    var stackVersion = null; 
+    var stackVersion = null;
     var systems = repository.get('operatingSystems');
 
     systems.forEach(function (os) {
@@ -350,7 +350,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
       });
     });
 
-    return stackVersion; 
+    return stackVersion;
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/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 bcb1ad7..3b269a0 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
@@ -123,7 +123,7 @@ App.upgradeWizardView = Em.View.extend({
    */
   noActiveItem: function () {
     return (Em.isNone(this.get('failedItem')) && Em.isNone(this.get('runningItem'))
&& Em.isNone(this.get('manualItem'))) &&
-      !['INIT', 'COMPLETED', 'ABORTED'].contains(App.get('upgradeState'));
+      !['NOT_REQUIRED', 'COMPLETED', 'ABORTED'].contains(App.get('upgradeState'));
   }.property('failedItem', 'runningItem', 'manualItem', 'App.upgradeState'),
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
index c87cb81..2647052 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js
@@ -160,7 +160,7 @@ App.MainAdminStackVersionsView = Em.View.extend({
             return stringUtils.compareVersions(version.get('repositoryVersion'), Em.get(currentVersion,
'repository_version')) < 1;
           }
         } else if (filter.get('value') === 'NOT_INSTALLED') {
-          return ['INIT', 'INSTALL_FAILED', 'INSTALLING', 'OUT_OF_SYNC'].contains(status);
+          return ['NOT_REQUIRED', 'INSTALL_FAILED', 'INSTALLING', 'OUT_OF_SYNC'].contains(status);
         } else {
           return status === filter.get('value');
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/test/app_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/app_test.js b/ambari-web/test/app_test.js
index 42789d5..810623d 100644
--- a/ambari-web/test/app_test.js
+++ b/ambari-web/test/app_test.js
@@ -441,7 +441,7 @@ describe('App', function () {
   describe('#upgradeSuspended', function () {
     var cases = [
       {
-        upgradeState: 'INIT',
+        upgradeState: 'NOT_REQUIRED',
         isSuspended: false,
         upgradeSuspended: false
       },
@@ -478,7 +478,7 @@ describe('App', function () {
 
     var cases = [
       {
-        upgradeState: 'INIT',
+        upgradeState: 'NOT_REQUIRED',
         isSuspended: false,
         upgradeAborted: false
       },
@@ -514,7 +514,7 @@ describe('App', function () {
   describe('#wizardIsNotFinished', function () {
     var cases = [
       {
-        upgradeState: 'INIT',
+        upgradeState: 'NOT_REQUIRED',
         wizardIsNotFinished: false
       },
       {
@@ -547,7 +547,7 @@ describe('App', function () {
   describe("#upgradeHolding", function () {
     var cases = [
       {
-        upgradeState: 'INIT',
+        upgradeState: 'NOT_REQUIRED',
         upgradeAborted: false,
         upgradeHolding: false
       },
@@ -562,7 +562,7 @@ describe('App', function () {
         upgradeHolding: true
       },
       {
-        upgradeState: 'INIT',
+        upgradeState: 'NOT_REQUIRED',
         upgradeAborted: true,
         upgradeHolding: true
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
index 1014298..a4a9a69 100644
--- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
@@ -98,9 +98,9 @@ describe('App.MainAdminStackAndUpgradeController', function() {
 
     it("state not ABORTED", function() {
       this.mock.returns(false);
-      controller.set('upgradeData', { Upgrade: {request_status: 'INIT'}});
+      controller.set('upgradeData', { Upgrade: {request_status: 'NOT_REQUIRED'}});
       controller.propertyDidChange('requestStatus');
-      expect(controller.get('requestStatus')).to.equal('INIT');
+      expect(controller.get('requestStatus')).to.equal('NOT_REQUIRED');
     });
 
     it("upgradeData is null", function() {
@@ -235,7 +235,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       controller.updateUpgradeData.restore();
       controller.setDBProperty.restore();
       controller.finish.restore();
-      App.set('upgradeState', 'INIT');
+      App.set('upgradeState', 'NOT_REQUIRED');
     });
 
     it("correct data", function() {
@@ -1224,7 +1224,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
   describe("#installRepoVersionSuccess()", function() {
     var mock = Em.Object.create({
       id: 1,
-      defaultStatus: 'INIT',
+      defaultStatus: 'NOT_REQUIRED',
       stackVersion: {}
     });
     beforeEach(function () {
@@ -3164,7 +3164,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       controller.finish();
       expect(controller.setDBProperties.calledWith({
         upgradeId: undefined,
-        upgradeState: 'INIT',
+        upgradeState: 'NOT_REQUIRED',
         upgradeVersion: undefined,
         currentVersion: undefined,
         upgradeTypeDisplayName: undefined,
@@ -3181,9 +3181,9 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       expect(App.clusterStatus.setClusterStatus.calledOnce).to.be.true;
     });
 
-    it("upgradeState should be INIT", function() {
+    it("upgradeState should be NOT_REQUIRED", function() {
       controller.finish();
-      expect(App.get('upgradeState')).to.be.equal('INIT');
+      expect(App.get('upgradeState')).to.be.equal('NOT_REQUIRED');
     });
 
     it("currentStackVersion should be set", function() {
@@ -3291,7 +3291,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
               ClusterStackVersions: {
                 version: '2.3',
                 stack: 'HDP',
-                state: 'INIT'
+                state: 'NOT_REQUIRED'
               },
               repository_versions: [
                 {
@@ -3307,7 +3307,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
               ClusterStackVersions: {
                 version: '2.2',
                 stack: 'HDP',
-                state: 'INIT'
+                state: 'NOT_REQUIRED'
               },
               repository_versions: [
                 {

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index b928b02..0d08a45 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -48,7 +48,7 @@ describe('App.UpgradeVersionBoxView', function () {
 
   describe("#isUpgrading", function () {
     afterEach(function () {
-      App.set('upgradeState', 'INIT');
+      App.set('upgradeState', 'NOT_REQUIRED');
     });
     it("wrong version", function () {
       App.set('upgradeState', 'IN_PROGRESS');
@@ -64,15 +64,15 @@ describe('App.UpgradeVersionBoxView', function () {
       view.propertyDidChange('isUpgrading');
       expect(view.get('isUpgrading')).to.be.true;
     });
-    it("upgradeState INIT", function () {
-      App.set('upgradeState', 'INIT');
+    it("upgradeState NOT_REQUIRED", function () {
+      App.set('upgradeState', 'NOT_REQUIRED');
       view.set('controller.upgradeVersion', 'HDP-2.2.2');
       view.set('content.displayName', 'HDP-2.2.2');
       view.propertyDidChange('isUpgrading');
       expect(view.get('isUpgrading')).to.be.false;
     });
-    it("upgradeState INIT and wrong version", function () {
-      App.set('upgradeState', 'INIT');
+    it("upgradeState NOT_REQUIRED and wrong version", function () {
+      App.set('upgradeState', 'NOT_REQUIRED');
       view.set('controller.upgradeVersion', 'HDP-2.2.2');
       view.set('content.displayName', 'HDP-2.2.1');
       view.propertyDidChange('isUpgrading');
@@ -367,11 +367,11 @@ describe('App.UpgradeVersionBoxView', function () {
       },
       {
         inputData: {
-          'content.status': 'INIT',
+          'content.status': 'NOT_REQUIRED',
           'controller.requestInProgress': false,
           'parentView.repoVersions': [
             Em.Object.create({
-              status: 'INIT'
+              status: 'NOT_REQUIRED'
             })
           ]
         },
@@ -380,20 +380,20 @@ describe('App.UpgradeVersionBoxView', function () {
           this.initMock.returns(false);
         },
         expected: {
-          status: 'INIT',
+          status: 'NOT_REQUIRED',
           isButton: true,
           buttons: [],
           isDisabled: false
         },
-        title: 'INIT state, no admin access, no requests in progress'
+        title: 'NOT_REQUIRED state, no admin access, no requests in progress'
       },
       {
         inputData: {
-          'content.status': 'INIT',
+          'content.status': 'NOT_REQUIRED',
           'controller.requestInProgress': true,
           'parentView.repoVersions': [
             Em.Object.create({
-              status: 'INIT'
+              status: 'NOT_REQUIRED'
             })
           ]
         },
@@ -402,12 +402,12 @@ describe('App.UpgradeVersionBoxView', function () {
           this.initMock.returns(true);
         },
         expected: {
-          status: 'INIT',
+          status: 'NOT_REQUIRED',
           isButton: true,
           buttons: [],
           isDisabled: true
         },
-        title: 'INIT state, no admin access, request in progress, not installation'
+        title: 'NOT_REQUIRED state, no admin access, request in progress, not installation'
       },
       {
         inputData: {
@@ -957,7 +957,7 @@ describe('App.UpgradeVersionBoxView', function () {
         title: 'upgrading just started'
       },
       {
-        status: 'INIT',
+        status: 'NOT_REQUIRED',
         isUpgrading: false,
         isRepoUrlsEditDisabled: false,
         title: 'neither upgrading nor installing packages'

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
index 075bcc8..7ae785c 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_wizard_view_test.js
@@ -322,7 +322,7 @@ describe('App.upgradeWizardView', function () {
           failedItem: null,
           runningItem: null,
           manualItem: null,
-          upgradeState: 'INIT'
+          upgradeState: 'NOT_REQUIRED'
         },
         result: false
       },

http://git-wip-us.apache.org/repos/asf/ambari/blob/863343ad/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
index cf9906f..32dc2e0 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js
@@ -45,7 +45,7 @@ describe('App.mainAdminStackVersionsView', function () {
   describe("#filterBy()", function () {
     var versions = [
         Em.Object.create({
-          status: "INIT",
+          status: "NOT_REQUIRED",
           repositoryVersion: "2.2.1.1",
           stackVersionType: 'HDP'
         }),
@@ -110,7 +110,7 @@ describe('App.mainAdminStackVersionsView', function () {
           }),
           filteredVersions: [
             Em.Object.create({
-              status: "INIT",
+              status: "NOT_REQUIRED",
               repositoryVersion: "2.2.1.1",
               stackVersionType: 'HDP'
             }),
@@ -164,7 +164,7 @@ describe('App.mainAdminStackVersionsView', function () {
           }),
           filteredVersions: [
             Em.Object.create({
-              status: "INIT",
+              status: "NOT_REQUIRED",
               repositoryVersion: "2.2.1.1",
               stackVersionType: 'HDP'
             }),


Mime
View raw message