From 354fd0f186625b0470f38e88d3c71cf3e954ce24 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 e5cfd4e2e6..b882e47487 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, @@ -116,6 +116,8 @@ function EditStepDialog({ ); } +const EditStepDialog = forwardRef(EditStepDialogWithRef); + EditStepDialog.propTypes = { allTasks: PropTypes.object, deleteTask: PropTypes.func, @@ -133,4 +135,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 037b2dbbfe..8ae77e96b7 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;