Skip to content

Commit

Permalink
final round of fixes and polish
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Sep 5, 2024
1 parent fae6ced commit 2a5e833
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/server_tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def show
render_data data: allowed_tag_names, status: :ok
end

# GET /api/v1/server_tags/fallback_mode
# GET /api/v1/server_tags/fallback_mode.json
# Returns global tag fallback mode (user config or global desired/required)
def fallback_mode
render_data data: Rails.configuration.server_tag_fallback_mode, status: :ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function RoomSettings() {
const { data: roomConfigs } = useRoomConfigs();
const { data: room } = useRoom(friendlyId);
const { data: serverTags } = useServerTags(friendlyId);
const { serverTagsFallbackMode } = useServerTagsFallbackMode();
const { data: serverTagsFallbackMode } = useServerTagsFallbackMode();

const updateMutationWrapper = () => useUpdateRoomSetting(friendlyId);
const deleteMutationWrapper = (args) => useDeleteRoom({ friendlyId, ...args });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@ export default function ServerTagRow({
ServerTagRow.defaultProps = {
currentTag: '',
tagRequired: false,
fallbackMode: 'config',
};

ServerTagRow.propTypes = {
updateMutation: PropTypes.func.isRequired,
currentTag: PropTypes.string,
tagRequired: PropTypes.bool,
serverTags: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
fallbackMode: PropTypes.string,
fallbackMode: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
};
4 changes: 2 additions & 2 deletions app/services/meeting_starter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ def handle_server_tag(meeting_options:)
tag_required = meeting_options.delete('serverTagRequired')
# handle override modes
if Rails.configuration.server_tag_fallback_mode == 'required'
tag_required = true
tag_required = 'true'
elsif Rails.configuration.server_tag_fallback_mode == 'desired'
tag_required = false
tag_required = 'false'
end

if tag_names.key?(tag) && !(tag_roles.key?(tag) && tag_roles[tag].exclude?(@room.user.role_id))
Expand Down
7 changes: 5 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@
resources :site_settings, only: :index
resources :rooms_configurations, only: %i[index show], param: :name
resources :locales, only: %i[index show], param: :name
resources :server_tags, only: :show, param: :friendly_id
resources :server_tags, only: :fallback_mode
resources :server_tags, only: :show, param: :friendly_id do
collection do
get '/fallback_mode', to: 'server_tags#fallback_mode'
end
end

namespace :admin do
resources :users, only: %i[update] do
Expand Down

0 comments on commit 2a5e833

Please sign in to comment.