diff --git a/src/extensions/components/registration/agencySelection/AgencySelection.tsx b/src/extensions/components/registration/agencySelection/AgencySelection.tsx index 760945f18..1a375e5b4 100644 --- a/src/extensions/components/registration/agencySelection/AgencySelection.tsx +++ b/src/extensions/components/registration/agencySelection/AgencySelection.tsx @@ -66,6 +66,7 @@ export const AgencySelection: VFC<{ onNextClick={onNextClick} zipcode={headlineZipcode} results={agencies} + fallbackUrl={registrationData?.mainTopic?.fallbackUrl} /> ); diff --git a/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx b/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx index 9344d56b4..5c3b43f11 100644 --- a/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx +++ b/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx @@ -24,8 +24,6 @@ import { useTranslation } from 'react-i18next'; import { RegistrationContext, RegistrationData } from '../../../../globalState'; import { AgencyDataInterface } from '../../../../globalState/interfaces'; import { AgencyLanguages } from './AgencyLanguages'; -import { parsePlaceholderString } from '../../../../utils/parsePlaceholderString'; -import { useAppConfig } from '../../../../hooks/useAppConfig'; import { MetaInfo } from '../metaInfo/MetaInfo'; import { REGISTRATION_DATA_VALIDATION } from '../registrationDataValidation'; import { UrlParamsContext } from '../../../../globalState/provider/UrlParamsProvider'; @@ -36,6 +34,7 @@ interface AgencySelectionResultsProps { zipcode?: string; results?: AgencyDataInterface[]; nextStepUrl: string; + fallbackUrl: string; onNextClick(): void; } @@ -44,10 +43,10 @@ export const AgencySelectionResults = ({ zipcode, results, nextStepUrl, + fallbackUrl, onNextClick }: AgencySelectionResultsProps) => { const { t } = useTranslation(); - const settings = useAppConfig(); const { setDisabledNextButton, registrationData } = useContext(RegistrationContext); const { consultant: preselectedConsultant } = useContext(UrlParamsContext); @@ -145,17 +144,10 @@ export const AgencySelectionResults = ({ startIcon={} target="_blank" component={Link} - // TODO: Add fallback URL from Tenant href={ - settings?.postcodeFallbackUrl - ? parsePlaceholderString( - settings.postcodeFallbackUrl, - { - url: 'https://fallbackURL.de', - postcode: zipcode - } - ) - : 'https://fallbackURL.de' + fallbackUrl + ? `${fallbackUrl}${zipcode}/` + : 'https://www.diakonie.de' } > {t('registration.agency.noresult.label')} diff --git a/src/globalState/interfaces/TopicsDataInterface.ts b/src/globalState/interfaces/TopicsDataInterface.ts index 334e681e2..c85efac04 100644 --- a/src/globalState/interfaces/TopicsDataInterface.ts +++ b/src/globalState/interfaces/TopicsDataInterface.ts @@ -7,6 +7,7 @@ export interface TopicsDataInterface { status: string; createDate: string; updateDate: string; + fallbackUrl: string; titles: { short: string; long: string;