Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.0 blake #491

Merged
merged 16 commits into from
Mar 13, 2015
Merged

0.4.0 blake #491

merged 16 commits into from
Mar 13, 2015

Conversation

brianhyder
Copy link
Member

No description provided.

* @static
* @method getRoleToDisplayNameMap
* @param {Localization} ls
* @return {Object}
*/
SecurityService.getRoleToDisplayNameMap = function(ls) {
if (util.isFunction(ls)) {
if (util.isFunction(ls.get)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this get changed? There were some instances where the localization service wasn't getting passed. The if check is there to provide support for backward compatiablity. This change will cause a null pointer error in those cases. Please change it back to if (util.isFunction(ls)) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was returning false in my tests, so I moved it to the get function and it worked.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 3.27% when pulling 2bd45bc on 0.4.0-blake into 5ddfdd4 on 0.4.0.

@@ -147,7 +147,8 @@ module.exports = function(pb) {
'ACCESS_ADMINISTRATOR': ls.get('ACCESS_ADMINISTRATOR'),
};
}
return null;
// Return an empty object instead of null, so things won't break after return
return {};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The null is here so that the code explicitly has to handle cases where it is calling the function in a deprecated manner. Was there a specific use case where it needed the change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code wasn't handling a null return, it was going straight to acting upon an object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What code exactly? That code that calls should be providing the Localization instance. Returning null was intentional to highlight code that used the call incorrectly.

UserService.prototype.getEditorSelectList(currId, cb) {
pb.log.warn('UserService: getEditorSelectList is deprecated. Use getWriterOrEditorSelectList instead');
this.getWriterOrEditorSelectList(currId, cb);
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the function signature back. I did this because we don't know if someone was already using it. I'd like to a take a deprecation strategy where possible to reduce churn on our users.

});
});
if(!self.article.author) {
self.article.author = self.session.authentication.user._id.toString();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is uncomfortably verbose but we need to refer to the _id paramter via:

self.session.authentication.user[pb.DAO.getIdField()].toString()

This helps reduce churn to support multiple DBs in the future.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 3.26% when pulling fc3c210 on 0.4.0-blake into 5ddfdd4 on 0.4.0.

@@ -72,7 +92,7 @@ module.exports = function(pb) {

for(i = 0; i < data.article.article_media.length; i++) {
for(j = 0; j < data.media.length; j++) {
if(pb.DAO.areIdsEqual(data.media[j][pb.DAO.idField()], data.article.article_media[i])) {
if(pb.DAO.areIdsEqual(data.media[j][pb.DAO.getIdField()], data.article.article_media[i])) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. I botched that.

Blake Callens and others added 3 commits March 12, 2015 09:37
Conflicts:
	plugins/pencilblue/controllers/api/admin/site_settings/email/send_test.js
	public/js/angular/filters/parsable_date.js
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 24.24% when pulling 3d8893b on 0.4.0-blake into 5b5fa60 on 0.4.0.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 24.24% when pulling 0b6e485 on 0.4.0-blake into 5b5fa60 on 0.4.0.

brianhyder added a commit that referenced this pull request Mar 13, 2015
@brianhyder brianhyder merged commit 0d91d8e into 0.4.0 Mar 13, 2015
@blakecallens blakecallens deleted the 0.4.0-blake branch April 19, 2015 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants