From e142ee909fb5e3af6c3656a27ccbbef824f8ad6a Mon Sep 17 00:00:00 2001 From: vladislavkeblysh Date: Tue, 10 Dec 2024 18:18:48 +0200 Subject: [PATCH] feat: add env variable to display image --- .env | 1 + .env.development | 1 + .env.test | 1 + .../post-comments/comments/comment/CommentHeader.jsx | 3 ++- src/discussions/posts/post/PostHeader.jsx | 3 ++- src/index.jsx | 1 + 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 273646442..9c9dfe5a7 100644 --- a/.env +++ b/.env @@ -22,3 +22,4 @@ USER_INFO_COOKIE_NAME='' SUPPORT_URL='' LEARNER_FEEDBACK_URL='' STAFF_FEEDBACK_URL='' +ENABLE_PROFILE_IMAGE='' diff --git a/.env.development b/.env.development index ae4b3cee5..f6fe6b42b 100644 --- a/.env.development +++ b/.env.development @@ -23,3 +23,4 @@ USER_INFO_COOKIE_NAME='edx-user-info' SUPPORT_URL='https://support.edx.org' LEARNER_FEEDBACK_URL='' STAFF_FEEDBACK_URL='' +ENABLE_PROFILE_IMAGE='true' diff --git a/.env.test b/.env.test index 84bc122cd..a1147f2b5 100644 --- a/.env.test +++ b/.env.test @@ -21,3 +21,4 @@ USER_INFO_COOKIE_NAME='edx-user-info' SUPPORT_URL='https://support.edx.org' LEARNER_FEEDBACK_URL='' STAFF_FEEDBACK_URL='' +ENABLE_PROFILE_IMAGE='' diff --git a/src/discussions/post-comments/comments/comment/CommentHeader.jsx b/src/discussions/post-comments/comments/comment/CommentHeader.jsx index fd9bc4da3..0337c2441 100644 --- a/src/discussions/post-comments/comments/comment/CommentHeader.jsx +++ b/src/discussions/post-comments/comments/comment/CommentHeader.jsx @@ -7,6 +7,7 @@ import classNames from 'classnames'; import { AvatarOutlineAndLabelColors } from '../../../../data/constants'; import { AuthorLabel } from '../../../common'; import { useAlertBannerVisible } from '../../../data/hooks'; +import {getConfig} from "@edx/frontend-platform"; const CommentHeader = ({ author, @@ -25,7 +26,7 @@ const CommentHeader = ({ closed, }); - const profileImage = postUsers && Object.values(postUsers)[0].profile.image; + const profileImage = getConfig().ENABLE_PROFILE_IMAGE === 'true' && postUsers && Object.values(postUsers)[0].profile.image; return (
diff --git a/src/index.jsx b/src/index.jsx index 9ad349991..77f2e58f0 100755 --- a/src/index.jsx +++ b/src/index.jsx @@ -40,6 +40,7 @@ initialize({ LEARNING_BASE_URL: process.env.LEARNING_BASE_URL, LEARNER_FEEDBACK_URL: process.env.LEARNER_FEEDBACK_URL, STAFF_FEEDBACK_URL: process.env.STAFF_FEEDBACK_URL, + ENABLE_PROFILE_IMAGE: process.env.ENABLE_PROFILE_IMAGE, }, 'DiscussionsConfig'); }, },