Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
feat(config): upgrade to angular 1.5
Browse files Browse the repository at this point in the history
Update bower dependencies to more recent versions.
Resolved hard-coded dependency by updating file upload
PhantomJs to 2.x series for tests (@usta)
Fix assertion in tests for compatibility with MongoDB 3.2 (@rhutchison)
Improve coding style tests to avoid type errors (@ilanbiala)
Fix refresh showing flash of scrollbar in menu
Remove deprecated angular-ui-utils

Fixes #1124
  • Loading branch information
trendzetter committed Mar 2, 2016
1 parent ee39a2c commit 500d1a6
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 37 deletions.
22 changes: 9 additions & 13 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@
"homepage": "http://meanjs.org/",
"license": "MIT",
"dependencies": {
"angular": "~1.3",
"angular-animate": "~1.3",
"angular-bootstrap": "~1.0",
"angular-file-upload": "1.1.5",
"angular-messages": "~1.3.17",
"angular-mocks": "~1.3",
"angular-resource": "~1.3",
"angular-ui-router": "~0.2",
"angular-ui-utils": "bower",
"bootstrap": "~3",
"angular": "~1.5.0",
"angular-animate": "~1.5.0",
"angular-bootstrap": "~1.2.1",
"angular-file-upload": "~2.2.0",
"angular-messages": "~1.5.0",
"angular-mocks": "~1.5.0",
"angular-resource": "~1.5.0",
"angular-ui-router": "~0.2.18",
"bootstrap": "~3.3.6",
"owasp-password-strength-test": "~1.3.0"
},
"resolutions": {
"angular": "~1.3"
}
}
3 changes: 1 addition & 2 deletions config/assets/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ module.exports = {
'public/lib/angular-animate/angular-animate.js',
'public/lib/angular-messages/angular-messages.js',
'public/lib/angular-ui-router/release/angular-ui-router.js',
'public/lib/angular-ui-utils/ui-utils.js',
'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
'public/lib/angular-file-upload/angular-file-upload.js',
'public/lib/angular-file-upload/dist/angular-file-upload.js',
'public/lib/owasp-password-strength-test/owasp-password-strength-test.js'
],
tests: ['public/lib/angular-mocks/angular-mocks.js']
Expand Down
3 changes: 1 addition & 2 deletions config/assets/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ module.exports = {
'public/lib/angular-animate/angular-animate.min.js',
'public/lib/angular-messages/angular-messages.min.js',
'public/lib/angular-ui-router/release/angular-ui-router.min.js',
'public/lib/angular-ui-utils/ui-utils.min.js',
'public/lib/angular-bootstrap/ui-bootstrap-tpls.min.js',
'public/lib/angular-file-upload/angular-file-upload.min.js',
'public/lib/angular-file-upload/dist/angular-file-upload.min.js',
'public/lib/owasp-password-strength-test/owasp-password-strength-test.js'
]
},
Expand Down
2 changes: 1 addition & 1 deletion modules/core/client/app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var ApplicationConfiguration = (function () {
// Init module configuration options
var applicationModuleName = 'mean';
var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ui.utils', 'angularFileUpload'];
var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'angularFileUpload'];

// Add a new vertical module
var registerModule = function (moduleName, dependencies) {
Expand Down
2 changes: 1 addition & 1 deletion modules/core/client/views/header.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</button>
<a ui-sref="home" class="navbar-brand">MEAN.JS</a>
</div>
<nav class="collapse navbar-collapse" uib-collapse="!isCollapsed" role="navigation">
<nav class="navbar-collapse" uib-collapse="!isCollapsed" role="navigation">
<ul class="nav navbar-nav" ng-if="menu.shouldRender(authentication.user);">
<li ng-repeat="item in menu.items | orderBy: 'position'" ng-if="item.shouldRender(authentication.user);" ng-switch="item.type" ng-class="{ active: $state.includes(item.state), dropdown: item.type === 'dropdown' }" class="{{item.class}}" uib-dropdown="item.type === 'dropdown'">
<a ng-switch-when="dropdown" class="dropdown-toggle" uib-dropdown-toggle role="button">{{::item.title}}&nbsp;<span class="caret"></span></a>
Expand Down
47 changes: 33 additions & 14 deletions modules/core/tests/client/socket.io.client.service.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,39 @@
* Functionality of the service is tested through
* the chat controller tests.
*/
window.io = function() {
this.cbs = {};
this.on = function(msg, cb) {
this.cbs[msg] = cb;
};
this.emit = function(msg, data) {
this.cbs[msg](data);
};
this.removeListener = function(msg) {
delete this.cbs[msg];
};
this.connect = function() {
this.socket = {};

var ngInjector = angular.injector(['ng']),
$window = ngInjector.get('$window');

var mock = function () {
var io = {
cbs: {},
connect: connect,
emit: emit,
on: on,
removeListener: removeListener
};
return this;

connect();

return io;

function connect() {
io.socket = {};
}

function emit(msg, data) {
io.cbs[msg](data);
}

function on(msg, cb) {
io.cbs[msg] = cb;
}

function removeListener(msg) {
delete io.cbs[msg];
}
};

$window.io = mock;
})();
10 changes: 8 additions & 2 deletions modules/users/tests/server/user.server.routes.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,10 @@ describe('User CRUD tests', function () {
}

// Call the assertion callback
userInfoRes.body.message.should.equal('Username already exists');
// MongoDB changed document validation output in version 3.2:
// >= 3.2 11000 duplicate key error collection: mean-test.users index: username already exists
// < 3.2 Username already exists
userInfoRes.body.message.toLowerCase().should.containEql('username already exists');

return done();
});
Expand Down Expand Up @@ -794,7 +797,10 @@ describe('User CRUD tests', function () {
}

// Call the assertion callback
userInfoRes.body.message.should.equal('Email already exists');
// MongoDB changed document validation output in version 3.2:
// >= 3.2 11000 duplicate key error collection: mean-test.users index: email already exists
// < 3.2 Email already exists
userInfoRes.body.message.toLowerCase().should.containEql('email already exists');

return done();
});
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"passport-local": "~1.0.0",
"passport-paypal-openidconnect": "~0.1.1",
"passport-twitter": "~1.0.4",
"phantomjs": "~1.9.19",
"phantomjs-prebuilt": "~2.1.4",
"serve-favicon": "~2.3.0",
"socket.io": "~1.3.7",
"swig": "~1.4.2",
Expand Down Expand Up @@ -116,7 +116,7 @@
"karma-firefox-launcher": "~0.1.7",
"karma-jasmine": "~0.3.7",
"karma-ng-html2js-preprocessor": "~0.2.1",
"karma-phantomjs-launcher": "~0.2.3",
"karma-phantomjs-launcher": "~1.0.0",
"load-grunt-tasks": "~3.2.0",
"mock-fs": "~3.7.0",
"run-sequence": "~1.1.5",
Expand Down

0 comments on commit 500d1a6

Please sign in to comment.