edemaine / comingle

Multiroom meeting app integrating web tools
MIT License
44 stars 8 forks source link

Archive empty room without entering #109

Closed hanryhu closed 3 years ago

hanryhu commented 4 years ago

If a room is empty, can we have a feature to delete it (or archive it) without entering? [resumably as a third button in the RoomList]

We encourage students to create rooms during OH, but at the end of OH there are a lot of empty husks lying around that I wish to clean up quickly.

Even better: one button to clean up all empty rooms.

edemaine commented 4 years ago

This is a good idea! But I worry about either option making it a little too easy for students to (accidentally) archive empty rooms. In my class, I want empty rooms to stick around until I want them to go (but when that is, I'd love this feature too). So I'm afraid this has to block on #53.

edemaine commented 3 years ago

@hanryhu It occurs to me that there's a way to hack this in the JavaScript console. If you paste the following into the console, you'll automatically archive all empty rooms (at least, based on my limited testing). Note that this will include any Main Room, so you might want to be in that room to prevent it from archiving (or tweak the code).

document.querySelectorAll('.RoomList .list-group-item[href]').forEach((r) => {
  if (!r.querySelector('.presence-count span') && !require('/lib/rooms.coffee').Rooms.findOne(r.dataset.room).archived) {
    console.log('Archiving', r.innerText, r.dataset.room);
    Meteor.call('roomEdit', {id:r.dataset.room, raised:false, archived: true, updator:require('/client/lib/presenceId.coffee').getCreator()})
}})
edemaine commented 3 years ago

This is no longer blocked! I propose that admins automatically get another button in the room dropdown to archive the room. Also, I think everyone should get a button for archived rooms to make unarchiving easier.

Alternatively, I could imagine the ability to select rooms (via checkboxes) and do a bulk action like archive, delete (#89), lock (#67). And we could add a "select all empty rooms" button...

edemaine commented 3 years ago

The buttons in the RoomList on the left are now implemented, as described above.

For bulk actions, there's now an API that lets you do things like "archive all rooms". The operation would be something like this:

curl -g 'https://comingle/api/room/edit?meeting=xxx&secret=yyy&rooms={"meeting":"xxx","archived":false}&archived=true'

You can also add various filters to the rooms query.