Skip to content

Commit

Permalink
Dashboard: Add one button add per column (#1970)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrisavoine authored Dec 8, 2023
1 parent c1d76bd commit 621c0c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions front/src/routes/dashboard/edit-dashboard/EditBoxColumns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,16 @@ const EditBoxColumns = ({ children, ...props }) => (
)}

{column.length === 0 && <EmptyColumnDropZone moveCard={props.moveCard} x={x} />}

{props.isMobileReordering && <AutoScrollMobile position="bottom" box_type={DASHBOARD_EDIT_BOX_TYPE} />}
<div class="d-flex justify-content-center mb-4">
<button class="btn btn-primary" onClick={() => props.addBox(x)}>
<Text id="dashboard.addBoxButton" /> <i class="fe fe-plus" />
</button>
</div>
</div>
))}
</div>
{props.isMobileReordering && <AutoScrollMobile position="bottom" box_type={DASHBOARD_EDIT_BOX_TYPE} />}
<div class="d-flex justify-content-center">
<button class="btn btn-primary" onClick={props.addBox}>
<Text id="dashboard.addBoxButton" /> <i class="fe fe-plus" />
</button>
</div>
</DndProvider>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions front/src/routes/dashboard/edit-dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{}]
}
}
Expand Down

0 comments on commit 621c0c5

Please sign in to comment.