From b01ee571f6248ac3d49bb49de734fcbd1c7d871b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Camblor?= Date: Sat, 6 Apr 2024 15:05:55 +0200 Subject: [PATCH] #79 displaying *unknown* room capacity indicator so that we show an indicator on every talks within a timeslot, regardless if we got an indication (or not) fixup! #79 refactored room-capacity-indicator component in order to centralize level properties --- .../src/functions/http/event/roomStats.ts | 5 +- mobile/package-lock.json | 8 +- mobile/package.json | 2 +- .../rooms/RoomCapacityIndicator.vue | 189 ++++++++++++------ .../src/components/talk-card/ScheduleTalk.vue | 7 +- .../timeslots/TimeslotsIterator.vue | 33 ++- mobile/src/i18n/en/index.ts | 1 + mobile/src/i18n/i18n-types.ts | 8 + mobile/src/models/VoxxrinSchedule.ts | 44 +++- mobile/src/state/useCurrentClock.ts | 7 +- mobile/src/views/TalkDetailsPage.vue | 2 +- mobile/src/views/event/FavoritesPage.vue | 4 +- mobile/src/views/event/SchedulePage.vue | 6 +- shared/constants/shared-constants.utils.ts | 4 + 14 files changed, 227 insertions(+), 93 deletions(-) create mode 100644 shared/constants/shared-constants.utils.ts diff --git a/cloud/functions/src/functions/http/event/roomStats.ts b/cloud/functions/src/functions/http/event/roomStats.ts index 08358d66..6507c5fb 100644 --- a/cloud/functions/src/functions/http/event/roomStats.ts +++ b/cloud/functions/src/functions/http/event/roomStats.ts @@ -10,6 +10,7 @@ import {RoomsStats, RoomStats} from "../../../../../../shared/event-stats"; import {db} from "../../../firebase"; import {toValidFirebaseKey} from "../../../../../../shared/utilities/firebase.utils"; + import {TALK_COMPLETION_THRESHOLD} from "../../../../../../shared/constants/shared-constants.utils"; export async function provideRoomsStats(response: Response, pathParams: {eventId: string}, queryParams: {token: string}, body: { @@ -114,10 +115,6 @@ async function updateRoomStatsFor(params: { eventId: string, timeslottedTalks: T } function maxTalkCompletionTimestampToBeConsideredACandidateForCapacityFillingRatio(talk: TimeslottedTalk) { - // If room capacity is provided after 85% of current talk duration, it means it should - // be linked to next talk (this can happen when talk ending is earlier than expected) - const TALK_COMPLETION_THRESHOLD = 0.85 - const startTimestamp = Date.parse(talk.start) const talkDuration = Date.parse(talk.end) - startTimestamp return (startTimestamp + (TALK_COMPLETION_THRESHOLD * talkDuration)) diff --git a/mobile/package-lock.json b/mobile/package-lock.json index b580eddc..ca0f7302 100644 --- a/mobile/package-lock.json +++ b/mobile/package-lock.json @@ -26,7 +26,7 @@ "p-queue": "8.0.1", "swiper": "11.0.2", "temporal-polyfill": "0.1.1", - "ts-pattern": "4.2.2", + "ts-pattern": "5.1.0", "typesafe-i18n": "5.24.3", "vue": "3.3.4", "vue-router": "4.1.6", @@ -10501,9 +10501,9 @@ } }, "node_modules/ts-pattern": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-4.2.2.tgz", - "integrity": "sha512-qzJMo2pbkUJWusRH5o8xR+xogn6RmvViyUgwBFTtRENLse470clCGjHDf6haWGZ1AOmk8XkEohUoBW8Uut6Scg==" + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.1.0.tgz", + "integrity": "sha512-sULbgZDTXrcr6WMeuR8gPb+dvNN/fNpxE8GHfosFHPJRPuxHVNtGcEiiNuQa6nxu40/dY6xYdTJmc7MG3w8B5g==" }, "node_modules/tslib": { "version": "2.6.2", diff --git a/mobile/package.json b/mobile/package.json index 05ed4258..aae4d6b9 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -42,7 +42,7 @@ "p-queue": "8.0.1", "swiper": "11.0.2", "temporal-polyfill": "0.1.1", - "ts-pattern": "4.2.2", + "ts-pattern": "5.1.0", "typesafe-i18n": "5.24.3", "vue": "3.3.4", "vue-router": "4.1.6", diff --git a/mobile/src/components/rooms/RoomCapacityIndicator.vue b/mobile/src/components/rooms/RoomCapacityIndicator.vue index 271cb658..337e541f 100644 --- a/mobile/src/components/rooms/RoomCapacityIndicator.vue +++ b/mobile/src/components/rooms/RoomCapacityIndicator.vue @@ -1,20 +1,15 @@