Skip to content

Commit

Permalink
removes unused function from numeric-input.jsx named getClasses (#284)
Browse files Browse the repository at this point in the history
## Summary:
Found an unused function in numeric-input.jsx called getClasses. This specific function was not used in Perseus or webapp. Removed it to practice doing a PR.

Issue: none

## Test plan:
Load the numeric input. Verify it looks correct.

Author: Myranae

Reviewers: jeresig, handeyeco, jeanettehead

Required Reviewers:

Approved By: jeresig

Checks: ✅ codecov/project, ✅ Lint, Flow, and Test (ubuntu-latest, 16.x), ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Cypress Coverage (ubuntu-latest, 16.x), ✅ Jest Coverage (ubuntu-latest, 16.x), ✅ Check for .changeset file (ubuntu-latest, 16.x), ✅ gerald, ✅ Check builds for changes in size (ubuntu-latest, 16.x)

Pull Request URL: #284
  • Loading branch information
Myranae authored Sep 20, 2022
1 parent c9710a4 commit 8a53d9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-mirrors-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

removes unused function from numeric-input.jsx named getClasses
14 changes: 1 addition & 13 deletions packages/perseus/src/widgets/numeric-input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import _ from "underscore";
import InputWithExamples from "../components/input-with-examples.jsx";
import PossibleAnswers from "../components/possible-answers.jsx";
import SimpleKeypadInput from "../components/simple-keypad-input.jsx";
import {ApiOptions, ClassNames as ApiClassNames} from "../perseus-api.jsx";
import {ApiOptions} from "../perseus-api.jsx";
import TexWrangler from "../tex-wrangler.js";
import KhanAnswerTypes from "../util/answer-types.js";
import KhanMath from "../util/math.js";
Expand Down Expand Up @@ -292,18 +292,6 @@ export class NumericInput extends React.Component<Props, State> {
return [answerBlurb, !!correct];
};

getClasses: (boolean, $FlowFixMe) => $FlowFixMe = (correct, rubric) => {
const classes = {};
classes["perseus-input-size-" + this.props.size] = true;
classes["perseus-input-right-align"] = this.props.rightAlign;
classes[ApiClassNames.CORRECT] =
rubric && correct && this.props.currentValue;
classes[ApiClassNames.INCORRECT] =
rubric && !correct && this.props.currentValue;
classes[ApiClassNames.UNANSWERED] = rubric && !this.props.currentValue;
return classes;
};

// TODO(Nicole, Jeremy): This is maybe never used and should be removed
examples: () => $ReadOnlyArray<string> = () => {
// if the set of specified forms are empty, allow all forms
Expand Down

0 comments on commit 8a53d9e

Please sign in to comment.