From 215608b136d959a9ee4dfe4e61a23e6ebb7a4d26 Mon Sep 17 00:00:00 2001 From: tomas-muller Date: Thu, 17 Jun 2021 10:37:02 +0200 Subject: [PATCH] Student Scheduling Dashboards: Enrollments - when showing classes of a course, list all classes - classes with no match are grayed out - it is possible to switch between showing all classes and just the matching classes using the sctdashShowUnmatchedClasses user setting parameter (defaults to yes, show unmatched classes) --- .../org/unitime/timetable/defaults/UserProperty.java | 1 + .../gwt/client/sectioning/SectioningStatusPage.java | 4 ++++ .../unitime/timetable/gwt/server/SectioningServlet.java | 9 ++++++++- .../timetable/gwt/shared/ClassAssignmentInterface.java | 4 ++++ .../status/FindEnrollmentInfoAction.java | 9 ++++++++- .../status/db/DbFindEnrollmentInfoAction.java | 3 ++- WebContent/styles/unitime.css | 4 ++++ 7 files changed, 31 insertions(+), 3 deletions(-) diff --git a/JavaSource/org/unitime/timetable/defaults/UserProperty.java b/JavaSource/org/unitime/timetable/defaults/UserProperty.java index 70641a6341..46ceb6dac3 100644 --- a/JavaSource/org/unitime/timetable/defaults/UserProperty.java +++ b/JavaSource/org/unitime/timetable/defaults/UserProperty.java @@ -48,6 +48,7 @@ public enum UserProperty { RoomFeaturesInOneColumn("roomFeaturesInOneColumn", CommonValues.Yes, "Display Room Features In One Column"), HighlighClassPreferences("highlightClassPrefs", CommonValues.UseSystemDefault, "Highlight preferences that are set directly on classes"), PrimaryCampus("primaryAcademicInitiative", "Primary academic initiative"), + StudentDashboardShowUnmatchedClasses("sctdashShowUnmatchedClasses", CommonValues.Yes, "Student Scheduling Dashboard: Show classes not meeting the filter (as grayed out)."), ; String iKey, iDefault, iDescription; diff --git a/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java b/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java index 3cbb611f04..fa9747bc8d 100644 --- a/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java +++ b/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java @@ -1154,6 +1154,10 @@ public void onSuccess(List result) { line.add(new NumberCell(e.getReservation(), e.getTotalReservation())); line.add(new NumberCell(e.getConsentNeeded(), e.getTotalConsentNeeded())); line.add(new NumberCell(e.getOverrideNeeded(), e.getTotalOverrideNeeded())); + if (Boolean.TRUE.equals(e.isNoMatch())) { + for (Widget w : line) + if (w != null) w.addStyleName("nomatch"); + } return line; } diff --git a/JavaSource/org/unitime/timetable/gwt/server/SectioningServlet.java b/JavaSource/org/unitime/timetable/gwt/server/SectioningServlet.java index f7decda4a6..b7e1675831 100644 --- a/JavaSource/org/unitime/timetable/gwt/server/SectioningServlet.java +++ b/JavaSource/org/unitime/timetable/gwt/server/SectioningServlet.java @@ -50,7 +50,9 @@ import org.unitime.localization.messages.SecurityMessages; import org.unitime.timetable.ApplicationProperties; import org.unitime.timetable.defaults.ApplicationProperty; +import org.unitime.timetable.defaults.CommonValues; import org.unitime.timetable.defaults.SessionAttribute; +import org.unitime.timetable.defaults.UserProperty; import org.unitime.timetable.gwt.client.sectioning.SectioningStatusFilterBox.SectioningStatusFilterRpcRequest; import org.unitime.timetable.gwt.resources.StudentSectioningConstants; import org.unitime.timetable.gwt.resources.StudentSectioningMessages; @@ -1962,6 +1964,7 @@ public List findEnrollmentInfos(boolean online, String query, Se query.matches("(?i:.*consent:[ ]?(todo|\\\"to do\\\").*)") ? getApprovableCourses(sessionId) : null, getMyStudents(sessionId), getSubjectAreas()) + .showUnmatchedClasses(CommonValues.Yes.eq(UserProperty.StudentDashboardShowUnmatchedClasses.get(sessionContext.getUser()))) .withFilter(filter), currentUser() ); } @@ -1973,6 +1976,7 @@ public List findEnrollmentInfos(boolean online, String query, Se query.matches("(?i:.*consent:[ ]?(todo|\\\"to do\\\").*)") ? getApprovableCourses(sessionId) : null, getMyStudents(sessionId), getSubjectAreas()) + .showUnmatchedClasses(CommonValues.Yes.eq(UserProperty.StudentDashboardShowUnmatchedClasses.get(sessionContext.getUser()))) .withFilter(filter), currentUser() ); } else { @@ -1980,7 +1984,10 @@ public List findEnrollmentInfos(boolean online, String query, Se if (server == null) throw new SectioningException(MSG.exceptionNoSolver()); - return server.execute(server.createAction(FindEnrollmentInfoAction.class).withParams(query, courseId, null, null, getMyStudents(server.getAcademicSession().getUniqueId()), getSubjectAreas()).withFilter(filter), currentUser()); + return server.execute(server.createAction(FindEnrollmentInfoAction.class) + .withParams(query, courseId, null, null, getMyStudents(server.getAcademicSession().getUniqueId()), getSubjectAreas()) + .showUnmatchedClasses(CommonValues.Yes.eq(UserProperty.StudentDashboardShowUnmatchedClasses.get(sessionContext.getUser()))) + .withFilter(filter), currentUser()); } } catch (PageAccessException e) { throw e; diff --git a/JavaSource/org/unitime/timetable/gwt/shared/ClassAssignmentInterface.java b/JavaSource/org/unitime/timetable/gwt/shared/ClassAssignmentInterface.java index cc854c9790..003dcf932a 100644 --- a/JavaSource/org/unitime/timetable/gwt/shared/ClassAssignmentInterface.java +++ b/JavaSource/org/unitime/timetable/gwt/shared/ClassAssignmentInterface.java @@ -1256,6 +1256,7 @@ public static class EnrollmentInfo implements IsSerializable, Serializable { private Boolean iControl; private Long iMasterCourseId; private String iMasterSubject, iMasterCourseNbr; + private Boolean iNoMatch; public EnrollmentInfo() {} @@ -1411,6 +1412,9 @@ public String getIndent(String ind) { public void setControl(Boolean control) { iControl = control; } public Boolean isControl() { return iControl; } + public void setNoMatch(Boolean noMatch) { iNoMatch = noMatch; } + public Boolean isNoMatch() { return iNoMatch; } + public Long getMasterCouresId() { return (iMasterCourseId != null ? iMasterCourseId : iCourseId); } public void setMasterCourseId(Long courseId) { iMasterCourseId = courseId; } diff --git a/JavaSource/org/unitime/timetable/onlinesectioning/status/FindEnrollmentInfoAction.java b/JavaSource/org/unitime/timetable/onlinesectioning/status/FindEnrollmentInfoAction.java index 92064b5d0c..ad01545664 100644 --- a/JavaSource/org/unitime/timetable/onlinesectioning/status/FindEnrollmentInfoAction.java +++ b/JavaSource/org/unitime/timetable/onlinesectioning/status/FindEnrollmentInfoAction.java @@ -85,6 +85,7 @@ public class FindEnrollmentInfoAction implements OnlineSectioningAction iCoursesIcoordinate, iCoursesIcanApprove, iMyStudents; protected Set iSubjectAreas; + protected boolean iShowUnmatchedClasses = true; public FindEnrollmentInfoAction withParams(String query, Long courseId, Set coursesIcoordinage, Set coursesIcanApprove, Set myStudents, Set subjects) { iQuery = new Query(query); @@ -100,6 +101,11 @@ public FindEnrollmentInfoAction withParams(String query, Long courseId, Set