@@ -1,5 +1,31 @@
|
||||
/*!
|
||||
* Copyright (c) 2024 PLANKA Software GmbH
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
const searchProjects = (value) => ({
|
||||
type: ActionTypes.PROJECTS_SEARCH,
|
||||
payload: {
|
||||
value,
|
||||
},
|
||||
});
|
||||
|
||||
const updateProjectsOrder = (value) => ({
|
||||
type: ActionTypes.PROJECTS_ORDER_UPDATE,
|
||||
payload: {
|
||||
value,
|
||||
},
|
||||
});
|
||||
|
||||
const toggleHiddenProjects = (isVisible) => ({
|
||||
type: ActionTypes.HIDDEN_PROJECTS_TOGGLE,
|
||||
payload: {
|
||||
isVisible,
|
||||
},
|
||||
});
|
||||
|
||||
const createProject = (data) => ({
|
||||
type: ActionTypes.PROJECT_CREATE,
|
||||
payload: {
|
||||
@@ -22,14 +48,28 @@ createProject.failure = (error) => ({
|
||||
},
|
||||
});
|
||||
|
||||
const handleProjectCreate = (project, users, projectManagers, boards, boardMemberships) => ({
|
||||
const handleProjectCreate = (
|
||||
project,
|
||||
users,
|
||||
projectManagers,
|
||||
backgroundImages,
|
||||
baseCustomFieldGroups,
|
||||
boards,
|
||||
boardMemberships,
|
||||
customFields,
|
||||
notificationServices,
|
||||
) => ({
|
||||
type: ActionTypes.PROJECT_CREATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
users,
|
||||
projectManagers,
|
||||
backgroundImages,
|
||||
baseCustomFieldGroups,
|
||||
boards,
|
||||
boardMemberships,
|
||||
customFields,
|
||||
notificationServices,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -56,32 +96,56 @@ updateProject.failure = (id, error) => ({
|
||||
},
|
||||
});
|
||||
|
||||
const handleProjectUpdate = (project) => ({
|
||||
const handleProjectUpdate = (
|
||||
project,
|
||||
boardIds,
|
||||
isAvailable,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
backgroundImages,
|
||||
baseCustomFieldGroups,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
taskLists,
|
||||
tasks,
|
||||
attachments,
|
||||
customFieldGroups,
|
||||
customFields,
|
||||
customFieldValues,
|
||||
notificationsToDelete,
|
||||
notificationServices,
|
||||
) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
const updateProjectBackgroundImage = (id) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
updateProjectBackgroundImage.success = (project) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
updateProjectBackgroundImage.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
boardIds,
|
||||
isAvailable,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
backgroundImages,
|
||||
baseCustomFieldGroups,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
taskLists,
|
||||
tasks,
|
||||
attachments,
|
||||
customFieldGroups,
|
||||
customFields,
|
||||
customFieldValues,
|
||||
notificationsToDelete,
|
||||
notificationServices,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -115,11 +179,13 @@ const handleProjectDelete = (project) => ({
|
||||
});
|
||||
|
||||
export default {
|
||||
searchProjects,
|
||||
updateProjectsOrder,
|
||||
toggleHiddenProjects,
|
||||
createProject,
|
||||
handleProjectCreate,
|
||||
updateProject,
|
||||
handleProjectUpdate,
|
||||
updateProjectBackgroundImage,
|
||||
deleteProject,
|
||||
handleProjectDelete,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user