Skip to content

Commit

Permalink
Merge pull request #1307 from SUSE/16-migration
Browse files Browse the repository at this point in the history
Upgrade to Angular 1.6
  • Loading branch information
nwmac authored Oct 27, 2017
2 parents bef83de + 2b7be12 commit 947a4ea
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 34 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"user-info": "./components/user-info"
},
"devDependencies": {
"angular-mocks": "~1.4.9"
"angular-mocks": "~1.6.6"
},
"config": {
"main": "cloud-foundry"
Expand Down
16 changes: 8 additions & 8 deletions components/app-core/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
".*"
],
"dependencies": {
"angular": "~1.4.14",
"angular-sanitize": "~1.4.14",
"angular": "~1.6.6",
"angular-sanitize": "~1.6.6",
"angular-smart-table": "~2.1.8",
"angular-ui-router": "~0.2.17",
"angular-translate": "~2.13.1",
"angular-translate-loader-static-files": "~2.13.1",
"angular-ui-router": "~0.4.2",
"angular-translate": "~2.15.2",
"angular-translate-loader-static-files": "~2.15.2",
"angular-websocket": "~2.0.0",
"jquery": "~1.11.3",
"lodash": "~4.0.1",
"moment": "~2.10.6",
"angular-moment": "~0.10.3",
"angular-cookies": "1.4",
"angular-moment": "~1.1.0",
"angular-cookies": "~1.6.6",
"angular-utf8-base64": "~0.0.5",
"moment-duration-format": "~1.3.0",
"app-framework": "./components/app-framework"
},
"devDependencies": {
"angular-mocks": "~1.4.14"
"angular-mocks": "~1.6.6"
}
}
5 changes: 4 additions & 1 deletion components/app-core/frontend/src/index.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
angular
.module('console-app', angularModules.concat(otherModules, ['app'], pluginModules), config);

function config($compileProvider, $logProvider) {
function config($compileProvider, $logProvider, $qProvider) {

/**
* Disabling Debug Data
Expand All @@ -43,6 +43,9 @@
$compileProvider.debugInfoEnabled(false);

$logProvider.debugEnabled(false);
$compileProvider.preAssignBindingsEnabled(true);
// Skip errors on unhandled rejections (promise chains that don't deal with errors)
$qProvider.errorOnUnhandledRejections(false);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div class="landing-content">
<div class="landing-spacer-left"></div>
<div class="landing-spacer-content" ng-transclude="div"></div>
<div class="landing-spacer-content" ng-transclude></div>
<div class="landing-spacer-right"></div>
</div>

Expand Down
20 changes: 10 additions & 10 deletions components/app-framework/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
"**/.*"
],
"dependencies": {
"angular": "~1.4.14",
"angular-animate": "~1.4.14",
"angular-bootstrap": "2.1.4",
"angular-breadcrumb": "~0.4.1",
"angular-sanitize": "~1.4.14",
"angular": "~1.6.6",
"angular-animate": "~1.6.6",
"angular-bootstrap": "~2.5.0",
"angular-breadcrumb": "~0.5.0",
"angular-sanitize": "~1.6.6",
"angular-smart-table": "~2.1.8",
"angular-toastr": "~1.7.0",
"angular-translate": "~2.13.1",
"angular-translate-loader-static-files": "~2.13.1",
"angular-toastr": "~2.1.1",
"angular-translate": "~2.15.2",
"angular-translate-loader-static-files": "~2.15.2",
"bootstrap": "~3.3.6",
"bootstrap-sass": "bootstrap-sass-official#^3.3.6",
"jquery": "~1.11.3",
"lodash": "~4.0.1",
"ngSmoothScroll": "~2.0.0",
"ng-tags-input": "~3.2.0",
"angular-cookies": "1.4",
"angular-cookies": "~1.6.6",
"angular-utf8-base64": "~0.0.5",
"SpinKit": "spinkit#~1.2.5"
},
"devDependencies": {
"angular-mocks": "~1.4.14"
"angular-mocks": "~1.6.6"
}
}
19 changes: 15 additions & 4 deletions components/app-framework/test/unit/widgets/confirm.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
'use strict';

describe('confirm service', function () {
var $rootScope, $q, $sce, $timeout, confirmDialog, confirmDialogContext, service;
var $rootScope, $q, $sce, $timeout, $animate, confirmDialog, confirmDialogContext, service;

beforeEach(module('ngAnimateMock'));
beforeEach(module('templates'));
beforeEach(module('app.framework'));
beforeEach(module('ui.bootstrap'));
Expand All @@ -13,6 +14,8 @@
$rootScope = $injector.get('$rootScope');
$q = $injector.get('$q');
$sce = $injector.get('$sce');

$animate = $injector.get('$animate');
confirmDialog = $injector.get('frameworkDialogConfirm');
confirmDialogContext = {
noHtmlEscape: true,
Expand All @@ -21,13 +24,15 @@
buttonText: {
yes: 'Yes, I am sure',
no: 'No'
},
callback: function () {
}
};
service = confirmDialog(confirmDialogContext);
}));

afterEach(function () {
$animate.flush();
});

it('confirm is defined as function', function () {
expect(angular.isFunction(confirmDialog)).toBe(true);
});
Expand All @@ -47,7 +52,7 @@

it('should close dialog when cancel pressed', function () {
service.result.then(function () {
fail('dailog should close cancel');
fail('dialog should close cancel');
});
$rootScope.$apply();
angular.element('.btn.btn-default').trigger('click');
Expand Down Expand Up @@ -77,6 +82,8 @@
angular.element('.btn.btn-primary').trigger('click');
$timeout.flush();
expect(angular.element('.modal-error .alert.alert-danger').text().trim()).toBe('error_msg');

angular.element('.btn.btn-default').trigger('click');
});

it('should get error when callback fails - get description', function () {
Expand All @@ -90,6 +97,8 @@
angular.element('.btn.btn-primary').trigger('click');
$timeout.flush();
expect(angular.element('.modal-error .alert.alert-danger').text().trim()).toBe('error_msg2');

angular.element('.btn.btn-default').trigger('click');
});

it('should get error when callback fails - default', function () {
Expand All @@ -102,6 +111,8 @@
angular.element('.btn.btn-primary').trigger('click');
$timeout.flush();
expect(angular.element('.modal-error .alert.alert-danger').text().trim()).toBe('msg');

angular.element('.btn.btn-default').trigger('click');
});

it('should close when there is no callback', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

function isApplicationWall() {
return browser.getCurrentUrl().then(function (url) {
return url === helpers.getHost() + '/#/cf/applications/list/gallery-view';
return url === helpers.getHost() + '/#!/cf/applications/list/gallery-view';
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
}

function goToCfEndpoints() {
return browser.get(helpers.getHost() + '/#/endpoint/cf');
return browser.get(helpers.getHost() + '/#!/endpoint/cf');
}

function isEndpoints() {
return browser.getCurrentUrl().then(function (url) {
return expect(url).toBe(helpers.getHost() + '/#/endpoint');
return expect(url).toBe(helpers.getHost() + '/#!/endpoint');
});
}

function isCfEndpoints() {
return browser.getCurrentUrl().then(function (url) {
return expect(url).toBe(helpers.getHost() + '/#/endpoint/cf/list');
return expect(url).toBe(helpers.getHost() + '/#!/endpoint/cf/list');
});
}

Expand All @@ -52,7 +52,7 @@
function isCfOganizationsDetails() {
browser.debugger();
return browser.getCurrentUrl().then(function (url) {
return expect(url).toMatch(helpers.getHost() + '/#/endpoint/.*/organizations');
return expect(url).toMatch(helpers.getHost() + '/#!/endpoint/.*/organizations');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,15 @@
loginPage.waitForLogin();
loginPage.login(helpers.getAdminUser(), helpers.getAdminPassword());

expect(browser.getCurrentUrl()).toBe(helpers.getHost() + '/#/endpoint');
expect(browser.getCurrentUrl()).toBe(helpers.getHost() + '/#!/endpoint');
});

it('should go directly to applications view on logout and login', function () {
navbar.logout();
loginPage.waitForLogin();
loginPage.login(helpers.getUser(), helpers.getPassword());

expect(browser.getCurrentUrl()).toBe(helpers.getHost() + '/#/cf/applications/list/gallery-view');
expect(browser.getCurrentUrl()).toBe(helpers.getHost() + '/#!/cf/applications/list/gallery-view');
});

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
}

function goToEndpoints() {
return browser.get(helpers.getHost() + '/#/endpoint');
return browser.get(helpers.getHost() + '/#!/endpoint');
}

function isEndpoints() {
return browser.getCurrentUrl().then(function (url) {
return url === helpers.getHost() + '/#/endpoint';
return url === helpers.getHost() + '/#!/endpoint';
});
}

Expand Down

0 comments on commit 947a4ea

Please sign in to comment.