diff --git a/src/components/localeSwitch/LocaleSwitch.tsx b/src/components/localeSwitch/LocaleSwitch.tsx index a23ee1c54..12299a8e8 100644 --- a/src/components/localeSwitch/LocaleSwitch.tsx +++ b/src/components/localeSwitch/LocaleSwitch.tsx @@ -113,6 +113,7 @@ export const LocaleSwitch: React.FC = ({ height={iconSize} className="navigation__icon__filled" color="inherit" + style={{ width: 'auto', height: 'auto' }} /> )}{' '} diff --git a/src/components/localeSwitch/localeSwitch.styles.scss b/src/components/localeSwitch/localeSwitch.styles.scss index d21ec07c2..131aceda3 100644 --- a/src/components/localeSwitch/localeSwitch.styles.scss +++ b/src/components/localeSwitch/localeSwitch.styles.scss @@ -27,4 +27,8 @@ font-weight: $font-weight-medium; } } + + .select__input__menu-portal { + z-index: 1000; + } } diff --git a/src/components/sessionsListItem/SessionListItemComponent.tsx b/src/components/sessionsListItem/SessionListItemComponent.tsx index 856a8c908..ca288065b 100644 --- a/src/components/sessionsListItem/SessionListItemComponent.tsx +++ b/src/components/sessionsListItem/SessionListItemComponent.tsx @@ -95,7 +95,6 @@ export const SessionListItemComponent = ({ ALIAS_MESSAGE_TYPES.MASTER_KEY_LOST ); const [plainTextLastMessage, setPlainTextLastMessage] = useState(null); - const topicSession = activeSession.item?.topic as TopicSessionInterface; const { autoSelectPostcode } = consultingType?.registration || @@ -348,10 +347,6 @@ export const SessionListItemComponent = ({ sessionTopic = activeSession.user.username; } - const showConsultingType = - consultingType && !tenantData?.settings?.featureTopicsEnabled; - const zipCodeSlash = showConsultingType ? '/ ' : ''; - return (
) : (
- {topic?.name ? `${topic.name} ` : ''} - {activeSession.item.consultingType !== 1 && - !isAsker && + {!isAsker && !activeSession.isLive && !autoSelectPostcode - ? zipCodeSlash + activeSession.item.postcode + ? activeSession.item.postcode : null}
)} - {topicSession?.id !== undefined && topicSession.name && ( + {topic?.name && (
- {topicSession?.name} + {topic.name}
)}
diff --git a/src/extensions/components/legalPageWrapper/legalPageWrapper.styles.scss b/src/extensions/components/legalPageWrapper/legalPageWrapper.styles.scss index 58105e7de..e6c6cbaa4 100644 --- a/src/extensions/components/legalPageWrapper/legalPageWrapper.styles.scss +++ b/src/extensions/components/legalPageWrapper/legalPageWrapper.styles.scss @@ -6,6 +6,7 @@ } .template { + width: 100%; max-width: 700px; h2, diff --git a/src/extensions/components/registration/Registration.tsx b/src/extensions/components/registration/Registration.tsx index 6122531b6..5cc996499 100644 --- a/src/extensions/components/registration/Registration.tsx +++ b/src/extensions/components/registration/Registration.tsx @@ -32,7 +32,8 @@ import { registrationSessionStorageKey, RegistrationData, NotificationsContext, - NOTIFICATION_TYPE_ERROR + NOTIFICATION_TYPE_ERROR, + LocaleContext } from '../../../globalState'; import { GlobalComponentContext } from '../../../globalState/provider/GlobalComponentContext'; import { @@ -83,6 +84,7 @@ export const Registration = () => { } = useContext(RegistrationContext); const { consultant: preselectedConsultant } = useContext(UrlParamsContext); const { tenant } = useContext(TenantContext); + const { locale } = useContext(LocaleContext); const [stepData, setStepData] = useState>({}); const [redirectOverlayActive, setRedirectOverlayActive] = @@ -185,7 +187,7 @@ export const Registration = () => { agencyId: registrationData.agency.id.toString(), postcode: registrationData.zipcode, termsAccepted: 'true', - preferredLanguage: 'de', + preferredLanguage: locale || 'de', consultingType: registrationData.agency.consultingType, ...(preselectedConsultant ? { consultantId: preselectedConsultant?.consultantId } @@ -222,7 +224,8 @@ export const Registration = () => { settings.multitenancyWithSingleDomainEnabled, tenant, addNotification, - t + t, + locale ]); const stepPaths = useMemo( @@ -356,6 +359,11 @@ export const Registration = () => { disabled={disabledNextButton} variant="contained" onClick={onRegisterClick} + type={ + disabledNextButton + ? 'button' + : 'submit' + } > {t('registration.register')} @@ -366,6 +374,11 @@ export const Registration = () => { variant="contained" onClick={onNextClick} sx={{ width: 'unset' }} + type={ + disabledNextButton + ? 'button' + : 'submit' + } > {t('registration.next')} diff --git a/src/extensions/components/registration/accountData/AccountData.tsx b/src/extensions/components/registration/accountData/AccountData.tsx index 86cd33c09..45e4d6167 100644 --- a/src/extensions/components/registration/accountData/AccountData.tsx +++ b/src/extensions/components/registration/accountData/AccountData.tsx @@ -200,6 +200,7 @@ export const AccountData: VFC<{ } onInputChange={setRepeatPassword} value={repeatPassword} + info=" " label={t('registration.account.repeatPassword.label')} isValueValid={async (val) => val === password && password.length > 0 @@ -209,7 +210,7 @@ export const AccountData: VFC<{ 'registration.account.repeatPassword.success' )} /> - + { setDataProtectionChecked(!dataProtectionChecked); diff --git a/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx b/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx index 5c3b43f11..bc5acd690 100644 --- a/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx +++ b/src/extensions/components/registration/agencySelection/AgencySelectionResults.tsx @@ -50,11 +50,14 @@ export const AgencySelectionResults = ({ const { setDisabledNextButton, registrationData } = useContext(RegistrationContext); const { consultant: preselectedConsultant } = useContext(UrlParamsContext); - const [selectedAgency, setSelectedAgency] = useState( registrationData?.agency ); + const onlyExternalAgencies = results?.every((agency) => agency.external); + const isSingleResultAndNotOnlyExternal = + results?.length === 1 && !onlyExternalAgencies; + useEffect(() => { if ( // only external agencies @@ -81,11 +84,7 @@ export const AgencySelectionResults = ({ return; } - if ( - // invalid agencyId, needs to be removed - selectedAgency && - results?.length === 0 - ) { + if (results?.length === 0) { setDisabledNextButton(true); onChange({ agency: undefined @@ -104,8 +103,6 @@ export const AgencySelectionResults = ({ } }, [selectedAgency, results, onChange, setDisabledNextButton, zipcode]); - const onlyExternalAgencies = results?.every((agency) => agency.external); - return ( <> {!!results && !preselectedConsultant && ( @@ -217,7 +214,7 @@ export const AgencySelectionResults = ({ )} {/* one Result */} - {results?.length === 1 && !onlyExternalAgencies && ( + {isSingleResultAndNotOnlyExternal && ( { if (REGISTRATION_DATA_VALIDATION.zipcode.validation(value)) { setDisabledNextButton(false); - onChange({ zipcode: value }); + onChange({ + zipcode: value, + agencyId: undefined, + agency: undefined + }); } else { setDisabledNextButton(true); } diff --git a/src/globalState/provider/LocaleProvider.tsx b/src/globalState/provider/LocaleProvider.tsx index 26d5a5eba..3d3f6133f 100644 --- a/src/globalState/provider/LocaleProvider.tsx +++ b/src/globalState/provider/LocaleProvider.tsx @@ -18,7 +18,9 @@ export function LocaleProvider(props) { const [initLocale, setInitLocale] = useState(null); const { informal } = useContext(InformalContext); const [locales, setLocales] = useState([]); - const [locale, setLocale] = useState(null); + const [locale, setLocale] = useState( + localStorage.getItem(STORAGE_KEY_LOCALE) || null + ); useEffect(() => { // If using the tenant service we should load first the tenant because we need the diff --git a/src/globalState/provider/RegistrationProvider.tsx b/src/globalState/provider/RegistrationProvider.tsx index e714e6a7f..b54b67e57 100644 --- a/src/globalState/provider/RegistrationProvider.tsx +++ b/src/globalState/provider/RegistrationProvider.tsx @@ -74,6 +74,7 @@ export function RegistrationProvider({ children }: PropsWithChildren<{}>) { const { url } = useRouteMatch(); + const [loading, setLoading] = useState(true); const [disabledNextButton, setDisabledNextButton] = useState(true); const [hasTopicError, setHasTopicError] = useState(false); const [hasAgencyError, setHasAgencyError] = useState(false); @@ -144,6 +145,7 @@ export function RegistrationProvider({ children }: PropsWithChildren<{}>) { (async () => { const registrationData = getSessionStorageData() as RegistrationData; + if (registrationData.mainTopicId) { registrationData.mainTopic = await apiGetTopicById( registrationData.mainTopicId @@ -161,6 +163,7 @@ export function RegistrationProvider({ children }: PropsWithChildren<{}>) { ); } setRegistrationData(registrationData); + setLoading(false); })(); }, []); @@ -250,7 +253,7 @@ export function RegistrationProvider({ children }: PropsWithChildren<{}>) { ] ); - if (!loaded) return null; + if (!loaded || loading) return null; return (