From 3f9fc513cfd3ae00d11101abf6af8edc46009e63 Mon Sep 17 00:00:00 2001 From: Raymond Zhou <56318341+rayzhou-bit@users.noreply.github.com> Date: Wed, 15 Feb 2023 09:52:52 -0800 Subject: [PATCH] feat: remove Hints widget from advanced editor (#247) --- .../SettingsWidget/__snapshots__/index.test.jsx.snap | 8 ++++++-- .../components/EditProblemView/SettingsWidget/index.jsx | 2 +- .../SettingsWidget/settingsComponents/HintsCard.jsx | 6 ++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap index b32579568..7bd06f8f0 100644 --- a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap @@ -19,7 +19,9 @@ exports[`SettingsWidget snapshot snapshot: renders Settings widget page 1`] = `
- +
- +
- +
{feedbackCard()}
diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/HintsCard.jsx b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/HintsCard.jsx index acbb0dff0..2b7cac1e4 100644 --- a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/HintsCard.jsx +++ b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/settingsComponents/HintsCard.jsx @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { injectIntl, FormattedMessage, intlShape } from '@edx/frontend-platform/i18n'; import SettingsOption from '../SettingsOption'; +import { ProblemTypeKeys } from '../../../../../../data/constants/problem'; import messages from '../messages'; import { hintsCardHooks, hintsRowHooks } from '../hooks'; import HintRow from './HintRow'; @@ -9,11 +10,15 @@ import Button from '../../../../../../sharedComponents/Button'; export const HintsCard = ({ hints, + problemType, updateSettings, // inject intl, }) => { const { summary, handleAdd } = hintsCardHooks(hints, updateSettings); + + if (problemType === ProblemTypeKeys.ADVANCED) { return null; } + return (