Add: Flag to enable apollo devtools in production (#21094)

* Add: Flag to enable apollo devtools in production

* Fix: missing field
This commit is contained in:
Tainan Felipe 2024-09-13 17:14:09 -03:00 committed by GitHub
parent 5f2b1b574d
commit 838565d52d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 1 deletions

View File

@ -98,6 +98,7 @@ export interface App {
fallbackOnEmptyLocaleString: boolean fallbackOnEmptyLocaleString: boolean
disableWebsocketFallback: boolean disableWebsocketFallback: boolean
maxMutationPayloadSize: number maxMutationPayloadSize: number
enableApolloDevTools: boolean
} }
export interface BbbTabletApp { export interface BbbTabletApp {

View File

@ -11,6 +11,7 @@ import apolloContextHolder from '../../core/graphql/apolloContextHolder/apolloCo
import connectionStatus from '../../core/graphql/singletons/connectionStatus'; import connectionStatus from '../../core/graphql/singletons/connectionStatus';
import deviceInfo from '/imports/utils/deviceInfo'; import deviceInfo from '/imports/utils/deviceInfo';
import BBBWeb from '/imports/api/bbb-web-api'; import BBBWeb from '/imports/api/bbb-web-api';
import useMeetingSettings from '/imports/ui/core/local-states/useMeetingSettings';
interface ConnectionManagerProps { interface ConnectionManagerProps {
children: React.ReactNode; children: React.ReactNode;
@ -65,6 +66,9 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
const tsLastPingMessageRef = useRef<number>(0); const tsLastPingMessageRef = useRef<number>(0);
const boundary = useRef(15_000); const boundary = useRef(15_000);
const [terminalError, setTerminalError] = React.useState<string>(''); const [terminalError, setTerminalError] = React.useState<string>('');
const [MeetingSettings] = useMeetingSettings();
const enableDevTools = MeetingSettings.public.app.enableApolloDevTools;
useEffect(() => { useEffect(() => {
BBBWeb.index().then(({ data }) => { BBBWeb.index().then(({ data }) => {
setGraphqlUrl(data.graphqlWebsocketUrl); setGraphqlUrl(data.graphqlWebsocketUrl);
@ -206,7 +210,7 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
client = new ApolloClient({ client = new ApolloClient({
link: wsLink, link: wsLink,
cache: new InMemoryCache(), cache: new InMemoryCache(),
connectToDevTools: process.env.NODE_ENV === 'development', connectToDevTools: (process.env.NODE_ENV === 'development') || enableDevTools,
}); });
setApolloClient(client); setApolloClient(client);
apolloContextHolder.setClient(client); apolloContextHolder.setClient(client);

View File

@ -20,6 +20,7 @@ export const meetingClientSettingsInitialValues: MeetingClientSettings = {
html5ClientBuild: 'HTML5_CLIENT_VERSION', html5ClientBuild: 'HTML5_CLIENT_VERSION',
helpLink: 'https://bigbluebutton.org/html5/', helpLink: 'https://bigbluebutton.org/html5/',
delayForUnmountOfSharedNote: 120000, delayForUnmountOfSharedNote: 120000,
enableApolloDevTools: false,
bbbTabletApp: { bbbTabletApp: {
enabled: true, enabled: true,
iosAppStoreUrl: 'https://apps.apple.com/us/app/bigbluebutton-tablet/id1641156756', iosAppStoreUrl: 'https://apps.apple.com/us/app/bigbluebutton-tablet/id1641156756',

View File

@ -83,6 +83,8 @@ public:
allowFullscreen: true allowFullscreen: true
preloadNextSlides: 2 preloadNextSlides: 2
warnAboutUnsavedContentOnMeetingEnd: false warnAboutUnsavedContentOnMeetingEnd: false
# Flag used to enable apollo dev tools in production
enableApolloDevTools: false
# Allows users to enable automatic transcription when joining a meeting. # Allows users to enable automatic transcription when joining a meeting.
# Automatic transcription requires the browser to support the web # Automatic transcription requires the browser to support the web
# speech API, which involves sending voice data to third-party servers! # speech API, which involves sending voice data to third-party servers!