Skip to content

Commit 9e65424

Browse files
authored
refactor: Remove unused defaultToAdvanced and getBetaParsedOLXData (#1753)
edx-platform would pass a default_to_advanced flag in through the REST API, depending on the value of a waffle flag. The flag did not actually cause anything to default to advanced. What it actually did was switch from getParsedOLXData to getParsedBetaOLXData. However, getBetaOLXParser was never implemented--it just logs a console warning and return getOLXParser. We remove this unused flag and unused function. The underlying default_to_advanced API flag and the backing waffle flag will be removed from edx-platform in a separate PR.
1 parent 27c4eec commit 9e65424

4 files changed

Lines changed: 1 addition & 17 deletions

File tree

src/editors/containers/ProblemEditor/components/SelectTypeModal/hooks.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const onSelect = ({
2323
attempts_before_showanswer_button: 0,
2424
show_reset_button: null,
2525
showanswer: null,
26-
defaultToAdvanced: false,
2726
},
2827
defaultSettings: snakeCaseKeys(defaultSettings),
2928
});

src/editors/containers/ProblemEditor/components/SelectTypeModal/hooks.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ describe('SelectTypeModal hooks', () => {
5555
attempts_before_showanswer_button: 0,
5656
show_reset_button: null,
5757
showanswer: null,
58-
defaultToAdvanced: false,
5958
},
6059
defaultSettings: mockDefaultSettings,
6160
});

src/editors/containers/ProblemEditor/data/OLXParser.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -753,13 +753,4 @@ export class OLXParser {
753753
groupFeedbackList,
754754
};
755755
}
756-
757-
getBetaParsedOLXData() {
758-
/* TODO: Replace olxParser.getParsedOLXData() with new parser function
759-
* and remove console.log()
760-
*/
761-
// eslint-disable-next-line no-console
762-
console.log('Should default to the advanced editor');
763-
return this.getParsedOLXData();
764-
}
765756
}

src/editors/data/redux/thunkActions/problem.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,9 @@ export const isBlankProblem = ({ rawOLX }) => {
3434
export const getDataFromOlx = ({ rawOLX, rawSettings, defaultSettings }) => {
3535
let olxParser;
3636
let parsedProblem;
37-
const { default_to_advanced: defaultToAdvanced } = rawSettings;
3837
try {
3938
olxParser = new OLXParser(rawOLX);
40-
if (defaultToAdvanced) {
41-
parsedProblem = olxParser.getBetaParsedOLXData();
42-
} else {
43-
parsedProblem = olxParser.getParsedOLXData();
44-
}
39+
parsedProblem = olxParser.getParsedOLXData();
4540
} catch (error) {
4641
// eslint-disable-next-line no-console
4742
console.error('The Problem Could Not Be Parsed from OLX. redirecting to Advanced editor.', error);

0 commit comments

Comments
 (0)