Skip to content

Commit

Permalink
LTI-401: Remove wait for moderator feature and rewording of settings (#…
Browse files Browse the repository at this point in the history
…337)

* LTI-401: updated locales for lock on join

* LTI-401: removed wait for moderator in favour of guest policy

* LTI-401: removed actioncable for wait for moderator feature

* LTI-401: added data migration for converting waitForModerator to guestPolicy

* LTI-401: rewording of message on workaround for firefox and safari

* LTI-401: rewording all remaining messages in locales

* LTI-401: fixed rubocops

* LTI-401: removed wait_for_mod? from tests

* LTI-401: fixed language file

* LTI-401: removed the job used by actioncable

* LTI-401: removed wait for moderator from the expectation
  • Loading branch information
jfederico authored Jul 24, 2024
1 parent 0539359 commit 557fe04
Show file tree
Hide file tree
Showing 14 changed files with 237 additions and 382 deletions.
33 changes: 0 additions & 33 deletions app/channels/wait_channel.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/controllers/concerns/bbb_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,6 @@ def update_recording(record_id, meta)
bbb.send_api_request('updateRecordings', meta)
end

# Check if the current @user must wait for moderator to join the current room.
def wait_for_mod?
return unless @chosen_room && @user

wait_setting = @chosen_room.waitForModerator != '0'
wait_setting && !@user.moderator?(bigbluebutton_moderator_roles)
end

# Return the number of participants in a meeting for the current room.
def participant_count
info = meeting_info
Expand Down
17 changes: 2 additions & 15 deletions app/controllers/rooms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,10 @@ def meeting_join
end and return
end

wait = wait_for_mod? && !meeting_running?
@meeting = join_meeting_url

if wait
respond_to do |format|
format.html
format.json { render(json: { wait_for_mod: wait, meeting: @meeting }) }
end
else
broadcast_meeting(action: 'join', delay: true)
NotifyRoomWatcherJob.perform_now(@chosen_room, { action: 'started' })
redirect_to(@meeting)
end
broadcast_meeting(action: 'join', delay: true)
redirect_to(@meeting)
rescue BigBlueButton::BigBlueButtonException => e
logger.error(e.to_s)
set_error(e.key, 500, 'bigbluebutton')
Expand Down Expand Up @@ -395,7 +386,6 @@ def room_params
:moderator,
:viewer,
:recording,
:wait_moderator,
:all_moderators,
:hide_name,
:hide_description,
Expand All @@ -414,7 +404,6 @@ def launch_params_to_new_room_params(handler, handler_legacy, launch_params)
description: launch_params['resource_link_description'] || '',
welcome: '',
recording: launch_params['custom_params'].key?('custom_record') ? launch_params['custom_params']['custom_record'] : true,
wait_moderator: message_has_custom?(launch_params, 'wait_moderator') || false,
all_moderators: message_has_custom?(launch_params, 'all_moderators') || false,
hide_name: message_has_custom?(launch_params, 'hide_name') || false,
hide_description: message_has_custom?(launch_params, 'hide_description') || false,
Expand Down Expand Up @@ -443,10 +432,8 @@ def fetch_new_room_params(handler, handler_legacy)
moderator: room['moderator'],
viewer: room['viewer'],
recording: room['recording'],
wait_moderator: room['wait_moderator'],
all_moderators: room['all_moderators'],
settings: {
waitForModerator: room['wait_moderator'],
record: room['recording'],
allModerators: room['all_moderators'],
}
Expand Down
14 changes: 9 additions & 5 deletions app/javascript/packs/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ $(document).on('turbolinks:load', function () {
$('#allModerators_checkbox').on('click', function () {
var all_mod_checked = $('#allModerators_checkbox').prop("checked");
if (all_mod_checked) {
$('#waitForModerator_checkbox').prop("checked", false);
$('#guestPolicy_checkbox').prop("checked", false).prop("disabled", true);
} else {
$('#guestPolicy_checkbox').prop("disabled", false);
}
})

$('#waitForModerator_checkbox').on('click', function () {
var wait_mod_checked = $('#waitForModerator_checkbox').prop("checked");
if (wait_mod_checked) {
$('#allModerators_checkbox').prop("checked", false);
$('#guestPolicy_checkbox').on('click', function () {
var guest_policy_checked = $('#guestPolicy_checkbox').prop("checked");
if (guest_policy_checked) {
$('#allModerators_checkbox').prop("checked", false).prop("disabled", true);
} else {
$('#allModerators_checkbox').prop("disabled", false);
}
})

Expand Down
39 changes: 6 additions & 33 deletions app/javascript/packs/rooms.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,24 @@
/*
/*
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
*
*
* Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
*
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/

$(document).on('turbolinks:load', function () {
var room = window.location.pathname.split('/')[3];

var controller = $("body").data('controller');
var action = $("body").data('action');
if (controller == "rooms" && action == "meeting_join") {
var personal_join_link = $("body").data('meeting');
App.waiter = App.cable.subscriptions.create({
channel: "WaitChannel",
room_id: room
}, {
connected: function (data) {
console.log("connected to wait");
},
disconnected: function (data) {
console.log("disconnected to wait");
console.log(data);
},
received: function (data) {
console.log("This is the wait data: " + JSON.stringify(data));
if (data.action == "started") {
$('#wait-for-mod-msg').hide();
window.location.replace(personal_join_link);
this.perform("notify_join");
this.unsubscribe();
}
}
})
}

$('#end-meeting-btn').on('click', function () {
var end_meeting_url = $(this).data('url');

Expand All @@ -70,7 +43,7 @@ $(document).on('turbolinks:load', function () {
() => {
console.log('access granted!');
$('#access-alert').hide();
// the user needs to reload and then press the button again for it to work
// the user needs to reload and then press the button again for it to work
},
() => { console.log('access denied') }
);
Expand Down
26 changes: 0 additions & 26 deletions app/jobs/notify_room_watcher_job.rb

This file was deleted.

5 changes: 2 additions & 3 deletions app/models/room.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Room < ApplicationRecord
before_save :default_values

store_accessor :settings, %i[lockSettingsDisableCam lockSettingsDisableMic lockSettingsDisablePrivateChat lockSettingsDisablePublicChat lockSettingsDisableNote]
store_accessor :settings, %i[waitForModerator allModerators guestPolicy record autoStartRecording allowStartStopRecording]
store_accessor :settings, %i[allModerators guestPolicy record autoStartRecording allowStartStopRecording]

# after_find is used for the following so that rooms that already exist will have these fields upon launch
after_find :initialize_setting_defaults, if: :settings_blank?
Expand All @@ -30,7 +30,7 @@ class Room < ApplicationRecord
include BrokerHelper

RECORDING_SETTINGS = [:record, :autoStartRecording, :allowStartStopRecording].freeze
ROOM_SETTINGS = [:guestPolicy, :allModerators, :waitForModerator].freeze
ROOM_SETTINGS = [:guestPolicy, :allModerators].freeze
CODE_LENGTH = 10

def default_values
Expand Down Expand Up @@ -98,7 +98,6 @@ def initialize_setting_defaults
lockSettingsDisableNote: '0',
autoStartRecording: '0',
allowStartStopRecording: '1',
waitForModerator: '1',
allModerators: '0',
guestPolicy: '1',
record: '1',
Expand Down
2 changes: 1 addition & 1 deletion app/views/rooms/_room.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
# You should have received a copy of the GNU Lesser General Public License along
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.

json.extract!(room, :id, :name, :hide_name, :description, :hide_description, :welcome, :moderator, :viewer, :recording, :wait_moderator, :all_moderators, :disable_webcams, :disable_mics,
json.extract!(room, :id, :name, :hide_name, :description, :hide_description, :welcome, :moderator, :viewer, :recording, :all_moderators, :disable_webcams, :disable_mics,
:settings, :created_at, :updated_at)
json.url(room_url(room, format: :json))
40 changes: 0 additions & 40 deletions app/views/rooms/meeting_join.html.erb

This file was deleted.

Loading

0 comments on commit 557fe04

Please sign in to comment.