2025-05-10 02:09:06 +02:00
|
|
|
/*!
|
|
|
|
|
* Copyright (c) 2024 PLANKA Software GmbH
|
|
|
|
|
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
|
|
|
|
*/
|
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
2019-08-31 04:07:25 +05:00
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const createListInCurrentBoard = (data) => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: EntryActionTypes.LIST_IN_CURRENT_BOARD_CREATE,
|
|
|
|
|
payload: {
|
|
|
|
|
data,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const handleListCreate = (list) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: EntryActionTypes.LIST_CREATE_HANDLE,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const updateList = (id, data) => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: EntryActionTypes.LIST_UPDATE,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
data,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const handleListUpdate = (list) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: EntryActionTypes.LIST_UPDATE_HANDLE,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const moveList = (id, index) => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: EntryActionTypes.LIST_MOVE,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
index,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-22 21:56:07 +02:00
|
|
|
const sortList = (id, data) => {
|
|
|
|
|
return {
|
|
|
|
|
type: EntryActionTypes.LIST_SORT,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
data,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
const moveListCardsToArchiveList = (id) => ({
|
|
|
|
|
type: EntryActionTypes.LIST_CARDS_TO_ARCHIVE_LIST_MOVE,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const clearTrashListInCurrentBoard = () => ({
|
|
|
|
|
type: EntryActionTypes.TRASH_LIST_IN_CURRENT_BOARD_CLEAR,
|
|
|
|
|
payload: {},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const handleListClear = (list) => ({
|
|
|
|
|
type: EntryActionTypes.LIST_CLEAR_HANDLE,
|
2024-04-22 21:56:07 +02:00
|
|
|
payload: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const deleteList = (id) => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: EntryActionTypes.LIST_DELETE,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
},
|
|
|
|
|
});
|
2021-06-24 01:05:22 +05:00
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
const handleListDelete = (list, cards) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: EntryActionTypes.LIST_DELETE_HANDLE,
|
|
|
|
|
payload: {
|
|
|
|
|
list,
|
2025-05-10 02:09:06 +02:00
|
|
|
cards,
|
2021-06-24 01:05:22 +05:00
|
|
|
},
|
|
|
|
|
});
|
2022-08-04 13:31:14 +02:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
createListInCurrentBoard,
|
|
|
|
|
handleListCreate,
|
|
|
|
|
updateList,
|
|
|
|
|
handleListUpdate,
|
|
|
|
|
moveList,
|
2024-04-22 21:56:07 +02:00
|
|
|
sortList,
|
2025-05-10 02:09:06 +02:00
|
|
|
moveListCardsToArchiveList,
|
|
|
|
|
clearTrashListInCurrentBoard,
|
|
|
|
|
handleListClear,
|
2022-08-04 13:31:14 +02:00
|
|
|
deleteList,
|
|
|
|
|
handleListDelete,
|
|
|
|
|
};
|