feat: Add ability to create new card at top (#1261)

Closes #1260
This commit is contained in:
Mashood ur Rehman
2025-07-21 12:10:58 +02:00
committed by GitHub
parent fdac299fc7
commit 2e0483d9e9
6 changed files with 62 additions and 42 deletions
+10 -10
View File
@@ -113,7 +113,7 @@ export function* handleCardsUpdate(cards, activities) {
yield put(actions.handleCardsUpdate(cards, activities));
}
export function* createCard(listId, data, autoOpen) {
export function* createCard(listId, data, index, autoOpen) {
const localId = yield call(createLocalId);
const list = yield select(selectors.selectListById, listId);
@@ -127,7 +127,7 @@ export function* createCard(listId, data, autoOpen) {
};
if (isListFinite(list)) {
nextData.position = yield select(selectors.selectNextCardPosition, listId);
nextData.position = yield select(selectors.selectNextCardPosition, listId, index);
}
yield put(
@@ -167,16 +167,16 @@ export function* createCard(listId, data, autoOpen) {
}
}
export function* createCardInFirstFiniteList(data, index, autoOpen) {
const firstFiniteListId = yield select(selectors.selectFirstFiniteListId);
yield call(createCard, firstFiniteListId, data, index, autoOpen);
}
export function* createCardInCurrentList(data, autoOpen) {
const currentListId = yield select(selectors.selectCurrentListId);
yield call(createCard, currentListId, data, autoOpen);
}
export function* createCardInFirstFiniteList(data, autoOpen) {
const firstFiniteListId = yield select(selectors.selectFirstFiniteListId);
yield call(createCard, firstFiniteListId, data, autoOpen);
yield call(createCard, currentListId, data, undefined, autoOpen);
}
export function* handleCardCreate(card) {
@@ -596,9 +596,9 @@ export default {
fetchCardsInCurrentList,
handleCardsUpdate,
createCard,
createCardInFirstFiniteList,
createCardInCurrentList,
handleCardCreate,
createCardInFirstFiniteList,
updateCard,
updateCurrentCard,
handleCardUpdate,