Skip to content
Snippets Groups Projects
Commit 969a5fff authored by Otto Visser's avatar Otto Visser
Browse files

Merge branch 'lab-filtering#125' into 'development'

Add date and time to lab filter when looking for requests

Closes #125

See merge request EIP/queue!83
parents 72f4a09f 4724d3d4
Branches
Tags
No related merge requests found
......@@ -206,6 +206,7 @@ public class Lab implements Serializable {
* exists, or an empty Optional otherwise.
*
* @param requestEntity
*
* @return
*/
public Optional<Request> getPendingRequest(RequestEntity requestEntity) {
......@@ -303,6 +304,7 @@ public class Lab implements Serializable {
* Check if the given student is enqueued
*
* @param entity
*
* @return
*/
public boolean isEnqueued(RequestEntity entity) {
......@@ -313,7 +315,9 @@ public class Lab implements Serializable {
/**
* Takes a requestEntity (User) and returns the Group entity, if any
* else returns the user
*
* @param requestEntity
*
* @return
*/
public RequestEntity getEntityFor(RequestEntity requestEntity) {
......@@ -327,6 +331,7 @@ public class Lab implements Serializable {
* Check if the given student is being processed
*
* @param requestEntity
*
* @return
*/
public boolean isBeingProcessed(RequestEntity requestEntity) {
......@@ -339,6 +344,7 @@ public class Lab implements Serializable {
* Get requests for the given student
*
* @param requestEntity
*
* @return
*/
public List<Request> requestsBy(RequestEntity requestEntity) {
......@@ -360,6 +366,7 @@ public class Lab implements Serializable {
* Get position of given student in queue. Assumes the student is enqueued.
*
* @param requestEntity
*
* @return
*/
public String position(RequestEntity requestEntity) {
......@@ -429,9 +436,13 @@ public class Lab implements Serializable {
return assignments.contains(assignment);
}
public boolean containsAllowedRequestType(RequestType requestType) { return allowedRequestTypes.contains(requestType); }
public boolean containsAllowedRequestType(RequestType requestType) {
return allowedRequestTypes.contains(requestType);
}
public boolean containsAllowedMentorGroup(FirstYearMentorGroup mentorGroup) { return allowedMentorGroups.contains(mentorGroup); }
public boolean containsAllowedMentorGroup(FirstYearMentorGroup mentorGroup) {
return allowedMentorGroups.contains(mentorGroup);
}
public LabSlot getSlot() {
return slot;
......@@ -490,7 +501,9 @@ public class Lab implements Serializable {
this.intervalTime = intervalTime;
}
public LocalDateTime getSlotSelectionOpensAt() { return slotSelectionOpensAt; }
public LocalDateTime getSlotSelectionOpensAt() {
return slotSelectionOpensAt;
}
public void setSlotSelectionOpensAt(LocalDateTime slotSelectionOpensAt) {
this.slotSelectionOpensAt = slotSelectionOpensAt;
......@@ -557,10 +570,18 @@ public class Lab implements Serializable {
}
}
public String toReadableString() {
LocalDateTime time = this.slot.getOpensAt();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm - " +
"dd MMM uu");
return "lab " + this.id + ": " + formatter.format(time);
}
/**
*
* @param requests Active requests
* @param user Active user currently working in the queue
*
* @return Number of requests for this lab with status Pending
* plus nr of requests assigned to current user
*/
......
......@@ -28,12 +28,13 @@
<label class="form-control-label" for="labSelect">Lab</label>
<select multiple="multiple" class="form-control" id="labSelect" name="lab">
<th:block th:each="lab : ${labs}">
<option th:value="${lab.id}"
th:unless="${#filter.valueInMultiMap('lab', lab, state)}" th:text="${lab}">One
<option
th:value="${lab.id}"
th:unless="${#filter.valueInMultiMap('lab', lab, state)}" th:text="${lab.toReadableString()}">One
</option>
<option th:value="${lab.id}"
th:if="${#filter.valueInMultiMap('lab', lab, state)}" selected="selected"
th:text="${lab}">One
th:text="${lab.toReadableString()}">One
</option>
</th:block>
</select>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment