Skip to content

Commit

Permalink
Reservations: Flags
Browse files Browse the repository at this point in the history
- always show the reservation flags such as
  - Allow Time Conflict
  - Can Assign Over Limit
  - Student Must Follow
  - Do Not Reserve Space
  (not just for the overrides)
- this is to ensure that it is always clear what the reservation/override does
  • Loading branch information
tomas-muller committed Jul 17, 2024
1 parent 956d38d commit 3ccfa43
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,19 @@ public String getName() {
}

String flags = "";
if (reservation.isOverride()) {
if (reservation.isAllowOverlaps())
flags += "\n " + MESSAGES.checkCanOverlap();
if (reservation.isOverLimit())
flags += "\n " + MESSAGES.checkCanOverLimit();
if (reservation.isMustBeUsed())
flags += "\n " + MESSAGES.checkMustBeUsed();
if (reservation.isAlwaysExpired())
flags += "\n " + MESSAGES.checkAllwaysExpired();
}
if (reservation.isAllowOverlaps())
flags += "\n " + MESSAGES.checkCanOverlap();
if (reservation.isOverLimit())
flags += "\n " + MESSAGES.checkCanOverLimit();
if (reservation.isMustBeUsed())
flags += "\n " + MESSAGES.checkMustBeUsed();
if (reservation.isAlwaysExpired())
flags += "\n " + MESSAGES.checkAllwaysExpired();
Integer limit = reservation.getReservationLimit();
if (reservation instanceof CourseReservation) {
line.add(new Label(MESSAGES.reservationCourseAbbv()));
Label label = new Label(MESSAGES.reservationCourseAbbv() + flags);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
Course course = ((CourseReservation) reservation).getCourse();
limit = course.getLimit();
line.add(new Label(course.getAbbv(), false));
Expand All @@ -291,9 +291,13 @@ public String getName() {
line.add(label);
} else if (reservation instanceof OverrideReservation) {
String type = CONSTANTS.reservationOverrideTypeAbbv()[((OverrideReservation)reservation).getType().ordinal()];
line.add(new Label(type == null ? ((OverrideReservation)reservation).getType().name() : type));
Label label = new Label(type == null ? ((OverrideReservation)reservation).getType().name() + flags : type);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
} else {
line.add(new Label(MESSAGES.reservationIndividualAbbv()));
Label label = new Label(MESSAGES.reservationIndividualAbbv() + flags);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
}
VerticalPanel students = new VerticalPanel();
if (limit == null)
Expand All @@ -315,18 +319,22 @@ public String getName() {
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
} else {
line.add(new Label(MESSAGES.reservationStudentGroupAbbv()));
Label label = new Label(MESSAGES.reservationStudentGroupAbbv() + flags);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
}
IdName group = ((GroupReservation) reservation).getGroup();
line.add(new Label(group.getAbbv() + " - " + group.getName() + " (" + group.getLimit() + ")", false));
} else if (reservation instanceof LCReservation) {
if (reservation.getOffering().getCourses().size() > 1 && iOfferingId != null) {
Course course = ((LCReservation) reservation).getCourse();
Label label = new Label(MESSAGES.reservationLearningCommunityAbbv() + "\n " + course.getAbbv());
Label label = new Label(MESSAGES.reservationLearningCommunityAbbv() + "\n " + course.getAbbv() + flags);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
} else {
line.add(new Label(MESSAGES.reservationLearningCommunityAbbv()));
Label label = new Label(MESSAGES.reservationLearningCommunityAbbv() + flags);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
}
IdName group = ((LCReservation) reservation).getGroup();
line.add(new Label(group.getAbbv() + " - " + group.getName() + " (" + group.getLimit() + ")", false));
Expand All @@ -336,7 +344,9 @@ public String getName() {
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
} else {
line.add(new Label(MESSAGES.reservationCurriculumAbbv()));
Label label = new Label(MESSAGES.reservationCurriculumAbbv() + flags);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
}
Areas curriculum = ((CurriculumReservation) reservation).getCurriculum();
VerticalPanel owner = new VerticalPanel();
Expand Down Expand Up @@ -406,7 +416,9 @@ else if (firstClasf) {
String filter = ((UniversalReservation) reservation).getFilter();
line.add(new Label(filter == null ? "" : filter, false));
} else {
line.add(new Label(MESSAGES.reservationUnknownAbbv()));
Label label = new Label(MESSAGES.reservationUnknownAbbv() + flags);
label.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE);
line.add(label);
line.add(new Label());
}
VerticalPanel restrictions = new VerticalPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public CSVFile createTable(Assignment<Request, Enrollment> assignment, DataPrope
line.add(new CSVFile.CSVField(course));

String flags = "";
if (reservation.isOverride() && reservation.isAllowOverlaps())
if (reservation.isAllowOverlaps())
flags += "\n " + MESSAGES.checkCanOverlap();
if (reservation.isOverride() && reservation.isOverLimit())
if (reservation.isOverLimit())
flags += "\n " + MESSAGES.checkCanOverLimit();
if (reservation.isMustBeUsed())
flags += "\n " + MESSAGES.checkMustBeUsed();
Expand All @@ -143,7 +143,7 @@ public CSVFile createTable(Assignment<Request, Enrollment> assignment, DataPrope
line.add(new CSVFile.CSVField(MESSAGES.reservationIndividualOverrideAbbv() + flags));
} else if (reservation instanceof OverrideReservation) {
String type = CONSTANTS.reservationOverrideTypeAbbv()[((OverrideReservation)reservation).getType().ordinal()];
line.add(new CSVFile.CSVField((type == null ? ((OverrideReservation)reservation).getType().name() : type) + flags));
line.add(new CSVFile.CSVField(type == null ? ((OverrideReservation)reservation).getType().name() + flags: type));
} else {
line.add(new CSVFile.CSVField(MESSAGES.reservationIndividualAbbv() + flags));
}
Expand Down
8 changes: 8 additions & 0 deletions WebContent/help/Release-Notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
<line>When unlimited enrollment is selected, make sure that all classes have zero number of rooms.</line>
</description>
</item>
<item>
<name>Reservations, Instructional Offering Detail, Student Scheduling Dashboards</name>
<description>
<line>Reservations table: Always show the reservation flags such as Allow Time Conflict,
Can Assign Over Limit, Student Must Follow, and Do Not Reserve Space.</line>
<line>This is to ensure that it is always clear what the reservation/override does.</line>
</description>
</item>
</category>
<category>
<title>Event Management</title>
Expand Down

0 comments on commit 3ccfa43

Please sign in to comment.