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

SAK-50592 Meetings default option and updating of teachers not included in the meeting #12956

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,32 @@ public Meeting updateMeeting(@RequestBody MeetingData data, @PathVariable String
meeting.setDescription(data.getDescription());
meeting.setStartDate(Instant.parse(data.getStartDate()));
meeting.setEndDate(Instant.parse(data.getEndDate()));


List<String> coorganizerEmails = new ArrayList<>();
if (MS_TEAMS.equals(data.getProvider())) {
String organizerEmail = meetingService.getMeetingProperty(meeting, ORGANIZER_USER);
String onlineMeetingId = meetingService.getMeetingProperty(meeting, ONLINE_MEETING_ID);

// Updating coorganizers
if (data.isCoorganizersEnabled()) {
List<Member> coorganizers = sakaiProxy.getSite(data.getSiteId()).getMembers()
.stream()
.filter(u -> {
boolean canUpdate = sakaiProxy.canUpdateSite("/site/" + data.getSiteId(), u.getUserId());
log.debug("User: " + u.getUserId() + " canUpdate: " + canUpdate);
return canUpdate;
})
.collect(Collectors.toList());

coorganizers.forEach(c -> log.debug("Filtered Coorganizer: " + c.getUserId()));

coorganizerEmails = coorganizers.stream()
.map(member -> sakaiProxy.getUser(member.getUserId()).getEmail())
.filter(StringUtils::isNotEmpty)
.collect(Collectors.toList());
}
if(StringUtils.isNotBlank(onlineMeetingId)) {
microsoftCommonService.updateOnlineMeeting(organizerEmail, onlineMeetingId, meeting.getTitle(), meeting.getStartDate(), meeting.getEndDate());
microsoftCommonService.updateOnlineMeeting(organizerEmail, onlineMeetingId, meeting.getTitle(), meeting.getStartDate(), meeting.getEndDate(), coorganizerEmails);
}
}

Expand Down
8 changes: 8 additions & 0 deletions meetings/ui/src/main/frontend/src/components/sakai-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,13 @@ export default {
color: var(--sakai-text-color-disabled);
}
}
.form-check-coorganizers {
appearance: none;
height: 15px;
width: 15px;
border-radius: 3px;
background-color: var(--sakai-background-color-1);
border: 1px solid var(--sakai-color-black) !important;
}
}
</style>
4 changes: 2 additions & 2 deletions meetings/ui/src/main/frontend/src/views/CreateMeeting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<div class="mt-3">
<div class="form-check">
<input
class="form-check-input"
class="form-check-coorganizers"
type="checkbox"
id="enableCoorganizers"
v-model="formdata.enableCoorganizers"
Expand Down Expand Up @@ -185,7 +185,7 @@ export default {
notificationType: "0",
groups: [],
participantOption: "SITE",
enableCoorganizers: false
enableCoorganizers: true
},
groups: [],
participants: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static enum PermissionRoles { READ, WRITE }

// ---------------------------------------- ONLINE MEETINGS --------------------------------------------------
TeamsMeetingData createOnlineMeeting(String userEmail, String subject, Instant startDate, Instant endDate, List<String> coorganizerEmails) throws MicrosoftCredentialsException;
void updateOnlineMeeting(String userEmail, String meetingId, String subject, Instant startDate, Instant endDate) throws MicrosoftCredentialsException;
void updateOnlineMeeting(String userEmail, String meetingId, String subject, Instant startDate, Instant endDate, List<String> coorganizerEmails) throws MicrosoftCredentialsException;
List<MeetingRecordingData> getOnlineMeetingRecordings(String onlineMeetingId, List<String> teamIdsList, boolean force) throws MicrosoftCredentialsException;

// ---------------------------------------- ONE-DRIVE (APPLICATION) --------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

import com.microsoft.graph.tasks.LargeFileUploadTask;
import com.microsoft.graph.tasks.LargeFileUploadResult;
import com.microsoft.graph.models.MeetingChatMode;
import com.microsoft.graph.models.AadUserConversationMember;
import com.microsoft.graph.models.CallRecordingEventMessageDetail;
import com.microsoft.graph.models.CallRecordingStatus;
Expand Down Expand Up @@ -1346,16 +1347,17 @@ public TeamsMeetingData createOnlineMeeting(String userEmail, String subject, In
// Lobby Settings
LobbyBypassSettings lobbySettings = new LobbyBypassSettings();
lobbySettings.scope = LobbyBypassScope.ORGANIZATION;

// Online Meeting
OnlineMeeting onlineMeeting = new OnlineMeeting();
if (startDate != null) { onlineMeeting.startDateTime = OffsetDateTime.ofInstant(startDate, ZoneId.systemDefault()); }
if (endDate != null) { onlineMeeting.endDateTime = OffsetDateTime.ofInstant(endDate, ZoneId.systemDefault()); }
onlineMeeting.participants = participants;
onlineMeeting.subject = subject;
onlineMeeting.lobbyBypassSettings = lobbySettings;
onlineMeeting.allowedPresenters = OnlineMeetingPresenters.ROLE_IS_PRESENTER;

onlineMeeting.allowedPresenters = OnlineMeetingPresenters.ORGANIZER;
onlineMeeting.allowMeetingChat = MeetingChatMode.ENABLED;

OnlineMeeting meeting = getGraphClient().users(organizerUser.getId()).onlineMeetings()
.buildRequest()
.post(onlineMeeting);
Expand All @@ -1368,7 +1370,7 @@ public TeamsMeetingData createOnlineMeeting(String userEmail, String subject, In
}

@Override
public void updateOnlineMeeting(String userEmail, String meetingId, String subject, Instant startDate, Instant endDate) throws MicrosoftCredentialsException {
public void updateOnlineMeeting(String userEmail, String meetingId, String subject, Instant startDate, Instant endDate, List<String> coorganizerEmails) throws MicrosoftCredentialsException {
// Get organizer user
MicrosoftUser organizerUser = getUserByEmail(userEmail);

Expand All @@ -1378,7 +1380,31 @@ public void updateOnlineMeeting(String userEmail, String meetingId, String subje
onlineMeeting.startDateTime = OffsetDateTime.ofInstant(startDate, ZoneId.systemDefault());
onlineMeeting.endDateTime = OffsetDateTime.ofInstant(endDate, ZoneId.systemDefault());
onlineMeeting.subject = subject;


MeetingParticipants participants = new MeetingParticipants();

// Coorganizers
List<MeetingParticipantInfo> attendees = new ArrayList<>();
if (coorganizerEmails != null) {
for (String coorganizerEmail : coorganizerEmails) {
if (!coorganizerEmail.equals(organizerUser.getEmail())) {
MicrosoftUser coorganizerUser = getUserByEmail(coorganizerEmail);
if (coorganizerUser != null) {
MeetingParticipantInfo coorganizer = new MeetingParticipantInfo();
IdentitySet coorganizerIdentity = new IdentitySet();
Identity coorganizerIden = new Identity();
coorganizerIden.id = coorganizerUser.getId();
coorganizerIden.displayName = coorganizerUser.getName();
coorganizerIdentity.user = coorganizerIden;
coorganizer.identity = coorganizerIdentity;
coorganizer.role = OnlineMeetingRole.COORGANIZER;
attendees.add(coorganizer);
}
}
}
participants.attendees = attendees;
}
onlineMeeting.participants = participants;
getGraphClient().users(organizerUser.getId()).onlineMeetings(meetingId)
.buildRequest()
.patch(onlineMeeting);
Expand Down
Loading