🚸(frontend) clarify transcription/recording access restrictions in UI
Make it explicit that non-owner/admin users cannot enable transcription. Beta feature behavior that may change in future versions.
This commit is contained in:
committed by
aleb_the_flash
parent
b618b2347f
commit
29a46a413e
@@ -10,6 +10,7 @@ import {
|
|||||||
useIsRecordingTransitioning,
|
useIsRecordingTransitioning,
|
||||||
useStartRecording,
|
useStartRecording,
|
||||||
useStopRecording,
|
useStopRecording,
|
||||||
|
useHasFeatureWithoutAdminRights,
|
||||||
} from '../index'
|
} from '../index'
|
||||||
import { useEffect, useMemo, useState } from 'react'
|
import { useEffect, useMemo, useState } from 'react'
|
||||||
import { ConnectionState, RoomEvent } from 'livekit-client'
|
import { ConnectionState, RoomEvent } from 'livekit-client'
|
||||||
@@ -42,6 +43,12 @@ export const TranscriptSidePanel = () => {
|
|||||||
RecordingMode.Transcript,
|
RecordingMode.Transcript,
|
||||||
FeatureFlags.Transcript
|
FeatureFlags.Transcript
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const hasFeatureWithoutAdminRights = useHasFeatureWithoutAdminRights(
|
||||||
|
RecordingMode.Transcript,
|
||||||
|
FeatureFlags.Transcript
|
||||||
|
)
|
||||||
|
|
||||||
const roomId = useRoomId()
|
const roomId = useRoomId()
|
||||||
|
|
||||||
const { mutateAsync: startRecordingRoom, isPending: isPendingToStart } =
|
const { mutateAsync: startRecordingRoom, isPending: isPendingToStart } =
|
||||||
@@ -134,30 +141,54 @@ export const TranscriptSidePanel = () => {
|
|||||||
/>
|
/>
|
||||||
{!hasTranscriptAccess ? (
|
{!hasTranscriptAccess ? (
|
||||||
<>
|
<>
|
||||||
<Text>{t('beta.heading')}</Text>
|
{hasFeatureWithoutAdminRights ? (
|
||||||
<Text
|
<>
|
||||||
variant="note"
|
<Text>{t('notAdminOrOwner.heading')}</Text>
|
||||||
wrap={'pretty'}
|
<Text
|
||||||
centered
|
variant="note"
|
||||||
className={css({
|
wrap="balance"
|
||||||
textStyle: 'sm',
|
centered
|
||||||
marginBottom: '2.5rem',
|
className={css({
|
||||||
marginTop: '0.25rem',
|
textStyle: 'sm',
|
||||||
})}
|
marginBottom: '2.5rem',
|
||||||
>
|
marginTop: '0.25rem',
|
||||||
{t('beta.body')}{' '}
|
})}
|
||||||
<A href={CRISP_HELP_ARTICLE_TRANSCRIPT} target="_blank">
|
>
|
||||||
{t('start.linkMore')}
|
{t('notAdminOrOwner.body')}
|
||||||
</A>
|
<br />
|
||||||
</Text>
|
<A href={CRISP_HELP_ARTICLE_TRANSCRIPT} target="_blank">
|
||||||
<LinkButton
|
{t('notAdminOrOwner.linkMore')}
|
||||||
size="sm"
|
</A>
|
||||||
variant="tertiary"
|
</Text>
|
||||||
href={BETA_USERS_FORM_URL}
|
</>
|
||||||
target="_blank"
|
) : (
|
||||||
>
|
<>
|
||||||
{t('beta.button')}
|
<Text>{t('beta.heading')}</Text>
|
||||||
</LinkButton>
|
<Text
|
||||||
|
variant="note"
|
||||||
|
wrap={'pretty'}
|
||||||
|
centered
|
||||||
|
className={css({
|
||||||
|
textStyle: 'sm',
|
||||||
|
marginBottom: '2.5rem',
|
||||||
|
marginTop: '0.25rem',
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{t('beta.body')}{' '}
|
||||||
|
<A href={CRISP_HELP_ARTICLE_TRANSCRIPT} target="_blank">
|
||||||
|
{t('start.linkMore')}
|
||||||
|
</A>
|
||||||
|
</Text>
|
||||||
|
<LinkButton
|
||||||
|
size="sm"
|
||||||
|
variant="tertiary"
|
||||||
|
href={BETA_USERS_FORM_URL}
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
{t('beta.button')}
|
||||||
|
</LinkButton>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { useFeatureFlagEnabled } from 'posthog-js/react'
|
||||||
|
import { useIsAnalyticsEnabled } from '@/features/analytics/hooks/useIsAnalyticsEnabled'
|
||||||
|
import { RecordingMode } from '../types'
|
||||||
|
import { useIsRecordingModeEnabled } from './useIsRecordingModeEnabled'
|
||||||
|
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
|
||||||
|
import { FeatureFlags } from '@/features/analytics/enums'
|
||||||
|
|
||||||
|
export const useHasFeatureWithoutAdminRights = (
|
||||||
|
mode: RecordingMode,
|
||||||
|
featureFlag: FeatureFlags
|
||||||
|
) => {
|
||||||
|
const featureEnabled = useFeatureFlagEnabled(featureFlag)
|
||||||
|
const isAnalyticsEnabled = useIsAnalyticsEnabled()
|
||||||
|
const isRecordingModeEnabled = useIsRecordingModeEnabled(mode)
|
||||||
|
const isAdminOrOwner = useIsAdminOrOwner()
|
||||||
|
|
||||||
|
return (
|
||||||
|
(featureEnabled || !isAnalyticsEnabled) &&
|
||||||
|
isRecordingModeEnabled &&
|
||||||
|
!isAdminOrOwner
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ export { useIsRecordingModeEnabled } from './hooks/useIsRecordingModeEnabled'
|
|||||||
export { useIsRecordingTransitioning } from './hooks/useIsRecordingTransitioning'
|
export { useIsRecordingTransitioning } from './hooks/useIsRecordingTransitioning'
|
||||||
export { useHasRecordingAccess } from './hooks/useHasRecordingAccess'
|
export { useHasRecordingAccess } from './hooks/useHasRecordingAccess'
|
||||||
export { useIsRecordingActive } from './hooks/useIsRecordingActive'
|
export { useIsRecordingActive } from './hooks/useIsRecordingActive'
|
||||||
|
export { useHasFeatureWithoutAdminRights } from './hooks/useHasFeatureWithoutAdminRights'
|
||||||
|
|
||||||
// api
|
// api
|
||||||
export { useStartRecording } from './api/startRecording'
|
export { useStartRecording } from './api/startRecording'
|
||||||
|
|||||||
@@ -223,6 +223,11 @@
|
|||||||
"loading": "Transkription wird gestartet",
|
"loading": "Transkription wird gestartet",
|
||||||
"linkMore": "Mehr erfahren"
|
"linkMore": "Mehr erfahren"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Zugriff eingeschränkt",
|
||||||
|
"body": "Aus Sicherheitsgründen kann nur der Ersteller oder ein Administrator des Meetings eine Transkription (Beta) starten.",
|
||||||
|
"linkMore": "Mehr erfahren"
|
||||||
|
},
|
||||||
"stop": {
|
"stop": {
|
||||||
"heading": "Transkription läuft...",
|
"heading": "Transkription läuft...",
|
||||||
"body": "Die Transkription deines Meetings läuft. Du erhältst das Ergebnis per E-Mail, sobald das Meeting beendet ist.",
|
"body": "Die Transkription deines Meetings läuft. Du erhältst das Ergebnis per E-Mail, sobald das Meeting beendet ist.",
|
||||||
@@ -254,6 +259,11 @@
|
|||||||
"loading": "Aufzeichnung wird gestartet",
|
"loading": "Aufzeichnung wird gestartet",
|
||||||
"linkMore": "Mehr erfahren"
|
"linkMore": "Mehr erfahren"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Zugriff eingeschränkt",
|
||||||
|
"body": "Aus Sicherheitsgründen kann nur der Ersteller oder ein Administrator des Meetings eine videoaufnahme (Beta) starten.",
|
||||||
|
"linkMore": "Mehr erfahren"
|
||||||
|
},
|
||||||
"stopping": {
|
"stopping": {
|
||||||
"heading": "Daten werden gespeichert…",
|
"heading": "Daten werden gespeichert…",
|
||||||
"body": "Sie können das Meeting verlassen, wenn Sie möchten; die Aufzeichnung wird automatisch beendet."
|
"body": "Sie können das Meeting verlassen, wenn Sie möchten; die Aufzeichnung wird automatisch beendet."
|
||||||
|
|||||||
@@ -223,6 +223,11 @@
|
|||||||
"loading": "Transcription starting",
|
"loading": "Transcription starting",
|
||||||
"linkMore": "Learn more"
|
"linkMore": "Learn more"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Restricted Access",
|
||||||
|
"body": "For security reasons, only the meeting creator or an admin can start a transcription (beta).",
|
||||||
|
"linkMore": "Learn more"
|
||||||
|
},
|
||||||
"stop": {
|
"stop": {
|
||||||
"heading": "Transcription in progress...",
|
"heading": "Transcription in progress...",
|
||||||
"body": "The transcription of your meeting is in progress. You will receive the result by email once the meeting is finished.",
|
"body": "The transcription of your meeting is in progress. You will receive the result by email once the meeting is finished.",
|
||||||
@@ -254,6 +259,11 @@
|
|||||||
"loading": "Recording starting",
|
"loading": "Recording starting",
|
||||||
"linkMore": "Learn more"
|
"linkMore": "Learn more"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Restricted Access",
|
||||||
|
"body": "For security reasons, only the meeting creator or an admin can start a recording (beta).",
|
||||||
|
"linkMore": "Learn more"
|
||||||
|
},
|
||||||
"stopping": {
|
"stopping": {
|
||||||
"heading": "Saving your data…",
|
"heading": "Saving your data…",
|
||||||
"body": "You can leave the meeting if you wish; the recording will finish automatically."
|
"body": "You can leave the meeting if you wish; the recording will finish automatically."
|
||||||
|
|||||||
@@ -223,6 +223,11 @@
|
|||||||
"loading": "Démarrage de la transcription",
|
"loading": "Démarrage de la transcription",
|
||||||
"linkMore": "En savoir plus"
|
"linkMore": "En savoir plus"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Accès restreint",
|
||||||
|
"body": "Pour des raisons de sécurité, seul le créateur ou un administrateur de la réunion peut lancer une transcription (beta).",
|
||||||
|
"linkMore": "En savoir plus"
|
||||||
|
},
|
||||||
"stop": {
|
"stop": {
|
||||||
"heading": "Transcription en cours …",
|
"heading": "Transcription en cours …",
|
||||||
"body": "La transcription de votre réunion est en cours. Vous recevrez le resultat par email une fois la réunion terminée.",
|
"body": "La transcription de votre réunion est en cours. Vous recevrez le resultat par email une fois la réunion terminée.",
|
||||||
@@ -254,6 +259,11 @@
|
|||||||
"loading": "Démarrage de l'enregistrement",
|
"loading": "Démarrage de l'enregistrement",
|
||||||
"linkMore": "En savoir plus"
|
"linkMore": "En savoir plus"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Accès restreint",
|
||||||
|
"body": "Pour des raisons de sécurité, seul le créateur ou un administrateur de la réunion peut lancer un enregistrement (beta).",
|
||||||
|
"linkMore": "En savoir plus"
|
||||||
|
},
|
||||||
"stopping": {
|
"stopping": {
|
||||||
"heading": "Sauvegarde de vos données…",
|
"heading": "Sauvegarde de vos données…",
|
||||||
"body": "Vous pouvez quitter la réunion si vous le souhaitez, la sauvegarde se terminera automatiquement."
|
"body": "Vous pouvez quitter la réunion si vous le souhaitez, la sauvegarde se terminera automatiquement."
|
||||||
|
|||||||
@@ -223,6 +223,11 @@
|
|||||||
"loading": "Transcriptie begint",
|
"loading": "Transcriptie begint",
|
||||||
"linkMore": "Meer informatie"
|
"linkMore": "Meer informatie"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Toegang beperkt",
|
||||||
|
"body": "Om veiligheidsredenen kan alleen de maker of een beheerder van de vergadering een transcriptie starten (beta).",
|
||||||
|
"linkMore": "Meer informatie"
|
||||||
|
},
|
||||||
"stop": {
|
"stop": {
|
||||||
"heading": "Transcriptie bezig...",
|
"heading": "Transcriptie bezig...",
|
||||||
"body": "De transcriptie van uw vergadering is bezig. U ontvangt het resultaat per e-mail zodra de vergadering is afgelopen.",
|
"body": "De transcriptie van uw vergadering is bezig. U ontvangt het resultaat per e-mail zodra de vergadering is afgelopen.",
|
||||||
@@ -254,6 +259,11 @@
|
|||||||
"loading": "Opname gestarten",
|
"loading": "Opname gestarten",
|
||||||
"linkMore": "Meer informatie"
|
"linkMore": "Meer informatie"
|
||||||
},
|
},
|
||||||
|
"notAdminOrOwner": {
|
||||||
|
"heading": "Toegang beperkt",
|
||||||
|
"body": "Om veiligheidsredenen kan alleen de maker of een beheerder van de vergadering een opname starten (beta).",
|
||||||
|
"linkMore": "Meer informatie"
|
||||||
|
},
|
||||||
"stopping": {
|
"stopping": {
|
||||||
"heading": "Uw gegevens worden opgeslagen…",
|
"heading": "Uw gegevens worden opgeslagen…",
|
||||||
"body": "U kunt de vergadering verlaten als u dat wilt; de opname wordt automatisch voltooid."
|
"body": "U kunt de vergadering verlaten als u dat wilt; de opname wordt automatisch voltooid."
|
||||||
|
|||||||
Reference in New Issue
Block a user