From 3636bfa70364aa796c8b3c759e81fee41a14a0c4 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Wed, 23 Apr 2025 17:28:39 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20display=20recording=20exp?= =?UTF-8?q?iration=20status=20in=20frontend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add recording expiration information to frontend interface, showing number of days until expiration or indicating permanent status. For expired recordings, display the date since which content has been unavailable. Improves transparency about content lifecycle. --- src/frontend/src/api/useConfig.ts | 1 + .../features/recording/api/fetchRecording.ts | 2 ++ .../recording/routes/RecordingDownload.tsx | 23 +++++++++++++++++++ src/frontend/src/locales/de/recording.json | 5 ++++ src/frontend/src/locales/en/recording.json | 7 +++++- src/frontend/src/locales/fr/recording.json | 7 +++++- src/frontend/src/locales/nl/recording.json | 7 +++++- 7 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/api/useConfig.ts b/src/frontend/src/api/useConfig.ts index 825914a2..205a333e 100644 --- a/src/frontend/src/api/useConfig.ts +++ b/src/frontend/src/api/useConfig.ts @@ -16,6 +16,7 @@ export interface ApiConfig { recording?: { is_enabled?: boolean available_modes?: RecordingMode[] + expiration_days?: number } } diff --git a/src/frontend/src/features/recording/api/fetchRecording.ts b/src/frontend/src/features/recording/api/fetchRecording.ts index e8c9dfe4..594db12b 100644 --- a/src/frontend/src/features/recording/api/fetchRecording.ts +++ b/src/frontend/src/features/recording/api/fetchRecording.ts @@ -9,6 +9,8 @@ export type RecordingApi = { key: string mode: RecordingMode status: RecordingStatus + is_expired: boolean + expired_at: string } export const fetchRecording = ({ recordingId }: { recordingId?: string }) => { diff --git a/src/frontend/src/features/recording/routes/RecordingDownload.tsx b/src/frontend/src/features/recording/routes/RecordingDownload.tsx index b72f5eb6..a800f066 100644 --- a/src/frontend/src/features/recording/routes/RecordingDownload.tsx +++ b/src/frontend/src/features/recording/routes/RecordingDownload.tsx @@ -13,9 +13,11 @@ import { ErrorScreen } from '@/components/ErrorScreen' import { LoadingScreen } from '@/components/LoadingScreen' import { fetchRecording } from '../api/fetchRecording' import { RecordingStatus } from '@/features/recording' +import { useConfig } from '@/api/useConfig' export const RecordingDownload = () => { const { t } = useTranslation('recording') + const { data: configData } = useConfig() const { recordingId } = useParams() const { isLoggedIn, isLoading: isAuthLoading } = useUser() @@ -50,6 +52,17 @@ export const RecordingDownload = () => { return } + if (data.is_expired) { + return ( + + ) + } + return ( @@ -74,6 +87,16 @@ export const RecordingDownload = () => { }), }} /> + + {configData?.recording?.expiration_days && ( + <> + {' '} + {t('success.expiration', { + expiration_days: configData?.recording?.expiration_days, + })} + + )} + {{room}} from {{created_at}}.", + "expiration": "Attention, this recording will expire after {{expiration_days}} day(s).", "button": "Download" } } diff --git a/src/frontend/src/locales/fr/recording.json b/src/frontend/src/locales/fr/recording.json index 4228afba..0032ef40 100644 --- a/src/frontend/src/locales/fr/recording.json +++ b/src/frontend/src/locales/fr/recording.json @@ -1,7 +1,11 @@ { "error": { "title": "Enregistrement indisponible", - "body": "Cet enregistrement est introuvable ou a été supprimé après sa période de validité de 7 jours." + "body": "Cet enregistrement est introuvable ou a été supprimé." + }, + "expired": { + "title": "Enregistrement expiré", + "body": "Cet enregistrement a été supprimé le {{date}}." }, "authentication": { "title": "Authentification requise", @@ -14,6 +18,7 @@ "success": { "title": "Votre enregistrement est prêt !", "body": "Enregistrement de la réunion {{room}} du {{created_at}}.", + "expiration": "Attention cet enregistrement expirera au bout de {{expiration_days}} jour(s).", "button": "Télécharger" } } diff --git a/src/frontend/src/locales/nl/recording.json b/src/frontend/src/locales/nl/recording.json index bda67456..43210731 100644 --- a/src/frontend/src/locales/nl/recording.json +++ b/src/frontend/src/locales/nl/recording.json @@ -1,7 +1,11 @@ { "error": { "title": "Opname niet beschikbaar", - "body": "Deze opname is niet gevonden of is verwijderd na de geldigheidsperiode van 7 dagen." + "body": "Deze opname is niet gevonden of is verwijderd." + }, + "expired": { + "title": "Opname verlopen", + "body": "Deze opname is verwijderd op {{date}}." }, "authentication": { "title": "Authenticatie vereist", @@ -14,6 +18,7 @@ "success": { "title": "Je opname is klaar!", "body": "Opname van de vergadering {{room}} op {{created_at}}.", + "expiration": "Let op, deze opname verloopt na {{expiration_days}} dag(en).", "button": "Downloaden" } }