From 5d69c672b235f992217ce98004667e6951a80494 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Fri, 15 Dec 2023 10:02:48 +1100 Subject: [PATCH] Lint --- .../ChallengeEditor/ChallengeView/index.js | 4 ++-- src/components/ChallengeEditor/index.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/ChallengeEditor/ChallengeView/index.js b/src/components/ChallengeEditor/ChallengeView/index.js index 8018e6a1..c2da57eb 100644 --- a/src/components/ChallengeEditor/ChallengeView/index.js +++ b/src/components/ChallengeEditor/ChallengeView/index.js @@ -102,8 +102,8 @@ const ChallengeView = ({ const showCheckpointPrizes = _.get(challenge, 'timelineTemplateId') === MULTI_ROUND_CHALLENGE_TEMPLATE_ID const isDataScience = challenge.trackId === DS_TRACK_ID const useDashboardData = _.find(challenge.metadata, { name: 'show_data_dashboard' }) - const useDashboard = useDashboardData ? - (_.isString(useDashboardData.value) && useDashboardData.value === "true") || + const useDashboard = useDashboardData + ? (_.isString(useDashboardData.value) && useDashboardData.value === 'true') || (_.isBoolean(useDashboardData.value) && useDashboardData.value) : false return ( diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js index 60e08de7..a1605fce 100644 --- a/src/components/ChallengeEditor/index.js +++ b/src/components/ChallengeEditor/index.js @@ -1069,10 +1069,10 @@ class ChallengeEditor extends Component { } let useDashboard = _.find(challengeMetadata, { name: 'show_data_dashboard' }) if (useDashboard === undefined) { - useDashboard = { name: 'show_data_dashboard', value: "false" } - } else if(_.isBoolean(useDashboard.value)){ + useDashboard = { name: 'show_data_dashboard', value: 'false' } + } else if (_.isBoolean(useDashboard.value)) { useDashboard = { name: 'show_data_dashboard', value: _.toString(useDashboard.value) } - } + } newChallenge.metadata.push(useDashboard) } @@ -1650,10 +1650,10 @@ class ChallengeEditor extends Component { const showDashBoard = (challenge.trackId === DS_TRACK_ID && isChallengeType) || (isDevChallenge && isMM) const useDashboardData = _.find(challenge.metadata, { name: 'show_data_dashboard' }) + const useDashboard = useDashboardData + ? (_.isString(useDashboardData.value) && useDashboardData.value === 'true') || + (_.isBoolean(useDashboardData.value) && useDashboardData.value) : false - const useDashboard = useDashboardData ? - (_.isString(useDashboardData.value) && useDashboardData.value === "true") || - (_.isBoolean(useDashboardData.value) && useDashboardData.value) : false const workTypes = getDomainTypes(challenge.trackId) const filteredTypes = metadata.challengeTypes.filter(type => workTypes.includes(type.abbreviation))