add conditions to hide/display issue filters

This commit is contained in:
Nadim Ritter 2024-01-26 15:54:25 +01:00
parent 8f0f6918f1
commit c662636cc2

View file

@ -12,12 +12,14 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.BooleanSupplier; import java.util.function.BooleanSupplier;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
import ch.ethz.seb.sebserver.gbl.model.exam.AllowedSEBVersion;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
@ -276,7 +278,9 @@ public class MonitoringRunningExam implements TemplateComposer {
fullPageMonitoringUpdate, fullPageMonitoringUpdate,
actionBuilder, actionBuilder,
clientTable, clientTable,
isExamSupporter)); isExamSupporter,
exam.checkASK,
exam.allowedSEBVersions));
final ProctoringServiceSettings proctoringSettings = new ProctoringServiceSettings(exam); final ProctoringServiceSettings proctoringSettings = new ProctoringServiceSettings(exam);
final ScreenProctoringSettings screenProctoringSettings = new ScreenProctoringSettings(exam); final ScreenProctoringSettings screenProctoringSettings = new ScreenProctoringSettings(exam);
@ -400,7 +404,9 @@ public class MonitoringRunningExam implements TemplateComposer {
final MonitoringFilter monitoringStatus, final MonitoringFilter monitoringStatus,
final PageActionBuilder actionBuilder, final PageActionBuilder actionBuilder,
final ClientConnectionTable clientTable, final ClientConnectionTable clientTable,
final BooleanSupplier isExamSupporter) { final BooleanSupplier isExamSupporter,
final boolean isAskCheckEnabled,
final List<AllowedSEBVersion> allowedSEBVersions) {
final FilterGUIUpdate statusFilterGUIUpdate = final FilterGUIUpdate statusFilterGUIUpdate =
new FilterGUIUpdate(this.pageService.getPolyglotPageService()); new FilterGUIUpdate(this.pageService.getPolyglotPageService());
@ -438,22 +444,27 @@ public class MonitoringRunningExam implements TemplateComposer {
ActionDefinition.MONITOR_EXAM_SHOW_DISABLED_CONNECTION, ActionDefinition.MONITOR_EXAM_SHOW_DISABLED_CONNECTION,
ActionDefinition.MONITOR_EXAM_HIDE_DISABLED_CONNECTION); ActionDefinition.MONITOR_EXAM_HIDE_DISABLED_CONNECTION);
addIssueFilterAction( if(isAskCheckEnabled){
monitoringStatus, addIssueFilterAction(
statusFilterGUIUpdate, monitoringStatus,
actionBuilder, statusFilterGUIUpdate,
clientTable, actionBuilder,
ConnectionIssueStatus.ASK_GRANTED, clientTable,
ActionDefinition.MONITOR_EXAM_SHOW_ASK_GRANTED, ConnectionIssueStatus.ASK_GRANTED,
ActionDefinition.MONITOR_EXAM_HIDE_ASK_GRANTED); ActionDefinition.MONITOR_EXAM_SHOW_ASK_GRANTED,
addIssueFilterAction( ActionDefinition.MONITOR_EXAM_HIDE_ASK_GRANTED);
monitoringStatus, }
statusFilterGUIUpdate,
actionBuilder, if(allowedSEBVersions != null) {
clientTable, addIssueFilterAction(
ConnectionIssueStatus.SEB_VERSION_GRANTED, monitoringStatus,
ActionDefinition.MONITOR_EXAM_SHOW_SEB_VERSION_GRANTED, statusFilterGUIUpdate,
ActionDefinition.MONITOR_EXAM_HIDE_SEB_VERSION_GRANTED); actionBuilder,
clientTable,
ConnectionIssueStatus.SEB_VERSION_GRANTED,
ActionDefinition.MONITOR_EXAM_SHOW_SEB_VERSION_GRANTED,
ActionDefinition.MONITOR_EXAM_HIDE_SEB_VERSION_GRANTED);
}
if (clientGroups != null && !clientGroups.isEmpty()) { if (clientGroups != null && !clientGroups.isEmpty()) {
clientGroups.forEach(clientGroup -> { clientGroups.forEach(clientGroup -> {