From 621c0c555d35ef21b3d049e1579809dc2ea6167f Mon Sep 17 00:00:00 2001 From: Jonathan Brisavoine <138247436+jbrisavoine@users.noreply.github.com> Date: Fri, 8 Dec 2023 10:12:40 +0100 Subject: [PATCH] Dashboard: Add one button add per column (#1970) --- .../dashboard/edit-dashboard/EditBoxColumns.jsx | 13 +++++++------ front/src/routes/dashboard/edit-dashboard/index.js | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/front/src/routes/dashboard/edit-dashboard/EditBoxColumns.jsx b/front/src/routes/dashboard/edit-dashboard/EditBoxColumns.jsx index 22e7317ae9..58d504b328 100644 --- a/front/src/routes/dashboard/edit-dashboard/EditBoxColumns.jsx +++ b/front/src/routes/dashboard/edit-dashboard/EditBoxColumns.jsx @@ -101,15 +101,16 @@ const EditBoxColumns = ({ children, ...props }) => ( )} {column.length === 0 && } + + {props.isMobileReordering && } +
+ +
))} - {props.isMobileReordering && } -
- -
); diff --git a/front/src/routes/dashboard/edit-dashboard/index.js b/front/src/routes/dashboard/edit-dashboard/index.js index 13acb48128..ff841974a3 100644 --- a/front/src/routes/dashboard/edit-dashboard/index.js +++ b/front/src/routes/dashboard/edit-dashboard/index.js @@ -104,11 +104,11 @@ class EditDashboard extends Component { await this.setState(newState); }; - addBox = () => { + addBox = x => { const newState = update(this.state, { currentDashboard: { boxes: { - 0: { + [x]: { $push: [{}] } }