- Begin to integrate DND with trello

- Resolve all ESLint issues in DND

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-06-13 17:52:03 -04:00
parent a8f2ca5643
commit 4602648fe5
123 changed files with 458 additions and 253 deletions

View File

@@ -65,25 +65,30 @@ const LaneHelper = {
return updateLanes(state, lanes);
},
moveCardAcrossLanes: (state, { fromLaneId, toLaneId, cardId, index }) => {
let cardToMove = null;
const interimLanes = state.lanes.map((lane) => {
if (lane.id === fromLaneId) {
cardToMove = lane.cards.find((card) => card.id === cardId);
const newCards = lane.cards.filter((card) => card.id !== cardId);
return updateLaneCards(lane, newCards);
} else {
return lane;
}
});
return LaneHelper.appendCardToLane(
{ ...state, lanes: interimLanes },
{
laneId: toLaneId,
card: cardToMove,
index: index
}
);
moveCardAcrossLanes: (state, ...params) => {
console.log("state");
console.dir(state);
console.log("params");
console.dir(params);
// let cardToMove = null;
// const interimLanes = state.lanes.map((lane) => {
// if (lane.id === fromLaneId) {
// cardToMove = lane.cards.find((card) => card.id === cardId);
// const newCards = lane.cards.filter((card) => card.id !== cardId);
// return updateLaneCards(lane, newCards);
// } else {
// return lane;
// }
// });
// return LaneHelper.appendCardToLane(
// { ...state, lanes: interimLanes },
// {
// laneId: toLaneId,
// card: cardToMove,
// index: index
// }
// );
return state;
},
updateCardsForLane: (state, { laneId, cards }) => {
@@ -103,12 +108,6 @@ const LaneHelper = {
return updateLanes(state, lanes);
},
moveLane: (state, { oldIndex, newIndex }) => {
const laneToMove = state.lanes[oldIndex];
const tempState = update(state, { lanes: { $splice: [[oldIndex, 1]] } });
return update(tempState, { lanes: { $splice: [[newIndex, 0, laneToMove]] } });
},
removeLane: (state, { laneId }) => {
const updatedLanes = state.lanes.filter((lane) => lane.id !== laneId);
return updateLanes(state, updatedLanes);