🌐(frontend) remove hardcoded DINUM-specific URLs from support forms

Replace instance-specific URLs with configurable values to make the
application more generic and reusable for other deployments.
This commit is contained in:
lebaudantoine
2025-06-02 22:16:24 +02:00
committed by aleb_the_flash
parent ba286724f3
commit c82168b6c0
12 changed files with 64 additions and 41 deletions

View File

@@ -330,6 +330,9 @@ class Base(Configuration):
"use_proconnect_button": values.BooleanValue( "use_proconnect_button": values.BooleanValue(
False, environ_name="FRONTEND_USE_PROCONNECT_BUTTON", environ_prefix=None False, environ_name="FRONTEND_USE_PROCONNECT_BUTTON", environ_prefix=None
), ),
"transcript": values.DictValue(
{}, environ_name="FRONTEND_TRANSCRIPT", environ_prefix=None
),
} }
# Mail # Mail

View File

@@ -10,10 +10,16 @@ export interface ApiConfig {
} }
support?: { support?: {
id: string id: string
help_article_transcript: string
help_article_recording: string
help_article_more_tools: string
} }
feedback: { feedback: {
url: string url: string
} }
transcript: {
form_beta_users: string
}
silence_livekit_debug_logs?: boolean silence_livekit_debug_logs?: boolean
is_silent_login_enabled?: boolean is_silent_login_enabled?: boolean
custom_css_url?: string custom_css_url?: string

View File

@@ -8,7 +8,7 @@ import { Button, LinkButton } from '@/primitives'
import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react' import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react'
import { useState } from 'react' import { useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { BETA_USERS_FORM_URL } from '@/utils/constants' import { useConfig } from '@/api/useConfig'
const Heading = styled('h2', { const Heading = styled('h2', {
base: { base: {
@@ -171,6 +171,8 @@ export const IntroSlider = () => {
const { t } = useTranslation('home', { keyPrefix: 'introSlider' }) const { t } = useTranslation('home', { keyPrefix: 'introSlider' })
const NUMBER_SLIDES = SLIDES.length const NUMBER_SLIDES = SLIDES.length
const { data } = useConfig()
return ( return (
<Container> <Container>
<div <div
@@ -203,7 +205,7 @@ export const IntroSlider = () => {
<Body>{t(`${slide.key}.body`)}</Body> <Body>{t(`${slide.key}.body`)}</Body>
{slide.isAvailableInBeta && ( {slide.isAvailableInBeta && (
<LinkButton <LinkButton
href={BETA_USERS_FORM_URL} href={data?.transcript.form_beta_users}
target="_blank" target="_blank"
tooltip={t('beta.tooltip')} tooltip={t('beta.tooltip')}
variant={'primary'} variant={'primary'}

View File

@@ -14,7 +14,6 @@ import { useEffect, useMemo, useState } from 'react'
import { ConnectionState, RoomEvent } from 'livekit-client' import { ConnectionState, RoomEvent } from 'livekit-client'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { RecordingStatus, recordingStore } from '@/stores/recording' import { RecordingStatus, recordingStore } from '@/stores/recording'
import { CRISP_HELP_ARTICLE_RECORDING } from '@/utils/constants'
import { import {
NotificationType, NotificationType,
@@ -24,8 +23,10 @@ import {
import posthog from 'posthog-js' import posthog from 'posthog-js'
import { useSnapshot } from 'valtio/index' import { useSnapshot } from 'valtio/index'
import { Spinner } from '@/primitives/Spinner' import { Spinner } from '@/primitives/Spinner'
import { useConfig } from '@/api/useConfig'
export const ScreenRecordingSidePanel = () => { export const ScreenRecordingSidePanel = () => {
const { data } = useConfig()
const [isLoading, setIsLoading] = useState(false) const [isLoading, setIsLoading] = useState(false)
const recordingSnap = useSnapshot(recordingStore) const recordingSnap = useSnapshot(recordingStore)
const { t } = useTranslation('rooms', { keyPrefix: 'screenRecording' }) const { t } = useTranslation('rooms', { keyPrefix: 'screenRecording' })
@@ -199,9 +200,11 @@ export const ScreenRecordingSidePanel = () => {
})} })}
> >
{t('start.body')} <br />{' '} {t('start.body')} <br />{' '}
<A href={CRISP_HELP_ARTICLE_RECORDING} target="_blank"> {data?.support?.help_article_recording && (
{t('start.linkMore')} <A href={data.support.help_article_recording} target="_blank">
</A> {t('start.linkMore')}
</A>
)}
</Text> </Text>
<Button <Button
isDisabled={isDisabled} isDisabled={isDisabled}

View File

@@ -16,10 +16,6 @@ import { useEffect, useMemo, useState } from 'react'
import { ConnectionState, RoomEvent } from 'livekit-client' import { ConnectionState, RoomEvent } from 'livekit-client'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { RecordingStatus, recordingStore } from '@/stores/recording' import { RecordingStatus, recordingStore } from '@/stores/recording'
import {
BETA_USERS_FORM_URL,
CRISP_HELP_ARTICLE_TRANSCRIPT,
} from '@/utils/constants'
import { FeatureFlags } from '@/features/analytics/enums' import { FeatureFlags } from '@/features/analytics/enums'
import { import {
NotificationType, NotificationType,
@@ -29,8 +25,11 @@ import {
import posthog from 'posthog-js' import posthog from 'posthog-js'
import { useSnapshot } from 'valtio/index' import { useSnapshot } from 'valtio/index'
import { Spinner } from '@/primitives/Spinner' import { Spinner } from '@/primitives/Spinner'
import { useConfig } from '@/api/useConfig'
export const TranscriptSidePanel = () => { export const TranscriptSidePanel = () => {
const { data } = useConfig()
const [isLoading, setIsLoading] = useState(false) const [isLoading, setIsLoading] = useState(false)
const { t } = useTranslation('rooms', { keyPrefix: 'transcript' }) const { t } = useTranslation('rooms', { keyPrefix: 'transcript' })
@@ -161,9 +160,14 @@ export const TranscriptSidePanel = () => {
> >
{t('notAdminOrOwner.body')} {t('notAdminOrOwner.body')}
<br /> <br />
<A href={CRISP_HELP_ARTICLE_TRANSCRIPT} target="_blank"> {data?.support?.help_article_transcript && (
{t('notAdminOrOwner.linkMore')} <A
</A> href={data.support.help_article_transcript}
target="_blank"
>
{t('notAdminOrOwner.linkMore')}
</A>
)}
</Text> </Text>
</> </>
) : ( ) : (
@@ -180,14 +184,19 @@ export const TranscriptSidePanel = () => {
})} })}
> >
{t('beta.body')}{' '} {t('beta.body')}{' '}
<A href={CRISP_HELP_ARTICLE_TRANSCRIPT} target="_blank"> {data?.support?.help_article_transcript && (
{t('start.linkMore')} <A
</A> href={data.support.help_article_transcript}
target="_blank"
>
{t('start.linkMore')}
</A>
)}
</Text> </Text>
<LinkButton <LinkButton
size="sm" size="sm"
variant="tertiary" variant="tertiary"
href={BETA_USERS_FORM_URL} href={data?.transcript.form_beta_users}
target="_blank" target="_blank"
> >
{t('beta.button')} {t('beta.button')}
@@ -263,9 +272,14 @@ export const TranscriptSidePanel = () => {
})} })}
> >
{t('start.body')} <br />{' '} {t('start.body')} <br />{' '}
<A href={CRISP_HELP_ARTICLE_TRANSCRIPT} target="_blank"> {data?.support?.help_article_transcript && (
{t('start.linkMore')} <A
</A> href={data.support.help_article_transcript}
target="_blank"
>
{t('start.linkMore')}
</A>
)}
</Text> </Text>
<Button <Button
isDisabled={isDisabled} isDisabled={isDisabled}

View File

@@ -2,7 +2,6 @@ import { A, Div, Text } from '@/primitives'
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { Button as RACButton } from 'react-aria-components' import { Button as RACButton } from 'react-aria-components'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { CRISP_HELP_ARTICLE_MORE_TOOLS } from '@/utils/constants'
import { ReactNode } from 'react' import { ReactNode } from 'react'
import { RiFileTextFill, RiLiveFill } from '@remixicon/react' import { RiFileTextFill, RiLiveFill } from '@remixicon/react'
import { SubPanelId, useSidePanel } from '../hooks/useSidePanel' import { SubPanelId, useSidePanel } from '../hooks/useSidePanel'
@@ -15,6 +14,7 @@ import {
useIsRecordingActive, useIsRecordingActive,
} from '@/features/recording' } from '@/features/recording'
import { FeatureFlags } from '@/features/analytics/enums' import { FeatureFlags } from '@/features/analytics/enums'
import { useConfig } from '@/api/useConfig'
export interface ToolsButtonProps { export interface ToolsButtonProps {
icon: ReactNode icon: ReactNode
@@ -113,6 +113,7 @@ const ToolButton = ({
} }
export const Tools = () => { export const Tools = () => {
const { data } = useConfig()
const { openTranscript, openScreenRecording, activeSubPanelId } = const { openTranscript, openScreenRecording, activeSubPanelId } =
useSidePanel() useSidePanel()
const { t } = useTranslation('rooms', { keyPrefix: 'moreTools' }) const { t } = useTranslation('rooms', { keyPrefix: 'moreTools' })
@@ -160,10 +161,14 @@ export const Tools = () => {
margin="md" margin="md"
> >
{t('body')}{' '} {t('body')}{' '}
<A href={CRISP_HELP_ARTICLE_MORE_TOOLS} target="_blank"> {data?.support?.help_article_more_tools && (
{t('moreLink')} <>
</A> <A href={data?.support?.help_article_more_tools} target="_blank">
. {t('moreLink')}
</A>
.
</>
)}
</Text> </Text>
{isTranscriptEnabled && ( {isTranscriptEnabled && (
<ToolButton <ToolButton

View File

@@ -192,7 +192,7 @@
"disclaimer": "Die Nachrichten sind nur für Teilnehmer zum Zeitpunkt des Sendens sichtbar. Alle Nachrichten werden am Ende des Anrufs gelöscht." "disclaimer": "Die Nachrichten sind nur für Teilnehmer zum Zeitpunkt des Sendens sichtbar. Alle Nachrichten werden am Ende des Anrufs gelöscht."
}, },
"moreTools": { "moreTools": {
"body": "Greifen Sie auf weitere Tools in Visio zu, um Ihre Meetings zu verbessern,", "body": "Greifen Sie auf weitere Tools in Visio zu, um Ihre Meetings zu verbessern.",
"moreLink": "mehr erfahren", "moreLink": "mehr erfahren",
"tools": { "tools": {
"transcript": { "transcript": {

View File

@@ -192,7 +192,7 @@
"disclaimer": "The messages are visible to participants only at the time they are sent. All messages are deleted at the end of the call." "disclaimer": "The messages are visible to participants only at the time they are sent. All messages are deleted at the end of the call."
}, },
"moreTools": { "moreTools": {
"body": "Access more tools in Visio to enhance your meetings,", "body": "Access more tools in Visio to enhance your meetings.",
"moreLink": "learn more", "moreLink": "learn more",
"tools": { "tools": {
"transcript": { "transcript": {

View File

@@ -192,7 +192,7 @@
"disclaimer": "Les messages sont visibles par les participants uniquement au moment de\nleur envoi. Tous les messages sont supprimés à la fin de l'appel." "disclaimer": "Les messages sont visibles par les participants uniquement au moment de\nleur envoi. Tous les messages sont supprimés à la fin de l'appel."
}, },
"moreTools": { "moreTools": {
"body": "Accèder à d'avantage d'outils dans Visio pour améliorer vos réunions,", "body": "Accèder à d'avantage d'outils dans Visio pour améliorer vos réunions.",
"moreLink": "en savoir plus", "moreLink": "en savoir plus",
"tools": { "tools": {
"transcript": { "transcript": {

View File

@@ -192,7 +192,7 @@
"disclaimer": "De berichten zijn alleen voor de deelnemers zichtbaar op het moment dat ze worden verzonden. Alle berichten worden verwijderd aan het einde van het gesprek." "disclaimer": "De berichten zijn alleen voor de deelnemers zichtbaar op het moment dat ze worden verzonden. Alle berichten worden verwijderd aan het einde van het gesprek."
}, },
"moreTools": { "moreTools": {
"body": "Toegang tot meer tools in Visio om je vergaderingen te verbeteren,", "body": "Toegang tot meer tools in Visio om je vergaderingen te verbeteren.",
"moreLink": "lees meer", "moreLink": "lees meer",
"tools": { "tools": {
"transcript": { "transcript": {

View File

@@ -1,11 +0,0 @@
export const BETA_USERS_FORM_URL =
'https://grist.numerique.gouv.fr/o/docs/forms/3fFfvJoTBEQ6ZiMi8zsQwX/17' as const
export const CRISP_HELP_ARTICLE_MORE_TOOLS =
'https://lasuite.crisp.help/fr/article/visio-tools-bvxj23' as const
export const CRISP_HELP_ARTICLE_TRANSCRIPT =
'https://lasuite.crisp.help/fr/article/visio-transcript-1sjq43x' as const
export const CRISP_HELP_ARTICLE_RECORDING =
'https://lasuite.crisp.help/fr/article/visio-enregistrement-wgc8o0' as const

View File

@@ -54,7 +54,8 @@ backend:
LIVEKIT_API_URL: https://livekit.127.0.0.1.nip.io/ LIVEKIT_API_URL: https://livekit.127.0.0.1.nip.io/
ALLOW_UNREGISTERED_ROOMS: False ALLOW_UNREGISTERED_ROOMS: False
FRONTEND_SILENCE_LIVEKIT_DEBUG: False FRONTEND_SILENCE_LIVEKIT_DEBUG: False
FRONTEND_SUPPORT: "{'id': '58ea6697-8eba-4492-bc59-ad6562585041'}" FRONTEND_SUPPORT: "{'id': '58ea6697-8eba-4492-bc59-ad6562585041', 'help_article_transcript': 'https://lasuite.crisp.help/fr/article/visio-transcript-1sjq43x', 'help_article_recording': 'https://lasuite.crisp.help/fr/article/visio-enregistrement-wgc8o0', 'help_article_more_tools': 'https://lasuite.crisp.help/fr/article/visio-tools-bvxj23'}"
FRONTEND_TRANSCRIPT: "{'form_beta_users': 'https://grist.numerique.gouv.fr/o/docs/forms/3fFfvJoTBEQ6ZiMi8zsQwX/17'}"
FRONTEND_FEEDBACK: "{'url': 'https://grist.numerique.gouv.fr/o/docs/cbMv4G7pLY3Z/USER-RESEARCH-or-LA-SUITE/f/26'}" FRONTEND_FEEDBACK: "{'url': 'https://grist.numerique.gouv.fr/o/docs/cbMv4G7pLY3Z/USER-RESEARCH-or-LA-SUITE/f/26'}"
AWS_S3_ENDPOINT_URL: http://minio.meet.svc.cluster.local:9000 AWS_S3_ENDPOINT_URL: http://minio.meet.svc.cluster.local:9000
AWS_S3_ACCESS_KEY_ID: meet AWS_S3_ACCESS_KEY_ID: meet