bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/settings/container.jsx
Lucas 9bf3f54183
feat: Initial BBB 3.0 Gladia transcriptions implementation (#20295)
* feat(html5): initial implementation of Gladia transcriptions to BBB 3.0

* fix(transcription): Add missing locales and fix invalid cc menu key

* fix(bbb-transcription-controller): Bump transcription controller to fix some bugs

* fix: adjust yq syntax for setting fs esl password in transctiption-controller

* fix(transcription): Use newer useSettings format from transcription options

* fix(captions): Correctly use captions settings

---------

Co-authored-by: João Victor <joaovictornunes973@gmail.com>
Co-authored-by: Anton Georgiev <anto.georgiev@gmail.com>
Co-authored-by: Ramón Souza <contato@ramonsouza.com>
2024-06-12 12:06:07 -04:00

73 lines
2.7 KiB
JavaScript

import React from 'react';
import Settings from './component';
import { layoutDispatch } from '../layout/context';
import { useIsScreenSharingEnabled } from '/imports/ui/services/features';
import UserReactionService from '/imports/ui/components/user-reaction/service';
import AudioCaptionsService from '/imports/ui/components/audio/audio-graphql/audio-captions/service';
import {
updateSettings,
getAvailableLocales,
} from './service';
import useUserChangedLocalSettings from '../../services/settings/hooks/useUserChangedLocalSettings';
import { useShouldRenderPaginationToggle } from '/imports/ui/components/video-provider/video-provider-graphql/hooks';
import useSettings from '/imports/ui/services/settings/hooks/useSettings';
import { SETTINGS } from '/imports/ui/services/settings/enums';
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
import useMeeting from '/imports/ui/core/hooks/useMeeting';
const ASK_MODERATOR = 'ASK_MODERATOR';
const SettingsContainer = (props) => {
const layoutContextDispatch = layoutDispatch();
const setLocalSettings = useUserChangedLocalSettings();
const paginationToggleEnabled = useShouldRenderPaginationToggle();
const { data: currentUser } = useCurrentUser((u) => ({
presenter: u.presenter,
isModerator: u.isModerator,
}));
const { data: meeting } = useMeeting((m) => ({
usersPolicies: {
guestPolicy: m.usersPolicies.guestPolicy,
},
}));
const application = useSettings(SETTINGS.APPLICATION);
const audio = useSettings(SETTINGS.AUDIO);
const dataSaving = useSettings(SETTINGS.DATA_SAVING);
const transcription = useSettings(SETTINGS.TRANSCRIPTION);
const availableLocales = getAvailableLocales();
const isPresenter = currentUser?.presenter ?? false;
const isModerator = currentUser?.isModerator ?? false;
const isScreenSharingEnabled = useIsScreenSharingEnabled();
const showGuestNotification = meeting?.usersPolicies?.guestPolicy === ASK_MODERATOR;
const isReactionsEnabled = UserReactionService.useIsEnabled();
const isGladiaEnabled = AudioCaptionsService.isGladia();
return (
<Settings
{...{
...props,
updateSettings,
application,
audio,
dataSaving,
transcription,
availableLocales,
isPresenter,
isModerator,
isScreenSharingEnabled,
showGuestNotification,
isReactionsEnabled,
showToggleLabel: false,
isVideoEnabled: window.meetingClientSettings.public.kurento.enableVideo,
isGladiaEnabled,
}}
layoutContextDispatch={layoutContextDispatch}
setLocalSettings={setLocalSettings}
paginationToggleEnabled={paginationToggleEnabled}
/>
);
};
export default SettingsContainer;