GRN2-xx: Fixed issue with join warning displaying incorrectly (#1957)

* Fixed issue with room settings

* Update room join consent string
This commit is contained in:
Ahmad Farhat 2020-07-30 10:50:04 -04:00 committed by GitHub
parent af8c78fdee
commit ec93d5e472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 32 deletions

View File

@ -94,31 +94,6 @@ module Joiner
} }
end end
# Gets the room setting based on the option set in the room configuration
def room_setting_with_config(name)
config = case name
when "muteOnStart"
"Room Configuration Mute On Join"
when "requireModeratorApproval"
"Room Configuration Require Moderator"
when "joinModerator"
"Room Configuration All Join Moderator"
when "anyoneCanStart"
"Room Configuration Allow Any Start"
when "recording"
"Room Configuration Recording"
end
case @settings.get_value(config)
when "enabled"
true
when "optional"
@room_settings[name]
when "disabled"
false
end
end
private private
def fetch_guest_id def fetch_guest_id

View File

@ -62,7 +62,7 @@ class RoomsController < ApplicationController
# GET /:room_uid # GET /:room_uid
def show def show
@room_settings = @room[:room_settings] @room_settings = JSON.parse(@room[:room_settings])
@anyone_can_start = room_setting_with_config("anyoneCanStart") @anyone_can_start = room_setting_with_config("anyoneCanStart")
@room_running = room_running?(@room.bbb_id) @room_running = room_running?(@room.bbb_id)
@shared_room = room_shared_with_user @shared_room = room_shared_with_user
@ -420,4 +420,30 @@ class RoomsController < ApplicationController
def valid_file_type def valid_file_type
Rails.configuration.allowed_file_types.split(",").include?(File.extname(room_params[:presentation].original_filename)) Rails.configuration.allowed_file_types.split(",").include?(File.extname(room_params[:presentation].original_filename))
end end
# Gets the room setting based on the option set in the room configuration
def room_setting_with_config(name)
config = case name
when "muteOnStart"
"Room Configuration Mute On Join"
when "requireModeratorApproval"
"Room Configuration Require Moderator"
when "joinModerator"
"Room Configuration All Join Moderator"
when "anyoneCanStart"
"Room Configuration Allow Any Start"
when "recording"
"Room Configuration Recording"
end
case @settings.get_value(config)
when "enabled"
true
when "optional"
@room_settings[name]
when "disabled"
false
end
end
helper_method :room_setting_with_config
end end

View File

@ -45,4 +45,13 @@ module RoomsHelper
def preupload_allowed? def preupload_allowed?
@settings.get_value("Preupload Presentation") == "true" @settings.get_value("Preupload Presentation") == "true"
end end
def display_joiner_consent
# If the require consent setting is checked, then check the room setting, else, set to false
if recording_consent_required?
room_setting_with_config("recording")
else
false
end
end
end end

View File

@ -101,10 +101,6 @@ class Room < ApplicationRecord
active_rooms + inactive_rooms active_rooms + inactive_rooms
end end
def recording_enabled?
JSON.parse(room_settings)["recording"]
end
private private
# Generates a uid for the room and BigBlueButton. # Generates a uid for the room and BigBlueButton.

View File

@ -51,7 +51,7 @@
</button> </button>
</span> </span>
</div> </div>
<% if recording_consent_required? && @room.recording_enabled? %> <% if display_joiner_consent %>
<label class="custom-control custom-checkbox"> <label class="custom-control custom-checkbox">
<input id="joiner-consent" type="checkbox" class="custom-control-input" required> <input id="joiner-consent" type="checkbox" class="custom-control-input" required>
<h4 class="text-left text-danger mt-4 custom-control-label"><%= t("room.recording_present") %></h4> <h4 class="text-left text-danger mt-4 custom-control-label"><%= t("room.recording_present") %></h4>

View File

@ -540,7 +540,7 @@ en:
invalid_provider: You have entered an invalid url. Please check the url and try again. invalid_provider: You have entered an invalid url. Please check the url and try again.
invitation_description: You have been invited to join %{name} using BigBlueButton. To join, click the link above and enter your name. invitation_description: You have been invited to join %{name} using BigBlueButton. To join, click the link above and enter your name.
invited: You have been invited to join invited: You have been invited to join
recording_present: The session is going to be recorded. This may include voice and video from your side. recording_present: I acknowledge that this session is going to be recorded. This may include my voice and video if enabled.
invite_participants: Invite Participants invite_participants: Invite Participants
join: Join join: Join
last_session: Last session on %{session} last_session: Last session on %{session}