Skip to content

Commit

Permalink
Merge commit '709c27f9753ed09daf417d5f8d46ffd3293481f0' into feature/…
Browse files Browse the repository at this point in the history
…meanjs_0_4_0_merge

* commit '709c27f9753ed09daf417d5f8d46ffd3293481f0':
  Wait for async saving and removing
  Change file ignore pattern to match word 'core' instead of chars
  Add missing newline at the end of text files
  Remove executable bit when not necessary
  Remove dist files 0.4.0
  Adjust profile image URLs on Fb and Twitter strategies
  Auth service
  Remove username from facebook strategy
  Fix meanjs#321 image paths in social meta tags [v0.4]
  Fix meanjs#283 glob path issue for Windows
  Because html5Mode is enabled, the links the social buttons point to will not work, the request to /api/auth/{provider} will be captured by ui-router and directed back to /. Adding target="_self" to each link will fix this issue. Maybe creating a new directive for links to hit server side endpoints would be more appropriate but this should do for now.

Conflicts:
	.gitignore
	Dockerfile
	config/assets/default.js
	modules/core/client/config/core.client.routes.js
	modules/core/client/controllers/home.client.controller.js
	modules/core/server/controllers/errors.server.controller.js
	modules/core/server/views/404.server.view.html
	modules/core/server/views/500.server.view.html
	modules/core/server/views/layout.server.view.html
	modules/users/client/controllers/authentication.client.controller.js
	modules/users/client/controllers/password.client.controller.js
	modules/users/client/services/authentication.client.service.js
	modules/users/client/services/users.client.service.js
	modules/users/client/views/authentication/authentication.client.view.html
	modules/users/server/config/strategies/local.js
	modules/users/server/controllers/users/users.authorization.server.controller.js
	modules/users/server/templates/reset-password-email.server.view.html
	public/dist/application.min.css
	public/dist/application.min.js
  • Loading branch information
Patrick Fowler committed Feb 23, 2015
2 parents 62db016 + 709c27f commit b22db12
Show file tree
Hide file tree
Showing 31 changed files with 106 additions and 101 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.sass-cache/
npm-debug.log
node_modules/
public/lib
app/tests/coverage/
public/lib/
public/dist/
.bower-*/
.idea/
uploads
Expand All @@ -21,6 +21,7 @@ Outset-Logo_*.png
scratchpad.*
public
log
app/tests/coverage/

# Elastic Beanstalk Files
.elasticbeanstalk/*
Expand Down
2 changes: 1 addition & 1 deletion .slugignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/app/tests
/app/tests
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ node_js:
env:
- NODE_ENV=travis
services:
- mongodb
- mongodb
Empty file modified Procfile
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion config/assets/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ module.exports = {
server: ['modules/*/tests/server/**/*.js'],
e2e: ['modules/*/tests/e2e/**/*.js']
}
};
};
2 changes: 1 addition & 1 deletion config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var initGlobalConfigFolders = function (config, assets) {
};

// Setting globbed client paths
config.folders.client = getGlobbedPaths(path.join(process.cwd(), 'modules/*/client/'), process.cwd());
config.folders.client = getGlobbedPaths(path.join(process.cwd(), 'modules/*/client/'), process.cwd().replace(new RegExp(/\\/g),'/'));
};

/**
Expand Down
Empty file modified config/lib/express.js
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion fig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ web:
db:
image: mongo
ports:
- "27017:27017"
- "27017:27017"
2 changes: 1 addition & 1 deletion modules/articles/client/articles.client.module.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';

// Use Applicaion configuration module to register a new module
ApplicationConfiguration.registerModule('articles');
ApplicationConfiguration.registerModule('articles');
Empty file modified modules/articles/client/config/articles.client.routes.js
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
});
};
}
]);
]);
2 changes: 1 addition & 1 deletion modules/articles/server/models/article.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ var ArticleSchema = new Schema({
}
});

mongoose.model('Article', ArticleSchema);
mongoose.model('Article', ArticleSchema);
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@
expect(scope.articles.length).toBe(0);
}));
});
}());
}());
6 changes: 3 additions & 3 deletions modules/articles/tests/server/article.server.model.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ describe('Article Model Unit Tests:', function() {
});

afterEach(function(done) {
Article.remove().exec();
User.remove().exec();
done();
Article.remove().exec(function() {
User.remove().exec(done);
});
});
});
6 changes: 3 additions & 3 deletions modules/articles/tests/server/article.server.routes.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ describe('Article CRUD tests', function() {
});

afterEach(function(done) {
User.remove().exec();
Article.remove().exec();
done();
User.remove().exec(function() {
Article.remove().exec(done);
});
});
});
2 changes: 1 addition & 1 deletion modules/chat/tests/client/chat.client.controller.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
describe('ChatController', function() {
// TODO: Add chat client controller tests
});
}());
}());
2 changes: 1 addition & 1 deletion modules/chat/tests/e2e/chat.e2e.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*/
describe('Chat E2E Tests:', function() {
// TODO: Add chat e2e tests
});
});
2 changes: 1 addition & 1 deletion modules/chat/tests/server/chat.socket.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*/
describe('Chat Socket Tests:', function() {
// TODO: Add chat socket tests
});
});
Empty file modified modules/core/client/core.client.module.js
100755 → 100644
Empty file.
127 changes: 65 additions & 62 deletions modules/core/server/views/layout.server.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>{{title}}</title>

<!-- General META -->
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="fragment" content="!" />
<base href="/" />

<!-- Responsive META -->
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">


<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">

<!-- Facebook META -->
<meta property="fb:app_id" content="{{facebookAppId}}">
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="/img/brand/logo.png">
<meta property="og:type" content="website">

<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="/img/brand/logo.png">

<!-- Fav Icon -->
<link href="/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">

<!--Application CSS Files-->
<title>{{title}}</title>

<!-- General META -->
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="fragment" content="!" />
<base href="/"/>

<!-- Responsive META -->
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">

<!-- Facebook META -->
<meta property="fb:app_id" content="{{facebookAppId}}">
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="{{url}}modules/core/img/brand/logo.png">
<meta property="og:type" content="website">

<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="{{url}}modules/core/img/brand/logo.png">

<!-- Fav Icon -->
<link href="/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">

<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">{% endfor %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}

<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
Expand All @@ -53,31 +53,34 @@
<div class="outer-container">
<ng-include src="'/modules/core/views/header.client.view.html'" class="navbar navbar-fixed-top"></ng-include>

<section class="content">
<section class="content">
<os-debug-info></os-debug-info>
{% block content %}{% endblock %}
</section>
{% block content %}{% endblock %}
</section>

<footer data-ng-include="'/modules/core/views/footer.client.view.html'" class="navbar navbar-bottom"></footer>

</div>
<!--Embedding The User Object-->
<script type="text/javascript">
var user = {{ user | json | safe }};
</script>

<!--Load The Socket.io File-->
<script type="text/javascript" src="/socket.io/socket.io.js"></script>

<!--Application JavaScript Files-->
<!--Embedding The User Object-->
<script type="text/javascript">
var user = {{ user | json | safe }};
</script>
<!--Load The Socket.io File-->
<script type="text/javascript" src="/socket.io/socket.io.js"></script>

<!--Application JavaScript Files-->
{% for jsFile in jsFiles %}
<script type="text/javascript" src="{{jsFile}}"></script>{% endfor %} {% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script type="text/javascript" src="{{host}}:35729/livereload.js"></script>
{% endif %}
<script type="text/javascript" src="{{jsFile}}"></script>
{% endfor %}

<!-- Google Analytics -->
<script>
{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script type="text/javascript" src="{{host}}:35729/livereload.js"></script>
{% endif %}

<!-- Google Analytics -->
<script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
Expand All @@ -88,11 +91,11 @@
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '{{googleAnalyticsTrackingID}}', 'auto');
ga('create', '{{googleAnalyticsTrackingID}}', 'auto');
/*ga('send', 'pageview');*/ /* DISABLE In Favor of $rootScope.$stateChangeSuccess*/
</script>
</script>

<!-- Google Code for Remarketing Tag -->
<!--------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
expect(scope.authentication).toBeTruthy();
});
});
})();
})();
Empty file modified modules/users/client/config/users.client.routes.js
100755 → 100644
Empty file.
14 changes: 8 additions & 6 deletions modules/users/client/services/authentication.client.service.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function () {
'use strict';
'use strict';

// Authentication service for user variables

function AuthenticationService() {
function AuthenticationService($window) {
var _this = this;

function isLoggedIn() {
Expand All @@ -16,13 +16,15 @@
}

_this._data = {
user: window.user,
user: $window.user,
isLoggedIn: isLoggedIn,
isAdmin: isAdmin
};
};

return _this._data;
}
return _this._data;
}

AuthenticationService.$inject = ['$window'];

angular
.module('users')
Expand Down
Empty file modified modules/users/client/users.client.module.js
100755 → 100644
Empty file.
5 changes: 2 additions & 3 deletions modules/users/server/config/strategies/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(config) {
clientID: config.facebook.clientID,
clientSecret: config.facebook.clientSecret,
callbackURL: config.facebook.callbackURL,
profileFields: ['id', 'name', 'displayName', 'email', 'username', 'photos'],
profileFields: ['id', 'name', 'displayName', 'emails', 'photos'],
passReqToCallback: true
},
function(req, accessToken, refreshToken, profile, done) {
Expand All @@ -29,8 +29,7 @@ module.exports = function(config) {
lastName: profile.name.familyName,
displayName: profile.displayName,
email: profile.emails[0].value,
username: profile.username,
profileImageURL: (profile.photos && profile.photos.length) ? profile.photos[0].value : undefined,
profileImageURL: (profile.id) ? '//graph.facebook.com/' + profile.id + '/picture?type=large' : undefined,
provider: 'facebook',
providerIdentifierField: 'id',
providerData: providerData
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/config/strategies/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function(config) {
var providerUserProfile = {
displayName: profile.displayName,
username: profile.username,
profileImageURL: (profile.photos && profile.photos.length) ? profile.photos[0].value : undefined,
profileImageURL: profile.photos[0].value.replace('normal', 'bigger'),
provider: 'twitter',
providerIdentifierField: 'id_str',
providerData: providerData
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/controllers/users.server.controller.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ module.exports = _.extend(
require('./users/users.authorization.server.controller'),
require('./users/users.password.server.controller'),
require('./users/users.profile.server.controller')
);
);
Empty file modified modules/users/server/models/user.server.model.js
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
<p>The {{appName}} Support Team</p>
</body>

</html>
</html>
12 changes: 6 additions & 6 deletions modules/users/tests/server/user.server.model.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ describe('User Model Unit Tests:', function() {
});

it('should fail to save an existing user again', function(done) {
user.save();
return user2.save(function(err) {
should.exist(err);
done();
user.save(function() {
user2.save(function(err) {
should.exist(err);
done();
});
});
});

Expand Down Expand Up @@ -101,7 +102,6 @@ describe('User Model Unit Tests:', function() {
});

after(function(done) {
User.remove().exec();
done();
User.remove().exec(done);
});
});
Empty file modified server.js
100755 → 100644
Empty file.

0 comments on commit b22db12

Please sign in to comment.