-
Notifications
You must be signed in to change notification settings - Fork 0
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
[GSoC19] Rc articles tests and improvements #9
base: rc_articles
Are you sure you want to change the base?
Conversation
reset git
add collaboration in setting and post add minor changes add collaboration toggle try collaborate in edit mode minor changes check setting while collaborating fix pseudo collision issue on collaboration
remove invite model
setRcTitle(rcTitle) { | ||
// Grab the post and current stored twitter title | ||
let post = this.post; | ||
let currentTitle = post.get('rcTitle'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems post & currentTitle are not mutable, we can use const.
} | ||
this.rcServices.getRoom(newRoom) | ||
.then((room) => { | ||
const existingRCRoom = room.data[0].exist && room.data[0].roomname === newRoom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we mentioned in another pull request, please use es6 destructuring feature.
clearRcImage() { | ||
this.set('post.rcImage', ''); | ||
|
||
if (this.get('post.isNew')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extract all
if (this.get('post.isNew')) {
return;
}
to a util method, we should not duplicate it.
app/controllers/staff/index.js
Outdated
if (role === 'Contributors') { | ||
isParent = this.currentUser.get('id') === user.parentId && user.roles.get('firstObject').name === 'Contributor'; | ||
} | ||
return user.status === 'inactive' && (role ? isParent || user.roles.get('firstObject').name === role : true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In activeUsers & suspendedUsers has duplicate logic, please think to build common method.
let isParent = false;
if (role === 'Contributors') {
isParent = this.currentUser.get('id') === user.parentId && user.roles.get('firstObject').name === 'Contributor';
}
return user.status === 'inactive' && (role ? isParent || user.roles.get('firstObject').name === role : true);
app/models/post.js
Outdated
return new RSVP.Promise((resolve) => { | ||
if (this.get('settings.isComments') && this.isPublished && !this.discussionRoomId && this.displayName === 'post') { | ||
return this.rcServices.createDiscussion(this.title, this.discussionRoomType).then((room) => { | ||
if (room && room.data[0].created) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can destructing value like [{create, rid, roomname, type}] = room.data;
@unclebean updated with changes as requested. |
@shubhsherl well done |
This PR adds:
06f3145
78bc602
59df658