-
Notifications
You must be signed in to change notification settings - Fork 240
Issue 691 hangout participant count #719
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
Issue 691 hangout participant count #719
Conversation
Issue-691. show number of hangout participants in all study group and my study group pages issue-691. Only decrement participant count when the logged in user joins the hangout room Issue-691 Decrement participant count when value is positive
…m/railsstudent/codebuddies into railsstudent-issue-691-hangout-participant-count
@distalx Changes made to get rid of the session variable |
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.
8000Thanks for the PR! Here are some suggestions I hope you'll find helpful.
server/hangouts/methods.js
Outdated
@@ -404,3 +404,36 @@ Meteor.methods({ | |||
|
|||
} | |||
}); | |||
|
|||
Meteor.methods({ |
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.
Please Move methods related to AppStats
collection under a /server/app_stats/methods.js
directory.
joinParticipant
and leaveParticipant
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.
Fixed
server/hangouts/publications.js
Outdated
@@ -82,3 +82,22 @@ Meteor.publish( 'hangoutSearch', function(searchTerm) { | |||
|
|||
return Hangouts.search(searchTerm); | |||
}); | |||
|
|||
Meteor.publish('hangoutParticipants', function(room) { |
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.
hangoutParticipants
and allHangoutParticipants
These publications should be also placed under /server/app_stats/publications.js
directory.
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.
Fixed
server/hangouts/publications.js
Outdated
}); | ||
|
||
Meteor.publish('allHangoutParticipants', function(hangoutRoomIds) { | ||
if (hangoutRoomIds == null || typeof hangoutRoomIds === 'undefined' || |
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.
Please make use of check
here.
i.e. check(hangoutRoomIds, Match.Maybe([String]))
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.
Fixed
@distalx Changes made |
@distalx Please kindly review this PR when you have time. Thanks. |
Great work @railsstudent! 👏 . Love seeing it all come together! LGTM! 👍 I have made few changes.
_ Although there is a one scenario which is really hard to get around._ When a person join the hangout by using a So there are two possibilities, when user won’t get the accurate participants count.
Possible solutions !
cc @lpatmo , @sergeant-q. |
…unt' into issue-691-hangout-participant-count
Thanks for the hard work here, @railsstudent and @distalx! 👏
I'm not too worried about this scenario, actually. If they close the Jitsi tab but forget to close the CB app, they'll still technically be in the hangout, right? Of the two proposed solutions, I would lean towards the cron job instead of removing the "click here" link, since I think the user experience is more terrible if you can't get in to the hangout at all. Plus, the external link gives us easy access to the URL for the Jitsi room. Shall I punt the cron job into a new issue -- and in the meantime, merge to staging? |
One thought: in I.e.
That way we won't have a bunch of laptop icons with (0) next to it, and it'd be easier to tell which study group rooms have active people at first glance. Thoughts welcome! |
@lpatmo Okay. I will work on it in the weekend. |
@railsstudent If you feel like you've slacked off, then I've been... comatose? :P The change is pretty straightforward -- it would be those two lines I pasted above for |
@lpatmo I think it is a good idea to hide the laptop icon when no one is in 24/7 hangout. |
Thanks! |
@lpatmo Templates fixed. Please kindly review |
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.
Excellent! Thank you.
* Issue 691 hangout participant count (#719) * fix for bug 690: admins should be able to access 24/7 hangout (#693) (#694) * Issue-691. Show number of participants in 24/7 hangout Issue-691. show number of hangout participants in all study group and my study group pages issue-691. Only decrement participant count when the logged in user joins the hangout room Issue-691 Decrement participant count when value is positive * Remove unique index comment * fix 'participants_count' of undefined console err * Get rid of session variable * Move server-side logic to new files * Enable seed data * minor improvements * Show laptop icon when people join 24/7 hangout * Fix account deletion. (#745) * fix typo * Schedule hangout default studygroup name (#743) * Default study group name when schedule a hangout in single study group duplicate hangout in single study group * Default study group name value is not displayed in dropdown input area unless trigger('change') is fired * Fixed error * Issue 667 create slack page (#744) * Create new Slack page * Add helpful links * Minor content edits! Note: I removed the slackin plugin in favor of a direct link because I noticed some positioning issues with the form that appears after a user clicks on the plugin; it's sometimes out of reach, and will make the user think that nothing happened. * Show study group name in disabled input box in modal (#748) * Refactoring 1 (#752) * fix for bug 690: admins should be able to access 24/7 hangout (#693) (#694) * refactor (routes) remove subs from router level * refactor (hangout_logged_out) make use of new syntax * refactor (hangouts) - remove dead code, restructure single hangout view
* Issue 691 hangout participant count (#719) * fix for bug 690: admins should be able to access 24/7 hangout (#693) (#694) * Issue-691. Show number of participants in 24/7 hangout Issue-691. show number of hangout participants in all study group and my study group pages issue-691. Only decrement participant count when the logged in user joins the hangout room Issue-691 Decrement participant count when value is positive * Remove unique index comment * fix 'participants_count' of undefined console err * Get rid of session variable * Move server-side logic to new files * Enable seed data * minor improvements * Show laptop icon when people join 24/7 hangout * Fix account deletion. (#745) * fix typo * Schedule hangout default studygroup name (#743) * Default study group name when schedule a hangout in single study group duplicate hangout in single study group * Default study group name value is not displayed in dropdown input area unless trigger('change') is fired * Fixed error * Issue 667 create slack page (#744) * Create new Slack page * Add helpful links * Minor content edits! Note: I removed the slackin plugin in favor of a direct link because I noticed some positioning issues with the form that appears after a user clicks on the plugin; it's sometimes out of reach, and will make the user think that nothing happened. * Show study group name in disabled input box in modal (#748) * Refactoring 1 (#752) * fix for bug 690: admins should be able to access 24/7 hangout (#693) (#694) * refactor (routes) remove subs from router level * refactor (hangout_logged_out) make use of new syntax * refactor (hangouts) - remove dead code, restructure single hangout view * Add 'add to google calendar' button that opens up link with event details from hangout, including meet.jit.si location (#755) * Display fallback image if image url of contributor is broken (#756) * Issue 547 redesign of /hangouts page (#757) * redesigned header area * hangouts area now uses flexbox + big redesign of cards area * adjust column display on profile page * completed hangout cards do not need to be very tall; also, hide meta content on hover * add popover descriptions for silent/collaboration/teaching icon keys * grammar correction * update hangout-faq a bit more, and give it its own route * capitalization fixes * adjust hover behavior of btn-block * fix up hangout cards in study groups * update faq content
Fixes #691.
Create a MongoDB collection app_stats with schema { hangout_id: string, participant_count: number }
A unique index should be created for hangout_id
// add unique index, db.app_stats.createIndex({ hangout_id, 1}, { unique: true });
Server publishes hangoutParticipants and allHangoutParticipants to return number of participants in a specific hangout room
In single study group.js, participant count is shown in a badge in 24/7 hangout tab
In hangout_frame.js, participant count is shown in a well below jitsu hangout. participant count is incremented when user loads jitsu and decremented when user leaves the page
In all study room.js and my study room.js, participant count of 24/7 hangout is listed for each study room; adjacent to laptop icon