Skip to content

Commit 2c7d413

Browse files
authored
Drop the deprecated (and unused) GroupMetadataEditor (#2978)
## Summary: I was poking around at something today and noticed that this APIOption is not used anywhere _inside_ Perseus. I also checked Khan Academy source and its not passed in anywhere, so we can delete it and the supporting component. Issue: "none" ## Test plan: `pnpm test` `pnpm typecheck` `rg GroupMetadataEditor` (no matches) `rg stub-tag-editor` (no imports of that now-unused component) Author: jeremywiebe Reviewers: SonicScrewdriver, handeyeco, ivyolamit, Myranae, mark-fitzgerald, nishasy Required Reviewers: Approved By: SonicScrewdriver Checks: ✅ 10 checks were successful Pull Request URL: #2978
1 parent 21722a0 commit 2c7d413

File tree

7 files changed

+11
-106
lines changed

7 files changed

+11
-106
lines changed

.changeset/famous-ties-march.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@khanacademy/perseus": major
3+
---
4+
5+
Remove deprecated APIOption: GroupMetadataEditor

.changeset/spotty-pears-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@khanacademy/perseus-editor": patch
3+
---
4+
5+
Update comment about GroupMetadataEditor (which is now gone)

packages/perseus-editor/src/iframe-content-renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class IframeContentRenderer extends React.Component<Props> {
170170
this._lastData = data;
171171

172172
// We can't use JSON.stringify/parse for this because the apiOptions
173-
// includes the functions GroupMetadataEditor, groupAnnotator, and onFocusChange.
173+
// includes the functions groupAnnotator, and onFocusChange.
174174
// @ts-expect-error - TS2339 - Property 'iframeDataStore' does not exist on type 'Window & typeof globalThis'.
175175
window.iframeDataStore[this.iframeID] = data;
176176
frame.contentWindow.postMessage(this.iframeID, "*");

packages/perseus/src/components/__docs__/stub-tag-editor.stories.tsx

Lines changed: 0 additions & 42 deletions
This file was deleted.

packages/perseus/src/components/stub-tag-editor.tsx

Lines changed: 0 additions & 53 deletions
This file was deleted.

packages/perseus/src/perseus-api.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,13 @@
3030
import PropTypes from "prop-types";
3131
import * as React from "react";
3232

33-
import StubTagEditor from "./components/stub-tag-editor";
34-
3533
import type {APIOptionsWithDefaults} from "./types";
3634

3735
export const ApiOptions = {
3836
propTypes: PropTypes.shape({
3937
isArticle: PropTypes.bool.isRequired,
4038

4139
onFocusChange: PropTypes.func.isRequired,
42-
GroupMetadataEditor: PropTypes.func.isRequired,
4340
showAlignmentOptions: PropTypes.bool.isRequired,
4441
readOnly: PropTypes.bool.isRequired,
4542

@@ -133,7 +130,6 @@ export const ApiOptions = {
133130
isMobileApp: false,
134131
editingDisabled: false,
135132
onFocusChange: function () {},
136-
GroupMetadataEditor: StubTagEditor,
137133
showAlignmentOptions: false,
138134
readOnly: false,
139135
groupAnnotator: function (): null {

packages/perseus/src/types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ export type ImageUploader = (
143143

144144
export type Path = ReadonlyArray<string>;
145145

146-
type StubTagEditorType = any; // from "./components/stub-tag-editor";
147-
148146
type TrackInteractionArgs = {
149147
// The widget type that this interaction originates from
150148
type: string;
@@ -182,10 +180,6 @@ export type APIOptions = Readonly<{
182180
keypadHeight?: number,
183181
focusedElement?: HTMLElement,
184182
) => unknown;
185-
/**
186-
* @deprecated - metadata is no longer used by the Group widget
187-
*/
188-
GroupMetadataEditor?: React.ComponentType<StubTagEditorType>;
189183
showAlignmentOptions?: boolean;
190184
/**
191185
* A boolean that indicates whether the associated problem has been

0 commit comments

Comments
 (0)