Skip to content
Snippets Groups Projects
Commit b2ce24a3 authored by Henry Page's avatar Henry Page :speech_balloon:
Browse files

[ConsecutiveQueueSlots] Fixed being able to take untakeable slots

parent ee664468
Branches
Tags v0.6.1
2 merge requests!8412425.0.0 release,!840Resolve "Consecutive slotted labs: UI does not restrict enqueuing on later slots."
......@@ -15,10 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- If a room has a map, students can now click the map to indicate their location. @rwbackx
### Changed
- Waiting time and processing time now uses consistent calculations. [@hpage](https://gitlab.ewi.tudelft.nl/hpage)
### Fixed
- Fix the copying of labs [@mmadara](https://gitlab.ewi.tudelft.nl/mmadara)
- Slot selection now throws an error if user selects non-consecutive slot in consecutive labs. [@hpage](https://gitlab.ewi.tudelft.nl/hpage)
## [2.4.0]
......
......@@ -287,7 +287,7 @@ class TimeSlot {
* @param requests The requests in the timeslot
* @param options Optional configuration.
*/
constructor(id, start, end, occupancy, capacity, requests, options) {
constructor(id, start, end, occupancy, capacity, requests, options = {}) {
this.id = id === undefined ? (TimeSlot.nextId++).toString() : id;
this.start = start;
this.end = end;
......
......@@ -54,7 +54,7 @@
<span>Select a time slot</span>
<div id="slot-select" style="max-height: 30rem"></div>
</div>
<p class="fw-500 colour-error" hidden id="time-slot-warning">Please select a time slot</p>
<p class="fw-500 colour-error" hidden id="time-slot-warning">Please select a valid time slot</p>
<div>
<span>Selected time slot:</span>
<span id="selected-slot" class="fw-500">none</span>
......@@ -120,7 +120,7 @@
// Show error if trying to enqueue without slot
document.getElementById("enqueue-form").addEventListener("submit", function (event) {
if (timeSlots.selected === undefined) {
if (timeSlots.selected === undefined || timeSlots.selected.untakable) {
document.getElementById("time-slot-warning").removeAttribute("hidden");
event.preventDefault();
event.stopPropagation();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment