From 7691256d7b52db114fc85b138ee398c8150c1fa5 Mon Sep 17 00:00:00 2001 From: Jim O'Donnell Date: Fri, 31 May 2024 23:05:43 +0100 Subject: [PATCH] fix(pages editor): broken prop types in EditStepDialog and NewTaskDialog --- .../TasksPage/components/EditStepDialog/EditStepDialog.jsx | 6 ++++-- .../components/TasksPage/components/NewTaskDialog.jsx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/pages/lab-pages-editor/components/TasksPage/components/EditStepDialog/EditStepDialog.jsx b/app/pages/lab-pages-editor/components/TasksPage/components/EditStepDialog/EditStepDialog.jsx index 39b6075436..17efca611d 100644 --- a/app/pages/lab-pages-editor/components/TasksPage/components/EditStepDialog/EditStepDialog.jsx +++ b/app/pages/lab-pages-editor/components/TasksPage/components/EditStepDialog/EditStepDialog.jsx @@ -13,7 +13,7 @@ const taskNames = { const DEFAULT_HANDLER = () => {}; -function EditStepDialog({ +function EditStepDialogWithRef({ allTasks = {}, deleteTask, enforceLimitedBranchingRule, @@ -117,6 +117,8 @@ function EditStepDialog({ ); } +const EditStepDialog = forwardRef(EditStepDialogWithRef); + EditStepDialog.propTypes = { allTasks: PropTypes.object, deleteTask: PropTypes.func, @@ -134,4 +136,4 @@ function onSubmit(e) { return false; } -export default forwardRef(EditStepDialog); +export default EditStepDialog; diff --git a/app/pages/lab-pages-editor/components/TasksPage/components/NewTaskDialog.jsx b/app/pages/lab-pages-editor/components/TasksPage/components/NewTaskDialog.jsx index f488b5adc9..991c7ddbe0 100644 --- a/app/pages/lab-pages-editor/components/TasksPage/components/NewTaskDialog.jsx +++ b/app/pages/lab-pages-editor/components/TasksPage/components/NewTaskDialog.jsx @@ -7,7 +7,7 @@ import TaskIcon from '../../../icons/TaskIcon.jsx'; const DEFAULT_HANDLER = () => {}; -function NewTaskDialog({ +function NewTaskDialogWithRef({ addTask = DEFAULT_HANDLER, enforceLimitedBranchingRule, openEditStepDialog = DEFAULT_HANDLER, @@ -122,6 +122,8 @@ function NewTaskDialog({ ); } +const NewTaskDialog = forwardRef(NewTaskDialogWithRef); + NewTaskDialog.propTypes = { addTask: PropTypes.func, enforceLimitedBranchingRule: PropTypes.shape({ @@ -136,4 +138,4 @@ function onSubmit(e) { return false; } -export default forwardRef(NewTaskDialog); +export default NewTaskDialog;