Skip to content

Commit

Permalink
Merge branch 'Onlineberatung:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mi authored Jan 28, 2024
2 parents eafc842 + 96a53e1 commit 6e05dde
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ CSRF_WHITELIST_HEADER_FOR_LOCAL_DEVELOPMENT=X-WHITELIST-HEADER
# Disable 2FA
REACT_APP_DISABLE_2FA_DUTY=0

### Registration
# Enable fallback loader for direct link registration where slug could not be matched (0/1)
FRONTEND_REGISTRATION_DIRECTLINK_FALLBACKLOADER_ENABLED=

### Weblate
# Weblate host
FRONTEND_WEBLATE_HOST=
Expand Down
11 changes: 11 additions & 0 deletions proxy/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,16 @@ module.exports = {
disabled: process.env.FRONTEND_TRANSLATION_CACHE_DISABLED || true,
time: process.env.FRONTEND_TRANSLATION_CACHE_TIME || 30
}
},
registration: {
directlink: {
fallbackLoader: {
enabled: !!parseInt(
process.env
.FRONTEND_REGISTRATION_DIRECTLINK_FALLBACKLOADER_ENABLED ||
'1'
)
}
}
}
};
3 changes: 2 additions & 1 deletion src/components/sessionHeader/GroupChatHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const GroupChatHeader = ({
)}
</div>

{!isActive && isConsultant && (
{(!isActive || isJoinGroupChatView) && isConsultant && (
<Link
to={groupChatInfoLink}
className="sessionMenu__item--desktop sessionMenu__button"
Expand All @@ -178,6 +178,7 @@ export const GroupChatHeader = ({
)}

{isActive &&
!isJoinGroupChatView &&
isConsultant &&
releaseToggles.featureVideoGroupChatsEnabled && (
<div
Expand Down
7 changes: 7 additions & 0 deletions src/globalState/interfaces/AppConfig/AppConfigInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export interface AppConfigInterface extends AppSettingsInterface {
};
};
groupChat?: GroupChatConfig;
registration?: {
directlink?: {
fallbackLoader?: {
enabled?: boolean;
};
};
};
}

interface ReleaseToggles {
Expand Down
29 changes: 28 additions & 1 deletion src/utils/useUrlParamsLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,32 @@ export default function useUrlParamsLoader() {
)
) {
consultingType = null;

// Fallback logic for special client because slug is not unique. So try reversed logicc
if (
settings?.registration?.directlink
?.fallbackLoader?.enabled &&
consultingTypeSlug
) {
const loadConsultingType = async (id) => {
const ct = await apiGetConsultingType({
consultingTypeId: id
});
return ct.slug === consultingTypeSlug
? ct
: null;
};

for (const {
consultingType: ctId
} of consultant.agencies) {
const res = await loadConsultingType(ctId);
if (res) {
consultingType = res;
break;
}
}
}
}
}
}
Expand Down Expand Up @@ -131,7 +157,8 @@ export default function useUrlParamsLoader() {
consultantId,
topicIdOrName,
settings.multitenancyWithSingleDomainEnabled,
settings.urls.toRegistration
settings.urls.toRegistration,
settings?.registration?.directlink?.fallbackLoader?.enabled
]);

useEffect(() => {
Expand Down

0 comments on commit 6e05dde

Please sign in to comment.