From efdfd99783fdea97b2dad556fb76c669b950a7a1 Mon Sep 17 00:00:00 2001 From: Bastieno Date: Wed, 22 Jan 2025 07:24:47 +0100 Subject: [PATCH] fix: logic with loadingMore --- data.js | 829 +++++++++++++++++++++++++++++- src/Calendar.js | 7 +- src/DateContentRow.js | 3 + src/EventEndingRow.js | 3 +- src/Month.js | 4 + src/TimeGrid.js | 2 + src/TimeGridHeader.js | 5 + src/sass/month.scss | 2 +- src/sass/time-grid.scss | 2 +- stories/props/grouping.stories.js | 6 +- 10 files changed, 842 insertions(+), 21 deletions(-) diff --git a/data.js b/data.js index 5ffc9d536..84b170dd6 100644 --- a/data.js +++ b/data.js @@ -50,6 +50,786 @@ export const grouping = { } export const shifts = [ + { + id: '47c4b613-7b06-4465-ba0f-1e495a202f22', + shiftNumber: 'QUFFZT', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-22T07:00:00.000Z', + end: '2025-01-22T16:00:00.000Z', + startTime: '2025-01-22T07:00:00.000Z', + endTime: '2025-01-22T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'da255383-98f1-4078-9ce1-09ce0b9c0eff', + shiftNumber: '2PQJ6X', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-22T07:00:00.000Z', + end: '2025-01-22T16:00:00.000Z', + startTime: '2025-01-22T07:00:00.000Z', + endTime: '2025-01-22T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '27348e46-7763-4eff-a21c-7a79c9fe1486', + shiftNumber: 'YPRHW4', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-22T07:00:00.000Z', + end: '2025-01-22T16:00:00.000Z', + startTime: '2025-01-22T07:00:00.000Z', + endTime: '2025-01-22T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '53ad1782-38cb-466b-b2a8-a0269cbf7810', + shiftNumber: '4866B8', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-22T07:00:00.000Z', + end: '2025-01-22T16:00:00.000Z', + startTime: '2025-01-22T07:00:00.000Z', + endTime: '2025-01-22T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'f97c3c50-586b-4c66-a7a7-158baa39358b', + shiftNumber: '6ZQSFJ', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-23T07:00:00.000Z', + end: '2025-01-23T16:00:00.000Z', + startTime: '2025-01-23T07:00:00.000Z', + endTime: '2025-01-23T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '30226d5f-6d51-4455-bdd5-32d68ee0fd2e', + shiftNumber: 'BTK9R3', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-23T07:00:00.000Z', + end: '2025-01-23T16:00:00.000Z', + startTime: '2025-01-23T07:00:00.000Z', + endTime: '2025-01-23T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'a9d7ffa2-3ed0-4942-a9b4-b6403e502702', + shiftNumber: '7HQVWW', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-23T07:00:00.000Z', + end: '2025-01-23T16:00:00.000Z', + startTime: '2025-01-23T07:00:00.000Z', + endTime: '2025-01-23T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '6d8b6470-7461-4524-9f1b-04137d3e0945', + shiftNumber: 'KRQ7WG', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-23T07:00:00.000Z', + end: '2025-01-23T16:00:00.000Z', + startTime: '2025-01-23T07:00:00.000Z', + endTime: '2025-01-23T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '935e14c4-6b3b-461b-ab7a-8858e1452082', + shiftNumber: 'XFUWU8', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-24T07:00:00.000Z', + end: '2025-01-24T16:00:00.000Z', + startTime: '2025-01-24T07:00:00.000Z', + endTime: '2025-01-24T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'd47f7eec-8d48-4d59-8fa9-1c9daa11952f', + shiftNumber: 'QFXX4M', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-24T07:00:00.000Z', + end: '2025-01-24T16:00:00.000Z', + startTime: '2025-01-24T07:00:00.000Z', + endTime: '2025-01-24T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '272bb830-ad0a-4605-ae99-e84322caa878', + shiftNumber: 'PRG998', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-24T07:00:00.000Z', + end: '2025-01-24T16:00:00.000Z', + startTime: '2025-01-24T07:00:00.000Z', + endTime: '2025-01-24T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '5037a8a7-f892-4d6f-a9b7-fa9e4ac2f6ad', + shiftNumber: 'KBLT9L', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-24T07:00:00.000Z', + end: '2025-01-24T16:00:00.000Z', + startTime: '2025-01-24T07:00:00.000Z', + endTime: '2025-01-24T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '60afa7c9-06f0-4daf-aea3-c7c693fe741c', + shiftNumber: 'G2BUHB', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-25T07:00:00.000Z', + end: '2025-01-25T16:00:00.000Z', + startTime: '2025-01-25T07:00:00.000Z', + endTime: '2025-01-25T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '85f23474-9db1-4e4c-9ecb-3c8e7e60c523', + shiftNumber: 'RB49X2', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-25T07:00:00.000Z', + end: '2025-01-25T16:00:00.000Z', + startTime: '2025-01-25T07:00:00.000Z', + endTime: '2025-01-25T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'd74d76a7-7780-46d0-b224-05aec3f29c19', + shiftNumber: 'HZFVP7', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-25T07:00:00.000Z', + end: '2025-01-25T16:00:00.000Z', + startTime: '2025-01-25T07:00:00.000Z', + endTime: '2025-01-25T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '94f7bce6-b3ed-4dfe-b083-8f922eaa700d', + shiftNumber: 'NYZ6N5', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-25T07:00:00.000Z', + end: '2025-01-25T16:00:00.000Z', + startTime: '2025-01-25T07:00:00.000Z', + endTime: '2025-01-25T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'c236b260-bfcc-4804-995c-79273070f66c', + shiftNumber: 'YLZV5T', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-26T07:00:00.000Z', + end: '2025-01-26T16:00:00.000Z', + startTime: '2025-01-26T07:00:00.000Z', + endTime: '2025-01-26T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '40090040-ef17-43c9-8a68-51c4201ae736', + shiftNumber: 'JHV46X', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-26T07:00:00.000Z', + end: '2025-01-26T16:00:00.000Z', + startTime: '2025-01-26T07:00:00.000Z', + endTime: '2025-01-26T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '65d25966-48ac-4fd9-a01c-ec29df33edff', + shiftNumber: '8QCP23', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-26T07:00:00.000Z', + end: '2025-01-26T16:00:00.000Z', + startTime: '2025-01-26T07:00:00.000Z', + endTime: '2025-01-26T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'd7be3fc5-fbc3-45c4-bdc4-3324bd9145b7', + shiftNumber: 'WSWN47', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-26T07:00:00.000Z', + end: '2025-01-26T16:00:00.000Z', + startTime: '2025-01-26T07:00:00.000Z', + endTime: '2025-01-26T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '59b42e5c-42e2-4916-8911-18042373400e', + shiftNumber: 'VFVBCX', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-27T07:00:00.000Z', + end: '2025-01-27T16:00:00.000Z', + startTime: '2025-01-27T07:00:00.000Z', + endTime: '2025-01-27T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'c22afeea-b6d6-4068-b9ec-a7ba78714995', + shiftNumber: '829T7R', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-27T07:00:00.000Z', + end: '2025-01-27T16:00:00.000Z', + startTime: '2025-01-27T07:00:00.000Z', + endTime: '2025-01-27T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'e10e2d6c-e557-4fc7-b294-fab9f7d13070', + shiftNumber: '4JM3N3', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-27T07:00:00.000Z', + end: '2025-01-27T16:00:00.000Z', + startTime: '2025-01-27T07:00:00.000Z', + endTime: '2025-01-27T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '169ad287-73a1-46b2-91ca-7891c7d17b67', + shiftNumber: 'C3XRMD', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-27T07:00:00.000Z', + end: '2025-01-27T16:00:00.000Z', + startTime: '2025-01-27T07:00:00.000Z', + endTime: '2025-01-27T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '8dfce599-4dc2-4c96-af6d-94373123c3cb', + shiftNumber: '66ZHCP', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-28T07:00:00.000Z', + end: '2025-01-28T16:00:00.000Z', + startTime: '2025-01-28T07:00:00.000Z', + endTime: '2025-01-28T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'c5ba349e-87f6-4540-80aa-b7a1f8d4b6c9', + shiftNumber: 'KYPUN8', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-28T07:00:00.000Z', + end: '2025-01-28T16:00:00.000Z', + startTime: '2025-01-28T07:00:00.000Z', + endTime: '2025-01-28T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '55f40f62-1337-4a83-a3c0-e39c22127e04', + shiftNumber: 'LWHXWG', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-28T07:00:00.000Z', + end: '2025-01-28T16:00:00.000Z', + startTime: '2025-01-28T07:00:00.000Z', + endTime: '2025-01-28T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '9bbde9d5-7526-4621-b364-67d965745577', + shiftNumber: 'V75WUB', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-28T07:00:00.000Z', + end: '2025-01-28T16:00:00.000Z', + startTime: '2025-01-28T07:00:00.000Z', + endTime: '2025-01-28T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '8e3de79f-0c43-4574-a34e-030efe6ff18b', + shiftNumber: '2UF7MG', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-29T07:00:00.000Z', + end: '2025-01-29T16:00:00.000Z', + startTime: '2025-01-29T07:00:00.000Z', + endTime: '2025-01-29T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'd1db8db8-9b39-4466-8b01-f6f045ded8fb', + shiftNumber: 'GYFBGH', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-29T07:00:00.000Z', + end: '2025-01-29T16:00:00.000Z', + startTime: '2025-01-29T07:00:00.000Z', + endTime: '2025-01-29T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'fd8345f7-55b1-4eef-bedc-335b22c58520', + shiftNumber: 'RNWW6W', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-29T07:00:00.000Z', + end: '2025-01-29T16:00:00.000Z', + startTime: '2025-01-29T07:00:00.000Z', + endTime: '2025-01-29T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '0c7e118f-083c-4e96-b9c0-fbbba956fb60', + shiftNumber: 'RRB98H', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-29T07:00:00.000Z', + end: '2025-01-29T16:00:00.000Z', + startTime: '2025-01-29T07:00:00.000Z', + endTime: '2025-01-29T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '5dd596d6-4312-4500-91c9-7aa25f85bbb0', + shiftNumber: 'L6ZWXP', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-30T07:00:00.000Z', + end: '2025-01-30T16:00:00.000Z', + startTime: '2025-01-30T07:00:00.000Z', + endTime: '2025-01-30T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 1, + caregiver: null, + }, + { + id: '302759d9-81a6-4416-93c8-951f7f54c27e', + shiftNumber: 'G7ZK39', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-30T07:00:00.000Z', + end: '2025-01-30T16:00:00.000Z', + startTime: '2025-01-30T07:00:00.000Z', + endTime: '2025-01-30T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'b220e910-d32c-4a9b-be2a-8034c7db2af0', + shiftNumber: 'PQ4SNZ', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-30T07:00:00.000Z', + end: '2025-01-30T16:00:00.000Z', + startTime: '2025-01-30T07:00:00.000Z', + endTime: '2025-01-30T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'LPN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '5a7b1fb3-3067-49d4-a351-00466124b459', + shiftNumber: '3C96Z4', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-30T07:00:00.000Z', + end: '2025-01-30T16:00:00.000Z', + startTime: '2025-01-30T07:00:00.000Z', + endTime: '2025-01-30T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'CNA', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: 'b2557c18-7e11-4887-85a2-902c49dd2c2b', + shiftNumber: '3UPYKY', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-31T07:00:00.000Z', + end: '2025-01-31T16:00:00.000Z', + startTime: '2025-01-31T07:00:00.000Z', + endTime: '2025-01-31T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '646900d4-7de2-464d-9fce-7e1e239ce81a', + shiftNumber: '44U4Z3', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-31T07:00:00.000Z', + end: '2025-01-31T16:00:00.000Z', + startTime: '2025-01-31T07:00:00.000Z', + endTime: '2025-01-31T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, + { + id: '3241088d-6b38-42d8-9aea-a80a321857e1', + shiftNumber: 'B6LBB6', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: 'open', + start: '2025-01-31T07:00:00.000Z', + end: '2025-01-31T16:00:00.000Z', + startTime: '2025-01-31T07:00:00.000Z', + endTime: '2025-01-31T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, { id: '12fc3bb3-b4c4-4f72-ad14-cde19136761e', shiftNumber: 'QWXRNK', @@ -222,26 +1002,27 @@ export const shifts = [ caregiver: null, }, { - id: '7e89d354-8be5-486e-9504-aedd60cd6052', - shiftNumber: 'PQNZXU', + id: 'c8fb63ca-0280-4fcd-b4a6-10da8d246753', + shiftNumber: '9KU9LY', title: '', - tooltip: '01/09 6:00 PM to 01/10 6:00 PM', - resourceId: '00662784-c9ee-4ff4-ae6b-397562a15b1c', - start: '2025-01-09T17:00:00.000Z', - end: '2025-01-10T17:00:00.000Z', - startTime: '2025-01-09T17:00:00.000Z', - endTime: '2025-01-10T17:00:00.000Z', + tooltip: '8:00 AM to 5:00 PM', + resourceId: '08ddd8d8-5946-476f-bc3e-f9b20906ff82', + start: '2025-01-09T07:00:00.000Z', + end: '2025-01-09T16:00:00.000Z', + startTime: '2025-01-09T07:00:00.000Z', + endTime: '2025-01-09T16:00:00.000Z', status: 'Expired', statusObj: { label: 'Expired', bgColor: '#ACACAC', color: 'black', }, + disciplineName: 'RN', caregiver: null, }, { - id: 'c8fb63ca-0280-4fcd-b4a6-10da8d246753', - shiftNumber: '9KU9LY', + id: 'ce7e8b1e-2c68-4968-977b-5ffdbde3f595', + shiftNumber: 'H4KYD5', title: '', tooltip: '8:00 AM to 5:00 PM', resourceId: '08ddd8d8-5946-476f-bc3e-f9b20906ff82', @@ -255,12 +1036,12 @@ export const shifts = [ bgColor: '#ACACAC', color: 'black', }, - disciplineName: 'RN', + disciplineName: 'LPN', caregiver: null, }, { - id: 'ce7e8b1e-2c68-4968-977b-5ffdbde3f595', - shiftNumber: 'H4KYD5', + id: '8f4beba6-181b-4420-82fe-f16728de3450', + shiftNumber: 'UFW92Y', title: '', tooltip: '8:00 AM to 5:00 PM', resourceId: '08ddd8d8-5946-476f-bc3e-f9b20906ff82', @@ -274,7 +1055,7 @@ export const shifts = [ bgColor: '#ACACAC', color: 'black', }, - disciplineName: 'LPN', + disciplineName: 'CNA', caregiver: null, }, { @@ -1797,4 +2578,24 @@ export const shifts = [ numberOfApplicants: 0, caregiver: null, }, + { + id: '3241088d-6b38-42d8-9aea-a80a321857e1', + shiftNumber: 'B6LBB6', + title: '', + tooltip: '8:00 AM to 5:00 PM', + resourceId: '00662784-c9ee-4ff4-ae6b-397562a15b1c', + start: '2025-01-31T07:00:00.000Z', + end: '2025-01-31T16:00:00.000Z', + startTime: '2025-01-31T07:00:00.000Z', + endTime: '2025-01-31T16:00:00.000Z', + status: 'Open', + statusObj: { + label: 'Open', + bgColor: '#E6E6E6', + color: 'black', + }, + disciplineName: 'RN', + numberOfApplicants: 0, + caregiver: null, + }, ] diff --git a/src/Calendar.js b/src/Calendar.js index 1f1b3c200..2e713c1f6 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -1047,8 +1047,13 @@ class Calendar extends React.Component { setFetchingMoreEvents = ({ isFetchingMoreEvents, dateTriggeringShowMore, + resourceTriggeringPopup, }) => { - this.setState({ isFetchingMoreEvents, dateTriggeringShowMore }) + this.setState({ + isFetchingMoreEvents, + dateTriggeringShowMore, + resourceTriggeringPopup, + }) } getView = () => { diff --git a/src/DateContentRow.js b/src/DateContentRow.js index d28022de7..5b6431a97 100644 --- a/src/DateContentRow.js +++ b/src/DateContentRow.js @@ -126,6 +126,7 @@ class DateContentRow extends React.Component { isPopupOpen, loadingMore, dateTriggeringShowMore, + triggeredLoadingMore, } = this.props if (renderForMeasure) return this.renderDummy() @@ -199,6 +200,7 @@ class DateContentRow extends React.Component { onShowMore={this.handleShowMore} loadingMore={loadingMore} dateTriggeringShowMore={dateTriggeringShowMore} + triggeredLoadingMore={triggeredLoadingMore} {...eventRowProps} /> )} @@ -240,6 +242,7 @@ DateContentRow.propTypes = { isAllDay: PropTypes.bool, isPopupOpen: PropTypes.bool, loadingMore: PropTypes.bool, + triggeredLoadingMore: PropTypes.bool, dateTriggeringShowMore: PropTypes.instanceOf(Date), accessors: PropTypes.object.isRequired, diff --git a/src/EventEndingRow.js b/src/EventEndingRow.js index c87986e13..cf6940574 100644 --- a/src/EventEndingRow.js +++ b/src/EventEndingRow.js @@ -81,6 +81,7 @@ class EventEndingRow extends React.Component { components, loadingMore, dateTriggeringShowMore, + triggeredLoadingMore, } = this.props const events = slotMetrics.getEventsForSlot(slot) const remainingEvents = eventsInSlot(segments, slot) @@ -114,7 +115,7 @@ class EventEndingRow extends React.Component { className={clsx('rbc-button-link', 'rbc-show-more')} onClick={(e) => this.showMore(slot, e)} > - {loadingMore && isSameDate + {loadingMore && isSameDate && triggeredLoadingMore ? 'Loading...' : localizer.messages.showMore(count, remainingEvents, events)} diff --git a/src/Month.js b/src/Month.js index 879db4d52..ba7afbeea 100644 --- a/src/Month.js +++ b/src/Month.js @@ -129,6 +129,8 @@ class MonthView extends React.Component { isPopupOpen, isFetchingMoreEvents, dateTriggeringShowMore, + resourceId, + resourceTriggeringPopup, } = this.props const { needLimitMeasure, rowLimit } = this.state @@ -175,6 +177,7 @@ class MonthView extends React.Component { isPopupOpen={isPopupOpen} loadingMore={isFetchingMoreEvents} dateTriggeringShowMore={dateTriggeringShowMore} + triggeredLoadingMore={resourceId === resourceTriggeringPopup} /> ) } @@ -347,6 +350,7 @@ class MonthView extends React.Component { setFetchingMoreEvents({ isFetchingMoreEvents: true, dateTriggeringShowMore: date, + resourceTriggeringPopup: resourceId, }) events = await getMoreEvents(date) } else { diff --git a/src/TimeGrid.js b/src/TimeGrid.js index 8b0b7ff7e..7b551f1dd 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -108,6 +108,7 @@ export default class TimeGrid extends Component { setFetchingMoreEvents({ isFetchingMoreEvents: true, dateTriggeringShowMore: date, + resourceTriggeringPopup: resourceId, }) events = await getMoreEvents(date) } else { @@ -312,6 +313,7 @@ export default class TimeGrid extends Component { hideGutter={this.props.isWeekGrouping} loadingMore={isFetchingMoreEvents} dateTriggeringShowMore={dateTriggeringShowMore} + triggeredLoadingMore={resourceId === resourceTriggeringPopup} isPopupOpen={isPopupOpen} isGrouped={isGrouped} /> diff --git a/src/TimeGridHeader.js b/src/TimeGridHeader.js index 51961cecb..0f11c841e 100644 --- a/src/TimeGridHeader.js +++ b/src/TimeGridHeader.js @@ -75,6 +75,7 @@ class TimeGridHeader extends React.Component { maxRows, loadingMore, dateTriggeringShowMore, + triggeredLoadingMore, isPopupOpen, isGrouped, } = this.props @@ -111,6 +112,7 @@ class TimeGridHeader extends React.Component { resizable={resizable} loadingMore={loadingMore} dateTriggeringShowMore={dateTriggeringShowMore} + triggeredLoadingMore={triggeredLoadingMore} isPopupOpen={isPopupOpen} /> ) @@ -135,6 +137,7 @@ class TimeGridHeader extends React.Component { loadingMore, isGrouped, dateTriggeringShowMore, + triggeredLoadingMore, components: { timeGutterHeader: TimeGutterHeader, resourceHeader: ResourceHeaderComponent = ResourceHeader, @@ -216,6 +219,7 @@ class TimeGridHeader extends React.Component { resizable={resizable} loadingMore={loadingMore} dateTriggeringShowMore={dateTriggeringShowMore} + triggeredLoadingMore={triggeredLoadingMore} isPopupOpen={isPopupOpen} /> @@ -250,6 +254,7 @@ TimeGridHeader.propTypes = { isGrouped: PropTypes.bool, isPopupOpen: PropTypes.bool, loadingMore: PropTypes.bool, + triggeredLoadingMore: PropTypes.bool, dateTriggeringShowMore: PropTypes.instanceOf(Date), onSelectSlot: PropTypes.func, diff --git a/src/sass/month.scss b/src/sass/month.scss index 4f3087bc3..d161edb7f 100644 --- a/src/sass/month.scss +++ b/src/sass/month.scss @@ -123,7 +123,7 @@ border-bottom: 1px solid #e5e5e5; margin: -10px -10px 5px -10px; padding: 2px 10px; - height: 28px; + height: 32px; display: flex; align-items: center; } diff --git a/src/sass/time-grid.scss b/src/sass/time-grid.scss index 943c714bc..7e54dc133 100644 --- a/src/sass/time-grid.scss +++ b/src/sass/time-grid.scss @@ -51,7 +51,7 @@ .rbc-row { box-sizing: border-box; - min-height: 20px; + min-height: 36px; } } diff --git a/stories/props/grouping.stories.js b/stories/props/grouping.stories.js index c17ab4d13..a223e294f 100644 --- a/stories/props/grouping.stories.js +++ b/stories/props/grouping.stories.js @@ -93,12 +93,12 @@ const getMoreEvents = (date) => { console.log({ date }) return new Promise((resolve) => { setTimeout(() => { - resolve(shifts.map((shift) => formatEvent(shift))) - }, 5000) + resolve(shifts.map(formatEvent).slice(0, 50)) + }, 3000) }) } -const events = shifts.map((shift) => formatEvent(shift)) +const events = shifts.map(formatEvent) const Template = (args) => { const [view, setView] = React.useState(Views.MONTH)