Skip to content

Commit

Permalink
passage-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
handeyeco committed Oct 2, 2024
1 parent 7015daa commit 3d381aa
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions packages/perseus/src/widgets/passage-ref/passage-ref.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import {isPassageWidget} from "../passage/utils";

import type {PerseusPassageRefWidgetOptions} from "../../perseus-types";
import type {ChangeFn, Widget, WidgetExports, WidgetProps} from "../../types";
import type {
NullUserInput,
PerseusPassageRefRubric,
} from "../../validation.types";
import type {PerseusPassageRefRubric} from "../../validation.types";

const EN_DASH = "\u2013";

Expand All @@ -35,6 +32,7 @@ type State = {
content: string | null | undefined;
};

// @ts-expect-error - TS2559 - Type 'PassageRef' has no properties in common with type 'Widget'.
class PassageRef extends React.Component<Props, State> implements Widget {
static contextType = PerseusI18nContext;
declare context: React.ContextType<typeof PerseusI18nContext>;
Expand All @@ -56,11 +54,6 @@ class PassageRef extends React.Component<Props, State> implements Widget {
content: null,
};

// TODO (LEMS-2396): remove validation logic from widgets that don't validate
static validate() {
return noopValidator();
}

componentDidMount() {
// TODO(scottgrant): This is a hack to remove the deprecated call to
// this.isMounted() but is still considered an anti-pattern.
Expand Down Expand Up @@ -89,11 +82,6 @@ class PassageRef extends React.Component<Props, State> implements Widget {
this._isMounted = false;
}

// TODO (LEMS-2396): remove validation logic from widgets that don't validate
getUserInput(): NullUserInput {
return null;
}

change: ChangeFn = (...args) => {
return Changeable.change.apply(this, args);
};
Expand Down Expand Up @@ -124,11 +112,6 @@ class PassageRef extends React.Component<Props, State> implements Widget {
}
};

// TODO (LEMS-2396): remove validation logic from widgets that don't validate
simpleValidate() {
return noopValidator();
}

render(): React.ReactNode {
const {strings} = this.context;
const lineRange = this.state.lineRange;
Expand Down Expand Up @@ -192,4 +175,6 @@ export default {
summaryText: widgetOptions.summaryText,
}),
version: {major: 0, minor: 1},
// TODO: things that aren't interactive shouldn't need validators
validator: noopValidator,
} as WidgetExports<typeof PassageRef>;

0 comments on commit 3d381aa

Please sign in to comment.