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
disableWebsocketFallback: boolean
maxMutationPayloadSize: number
enableApolloDevTools: boolean
}
export interface BbbTabletApp {

View File

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

View File

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

View File

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