From 0a118ca3869110fb8d4cb44a5cce89453d7e4e8a Mon Sep 17 00:00:00 2001 From: Nisha Yerunkar Date: Tue, 30 Jul 2024 14:21:01 -0700 Subject: [PATCH] [Interactive Graph Editor - Stories] Fix broken default and controlled stories (#1463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: The stories are broken because of a missing null check. Adding that here. Issue: none ## Test plan: `yarn start` Check that the following stories work - http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph-editor--default - http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph-editor--controlled Author: nishasy Reviewers: jeremywiebe Required Reviewers: Approved By: jeremywiebe Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: https://github.com/Khan/perseus/pull/1463 --- .changeset/wicked-rocks-exist.md | 5 +++++ .../perseus-editor/src/widgets/interactive-graph-editor.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/wicked-rocks-exist.md diff --git a/.changeset/wicked-rocks-exist.md b/.changeset/wicked-rocks-exist.md new file mode 100644 index 0000000000..d09c24ceeb --- /dev/null +++ b/.changeset/wicked-rocks-exist.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/perseus-editor": patch +--- + +[Interactive Graph Editor - Storybook] Fix broken default and controlled stories diff --git a/packages/perseus-editor/src/widgets/interactive-graph-editor.tsx b/packages/perseus-editor/src/widgets/interactive-graph-editor.tsx index c5732ef8ed..e697b1d21c 100644 --- a/packages/perseus-editor/src/widgets/interactive-graph-editor.tsx +++ b/packages/perseus-editor/src/widgets/interactive-graph-editor.tsx @@ -473,7 +473,7 @@ class InteractiveGraphEditor extends React.Component { )} {this.props.graph?.type && - this.props.apiOptions.flags?.mafs?.["start-coords-ui"] && ( + this.props.apiOptions?.flags?.mafs?.["start-coords-ui"] && (