Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVE] Rewrite Call as React component #19778

Merged
merged 11 commits into from
Feb 10, 2021
5 changes: 0 additions & 5 deletions app/videobridge/.eslintrc

This file was deleted.

5 changes: 0 additions & 5 deletions app/videobridge/client/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import './stylesheets/video.css';
import './views/videoFlexTab.html';
import './views/bbbLiveView.html';
import './views/videoFlexTabBbb.html';
import './views/videoFlexTab';
import './views/videoFlexTabBbb';
import './tabBar';
import './actionLink';
import '../lib/messageType';
18 changes: 0 additions & 18 deletions app/videobridge/client/stylesheets/video.css

This file was deleted.

11 changes: 8 additions & 3 deletions app/videobridge/client/tabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo } from 'react';
import React, { useMemo, lazy } from 'react';
import { useStableArray } from '@rocket.chat/fuselage-hooks';
import { Option, Badge } from '@rocket.chat/fuselage';

Expand All @@ -7,6 +7,8 @@ import { addAction, ToolboxActionConfig } from '../../../client/views/room/lib/T
import { useTranslation } from '../../../client/contexts/TranslationContext';
import Header from '../../../client/components/Header';

const templateBBB = lazy(() => import('../../../client/views/room/contextualBar/Call/BBB'));

addAction('bbb_video', ({ room }) => {
const enabled = useSetting('bigbluebutton_Enabled');
const t = useTranslation();
Expand All @@ -28,7 +30,7 @@ addAction('bbb_video', ({ room }) => {
id: 'bbb_video',
title: 'BBB Video Call',
icon: 'phone',
template: 'videoFlexTabBbb',
template: templateBBB,
order: live ? -1 : 0,
renderAction: (props): React.ReactNode => <Header.ToolBoxAction {...props}>
{live ? <Header.Badge title={t('Started_a_video_call')} variant='primary'>!</Header.Badge> : null}
Expand All @@ -37,6 +39,8 @@ addAction('bbb_video', ({ room }) => {
} : null), [enabled, groups, live, t]);
});

const templateJitsi = lazy(() => import('../../../client/views/room/contextualBar/Call/Jitsi'));

addAction('video', ({ room }) => {
const enabled = useSetting('Jitsi_Enabled');
const t = useTranslation();
Expand All @@ -59,7 +63,8 @@ addAction('video', ({ room }) => {
id: 'video',
title: 'Call',
icon: 'phone',
template: 'videoFlexTab',
template: templateJitsi,
full: true,
order: live ? -1 : 0,
renderAction: (props): React.ReactNode => <Header.ToolBoxAction {...props}>
{live && <Header.Badge title={t('Started_a_video_call')} variant='primary'>!</Header.Badge>}
Expand Down
16 changes: 0 additions & 16 deletions app/videobridge/client/views/videoFlexTab.html

This file was deleted.

190 changes: 0 additions & 190 deletions app/videobridge/client/views/videoFlexTab.js

This file was deleted.

16 changes: 0 additions & 16 deletions app/videobridge/client/views/videoFlexTabBbb.html

This file was deleted.

64 changes: 0 additions & 64 deletions app/videobridge/client/views/videoFlexTabBbb.js

This file was deleted.

8 changes: 3 additions & 5 deletions app/videobridge/server/methods/bbb.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@ Meteor.methods({
const endApiResult = HTTP.get(endApi);

if (endApiResult.statusCode !== 200) {
// TODO improve error logging
console.log({ endApiResult });
return;
saveStreamingOptions(rid, {});
throw new Meteor.Error(endApiResult);
}

const doc = parseString(endApiResult.content);

if (doc.response.returncode[0] === 'FAILED') {
if (['SUCCESS', 'FAILED'].includes(doc.response.returncode[0])) {
saveStreamingOptions(rid, {});
}
},
Expand Down
Loading