From 9b1077acf5d71dd0377f2b468a21407f9ddafd50 Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Fri, 4 Sep 2020 22:29:29 +0300 Subject: [PATCH] fix: render editor tabs if SHOW_UPCOMING_CHANGES is 'true' (#39513) --- client/src/templates/Challenges/classic/DesktopLayout.js | 8 ++++++-- config/env.js | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/src/templates/Challenges/classic/DesktopLayout.js b/client/src/templates/Challenges/classic/DesktopLayout.js index 32dd8c86276..459b34227f6 100644 --- a/client/src/templates/Challenges/classic/DesktopLayout.js +++ b/client/src/templates/Challenges/classic/DesktopLayout.js @@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; import { first } from 'lodash'; import EditorTabs from './EditorTabs'; import ActionRow from './ActionRow'; +import { showUpcomingChanges } from '../../../../config/env.json'; const propTypes = { challengeFiles: PropTypes.object, @@ -43,9 +44,10 @@ class DesktopLayout extends Component { } = this.props; const challengeFile = this.getChallengeFile(); + return ( - {hasEditableBoundries && } + {showUpcomingChanges && hasEditableBoundries && } {instructions} @@ -57,7 +59,9 @@ class DesktopLayout extends Component { { - {!hasEditableBoundries && } + {showUpcomingChanges && !hasEditableBoundries && ( + + )} {editor} } diff --git a/config/env.js b/config/env.js index dbfe80155dc..805336b1675 100644 --- a/config/env.js +++ b/config/env.js @@ -19,7 +19,8 @@ const { ALGOLIA_APP_ID: algoliaAppId, ALGOLIA_API_KEY: algoliaAPIKey, PAYPAL_CLIENT_ID: paypalClientId, - DEPLOYMENT_ENV: deploymentEnv + DEPLOYMENT_ENV: deploymentEnv, + SHOW_UPCOMING_CHANGES: showUpcomingChanges } = process.env; const locations = { @@ -48,5 +49,6 @@ module.exports = Object.assign(locations, { paypalClientId: !paypalClientId || paypalClientId === 'id_from_paypal_dashboard' ? null - : paypalClientId + : paypalClientId, + showUpcomingChanges: showUpcomingChanges === 'true' });