Refonte de l'UI #37
@ -228,7 +228,7 @@ export class BoardPage extends React.Component<BoardPageProps> {
|
|||||||
e.currentTarget.closest('.react-kanban-column').classList.toggle('minimized');
|
e.currentTarget.closest('.react-kanban-column').classList.toggle('minimized');
|
||||||
}
|
}
|
||||||
|
|
||||||
onCardDragEnd(b: any, card: any, source: any, dest: any) {
|
onCardDragEnd(card: any, source: any, dest: any) {
|
||||||
const { board } = this.props;
|
const { board } = this.props;
|
||||||
this.props.dispatch(moveCard(
|
this.props.dispatch(moveCard(
|
||||||
board.id,
|
board.id,
|
||||||
|
@ -37,22 +37,22 @@ function handleMoveCard(state: any, action: any) {
|
|||||||
|
|
||||||
const kanboard = state.byID[boardID];
|
const kanboard = state.byID[boardID];
|
||||||
|
|
||||||
const lanes = [ ...kanboard.columns ];
|
const columns = [ ...kanboard.columns ];
|
||||||
const fromLane = lanes[fromLaneID];
|
const fromLane = columns[fromLaneID];
|
||||||
const toLane = lanes[toLaneID];
|
const toLane = columns[toLaneID];
|
||||||
const card = fromLane.cards[fromPosition];
|
const card = fromLane.cards[fromPosition];
|
||||||
|
|
||||||
const fromCards = [ ...fromLane.cards ];
|
const fromCards = [ ...fromLane.cards ];
|
||||||
if (fromLaneID !== toLaneID) {
|
if (fromLaneID !== toLaneID) {
|
||||||
fromCards.splice(fromPosition, 1);
|
fromCards.splice(fromPosition, 1);
|
||||||
lanes[fromLaneID] = {
|
columns[fromLaneID] = {
|
||||||
...fromLane,
|
...fromLane,
|
||||||
cards: fromCards,
|
cards: fromCards,
|
||||||
};
|
};
|
||||||
|
|
||||||
const toCards = [ ...toLane.cards ];
|
const toCards = [ ...toLane.cards ];
|
||||||
toCards.splice(toPosition, 0, card);
|
toCards.splice(toPosition, 0, card);
|
||||||
lanes[toLaneID] = {
|
columns[toLaneID] = {
|
||||||
...toLane,
|
...toLane,
|
||||||
cards: toCards,
|
cards: toCards,
|
||||||
};
|
};
|
||||||
@ -67,7 +67,7 @@ function handleMoveCard(state: any, action: any) {
|
|||||||
...state.byID,
|
...state.byID,
|
||||||
[boardID]: {
|
[boardID]: {
|
||||||
...state.byID[boardID],
|
...state.byID[boardID],
|
||||||
lanes,
|
columns,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,7 @@ export function* moveCardSaga(action: any) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const toLane = kanboard.lanes[toLaneID];
|
const toLane = kanboard.columns[toLaneID];
|
||||||
const card = toLane.cards[toPosition];
|
const card = toLane.cards[toPosition];
|
||||||
|
|
||||||
if (!card) return;
|
if (!card) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user