remove remaining files

This commit is contained in:
Ramón Souza 2023-11-14 10:18:19 -03:00
parent ab26ca09b7
commit d2512ef4fb
7 changed files with 22 additions and 105 deletions

View File

@ -1,7 +1,6 @@
import AbstractCollection from '/imports/ui/services/LocalCollectionSynchronizer/LocalCollectionSynchronizer';
// Collections
import Presentations from '/imports/api/presentations';
import PresentationUploadToken from '/imports/api/presentation-upload-token';
import Screenshare from '/imports/api/screenshare';
import UserInfos from '/imports/api/users-infos';
@ -30,7 +29,6 @@ export const localCollectionRegistry = {
localCurrentPollSync: new AbstractCollection(CurrentPoll, CurrentPoll),
localCurrentUserSync: new AbstractCollection(CurrentUser, CurrentUser),
localPollsSync: new AbstractCollection(Polls, Polls),
localPresentationsSync: new AbstractCollection(Presentations, Presentations),
localPresentationUploadTokenSync: new AbstractCollection(
PresentationUploadToken,
PresentationUploadToken,

View File

@ -1,22 +0,0 @@
import RedisPubSub from '/imports/startup/server/redis';
import handlePresentationAdded from './handlers/presentationAdded';
import handlePresentationRemove from './handlers/presentationRemove';
import handlePresentationCurrentSet from './handlers/presentationCurrentSet';
import handlePresentationConversionUpdate from './handlers/presentationConversionUpdate';
import handlePresentationDownloadableSet from './handlers/presentationDownloadableSet';
import handlePresentationExport from './handlers/presentationExport';
import handlePresentationExportToastUpdate from './handlers/presentationExportToastUpdate';
RedisPubSub.on('PdfConversionInvalidErrorEvtMsg', handlePresentationConversionUpdate);
RedisPubSub.on('PresentationPageGeneratedEvtMsg', handlePresentationConversionUpdate);
RedisPubSub.on('PresentationPageCountErrorEvtMsg', handlePresentationConversionUpdate);
RedisPubSub.on('PresentationUploadedFileTimeoutErrorEvtMsg', handlePresentationConversionUpdate);
RedisPubSub.on('PresentationHasInvalidMimeTypeErrorEvtMsg', handlePresentationConversionUpdate);
RedisPubSub.on('PresentationConversionUpdateEvtMsg', handlePresentationConversionUpdate);
RedisPubSub.on('PresentationUploadedFileTooLargeErrorEvtMsg', handlePresentationConversionUpdate);
RedisPubSub.on('PresentationConversionCompletedEvtMsg', handlePresentationAdded);
RedisPubSub.on('RemovePresentationEvtMsg', handlePresentationRemove);
RedisPubSub.on('SetCurrentPresentationEvtMsg', handlePresentationCurrentSet);
RedisPubSub.on('SetPresentationDownloadableEvtMsg', handlePresentationDownloadableSet);
RedisPubSub.on('NewPresFileAvailableEvtMsg', handlePresentationExport);
RedisPubSub.on('PresAnnStatusEvtMsg', handlePresentationExportToastUpdate);

View File

@ -1,6 +1,5 @@
import { Meteor } from 'meteor/meteor';
import removePresentation from './methods/removePresentation';
import setPresentationRenderedInToast from './methods/setPresentationRenderedInToast';
import setPresentation from './methods/setPresentation';
import setPresentationDownloadable from './methods/setPresentationDownloadable';
import exportPresentation from './methods/exportPresentation';
@ -10,5 +9,4 @@ Meteor.methods({
setPresentation,
setPresentationDownloadable,
exportPresentation,
setPresentationRenderedInToast,
});

View File

@ -2,9 +2,6 @@ import RedisPubSub from '/imports/startup/server/redis';
import { check } from 'meteor/check';
import { extractCredentials } from '/imports/api/common/server/helpers';
import Logger from '/imports/startup/server/logger';
import Presentations from '/imports/api/presentations';
const EXPORTING_THRESHOLD_PER_SLIDE = 2500;
export default async function exportPresentation(presentationId, fileStateType) {
const REDIS_CONFIG = Meteor.settings.private.redis;
@ -25,32 +22,6 @@ export default async function exportPresentation(presentationId, fileStateType)
pages: [],
};
const setObserver = async () => {
let timeoutRef = null;
const selector = { meetingId, id: presentationId };
const cursor = Presentations.find(selector);
const pres = await Presentations.findOneAsync(selector);
const numPages = pres?.pages?.length ?? 1;
const threshold = EXPORTING_THRESHOLD_PER_SLIDE * numPages;
const observer = cursor.observe({
changed: (doc) => {
const { status } = doc.exportation;
if (status === 'EXPORTED') {
Meteor.clearTimeout(timeoutRef);
}
},
});
timeoutRef = Meteor.setTimeout(async () => {
observer.stop();
}, threshold);
};
await setObserver();
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
} catch (err) {
Logger.error(`Exception while invoking method exportPresentation ${err.stack}`);

View File

@ -1,28 +0,0 @@
import Presentations from '/imports/api/presentations';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
import { check } from 'meteor/check';
export default async function setPresentationRenderedInToast() {
try {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(requesterUserId, String);
const payload = {
$set: { renderedInToast: true },
};
const numberAffected = await Presentations.updateAsync({
renderedInToast: false,
meetingId,
}, payload, {multi: true});
if (numberAffected) {
Logger.info(`Presentations have been set as rendered in the toast within meeting=${meetingId}, ${numberAffected} documents affected.`);
}
} catch (err) {
Logger.error(`Exception while invoking method setPresentationRenderedInToast ${err.stack}`);
}
}

View File

@ -1,4 +1,3 @@
import Presentations from '/imports/api/presentations';
import { isScreenBroadcasting, isCameraAsContentBroadcasting } from '/imports/ui/components/screenshare/service';
import Settings from '/imports/ui/services/settings';
import getFromUserSettings from '/imports/ui/services/users-settings';
@ -16,16 +15,6 @@ const LAYOUT_CONFIG = Meteor.settings.public.layout;
const KURENTO_CONFIG = Meteor.settings.public.kurento;
const PRESENTATION_CONFIG = Meteor.settings.public.presentation;
const getPresentationInfo = () => {
const currentPresentation = Presentations.findOne({
current: true,
});
return {
current_presentation: (currentPresentation != null),
};
};
function shouldShowWhiteboard() {
return true;
}
@ -80,7 +69,6 @@ const buildLayoutWhenPresentationAreaIsDisabled = (layoutContextDispatch) => {
export default {
buildLayoutWhenPresentationAreaIsDisabled,
getPresentationInfo,
shouldShowWhiteboard,
shouldShowScreenshare,
shouldShowExternalVideo,

View File

@ -1,9 +1,9 @@
import React, { useContext } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import MediaService from '/imports/ui/components/media/service';
import Auth from '/imports/ui/services/auth';
import VideoService from '/imports/ui/components/video-provider/service';
import { useSubscription } from '@apollo/client';
import { UsersContext } from '../components-data/users-context/context';
import {
layoutSelect,
@ -14,14 +14,17 @@ import {
import WebcamComponent from '/imports/ui/components/webcam/component';
import { LAYOUT_TYPE } from '../layout/enums';
import { sortVideoStreams } from '/imports/ui/components/video-provider/stream-sorting';
import {
CURRENT_PRESENTATION_PAGE_SUBSCRIPTION,
} from '/imports/ui/components/whiteboard/queries';
const { defaultSorting: DEFAULT_SORTING } = Meteor.settings.public.kurento.cameraSortingModes;
const WebcamContainer = ({
audioModalIsOpen,
swapLayout,
usersVideo,
layoutType,
isLayoutSwapped,
}) => {
const fullscreen = layoutSelect((i) => i.fullscreen);
const isRTL = layoutSelect((i) => i.isRTL);
@ -31,6 +34,20 @@ const WebcamContainer = ({
const cameraDock = layoutSelectOutput((i) => i.cameraDock);
const layoutContextDispatch = layoutDispatch();
const { data: presentationPageData } = useSubscription(CURRENT_PRESENTATION_PAGE_SUBSCRIPTION);
const presentationPage = presentationPageData?.pres_page_curr[0] || {};
const hasPresentation = !!presentationPage?.presentationId;
const swapLayout = !hasPresentation || isLayoutSwapped;
let floatingOverlay = false;
let hideOverlay = false;
if (swapLayout) {
floatingOverlay = true;
hideOverlay = true;
}
const { cameraOptimalGridSize } = cameraDockInput;
const { display: displayPresentation } = presentation;
@ -56,14 +73,15 @@ const WebcamContainer = ({
displayPresentation,
isRTL,
isGridEnabled,
floatingOverlay,
hideOverlay,
}}
/>
)
: null;
};
export default withTracker((props) => {
const { current_presentation: hasPresentation } = MediaService.getPresentationInfo();
export default withTracker(() => {
const data = {
audioModalIsOpen: Session.get('audioModalIsOpen'),
isMeteorConnected: Meteor.status().connected,
@ -77,12 +95,6 @@ export default withTracker((props) => {
} else {
data.usersVideo = usersVideo;
}
data.swapLayout = !hasPresentation || props.isLayoutSwapped;
if (data.swapLayout) {
data.floatingOverlay = true;
data.hideOverlay = true;
}
return data;
})(WebcamContainer);