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-50690 Meetings add banner to register and add option to download assistance reports CSV #13027

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Aniii10
Copy link
Contributor

@Aniii10 Aniii10 commented Nov 18, 2024

In the Meetings tool, add an informational alert at the top of the tool to inform the user that they need to register with Microsoft to sign in. Additionally, for each created meeting, provide the option to download the attendance report in CSV format and preview it.

@bgarciaentornos
Copy link
Contributor

The banner is optional, it can be hidden using a property

Copy link
Contributor

@bgarciaentornos bgarciaentornos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly fine, just a few changes

# SAK-50690 Meetings: select message and option to show attendance reports
# Select whether to display the informational alert of the meetings tool.
# DEFAULT: false
# show.meeting.banner=false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# show.meeting.banner=false
# show.meeting.banner=true

Comment on lines 622 to 623
List<AttendanceRecord> attendanceRecords = microsoftCommonService.getMeetingAttendanceReport(onlineMeetingId, organizerEmail);
if ("csv".equalsIgnoreCase(format)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix tabulation

meeting.entry_date=Entry Date
meeting.exit_date=Exit Date
meeting.interval_duration=Interval Duration (seconds)
meeting.details=Assistance Details for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meeting.details=Assistance Details for
meeting.details=Assistance Details for

meeting.exit_date=Data de sortida
meeting.interval_duration=Interval de Duraci\u00F3 (segons)
meeting.details=Detalls d\u2019assist\u00e8ncia per a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meeting.details=Detalls d\u2019assist\u00e8ncia per a
meeting.details=Detalls d\u2019assist\u00e8ncia per a

meeting.entry_date=Fecha de entrada
meeting.exit_date=Fecha de salida
meeting.interval_duration=Intervalo de Duraci\u00f3n (segundos)
meeting.details=Detalles de asistencia para
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meeting.details=Detalles de asistencia para
meeting.details=Detalles de asistencia para

console.error('Error loading meeting banner configuration.');
}
} catch (error) {
console.error('Error loading meeting banner configuration:', error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.error('Error loading meeting banner configuration:', error);
console.error('Error loading default configuration:', error);

Let's make it more generic in case we need it for other properties in the future


try {
List<AttendanceRecord> attendanceRecords = microsoftCommonService.getMeetingAttendanceReport(onlineMeetingId, organizerEmail);
if ("csv".equalsIgnoreCase(format)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a constant defined at the top, something like REPORT_FORMAT_CSV = "csv"

if ("csv".equalsIgnoreCase(format)) {
byte[] csvContent = microsoftCommonService.createAttendanceReportCsv(attendanceRecords);
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"attendance_report.csv\"")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to use a constante for the filename too



public void inicializeMeetingNameColumns(String meetingAttendanceReport, String meetingName, String meetingEmail, String meetingRole, String meetingDuration, String meetingDurationInterval, String meetingEntryDate, String meetingExitDate, String meetingsDetails) {
MEETING_ATTENDANCE_REPORT= meetingAttendanceReport;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this variable is used anywhere else

String onlineMeetingId = meetingService.getMeetingProperty(meeting, ONLINE_MEETING_ID);
String organizerEmail = meetingService.getMeetingProperty(meeting, ORGANIZER_USER);
checkUpdatePermissions(meeting.getSiteId());
microsoftCommonService.inicializeMeetingNameColumns(rb.getString("meeting.attendance_report"), rb.getString("meeting.column_name"), rb.getString("meeting.column_email"), rb.getString("meeting.column_role"), rb.getString("meeting.column_duration"), rb.getString("meeting.interval_duration"), rb.getString("meeting.entry_date"), rb.getString("meeting.exit_date"), rb.getString("meeting.details"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this method is not necessary, it might be better doing that inside the create report method directly

Comment on lines 89 to 95
</dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.10.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix tabs

Comment on lines 631 to 636
microsoftCommonService.inicializeMeetingNameColumns(columnsName);

try {
List<AttendanceRecord> attendanceRecords = microsoftCommonService.getMeetingAttendanceReport(onlineMeetingId, organizerEmail);
if (REPORT_FORMAT_CSV.equalsIgnoreCase(format)) {
byte[] csvContent = microsoftCommonService.createAttendanceReportCsv(attendanceRecords);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
microsoftCommonService.inicializeMeetingNameColumns(columnsName);
try {
List<AttendanceRecord> attendanceRecords = microsoftCommonService.getMeetingAttendanceReport(onlineMeetingId, organizerEmail);
if (REPORT_FORMAT_CSV.equalsIgnoreCase(format)) {
byte[] csvContent = microsoftCommonService.createAttendanceReportCsv(attendanceRecords);
try {
List<AttendanceRecord> attendanceRecords = microsoftCommonService.getMeetingAttendanceReport(onlineMeetingId, organizerEmail);
if (REPORT_FORMAT_CSV.equalsIgnoreCase(format)) {
byte[] csvContent = microsoftCommonService.createAttendanceReportCsv(attendanceRecords, columnsName);

@@ -115,7 +116,10 @@ public static enum PermissionRoles { READ, WRITE }
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, List<String> coorganizerEmails) throws MicrosoftCredentialsException;
List<MeetingRecordingData> getOnlineMeetingRecordings(String onlineMeetingId, List<String> teamIdsList, boolean force) throws MicrosoftCredentialsException;

List<AttendanceRecord> getMeetingAttendanceReport(String onlineMeetingId, String userEmail) throws MicrosoftCredentialsException;
void inicializeMeetingNameColumns(List<String> columnsName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed


List<AttendanceRecord> getMeetingAttendanceReport(String onlineMeetingId, String userEmail) throws MicrosoftCredentialsException;
void inicializeMeetingNameColumns(List<String> columnsName);
byte[] createAttendanceReportCsv(List<AttendanceRecord> attendanceRecords);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
byte[] createAttendanceReportCsv(List<AttendanceRecord> attendanceRecords);
byte[] createAttendanceReportCsv(List<AttendanceRecord> attendanceRecords, List<String> columnsName);

@Aniii10 Aniii10 force-pushed the EVDOC01-163 branch 2 times, most recently from fa645a5 to 8a152b9 Compare November 20, 2024 13:20
Copy link
Contributor

@bgarciaentornos bgarciaentornos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bgarciaentornos bgarciaentornos changed the title SAK-50690: Select missatge and option to show assistance reports SAK-50690: Meetings assistance reports csv and preview + info banner Nov 20, 2024
@@ -12,6 +12,13 @@ status_text_unknown=estado desconocido
status_text_waiting=esperando para comenzar
edit_action=Editar
delete_action=Eliminar
close_action=Cerrar
attendance_report_action=Informes de assistencia
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informes de asistencia

close_action=Cerrar
attendance_report_action=Informes de assistencia
download_report_excel= Descargar en csv
download_report_error_message=Los datos de assistencia no se han cargado correctamente. Probarlo m\u00e1s tarde.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Los datos de asistencia

meeting_login_application=Inicia sessi\u00F3n con la aplicaci\u00F3n.
meeting_not_application_installed=En caso de no tener la aplicaci\u00F3n instalada, este
meeting_link=enlace
meeting_download_by_link=te permitir\u00E1 descargartela.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

te permitir\u00E1 descarg\u00E1rtela.

spinner: "fa-spinner fa-spin",
download: "fa fa-download",
fileCsv: "fa fa-file",
eye: "fa fa-eye",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eye: "fa fa-eye"

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.10.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.12.0


@Transactional(readOnly = true)
public byte[] createAttendanceReportCsv(List<AttendanceRecord> attendanceRecords, List<String> columnNames) {
if (columnNames == null || columnNames.size() != 7) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll use a constant defined at the top for the number 7.
public static int COLUMN_SIZE = 7.

@ern ern changed the title SAK-50690: Meetings assistance reports csv and preview + info banner SAK-50690 Meetings add banner to register and add option to download assistance reports CSV Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants