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
|
|
|
|
*/
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const createProjectManager = (projectManager) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: ActionTypes.PROJECT_MANAGER_CREATE,
|
|
|
|
payload: {
|
|
|
|
projectManager,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
createProjectManager.success = (localId, projectManager) => ({
|
|
|
|
type: ActionTypes.PROJECT_MANAGER_CREATE__SUCCESS,
|
|
|
|
payload: {
|
|
|
|
localId,
|
|
|
|
projectManager,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
createProjectManager.failure = (localId, error) => ({
|
|
|
|
type: ActionTypes.PROJECT_MANAGER_CREATE__FAILURE,
|
|
|
|
payload: {
|
|
|
|
localId,
|
|
|
|
error,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const handleProjectManagerCreate = (
|
2021-06-24 01:05:22 +05:00
|
|
|
projectManager,
|
2025-05-10 02:09:06 +02:00
|
|
|
boardIds,
|
|
|
|
isCurrentUser,
|
|
|
|
isProjectAvailable,
|
2021-06-24 01:05:22 +05:00
|
|
|
project,
|
|
|
|
board,
|
|
|
|
users,
|
|
|
|
projectManagers,
|
2025-05-10 02:09:06 +02:00
|
|
|
backgroundImages,
|
|
|
|
baseCustomFieldGroups,
|
2021-06-24 01:05:22 +05:00
|
|
|
boards,
|
|
|
|
boardMemberships,
|
|
|
|
labels,
|
|
|
|
lists,
|
|
|
|
cards,
|
|
|
|
cardMemberships,
|
|
|
|
cardLabels,
|
2025-05-10 02:09:06 +02:00
|
|
|
taskLists,
|
2021-06-24 01:05:22 +05:00
|
|
|
tasks,
|
|
|
|
attachments,
|
2025-05-10 02:09:06 +02:00
|
|
|
customFieldGroups,
|
|
|
|
customFields,
|
|
|
|
customFieldValues,
|
|
|
|
notificationsToDelete,
|
|
|
|
notificationServices,
|
2021-06-24 01:05:22 +05:00
|
|
|
) => ({
|
|
|
|
type: ActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
|
|
|
payload: {
|
|
|
|
projectManager,
|
2025-05-10 02:09:06 +02:00
|
|
|
boardIds,
|
|
|
|
isCurrentUser,
|
|
|
|
isProjectAvailable,
|
2021-06-24 01:05:22 +05:00
|
|
|
project,
|
|
|
|
board,
|
|
|
|
users,
|
|
|
|
projectManagers,
|
2025-05-10 02:09:06 +02:00
|
|
|
backgroundImages,
|
|
|
|
baseCustomFieldGroups,
|
2021-06-24 01:05:22 +05:00
|
|
|
boards,
|
|
|
|
boardMemberships,
|
|
|
|
labels,
|
|
|
|
lists,
|
|
|
|
cards,
|
|
|
|
cardMemberships,
|
|
|
|
cardLabels,
|
2025-05-10 02:09:06 +02:00
|
|
|
taskLists,
|
2021-06-24 01:05:22 +05:00
|
|
|
tasks,
|
|
|
|
attachments,
|
2025-05-10 02:09:06 +02:00
|
|
|
customFieldGroups,
|
|
|
|
customFields,
|
|
|
|
customFieldValues,
|
|
|
|
notificationsToDelete,
|
|
|
|
notificationServices,
|
2021-06-24 01:05:22 +05:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
const deleteProjectManager = (id) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: ActionTypes.PROJECT_MANAGER_DELETE,
|
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
deleteProjectManager.success = (projectManager) => ({
|
|
|
|
type: ActionTypes.PROJECT_MANAGER_DELETE__SUCCESS,
|
|
|
|
payload: {
|
|
|
|
projectManager,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
deleteProjectManager.failure = (id, error) => ({
|
|
|
|
type: ActionTypes.PROJECT_MANAGER_DELETE__FAILURE,
|
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
error,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
const handleProjectManagerDelete = (projectManager) => ({
|
2021-06-24 01:05:22 +05:00
|
|
|
type: ActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
|
|
|
payload: {
|
|
|
|
projectManager,
|
|
|
|
},
|
|
|
|
});
|
2022-08-04 13:31:14 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
createProjectManager,
|
|
|
|
handleProjectManagerCreate,
|
|
|
|
deleteProjectManager,
|
|
|
|
handleProjectManagerDelete,
|
|
|
|
};
|