booking-flow-finalized-design kindaaaa #7

Merged
jare2473 merged 20 commits from booking-flow-finalized-design into main 2025-09-30 10:50:54 +02:00
8 changed files with 960 additions and 5 deletions
Showing only changes of commit 8932bcbfed - Show all commits

View File

@@ -0,0 +1,492 @@
{
"date": "2025-09-29",
"dayName": "måndag",
"bookings": [
{
"id": 1,
"room": "G10:1",
"time": "08:00-10:00",
"startTime": 0,
"endTime": 4,
"title": "study",
"details": "tid: 08-10"
},
{
"id": 2,
"room": "G10:2",
"time": "09:00-13:00",
"startTime": 2,
"endTime": 10,
"title": "REQ",
"details": "tid: 09-13"
},
{
"id": 3,
"room": "G10:3",
"time": "10:00-12:00",
"startTime": 4,
"endTime": 8,
"title": "plugg",
"details": "tid: 10-12"
},
{
"id": 4,
"room": "G10:4",
"time": "09:00-13:00",
"startTime": 2,
"endTime": 10,
"title": "Välkommen välkommen",
"details": "tid: 09-13"
},
{
"id": 5,
"room": "G10:5",
"time": "13:00-17:00",
"startTime": 10,
"endTime": 18,
"title": "REQ",
"details": "tid: 13-17"
},
{
"id": 6,
"room": "G10:6",
"time": "13:00-14:00",
"startTime": 10,
"endTime": 12,
"title": "FEEWC",
"details": "tid: 13-14"
},
{
"id": 7,
"room": "G10:6",
"time": "14:00-16:00",
"startTime": 12,
"endTime": 16,
"title": "metod",
"details": "tid: 14-16"
},
{
"id": 8,
"room": "G10:7",
"time": "10:00-13:00",
"startTime": 4,
"endTime": 10,
"title": "Project Management Team 5",
"details": "tid: 10-13"
},
{
"id": 9,
"room": "G10:7",
"time": "14:00-18:00",
"startTime": 12,
"endTime": 20,
"title": "Tenta plugg",
"details": "tid: 14-18"
},
{
"id": 10,
"room": "G5:1",
"time": "10:00-12:00",
"startTime": 4,
"endTime": 8,
"title": "Plugg G25",
"details": "tid: 10-12"
},
{
"id": 11,
"room": "G5:10",
"time": "08:00-11:00",
"startTime": 0,
"endTime": 6,
"title": "Grupp 43A",
"details": "tid: 08-11"
},
{
"id": 12,
"room": "G5:11",
"time": "11:00-15:00",
"startTime": 6,
"endTime": 14,
"title": "Plottest",
"details": "tid: 11-15"
},
{
"id": 13,
"room": "G5:12",
"time": "08:00-10:00",
"startTime": 0,
"endTime": 4,
"title": "Study",
"details": "tid: 08-10"
},
{
"id": 14,
"room": "G5:12",
"time": "12:00-14:00",
"startTime": 8,
"endTime": 12,
"title": "metod",
"details": "tid: 12-14"
},
{
"id": 15,
"room": "G5:13",
"time": "09:00-13:00",
"startTime": 2,
"endTime": 10,
"title": "DSB Grupp 25 krav intervju",
"details": "tid: 09-13"
},
{
"id": 16,
"room": "G5:13",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "Project Group meeting",
"details": "tid: 13-15"
},
{
"id": 17,
"room": "G5:13",
"time": "15:00-17:00",
"startTime": 14,
"endTime": 18,
"title": "Examensarbete",
"details": "tid: 15-17"
},
{
"id": 18,
"room": "G5:14",
"time": "09:00-12:00",
"startTime": 2,
"endTime": 8,
"title": "KP Plugg Krav",
"details": "tid: 09-12"
},
{
"id": 19,
"room": "G5:14",
"time": "12:00-16:00",
"startTime": 8,
"endTime": 16,
"title": "REQ Grupp 5",
"details": "tid: 12-16"
},
{
"id": 20,
"room": "G5:14",
"time": "16:00-17:00",
"startTime": 16,
"endTime": 18,
"title": "Metod g6",
"details": "tid: 16-17"
},
{
"id": 21,
"room": "G5:15",
"time": "09:00-14:00",
"startTime": 2,
"endTime": 12,
"title": "Krav grupp",
"details": "tid: 09-14"
},
{
"id": 22,
"room": "G5:15",
"time": "13:00-14:00",
"startTime": 10,
"endTime": 12,
"title": "Stats",
"details": "tid: 13-14"
},
{
"id": 23,
"room": "G5:15",
"time": "14:00-17:00",
"startTime": 12,
"endTime": 18,
"title": "Plugg TRIO",
"details": "tid: 14-17"
},
{
"id": 24,
"room": "G5:16",
"time": "11:00-13:00",
"startTime": 6,
"endTime": 10,
"title": "plugggg",
"details": "tid: 11-13"
},
{
"id": 25,
"room": "G5:17",
"time": "09:00-12:00",
"startTime": 2,
"endTime": 8,
"title": "Experiment KP G4",
"details": "tid: 09-12"
},
{
"id": 26,
"room": "G5:17",
"time": "14:00-17:00",
"startTime": 12,
"endTime": 18,
"title": "plugg",
"details": "tid: 14-17"
},
{
"id": 27,
"room": "G5:2",
"time": "12:00-16:00",
"startTime": 8,
"endTime": 16,
"title": "Grups testning",
"details": "tid: 12-16"
},
{
"id": 28,
"room": "G5:3",
"time": "09:00-12:00",
"startTime": 2,
"endTime": 8,
"title": "Experiment KP G4",
"details": "tid: 09-12"
},
{
"id": 29,
"room": "G5:3",
"time": "10:00-14:00",
"startTime": 4,
"endTime": 12,
"title": "KRAV meeting",
"details": "tid: 10-14"
},
{
"id": 30,
"room": "G5:4",
"time": "14:00-16:00",
"startTime": 12,
"endTime": 16,
"title": "P",
"details": "tid: 14-16"
},
{
"id": 31,
"room": "G5:5",
"time": "10:00-14:00",
"startTime": 4,
"endTime": 12,
"title": "msb METOD 38",
"details": "tid: 10-14"
},
{
"id": 32,
"room": "G5:6",
"time": "10:00-13:00",
"startTime": 4,
"endTime": 10,
"title": "Metod gr 50 REQ Group 5",
"details": "tid: 10-13"
},
{
"id": 33,
"room": "G5:6",
"time": "11:00-13:00",
"startTime": 6,
"endTime": 10,
"title": "REQ Group 5",
"details": "tid: 11-13"
},
{
"id": 34,
"room": "G5:7",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "LOCKED IN KRAV",
"details": "tid: 13-15"
},
{
"id": 35,
"room": "G5:8",
"time": "13:00-17:00",
"startTime": 10,
"endTime": 18,
"title": "REQ Study",
"details": "tid: 13-17"
},
{
"id": 36,
"room": "G5:8",
"time": "15:00-18:00",
"startTime": 14,
"endTime": 20,
"title": "plugg",
"details": "tid: 15-18"
},
{
"id": 37,
"room": "G5:9",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "Study",
"details": "tid: 13-15"
},
{
"id": 38,
"room": "G5:9",
"time": "14:00-18:00",
"startTime": 12,
"endTime": 20,
"title": "Stats Plugg",
"details": "tid: 14-18"
},
{
"id": 39,
"room": "G10:1",
"time": "10:00-13:00",
"startTime": 4,
"endTime": 10,
"title": "Test KP grupp 1",
"details": "tid: 10-13"
},
{
"id": 40,
"room": "G10:1",
"time": "12:00-15:00",
"startTime": 8,
"endTime": 14,
"title": "METOD grupp 37",
"details": "tid: 12-15"
},
{
"id": 41,
"room": "G10:1",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "G25 Krav Group meeting",
"details": "tid: 13-15"
},
{
"id": 42,
"room": "G10:1",
"time": "15:00-16:00",
"startTime": 14,
"endTime": 16,
"title": "IS plugg session",
"details": "tid: 15-16"
},
{
"id": 43,
"room": "G10:2",
"time": "15:00-17:00",
"startTime": 14,
"endTime": 18,
"title": "ERP dsb test",
"details": "tid: 15-17"
},
{
"id": 44,
"room": "G10:4",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "Group L",
"details": "tid: 13-15"
},
{
"id": 45,
"room": "G10:5",
"time": "17:00-21:00",
"startTime": 18,
"endTime": 26,
"title": "Kati se getires :)",
"details": "tid: 17-21"
},
{
"id": 46,
"room": "G5:11",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "Meeting",
"details": "tid: 13-15"
},
{
"id": 47,
"room": "G5:12",
"time": "10:00-12:00",
"startTime": 4,
"endTime": 8,
"title": "Grupp",
"details": "tid: 10-12"
},
{
"id": 48,
"room": "G5:13",
"time": "15:00-17:00",
"startTime": 14,
"endTime": 18,
"title": "Sifu",
"details": "tid: 15-17"
},
{
"id": 49,
"room": "G5:14",
"time": "14:00-17:00",
"startTime": 12,
"endTime": 18,
"title": "Plugg TRIO",
"details": "tid: 14-17"
},
{
"id": 50,
"room": "G5:15",
"time": "15:00-17:00",
"startTime": 14,
"endTime": 18,
"title": "working",
"details": "tid: 15-17"
},
{
"id": 51,
"room": "G5:16",
"time": "14:00-17:00",
"startTime": 12,
"endTime": 18,
"title": "IS 1 session",
"details": "tid: 14-17"
},
{
"id": 52,
"room": "G10:1",
"time": "17:00-20:00",
"startTime": 18,
"endTime": 24,
"title": "SUPCOM DB",
"details": "tid: 17-20"
},
{
"id": 53,
"room": "G5:12",
"time": "16:00-16:00",
"startTime": 16,
"endTime": 16,
"title": "DIFO grupp 43",
"details": "tid: 12-16"
},
{
"id": 54,
"room": "G5:11",
"time": "15:00-18:00",
"startTime": 14,
"endTime": 20,
"title": "Projektarbete Meeting",
"details": "tid: 15-18"
}
]
}

View File

@@ -0,0 +1,447 @@
{
"date": "2025-09-30",
"dayName": "tisdag",
"bookings": [
{
"id": 1,
"room": "G10:1",
"time": "08:00-12:00",
"startTime": 0,
"endTime": 8,
"title": "välkommen 2",
"details": "tid: 08-12"
},
{
"id": 2,
"room": "G10:2",
"time": "09:00-13:00",
"startTime": 2,
"endTime": 10,
"title": "Grupp 1",
"details": "tid: 09-13"
},
{
"id": 3,
"room": "G10:3",
"time": "08:00-12:00",
"startTime": 0,
"endTime": 8,
"title": "Välkommen",
"details": "tid: 08-12"
},
{
"id": 4,
"room": "G10:4",
"time": "09:00-13:00",
"startTime": 2,
"endTime": 10,
"title": "Plugg - LOGIK & SAK1",
"details": "tid: 09-13"
},
{
"id": 5,
"room": "G10:5",
"time": "10:00-14:00",
"startTime": 4,
"endTime": 12,
"title": "KRAV grupp 15a",
"details": "tid: 10-14"
},
{
"id": 6,
"room": "G10:6",
"time": "10:00-11:00",
"startTime": 4,
"endTime": 6,
"title": "Läsgrupp 8",
"details": "tid: 10-11"
},
{
"id": 7,
"room": "G10:6",
"time": "11:00-15:00",
"startTime": 6,
"endTime": 14,
"title": "p",
"details": "tid: 11-15"
},
{
"id": 8,
"room": "G10:7",
"time": "09:00-12:00",
"startTime": 2,
"endTime": 8,
"title": "Introduktion Kreativ Bokföring",
"details": "tid: 09-12"
},
{
"id": 9,
"room": "G10:7",
"time": "15:00-17:00",
"startTime": 14,
"endTime": 18,
"title": "G25 Krav",
"details": "tid: 15-17"
},
{
"id": 10,
"room": "G5:1",
"time": "09:00-11:00",
"startTime": 2,
"endTime": 6,
"title": "Drop-in studieavvägledning",
"details": "tid: 09-30-11"
},
{
"id": 11,
"room": "G5:10",
"time": "09:00-11:00",
"startTime": 2,
"endTime": 6,
"title": "Grou 05a",
"details": "tid: 09-11"
},
{
"id": 12,
"room": "G5:10",
"time": "11:00-15:00",
"startTime": 6,
"endTime": 14,
"title": "Ej bokningsbar DIFO labb",
"details": "tid: 11-11:30, tid: 11-15"
},
{
"id": 13,
"room": "G5:11",
"time": "11:00-15:00",
"startTime": 6,
"endTime": 14,
"title": "KRAVlösa",
"details": "tid: 11-15"
},
{
"id": 14,
"room": "G5:12",
"time": "09:00-12:00",
"startTime": 2,
"endTime": 8,
"title": "REQ Group 5",
"details": "tid: 09-12"
},
{
"id": 15,
"room": "G5:12",
"time": "12:00-16:00",
"startTime": 8,
"endTime": 16,
"title": "Grupp 34 Projektarbete",
"details": "tid: 12-16"
},
{
"id": 16,
"room": "G5:13",
"time": "10:00-12:00",
"startTime": 4,
"endTime": 8,
"title": "Metod 46",
"details": "tid: 10-12"
},
{
"id": 17,
"room": "G5:14",
"time": "09:00-10:00",
"startTime": 2,
"endTime": 4,
"title": "ERP Group work",
"details": "tid: 09-10"
},
{
"id": 18,
"room": "G5:14",
"time": "10:00-14:00",
"startTime": 4,
"endTime": 12,
"title": "metod",
"details": "tid: 10-14"
},
{
"id": 19,
"room": "G5:14",
"time": "14:00-15:00",
"startTime": 12,
"endTime": 14,
"title": "Group AE",
"details": "tid: 14-15"
},
{
"id": 20,
"room": "G5:15",
"time": "09:00-13:00",
"startTime": 2,
"endTime": 10,
"title": "Plugg TRIO",
"details": "tid: 09-13"
},
{
"id": 21,
"room": "G5:15",
"time": "14:00-17:00",
"startTime": 12,
"endTime": 18,
"title": "Plugg TRIO",
"details": "tid: 14-17"
},
{
"id": 22,
"room": "G5:16",
"time": "09:00-12:00",
"startTime": 2,
"endTime": 8,
"title": "User testing",
"details": "tid: 09-12"
},
{
"id": 23,
"room": "G5:17",
"time": "10:00-12:00",
"startTime": 4,
"endTime": 8,
"title": "sah",
"details": "tid: 10-12"
},
{
"id": 24,
"room": "G5:17",
"time": "12:00-16:00",
"startTime": 8,
"endTime": 16,
"title": "plugg KRAV projektarbete",
"details": "tid: 12-16, tid: 12-13"
},
{
"id": 25,
"room": "G5:17",
"time": "13:00-16:00",
"startTime": 10,
"endTime": 16,
"title": "Krav",
"details": "tid: 13-16"
},
{
"id": 26,
"room": "G5:2",
"time": "10:00-14:00",
"startTime": 4,
"endTime": 12,
"title": "APID G4 Experiment",
"details": "tid: 10-14"
},
{
"id": 27,
"room": "G5:2",
"time": "11:00-15:00",
"startTime": 6,
"endTime": 14,
"title": "Group 8",
"details": "tid: 11-15"
},
{
"id": 28,
"room": "G5:2",
"time": "14:00-15:00",
"startTime": 12,
"endTime": 14,
"title": "Sonic",
"details": "tid: 14-15"
},
{
"id": 29,
"room": "G5:2",
"time": "15:00-19:00",
"startTime": 14,
"endTime": 22,
"title": "plugg",
"details": "tid: 15-19"
},
{
"id": 30,
"room": "G5:3",
"time": "09:00-13:00",
"startTime": 2,
"endTime": 10,
"title": "plugg",
"details": "tid: 09-13"
},
{
"id": 31,
"room": "G5:4",
"time": "10:00-13:00",
"startTime": 4,
"endTime": 10,
"title": "msb IS1 Group 41",
"details": "tid: 10-13"
},
{
"id": 32,
"room": "G5:4",
"time": "11:00-15:00",
"startTime": 6,
"endTime": 14,
"title": "Plugg",
"details": "tid: 11-15"
},
{
"id": 33,
"room": "G5:5",
"time": "10:00-12:00",
"startTime": 4,
"endTime": 8,
"title": "Stats",
"details": "tid: 10-12"
},
{
"id": 34,
"room": "G5:5",
"time": "12:00-13:00",
"startTime": 8,
"endTime": 10,
"title": "plugg",
"details": "tid: 12-13"
},
{
"id": 35,
"room": "G5:6",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "MAJO assignemnt",
"details": "tid: 13-15"
},
{
"id": 36,
"room": "G5:6",
"time": "13:00-17:00",
"startTime": 10,
"endTime": 18,
"title": "plugg Group 21",
"details": "tid: 13-17, tid: 13-15"
},
{
"id": 37,
"room": "G5:7",
"time": "14:00-16:00",
"startTime": 12,
"endTime": 16,
"title": "Stats",
"details": "tid: 14-16"
},
{
"id": 38,
"room": "G10:1",
"time": "12:00-16:00",
"startTime": 8,
"endTime": 16,
"title": "plugg",
"details": "tid: 12-16"
},
{
"id": 39,
"room": "G10:2",
"time": "13:00-16:00",
"startTime": 10,
"endTime": 16,
"title": "KRAV grupp 33A",
"details": "tid: 12-16"
},
{
"id": 40,
"room": "G10:3",
"time": "15:00-17:00",
"startTime": 14,
"endTime": 18,
"title": "pluggiluring :D",
"details": "tid: 15-17"
},
{
"id": 41,
"room": "G10:4",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "G25 Krav",
"details": "tid: 13-15"
},
{
"id": 42,
"room": "G10:5",
"time": "14:00-18:00",
"startTime": 12,
"endTime": 20,
"title": "KRAV Plugg",
"details": "tid: 14-18"
},
{
"id": 43,
"room": "G10:6",
"time": "15:00-18:00",
"startTime": 14,
"endTime": 20,
"title": "TinyML project work",
"details": "tid: 15-18"
},
{
"id": 44,
"room": "G10:7",
"time": "15:00-18:00",
"startTime": 14,
"endTime": 20,
"title": "ERP Meeting",
"details": "tid: 15-18"
},
{
"id": 45,
"room": "G10:1",
"time": "16:00-19:00",
"startTime": 16,
"endTime": 22,
"title": "Plugg",
"details": "tid: 16-19"
},
{
"id": 46,
"room": "G5:11",
"time": "12:00-16:00",
"startTime": 8,
"endTime": 16,
"title": "Krav grupp grupparbete",
"details": "tid: 12-16"
},
{
"id": 47,
"room": "G5:12",
"time": "12:00-16:00",
"startTime": 8,
"endTime": 16,
"title": "HUGO",
"details": "tid: 12-16"
},
{
"id": 48,
"room": "G5:13",
"time": "13:00-14:00",
"startTime": 10,
"endTime": 12,
"title": "MAJO AE",
"details": "tid: 13-14"
},
{
"id": 49,
"room": "G5:8",
"time": "13:00-15:00",
"startTime": 10,
"endTime": 14,
"title": "IS1 plugg Group 21",
"details": "tid: 13-15"
}
]
}

View File

@@ -15,7 +15,7 @@ export function RoomSelectionField({ clean = false, roomTypeFilter = null }) {
if (!roomTypeFilter || roomTypeFilter === 'litet-grupprum') {
// Add small rooms G5:1-15
rooms = rooms.concat(
Array.from({ length: settings.numberOfRooms }, (_, i) => ({
Array.from({ length: settings.numberOfSmallGroupRooms }, (_, i) => ({
value: `G5:${i + 1}`,
label: `G5:${i + 1}`,
}))
@@ -25,7 +25,7 @@ export function RoomSelectionField({ clean = false, roomTypeFilter = null }) {
if (!roomTypeFilter || roomTypeFilter === 'stort-grupprum') {
// Add large rooms G10:1-7
rooms = rooms.concat(
Array.from({ length: 7 }, (_, i) => ({
Array.from({ length: settings.numberOfLargeGroupRooms }, (_, i) => ({
value: `G10:${i + 1}`,
label: `G10:${i + 1}`,
}))

View File

@@ -277,6 +277,7 @@ export function TimeCardContainer({ addBooking, forceOneColumn = false }) {
const renderTimeCard = (slotIndex) => {
let maxConsecutive = 0;
let roomId = "";
console.log(booking);
if (booking.currentRoom) {
const consecutive = countConsecutiveFromSlot(booking.currentRoom.times, slotIndex);

View File

@@ -1,4 +1,6 @@
export const NUMBER_OF_ROOMS = 15;
export const NUMBER_OF_SMALL_GROUP_ROOMS = 17;
export const NUMBER_OF_LARGE_GROUP_ROOMS = 7;
export const CHANCE_OF_AVAILABILITY = 0.5;
export const DEFAULT_BOOKING_TITLE = "Jacobs bokning";

View File

@@ -1,6 +1,11 @@
import React, { createContext, useContext, useState, useEffect } from 'react';
import { today, getLocalTimeZone, CalendarDate } from '@internationalized/date';
import { USER } from '../constants/bookingConstants';
import {
USER,
CHANCE_OF_AVAILABILITY,
NUMBER_OF_SMALL_GROUP_ROOMS,
NUMBER_OF_LARGE_GROUP_ROOMS,
} from '../constants/bookingConstants';
const SettingsContext = createContext();
@@ -8,8 +13,10 @@ const SettingsContext = createContext();
const DEFAULT_SETTINGS = {
mockToday: null,
bookingRangeDays: 14,
roomAvailabilityChance: 0.7,
roomAvailabilityChance: CHANCE_OF_AVAILABILITY,
numberOfRooms: 5,
numberOfSmallGroupRooms: NUMBER_OF_SMALL_GROUP_ROOMS,
numberOfLargeGroupRooms: NUMBER_OF_LARGE_GROUP_ROOMS,
earliestTimeSlot: 0,
latestTimeSlot: 23,
currentUserName: USER.name,

View File

@@ -250,7 +250,7 @@ export function BookingSettings() {
<div className={styles.description} style={{marginTop: '0.5rem', fontSize: '0.85rem'}}>
<strong>Inline Expansion:</strong> Card expands directly in the list for editing<br/>
<strong>Modal Popup:</strong> Always opens in a centered modal dialog<br/>
<strong>Responsive:</strong> Inline on mobile (780px), modal on desktop (>780px)
<strong>Responsive:</strong> Inline on mobile (&le;780px), modal on desktop (&gt;780px)
</div>
</div>
</div>

View File

@@ -2,6 +2,12 @@ import React from 'react';
import { today, getLocalTimeZone } from '@internationalized/date';
import { NUMBER_OF_ROOMS, CHANCE_OF_AVAILABILITY, USER } from '../constants/bookingConstants';
// Simple seeded random number generator
const seededRandom = (seed) => {
const x = Math.sin(seed) * 10000;
return x - Math.floor(x);
};
export const generateInitialRooms = (chanceOfAvailability = CHANCE_OF_AVAILABILITY, numberOfRooms = NUMBER_OF_ROOMS, earliestSlot = 0, latestSlot = 23) => {
return [...Array(numberOfRooms)].map((room, index) => ({
roomId: `G5:${index + 1}`,