diff --git a/src/lib/themes/aha.theme.ts b/src/lib/themes/aha.theme.ts index a2dfeea6..a73890c2 100644 --- a/src/lib/themes/aha.theme.ts +++ b/src/lib/themes/aha.theme.ts @@ -94,3 +94,4 @@ export const TickColorDark = '#DED6EC'; export const PUBLIC_LOGO_IMAGE_SOURCE='https://www.heart.org/-/media/Images/Logos/Global-Do-No-Edit/Header/AHA_Full.svg?h=256&iar=0&mw=960&w=426&hash=502DC0C0397CFBA7EA1142C51E062876'; export const PUBLIC_FOOTER_TEXT='American Heart Association' export const PUBLIC_FOOTER_LINK='https://www.heart.org' +export const SYSTEM_NAME = 'American Heart Association'; diff --git a/src/lib/themes/rean.theme.ts b/src/lib/themes/rean.theme.ts index 11f72297..9738929c 100644 --- a/src/lib/themes/rean.theme.ts +++ b/src/lib/themes/rean.theme.ts @@ -94,3 +94,4 @@ export const TickColorDark = '#DED6EC'; export const PUBLIC_LOGO_IMAGE_SOURCE='https://www.reanfoundation.org/wp-content/uploads/2021/10/REAN-Foundation-brand-Logo.png'; export const PUBLIC_FOOTER_TEXT='REAN Foundation'; export const PUBLIC_FOOTER_LINK='https://www.reanfoundation.org'; +export const SYSTEM_NAME = 'REAN Foundation'; \ No newline at end of file diff --git a/src/lib/themes/theme.selector.ts b/src/lib/themes/theme.selector.ts index 473b5a0f..8af196f3 100644 --- a/src/lib/themes/theme.selector.ts +++ b/src/lib/themes/theme.selector.ts @@ -10,6 +10,7 @@ import { TickColorDark as AHATickColorDark } from './aha.theme'; import { PUBLIC_LOGO_IMAGE_SOURCE as AHA_PUBLIC_LOGO_IMAGE_SOURCE } from './aha.theme'; import { PUBLIC_FOOTER_TEXT as AHA_PUBLIC_FOOTER_TEXT } from './aha.theme'; import { PUBLIC_FOOTER_LINK as AHA_PUBLIC_FOOTER_LINK } from './aha.theme'; +import { SYSTEM_NAME as AHA_SYSTEM_NAME } from './aha.theme'; // REAN Theme imports import { ThemeColors as REANThemeColors } from './rean.theme'; @@ -21,6 +22,7 @@ import { ThemeDarkColor as REANThemeDarkColor } from './rean.theme'; import { PUBLIC_LOGO_IMAGE_SOURCE as REAN_PUBLIC_LOGO_IMAGE_SOURCE } from './rean.theme'; import { PUBLIC_FOOTER_TEXT as REAN_PUBLIC_FOOTER_TEXT } from './rean.theme'; import { PUBLIC_FOOTER_LINK as REAN_PUBLIC_FOOTER_LINK } from './rean.theme'; +import { SYSTEM_NAME as REAN_SYSTEM_NAME } from './rean.theme'; import { SYSTEM_ID } from '../constants'; @@ -133,3 +135,15 @@ export const getPublicFooterLink = () => { return REAN_PUBLIC_FOOTER_LINK; } }; + +export const getSystemName = () => { + const systemType: SystemTypes = SYSTEM_ID as SystemTypes; + switch (systemType as SystemTypes) { + case SystemTypes.REAN: + return REAN_SYSTEM_NAME; + case SystemTypes.AHA: + return AHA_SYSTEM_NAME; + default: + return REAN_SYSTEM_NAME; + } +}; diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 88e7b70b..d4ded701 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -8,13 +8,11 @@ import type { PageServerLoad } from './$types'; import { SessionManager } from './api/session.manager'; import { login } from './api/services/user'; import { getUserRoles } from './api/services/types'; -import { SYSTEM_NAME } from '$env/static/private'; //////////////////////////////////////////////////////////////// export const load: PageServerLoad = async (event: RequestEvent) => { try { - const systemName = SYSTEM_NAME; let roles: PersonRole[] = await getUserRoles(); if (!roles || roles.length === 0) { roles = UserRoles; @@ -22,7 +20,6 @@ export const load: PageServerLoad = async (event: RequestEvent) => { return { message: 'Common data successfully retrieved!', roles, - systemName }; } catch (error) { console.error(`Error retrieving data : ${error.message}`); diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index eb6a70da..b9a9ceb2 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -7,7 +7,8 @@ import { getPublicLogoImageSource, getPublicFooterText, - getPublicFooterLink + getPublicFooterLink, + getSystemName, } from '$lib/themes/theme.selector'; const logoImageSource = getPublicLogoImageSource(); @@ -29,7 +30,7 @@ LocalStorageUtils.removeItem('prevUrl'); } - var systemName = data.systemName; + var systemName = getSystemName();