Skip to content

Commit

Permalink
Student Scheduling Dashboards: Enrollments
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
tomas-muller committed Jun 17, 2021
1 parent 13cf22f commit 215608b
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,10 @@ public void onSuccess(List<EnrollmentInfo> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1962,6 +1964,7 @@ public List<EnrollmentInfo> 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()
);
}
Expand All @@ -1973,14 +1976,18 @@ public List<EnrollmentInfo> 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 {
OnlineSectioningServer server = getStudentSolver();
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down Expand Up @@ -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; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public class FindEnrollmentInfoAction implements OnlineSectioningAction<List<Enr
protected Long iCourseId;
protected Set<Long> iCoursesIcoordinate, iCoursesIcanApprove, iMyStudents;
protected Set<String> iSubjectAreas;
protected boolean iShowUnmatchedClasses = true;

public FindEnrollmentInfoAction withParams(String query, Long courseId, Set<Long> coursesIcoordinage, Set<Long> coursesIcanApprove, Set<Long> myStudents, Set<String> subjects) {
iQuery = new Query(query);
Expand All @@ -100,6 +101,11 @@ public FindEnrollmentInfoAction withParams(String query, Long courseId, Set<Long
return this;
}

public FindEnrollmentInfoAction showUnmatchedClasses(boolean showUnmatchedClasses) {
iShowUnmatchedClasses = showUnmatchedClasses;
return this;
}

protected SectioningStatusFilterRpcRequest iFilter = null;
public FindEnrollmentInfoAction withFilter(SectioningStatusFilterRpcRequest filter) {
iFilter = filter;
Expand Down Expand Up @@ -765,7 +771,8 @@ public int compare(EnrollmentInfo e1, EnrollmentInfo e2) {
}
}

if (match == 0) continue;
if (match == 0 && !iShowUnmatchedClasses) continue;
e.setNoMatch(match == 0);

e.setLimit(section.getLimit());
e.setOther(other);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,8 @@ public int compare(Class_ s1, Class_ s2) {
}
}

if (match == 0) continue;
if (match == 0 && !iShowUnmatchedClasses) continue;
e.setNoMatch(match == 0);

e.setLimit(section.getSectioningLimit());
e.setOther(other);
Expand Down
4 changes: 4 additions & 0 deletions WebContent/styles/unitime.css
Original file line number Diff line number Diff line change
Expand Up @@ -6226,6 +6226,10 @@ unitime-RoomSharingWidget .legend .blank {
border-left: none;
}

.unitime-EnrollmentsTable .nomatch {
color: gray;
}

.unitime-LogsTable tr:nth-child(odd) {
background-color: #eee;
}
Expand Down

0 comments on commit 215608b

Please sign in to comment.