Add 'no content' toast for slide capture

This commit is contained in:
Daniel Petri Rocha 2023-01-14 18:00:29 +01:00
parent da6f5d996e
commit a72d76a46a
4 changed files with 45 additions and 25 deletions

View File

@ -57,6 +57,16 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
BbbCommonEnvCoreMsg(envelope, event)
}
def buildBroadcastPresentationConversionUpdateEvtMsg(parentMeetingId: String, status: String, presentationId: String, filename: String, temporaryPresentationId: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, parentMeetingId, "not-used")
val envelope = BbbCoreEnvelope(PresentationPageConvertedEventMsg.NAME, routing)
val header = BbbClientMsgHeader(PresentationConversionUpdateEvtMsg.NAME, parentMeetingId, "not-used")
val body = PresentationConversionUpdateEvtMsgBody("DEFAULT_PRESENTATION_POD", status, "not-used", presentationId, filename, temporaryPresentationId)
val event = PresentationConversionUpdateEvtMsg(header, body)
BbbCommonEnvCoreMsg(envelope, event)
}
def buildBroadcastPresAnnStatusMsg(presAnnStatusMsg: PresAnnStatusMsg, liveMeeting: LiveMeeting): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, "not-used")
val envelope = BbbCoreEnvelope(PresentationPageConvertedEventMsg.NAME, routing)
@ -193,13 +203,20 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
val exportJob: ExportJob = new ExportJob(jobId, JobTypes.CAPTURE_PRESENTATION, filename, presId, presLocation, allPages, pagesRange, parentMeetingId, presentationUploadToken)
val storeAnnotationPages: List[PresentationPageForExport] = getPresentationPagesForExport(pagesRange, pageCount, presId, currentPres, liveMeeting);
// Send Export Job to Redis
val job = buildStoreExportJobInRedisSysMsg(exportJob, liveMeeting)
bus.outGW.send(job)
val annotationCount: Int = storeAnnotationPages.map(_.annotations.size).sum
// Send Annotations to Redis
val annotations = new StoredAnnotations(jobId, presId, storeAnnotationPages)
bus.outGW.send(buildStoreAnnotationsInRedisSysMsg(annotations, liveMeeting))
if (annotationCount > 0) {
// Send Export Job to Redis
val job = buildStoreExportJobInRedisSysMsg(exportJob, liveMeeting)
bus.outGW.send(job)
// Send Annotations to Redis
val annotations = new StoredAnnotations(jobId, presId, storeAnnotationPages)
bus.outGW.send(buildStoreAnnotationsInRedisSysMsg(annotations, liveMeeting))
} else {
// Notify that no content is available
bus.outGW.send(buildBroadcastPresentationConversionUpdateEvtMsg(parentMeetingId, "204", jobId, filename, presentationUploadToken))
}
}
}

View File

@ -2,13 +2,12 @@ import Pads, { PadsUpdates } from '/imports/api/pads';
import Breakouts from '/imports/api/breakouts';
import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger';
import Presentations from '/imports/api/presentations';
import _ from 'lodash';
export default function padCapture(breakoutId, parentMeetingId) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'PadCapturePubMsg';
const EVENT_NAME_ERROR = 'PresentationConversionUpdateSysPubMsg';
const EXTERNAL_ID = Meteor.settings.public.notes.id;
try {
@ -51,21 +50,18 @@ export default function padCapture(breakoutId, parentMeetingId) {
}
// Notify that no content is available
Presentations.insert({
id: _.uniqueId(filename),
meetingId: parentMeetingId,
temporaryPresentationId: `${breakoutId}-notes`,
renderedInToast: false,
lastModifiedUploader: false,
filename,
conversion: {
done: false,
error: true,
status: 204,
},
});
const temporaryPresentationId = `${breakoutId}-notes`;
const payload = {
podId: 'DEFAULT_PRESENTATION_POD',
messageKey: '204',
code: 'not-used',
presentationId: temporaryPresentationId,
presName: filename,
temporaryPresentationId,
};
return null;
Logger.info(`No notes available for capture in meetingId=${breakoutId} parentMeetingId=${parentMeetingId} padId=${pad.padId}`);
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME_ERROR, parentMeetingId, 'system', payload);
} catch (err) {
Logger.error(`Exception while invoking method padCapture ${err.stack}`);
return null;

View File

@ -14,6 +14,7 @@ const GENERATED_SLIDE_KEY = 'GENERATED_SLIDE';
const FILE_TOO_LARGE_KEY = 'FILE_TOO_LARGE';
const CONVERSION_TIMEOUT_KEY = "CONVERSION_TIMEOUT";
const IVALID_MIME_TYPE_KEY = "IVALID_MIME_TYPE";
const NO_CONTENT = '204';
// const GENERATING_THUMBNAIL_KEY = 'GENERATING_THUMBNAIL';
// const GENERATED_THUMBNAIL_KEY = 'GENERATED_THUMBNAIL';
// const GENERATING_TEXTFILES_KEY = 'GENERATING_TEXTFILES';
@ -76,6 +77,13 @@ export default function handlePresentationConversionUpdate({ body }, meetingId)
statusModifier['conversion.numPages'] = body.numberOfPages;
break;
case NO_CONTENT:
statusModifier['conversion.done'] = false;
statusModifier['conversion.error'] = true;
statusModifier.id = presentationId;
statusModifier.name = presentationName;
break;
default:
break;
}

View File

@ -7,7 +7,6 @@ import UserListService from '/imports/ui/components/user-list/service';
import fp from 'lodash/fp';
import UsersPersistentData from '/imports/api/users-persistent-data';
import { UploadingPresentations } from '/imports/api/presentations';
import _ from 'lodash';
const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator;
@ -43,7 +42,7 @@ const upsertCapturedContent = (filename, temporaryPresentationId) => {
temporaryPresentationId,
}, {
$set: {
id: _.uniqueId(filename),
id: temporaryPresentationId,
temporaryPresentationId,
progress: 0,
filename,
@ -60,7 +59,7 @@ const upsertCapturedContent = (filename, temporaryPresentationId) => {
const setCapturedContentUploading = () => {
const breakoutRooms = findBreakouts();
breakoutRooms.forEach((breakout) => {
const filename = breakout.shortName; // breakout.name
const filename = breakout.shortName;
const temporaryPresentationId = breakout.breakoutId;
if (breakout.captureNotes) {