From e1f358ae9bb06f572cbb0dc2d63a8f333e082c39 Mon Sep 17 00:00:00 2001 From: Diana Catalina Olarte Date: Mon, 1 Jul 2024 20:59:03 +1000 Subject: [PATCH] fix: ENABLED_ORG_LOGO definition --- src/Header.jsx | 1 + src/__snapshots__/Header.test.jsx.snap | 16 ++++++++-------- src/learning-header/LearningHeader.jsx | 5 +---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Header.jsx b/src/Header.jsx index bff801fe05..d230982442 100644 --- a/src/Header.jsx +++ b/src/Header.jsx @@ -28,6 +28,7 @@ ensureConfig([ subscribe(APP_CONFIG_INITIALIZED, () => { mergeConfig({ AUTHN_MINIMAL_HEADER: !!process.env.AUTHN_MINIMAL_HEADER, + ENABLED_ORG_LOGO: !!process.env.ENABLED_ORG_LOGO, }, 'Header additional config'); }); diff --git a/src/__snapshots__/Header.test.jsx.snap b/src/__snapshots__/Header.test.jsx.snap index da50a8db5f..f83161b154 100644 --- a/src/__snapshots__/Header.test.jsx.snap +++ b/src/__snapshots__/Header.test.jsx.snap @@ -93,7 +93,7 @@ exports[`
renders correctly for anonymous mobile 1`] = ` height="24px" role="img" style={ - { + Object { "height": "1.5rem", "width": "1.5rem", } @@ -163,7 +163,7 @@ exports[`
renders correctly for anonymous mobile 1`] = ` renders correctly for anonymous mobile 1`] = ` height="24px" role="img" style={ - { + Object { "height": "1.5rem", "width": "1.5rem", } @@ -253,7 +253,7 @@ exports[`
renders correctly for authenticated desktop 1`] = ` renders correctly for authenticated desktop 1`] = ` height="24px" role="img" style={ - { + Object { "height": "1.5em", "width": "1.5em", } @@ -339,7 +339,7 @@ exports[`
renders correctly for authenticated mobile 1`] = ` height="24px" role="img" style={ - { + Object { "height": "1.5rem", "width": "1.5rem", } @@ -409,7 +409,7 @@ exports[`
renders correctly for authenticated mobile 1`] = ` renders correctly for authenticated mobile 1`] = ` height="24px" role="img" style={ - { + Object { "height": "1.5rem", "width": "1.5rem", } diff --git a/src/learning-header/LearningHeader.jsx b/src/learning-header/LearningHeader.jsx index 5e5c7d870b..2d30418dde 100644 --- a/src/learning-header/LearningHeader.jsx +++ b/src/learning-header/LearningHeader.jsx @@ -25,15 +25,12 @@ LinkedLogo.propTypes = { src: PropTypes.string.isRequired, alt: PropTypes.string.isRequired, }; - -// this feature flag is not included on the frontend-platform, we have to get it directly from ENV -const enabledOrgLogo = process.env.ENABLED_ORG_LOGO || false; - const LearningHeader = ({ courseOrg, courseTitle, intl, showUserDropdown, }) => { const { authenticatedUser } = useContext(AppContext); const [logoOrg, setLogoOrg] = useState(null); + const enabledOrgLogo = getConfig().ENABLED_ORG_LOGO || false; useEffect(() => { if (courseOrg) {