Skip to content

Commit

Permalink
Merge pull request bigbluebutton#15251 from ramonlsouza/issue-15001
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavotrott authored Sep 2, 2022
2 parents 3efcd09 + ccce085 commit f7f20f3
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ case class DurationProps(duration: Int, createdTime: Long, createdDate: String,
endWhenNoModerator: Boolean, endWhenNoModeratorDelayInMinutes: Int)

case class MeetingProp(
name: String,
extId: String,
intId: String,
meetingCameraCap: Int,
maxPinnedCameras: Int,
isBreakout: Boolean,
disabledFeatures: Vector[String],
notifyRecordingIsOn: Boolean,
name: String,
extId: String,
intId: String,
meetingCameraCap: Int,
maxPinnedCameras: Int,
isBreakout: Boolean,
disabledFeatures: Vector[String],
notifyRecordingIsOn: Boolean,
uploadExternalDescription: String,
uploadExternalUrl: String,
)

case class BreakoutProps(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public class ApiParams {
public static final String DISABLED_FEATURES = "disabledFeatures";
public static final String NOTIFY_RECORDING_IS_ON = "notifyRecordingIsOn";

public static final String UPLOAD_EXTERNAL_DESCRIPTION = "uploadExternalDescription";
public static final String UPLOAD_EXTERNAL_URL = "uploadExternalUrl";

public static final String BREAKOUT_ROOMS_ENABLED = "breakoutRoomsEnabled";
public static final String BREAKOUT_ROOMS_RECORD = "breakoutRoomsRecord";
public static final String BREAKOUT_ROOMS_PRIVATE_CHAT_ENABLED = "breakoutRoomsPrivateChatEnabled";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ private void handleCreateMeeting(Meeting m) {
m.getUserActivitySignResponseDelayInMinutes(), m.getEndWhenNoModerator(), m.getEndWhenNoModeratorDelayInMinutes(),
m.getMuteOnStart(), m.getAllowModsToUnmuteUsers(), m.getAllowModsToEjectCameras(), m.getMeetingKeepEvents(),
m.breakoutRoomsParams, m.lockSettingsParams, m.getHtml5InstanceId(),
m.getGroups(), m.getDisabledFeatures(), m.getNotifyRecordingIsOn());
m.getGroups(), m.getDisabledFeatures(), m.getNotifyRecordingIsOn(),
m.getUploadExternalDescription(), m.getUploadExternalUrl());
}

private String formatPrettyDate(Long timestamp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public class ParamsProcessorUtil {
private boolean defaultKeepEvents = false;
private Boolean useDefaultLogo;
private String defaultLogoURL;
private String defaultUploadExternalDescription = "";
private String defaultUploadExternalUrl = "";

private boolean defaultBreakoutRoomsEnabled = true;
private boolean defaultBreakoutRoomsRecord;
Expand Down Expand Up @@ -618,6 +620,16 @@ boolean record = processRecordMeeting(params.get(ApiParams.RECORD));
guestPolicy = params.get(ApiParams.GUEST_POLICY);
}

String uploadExternalDescription = defaultUploadExternalDescription;
if (!StringUtils.isEmpty(params.get(ApiParams.UPLOAD_EXTERNAL_DESCRIPTION))) {
uploadExternalDescription = params.get(ApiParams.UPLOAD_EXTERNAL_DESCRIPTION);
}

String uploadExternalUrl = defaultUploadExternalUrl;
if (!StringUtils.isEmpty(params.get(ApiParams.UPLOAD_EXTERNAL_URL))) {
uploadExternalUrl = params.get(ApiParams.UPLOAD_EXTERNAL_URL);
}

String meetingLayout = defaultMeetingLayout;

ArrayList<Group> groups = processGroupsParams(params);
Expand Down Expand Up @@ -701,6 +713,8 @@ boolean record = processRecordMeeting(params.get(ApiParams.RECORD));
.withGroups(groups)
.withDisabledFeatures(listOfDisabledFeatures)
.withNotifyRecordingIsOn(notifyRecordingIsOn)
.withUploadExternalDescription(uploadExternalDescription)
.withUploadExternalUrl(uploadExternalUrl)
.build();

if (!StringUtils.isEmpty(params.get(ApiParams.MODERATOR_ONLY_MESSAGE))) {
Expand Down Expand Up @@ -1369,6 +1383,14 @@ public void setNotifyRecordingIsOn(Boolean notifyRecordingIsOn) {
this.defaultNotifyRecordingIsOn = notifyRecordingIsOn;
}

public void setUploadExternalDescription(String uploadExternalDescription) {
this.defaultUploadExternalDescription = uploadExternalDescription;
}

public void setUploadExternalUrl(String uploadExternalUrl) {
this.defaultUploadExternalUrl = uploadExternalUrl;
}

public void setBbbVersion(String version) {
this.bbbVersion = this.allowRevealOfBBBVersion ? version : "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class Meeting {
private Boolean allowRequestsWithoutSession = false;
private Boolean allowModsToEjectCameras = false;
private Boolean meetingKeepEvents;
private String uploadExternalDescription;
private String uploadExternalUrl;

private Integer meetingExpireIfNoUserJoinedInMinutes = 5;
private Integer meetingExpireWhenLastUserLeftInMinutes = 1;
Expand All @@ -119,6 +121,8 @@ public Meeting(Meeting.Builder builder) {
intMeetingId = builder.internalId;
disabledFeatures = builder.disabledFeatures;
notifyRecordingIsOn = builder.notifyRecordingIsOn;
uploadExternalDescription = builder.uploadExternalDescription;
uploadExternalUrl = builder.uploadExternalUrl;
if (builder.viewerPass == null){
viewerPass = "";
} else {
Expand Down Expand Up @@ -380,6 +384,13 @@ public Boolean getNotifyRecordingIsOn() {
return notifyRecordingIsOn;
}

public String getUploadExternalDescription() {
return uploadExternalDescription;
}
public String getUploadExternalUrl() {
return uploadExternalUrl;
}

public String getWelcomeMessageTemplate() {
return welcomeMsgTemplate;
}
Expand Down Expand Up @@ -810,6 +821,8 @@ public static class Builder {
private String learningDashboardAccessToken;
private ArrayList<String> disabledFeatures;
private Boolean notifyRecordingIsOn;
private String uploadExternalDescription;
private String uploadExternalUrl;
private int duration;
private String webVoice;
private String telVoice;
Expand Down Expand Up @@ -937,6 +950,16 @@ public Builder withNotifyRecordingIsOn(Boolean b) {
return this;
}

public Builder withUploadExternalDescription(String d) {
this.uploadExternalDescription = d;
return this;
}

public Builder withUploadExternalUrl(String u) {
this.uploadExternalUrl = u;
return this;
}

public Builder withWelcomeMessage(String w) {
welcomeMsg = w;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class CreateMeetingMessage {
public final String learningDashboardAccessToken;
public final ArrayList<String> disabledFeatures;
public final Boolean notifyRecordingIsOn;
public final String uploadExternalDescription;
public final String uploadExternalUrl;
public final Long createTime;
public final String createDate;
public final Map<String, String> metadata;
Expand All @@ -36,6 +38,8 @@ public CreateMeetingMessage(String id, String externalId, String name, Boolean r
String viewerPass, String learningDashboardAccessToken,
ArrayList<String> disabledFeatures,
Boolean notifyRecordingIsOn,
String uploadExternalDescription,
String uploadExternalUrl,
Long createTime, String createDate, Map<String, String> metadata) {
this.id = id;
this.externalId = externalId;
Expand All @@ -54,6 +58,8 @@ public CreateMeetingMessage(String id, String externalId, String name, Boolean r
this.learningDashboardAccessToken = learningDashboardAccessToken;
this.disabledFeatures = disabledFeatures;
this.notifyRecordingIsOn = notifyRecordingIsOn;
this.uploadExternalDescription = uploadExternalDescription;
this.uploadExternalUrl = uploadExternalUrl;
this.createTime = createTime;
this.createDate = createDate;
this.metadata = metadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ void createMeeting(String meetingID, String externalMeetingID,
Integer html5InstanceId,
ArrayList<Group> groups,
ArrayList<String> disabledFeatures,
Boolean notifyRecordingIsOn);
Boolean notifyRecordingIsOn,
String uploadExternalDescription,
String uploadExternalUrl);

void registerUser(String meetingID, String internalUserId, String fullname, String role,
String externUserID, String authToken, String avatarURL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ class BbbWebApiGWApp(
html5InstanceId: java.lang.Integer,
groups: java.util.ArrayList[Group],
disabledFeatures: java.util.ArrayList[String],
notifyRecordingIsOn: java.lang.Boolean): Unit = {
notifyRecordingIsOn: java.lang.Boolean,
uploadExternalDescription: String,
uploadExternalUrl: String): Unit = {

val disabledFeaturesAsVector: Vector[String] = disabledFeatures.asScala.toVector

Expand All @@ -160,7 +162,9 @@ class BbbWebApiGWApp(
maxPinnedCameras = maxPinnedCameras.intValue(),
isBreakout = isBreakout.booleanValue(),
disabledFeaturesAsVector,
notifyRecordingIsOn
notifyRecordingIsOn,
uploadExternalDescription,
uploadExternalUrl
)

val durationProps = DurationProps(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export default function addMeeting(meeting) {
name: String,
disabledFeatures: Array,
notifyRecordingIsOn: Boolean,
uploadExternalDescription: String,
uploadExternalUrl: String,
},
usersProp: {
webcamsOnlyForModerator: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ const intlMessages = defineMessages({
id: 'app.presentationUploder.dropzoneLabel',
description: 'message warning where drop files for upload',
},
externalUploadTitle: {
id: 'app.presentationUploder.externalUploadTitle',
description: 'title for external upload area',
},
externalUploadLabel: {
id: 'app.presentationUploder.externalUploadLabel',
description: 'message of external upload button',
},
dropzoneImagesLabel: {
id: 'app.presentationUploder.dropzoneImagesLabel',
description: 'message warning where drop images for upload',
Expand Down Expand Up @@ -294,6 +302,7 @@ class PresentationUploader extends Component {
this.handleSendToChat = this.handleSendToChat.bind(this);
// renders
this.renderDropzone = this.renderDropzone.bind(this);
this.renderExternalUpload = this.renderExternalUpload.bind(this);
this.renderPicDropzone = this.renderPicDropzone.bind(this);
this.renderPresentationList = this.renderPresentationList.bind(this);
this.renderPresentationItem = this.renderPresentationItem.bind(this);
Expand Down Expand Up @@ -1173,6 +1182,32 @@ class PresentationUploader extends Component {
);
}

renderExternalUpload() {
const { externalUploadData, intl } = this.props;

const { uploadExternalDescription, uploadExternalUrl } = externalUploadData;

if (!uploadExternalDescription || !uploadExternalUrl) return null;

return (
<Styled.ExternalUpload>
<div>
<Styled.ExternalUploadTitle>
{intl.formatMessage(intlMessages.externalUploadTitle)}
</Styled.ExternalUploadTitle>

<p>{uploadExternalDescription}</p>
</div>
<Styled.ExternalUploadButton
color="default"
onClick={() => window.open(`${uploadExternalUrl}`)}
label={intl.formatMessage(intlMessages.externalUploadLabel)}
aria-describedby={intl.formatMessage(intlMessages.externalUploadLabel)}
/>
</Styled.ExternalUpload>
)
}

renderPicDropzone() {
const {
intl,
Expand Down Expand Up @@ -1325,6 +1360,7 @@ class PresentationUploader extends Component {
</Styled.ExportHint>
{isMobile ? this.renderPicDropzone() : null}
{this.renderDropzone()}
{this.renderExternalUpload()}
</Styled.ModalInner>
</Styled.UploaderModal>
) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ export default withTracker(() => {
exportPresentationToChat,
isOpen: Session.get('showUploadPresentationView') || false,
selectedToBeNextCurrent: Session.get('selectedToBeNextCurrent') || null,
externalUploadData: Service.getExternalUploadData(),
};
})(PresentationUploaderContainer);
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { makeCall } from '/imports/ui/services/api';
import logger from '/imports/startup/client/logger';
import _ from 'lodash';
import { Random } from 'meteor/random'
import Meetings from '/imports/api/meetings';

const CONVERSION_TIMEOUT = 300000;
const TOKEN_TIMEOUT = 5000;
Expand Down Expand Up @@ -270,6 +271,25 @@ const persistPresentationChanges = (oldState, newState, uploadEndpoint, podId) =
.then(removePresentations.bind(null, presentationsToRemove, podId));
};

const getExternalUploadData = () => {
const { meetingProp } = Meetings.findOne(
{ meetingId: Auth.meetingID },
{
fields: {
'meetingProp.uploadExternalDescription': 1,
'meetingProp.uploadExternalUrl': 1
},
},
);

const { uploadExternalDescription, uploadExternalUrl } = meetingProp;

return {
uploadExternalDescription,
uploadExternalUrl,
}
};

const exportPresentationToChat = (presentationId, observer) => {
let lastStatus = {};

Expand Down Expand Up @@ -307,5 +327,6 @@ export default {
dispatchTogglePresentationDownloadable,
setPresentation,
requestPresentationUploadToken,
getExternalUploadData,
exportPresentationToChat,
};
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,33 @@ const ExtraHint = styled.div`
font-weight: bold;
`;

const ExternalUpload = styled.div`
background-color: ${colorOffWhite};
border-radius: ${borderRadius};
margin-top: 2rem;
padding: ${lgPaddingX};
color: ${colorText};
font-weight: normal;
display: flex;
justify-content: space-between;
flex-direction: row;
& p {
margin: 0;
}
`;

const ExternalUploadTitle = styled.h4`
font-size: 0.9rem;
margin: 0;
`;

const ExternalUploadButton = styled(Button)`
height: 2rem;
align-self: center;
margin-left: 2rem;
`;

const ExportHint = styled(ModalHint)`
margin: 2rem 0;
`;
Expand Down Expand Up @@ -672,6 +699,9 @@ export default {
TableItemActions,
DownloadButton,
ExtraHint,
ExternalUpload,
ExternalUploadTitle,
ExternalUploadButton,
ExportHint,
SetCurrentAction,
Head,
Expand Down
2 changes: 2 additions & 0 deletions bigbluebutton-html5/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@
"app.presentationUploder.dropzoneImagesLabel": "Drag images here to upload",
"app.presentationUploder.browseFilesLabel": "or browse for files",
"app.presentationUploder.browseImagesLabel": "or browse/capture for images",
"app.presentationUploder.externalUploadTitle": "Add content from 3rd party application",
"app.presentationUploder.externalUploadLabel": "Browse files",
"app.presentationUploder.fileToUpload": "To be uploaded ...",
"app.presentationUploder.currentBadge": "Current",
"app.presentationUploder.rejectedError": "The selected file(s) have been rejected. Please check the file type(s).",
Expand Down

0 comments on commit f7f20f3

Please sign in to comment.