Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
@@ -1,23 +1,21 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createActionReceived = (action) => ({
|
||||
type: ActionTypes.ACTION_CREATE_RECEIVED,
|
||||
export const handleActionCreate = (action) => ({
|
||||
type: ActionTypes.ACTION_CREATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateActionReceived = (action) => ({
|
||||
type: ActionTypes.ACTION_UPDATE_RECEIVED,
|
||||
export const handleActionUpdate = (action) => ({
|
||||
type: ActionTypes.ACTION_UPDATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteActionReceived = (action) => ({
|
||||
type: ActionTypes.ACTION_DELETE_RECEIVED,
|
||||
export const handleActionDelete = (action) => ({
|
||||
type: ActionTypes.ACTION_DELETE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
export const fetchActionsRequested = (cardId) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH_REQUESTED,
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const fetchActions = (cardId) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH,
|
||||
payload: {
|
||||
cardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchActionsSucceeded = (cardId, actions, users) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH_SUCCEEDED,
|
||||
fetchActions.success = (cardId, actions, users) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH__SUCCESS,
|
||||
payload: {
|
||||
cardId,
|
||||
actions,
|
||||
@@ -18,8 +17,8 @@ export const fetchActionsSucceeded = (cardId, actions, users) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchActionsFailed = (cardId, error) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH_FAILED,
|
||||
fetchActions.failure = (cardId, error) => ({
|
||||
type: ActionTypes.ACTIONS_FETCH__FAILURE,
|
||||
payload: {
|
||||
cardId,
|
||||
error,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createAttachment = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,29 @@ export const createAttachment = (attachment) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createAttachment.success = (localId, attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
createAttachment.failure = (localId, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentCreate = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachment = (id, data) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +38,28 @@ export const updateAttachment = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateAttachment.success = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
updateAttachment.failure = (id, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentUpdate = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachment = (id) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE,
|
||||
payload: {
|
||||
@@ -24,93 +67,23 @@ export const deleteAttachment = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createAttachmentRequested = (localId, data) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createAttachmentSucceeded = (localId, attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const createAttachmentFailed = (localId, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createAttachmentReceived = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_CREATE_RECEIVED,
|
||||
deleteAttachment.success = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE__SUCCESS,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachmentRequested = (id, data) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachmentSucceeded = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachmentFailed = (id, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE_FAILED,
|
||||
deleteAttachment.failure = (id, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachmentReceived = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachmentRequested = (id) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachmentSucceeded = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachmentFailed = (id, error) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachmentReceived = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE_RECEIVED,
|
||||
export const handleAttachmentDelete = (attachment) => ({
|
||||
type: ActionTypes.ATTACHMENT_DELETE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
|
||||
97
client/src/actions/board-membership.js
Normal file
97
client/src/actions/board-membership.js
Normal file
@@ -0,0 +1,97 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createBoardMembership = (boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
createBoardMembership.success = (localId, boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
createBoardMembership.failure = (localId, error) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipCreate = (
|
||||
boardMembership,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
handleBoardMembershipCreate.fetchProject = (id, currentUserId, currentBoardId) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE__PROJECT_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
currentUserId,
|
||||
currentBoardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardMembership = (id) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoardMembership.success = (boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE__SUCCESS,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoardMembership.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipDelete = (boardMembership) => ({
|
||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createBoard = (board) => ({
|
||||
type: ActionTypes.BOARD_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,74 @@ export const createBoard = (board) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createBoard.success = (localId, board, boardMemberships) => ({
|
||||
type: ActionTypes.BOARD_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
board,
|
||||
boardMemberships,
|
||||
},
|
||||
});
|
||||
|
||||
createBoard.failure = (localId, error) => ({
|
||||
type: ActionTypes.BOARD_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardCreate = (board) => ({
|
||||
type: ActionTypes.BOARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchBoard = (id) => ({
|
||||
type: ActionTypes.BOARD_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
fetchBoard.success = (
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.BOARD_FETCH__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
fetchBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_FETCH__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateBoard = (id, data) => ({
|
||||
type: ActionTypes.BOARD_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +83,28 @@ export const updateBoard = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateBoard.success = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
updateBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardUpdate = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoard = (id) => ({
|
||||
type: ActionTypes.BOARD_DELETE,
|
||||
payload: {
|
||||
@@ -24,135 +112,23 @@ export const deleteBoard = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createBoardRequested = (localId, data) => ({
|
||||
type: ActionTypes.BOARD_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createBoardSucceeded = (localId, board, lists, labels) => ({
|
||||
type: ActionTypes.BOARD_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
board,
|
||||
lists,
|
||||
labels,
|
||||
},
|
||||
});
|
||||
|
||||
export const createBoardFailed = (localId, error) => ({
|
||||
type: ActionTypes.BOARD_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createBoardReceived = (board, lists, labels) => ({
|
||||
type: ActionTypes.BOARD_CREATE_RECEIVED,
|
||||
deleteBoard.success = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
lists,
|
||||
labels,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchBoardRequested = (id) => ({
|
||||
type: ActionTypes.BOARD_FETCH_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchBoardSucceeded = (
|
||||
board,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.BOARD_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
board,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchBoardFailed = (id, error) => ({
|
||||
type: ActionTypes.BOARD_FETCH_FAILED,
|
||||
deleteBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateBoardRequested = (id, data) => ({
|
||||
type: ActionTypes.BOARD_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateBoardSucceeded = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateBoardFailed = (id, error) => ({
|
||||
type: ActionTypes.BOARD_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateBoardReceived = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardRequested = (id) => ({
|
||||
type: ActionTypes.BOARD_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardSucceeded = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardFailed = (id, error) => ({
|
||||
type: ActionTypes.BOARD_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardReceived = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE_RECEIVED,
|
||||
export const handleBoardDelete = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createCardLabelRequested = (data) => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardLabelSucceeded = (cardLabel) => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardLabelFailed = (error) => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardLabelReceived = (cardLabel) => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_RECEIVED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardLabelRequested = (cardId, labelId) => ({
|
||||
type: ActionTypes.CARD_LABEL_DELETE_REQUESTED,
|
||||
payload: {
|
||||
cardId,
|
||||
labelId,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardLabelSucceeded = (cardLabel) => ({
|
||||
type: ActionTypes.CARD_LABEL_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardLabelFailed = (cardId, labelId, error) => ({
|
||||
type: ActionTypes.CARD_LABEL_DELETE_FAILED,
|
||||
payload: {
|
||||
cardId,
|
||||
labelId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardLabelReceived = (cardLabel) => ({
|
||||
type: ActionTypes.CARD_LABEL_DELETE_RECEIVED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
@@ -1,62 +0,0 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createCardMembershipRequested = (data) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardMembershipSucceeded = (cardMembership) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardMembershipFailed = (error) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardMembershipReceived = (cardMembership) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_RECEIVED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardMembershipRequested = (cardId, userId) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_DELETE_REQUESTED,
|
||||
payload: {
|
||||
cardId,
|
||||
userId,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardMembershipSucceeded = (cardMembership) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardMembershipFailed = (cardId, userId, error) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_DELETE_FAILED,
|
||||
payload: {
|
||||
cardId,
|
||||
userId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardMembershipReceived = (cardMembership) => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_DELETE_RECEIVED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createCard = (card) => ({
|
||||
type: ActionTypes.CARD_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,29 @@ export const createCard = (card) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createCard.success = (localId, card) => ({
|
||||
type: ActionTypes.CARD_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
createCard.failure = (localId, error) => ({
|
||||
type: ActionTypes.CARD_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardCreate = (card) => ({
|
||||
type: ActionTypes.CARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCard = (id, data) => ({
|
||||
type: ActionTypes.CARD_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +38,28 @@ export const updateCard = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateCard.success = (card) => ({
|
||||
type: ActionTypes.CARD_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
updateCard.failure = (id, error) => ({
|
||||
type: ActionTypes.CARD_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardUpdate = (card) => ({
|
||||
type: ActionTypes.CARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCard = (id) => ({
|
||||
type: ActionTypes.CARD_DELETE,
|
||||
payload: {
|
||||
@@ -24,130 +67,23 @@ export const deleteCard = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createCardRequested = (localId, data) => ({
|
||||
type: ActionTypes.CARD_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardSucceeded = (
|
||||
localId,
|
||||
card,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.CARD_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
card,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardFailed = (localId, error) => ({
|
||||
type: ActionTypes.CARD_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardReceived = (card, cardMemberships, cardLabels, tasks, attachments) => ({
|
||||
type: ActionTypes.CARD_CREATE_RECEIVED,
|
||||
payload: {
|
||||
card,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCardRequested = (id) => ({
|
||||
type: ActionTypes.CARD_FETCH_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCardSucceeded = (card) => ({
|
||||
type: ActionTypes.CARD_FETCH_SUCCEEDED,
|
||||
deleteCard.success = (card) => ({
|
||||
type: ActionTypes.CARD_DELETE__SUCCESS,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCardFailed = (id, error) => ({
|
||||
type: ActionTypes.CARD_FETCH_FAILED,
|
||||
deleteCard.failure = (id, error) => ({
|
||||
type: ActionTypes.CARD_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCardRequested = (id, data) => ({
|
||||
type: ActionTypes.CARD_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCardSucceeded = (card) => ({
|
||||
type: ActionTypes.CARD_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCardFailed = (id, error) => ({
|
||||
type: ActionTypes.CARD_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCardReceived = (card) => ({
|
||||
type: ActionTypes.CARD_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardRequested = (id) => ({
|
||||
type: ActionTypes.CARD_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardSucceeded = (card) => ({
|
||||
type: ActionTypes.CARD_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardFailed = (id, error) => ({
|
||||
type: ActionTypes.CARD_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardReceived = (card) => ({
|
||||
type: ActionTypes.CARD_DELETE_RECEIVED,
|
||||
export const handleCardDelete = (card) => ({
|
||||
type: ActionTypes.CARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createCommentAction = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,22 @@ export const createCommentAction = (action) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createCommentAction.success = (localId, action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
createCommentAction.failure = (localId, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCommentAction = (id, data) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +31,21 @@ export const updateCommentAction = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateCommentAction.success = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
updateCommentAction.failure = (id, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCommentAction = (id) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE,
|
||||
payload: {
|
||||
@@ -24,71 +53,15 @@ export const deleteCommentAction = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createCommentActionRequested = (localId, data) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCommentActionSucceeded = (localId, action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCommentActionFailed = (localId, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCommentActionRequested = (id, data) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCommentActionSucceeded = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE_SUCCEEDED,
|
||||
deleteCommentAction.success = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE__SUCCESS,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCommentActionFailed = (id, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCommentActionRequested = (id) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCommentActionSucceeded = (action) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCommentActionFailed = (id, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE_FAILED,
|
||||
deleteCommentAction.failure = (id, error) => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
|
||||
@@ -1,9 +1,41 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const coreInitialized = () => ({
|
||||
type: ActionTypes.CORE_INITIALIZED,
|
||||
payload: {},
|
||||
export const initializeCore = (
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
) => ({
|
||||
type: ActionTypes.CORE_INITIALIZE,
|
||||
payload: {
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
},
|
||||
});
|
||||
|
||||
22
client/src/actions/entry/action.js
Normal file
22
client/src/actions/entry/action.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const handleActionCreate = (action) => ({
|
||||
type: EntryActionTypes.ACTION_CREATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleActionUpdate = (action) => ({
|
||||
type: EntryActionTypes.ACTION_UPDATE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleActionDelete = (action) => ({
|
||||
type: EntryActionTypes.ACTION_DELETE_HANDLE,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
@@ -7,6 +7,14 @@ export const createAttachmentInCurrentCard = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentCreate = (attachment, requestId) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_CREATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
requestId,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateAttachment = (id, data) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_UPDATE,
|
||||
payload: {
|
||||
@@ -15,9 +23,23 @@ export const updateAttachment = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentUpdate = (attachment) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteAttachment = (id) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleAttachmentDelete = (attachment) => ({
|
||||
type: EntryActionTypes.ATTACHMENT_DELETE_HANDLE,
|
||||
payload: {
|
||||
attachment,
|
||||
},
|
||||
});
|
||||
|
||||
29
client/src/actions/entry/board-membership.js
Normal file
29
client/src/actions/entry/board-membership.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createMembershipInCurrentBoard = (data) => ({
|
||||
type: EntryActionTypes.MEMBERSHIP_IN_CURRENT_BOARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipCreate = (boardMembership) => ({
|
||||
type: EntryActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardMembership = (id) => ({
|
||||
type: EntryActionTypes.BOARD_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardMembershipDelete = (boardMembership) => ({
|
||||
type: EntryActionTypes.BOARD_MEMBERSHIP_DELETE_HANDLE,
|
||||
payload: {
|
||||
boardMembership,
|
||||
},
|
||||
});
|
||||
@@ -7,6 +7,13 @@ export const createBoardInCurrentProject = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardCreate = (board) => ({
|
||||
type: EntryActionTypes.BOARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchBoard = (id) => ({
|
||||
type: EntryActionTypes.BOARD_FETCH,
|
||||
payload: {
|
||||
@@ -22,6 +29,13 @@ export const updateBoard = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardUpdate = (board) => ({
|
||||
type: EntryActionTypes.BOARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const moveBoard = (id, index) => ({
|
||||
type: EntryActionTypes.BOARD_MOVE,
|
||||
payload: {
|
||||
@@ -36,3 +50,10 @@ export const deleteBoard = (id) => ({
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleBoardDelete = (board) => ({
|
||||
type: EntryActionTypes.BOARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -8,6 +8,13 @@ export const createCard = (listId, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardCreate = (card) => ({
|
||||
type: EntryActionTypes.CARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCard = (id, data) => ({
|
||||
type: EntryActionTypes.CARD_UPDATE,
|
||||
payload: {
|
||||
@@ -23,6 +30,13 @@ export const updateCurrentCard = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleCardUpdate = (card) => ({
|
||||
type: EntryActionTypes.CARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const moveCard = (id, listId, index = 0) => ({
|
||||
type: EntryActionTypes.CARD_MOVE,
|
||||
payload: {
|
||||
@@ -70,3 +84,10 @@ export const deleteCurrentCard = () => ({
|
||||
type: EntryActionTypes.CURRENT_CARD_DELETE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const handleCardDelete = (card) => ({
|
||||
type: EntryActionTypes.CARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
7
client/src/actions/entry/core.js
Normal file
7
client/src/actions/entry/core.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const initializeCore = () => ({
|
||||
type: EntryActionTypes.CORE_INITIALIZE,
|
||||
payload: {},
|
||||
});
|
||||
@@ -1,14 +1,18 @@
|
||||
export * from './socket';
|
||||
export * from './login';
|
||||
export * from './core';
|
||||
export * from './modal';
|
||||
export * from './user';
|
||||
export * from './project';
|
||||
export * from './project-membership';
|
||||
export * from './project-manager';
|
||||
export * from './board';
|
||||
export * from './board-membership';
|
||||
export * from './label';
|
||||
export * from './list';
|
||||
export * from './card';
|
||||
export * from './task';
|
||||
export * from './attachment';
|
||||
export * from './actions';
|
||||
export * from './action';
|
||||
export * from './comment-action';
|
||||
export * from './notification';
|
||||
|
||||
@@ -7,6 +7,13 @@ export const createLabelInCurrentBoard = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelCreate = (label) => ({
|
||||
type: EntryActionTypes.LABEL_CREATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabel = (id, data) => ({
|
||||
type: EntryActionTypes.LABEL_UPDATE,
|
||||
payload: {
|
||||
@@ -15,6 +22,13 @@ export const updateLabel = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelUpdate = (label) => ({
|
||||
type: EntryActionTypes.LABEL_UPDATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabel = (id) => ({
|
||||
type: EntryActionTypes.LABEL_DELETE,
|
||||
payload: {
|
||||
@@ -22,6 +36,13 @@ export const deleteLabel = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelDelete = (label) => ({
|
||||
type: EntryActionTypes.LABEL_DELETE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.LABEL_TO_CARD_ADD,
|
||||
payload: {
|
||||
@@ -37,6 +58,13 @@ export const addLabelToCurrentCard = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelToCardAdd = (cardLabel) => ({
|
||||
type: EntryActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
@@ -52,6 +80,13 @@ export const removeLabelFromCurrentCard = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelFromCardRemove = (cardLabel) => ({
|
||||
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToFilterInCurrentBoard = (id) => ({
|
||||
type: EntryActionTypes.LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||
payload: {
|
||||
|
||||
@@ -7,6 +7,13 @@ export const createListInCurrentBoard = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListCreate = (list) => ({
|
||||
type: EntryActionTypes.LIST_CREATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateList = (id, data) => ({
|
||||
type: EntryActionTypes.LIST_UPDATE,
|
||||
payload: {
|
||||
@@ -15,6 +22,13 @@ export const updateList = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListUpdate = (list) => ({
|
||||
type: EntryActionTypes.LIST_UPDATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const moveList = (id, index) => ({
|
||||
type: EntryActionTypes.LIST_MOVE,
|
||||
payload: {
|
||||
@@ -29,3 +43,10 @@ export const deleteList = (id) => ({
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListDelete = (list) => ({
|
||||
type: EntryActionTypes.LIST_DELETE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -22,6 +22,13 @@ export const openProjectAddModal = () => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const openProjectSettingsModal = () => ({
|
||||
type: EntryActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
type: ModalTypes.PROJECT_SETTINGS,
|
||||
},
|
||||
});
|
||||
|
||||
export const closeModal = () => ({
|
||||
type: EntryActionTypes.MODAL_CLOSE,
|
||||
payload: {},
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const handleNotificationCreate = (notification) => ({
|
||||
type: EntryActionTypes.NOTIFICATION_CREATE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotification = (id) => ({
|
||||
type: EntryActionTypes.NOTIFICATION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleNotificationDelete = (notification) => ({
|
||||
type: EntryActionTypes.NOTIFICATION_DELETE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
});
|
||||
|
||||
29
client/src/actions/entry/project-manager.js
Executable file
29
client/src/actions/entry/project-manager.js
Executable file
@@ -0,0 +1,29 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createManagerInCurrentProject = (data) => ({
|
||||
type: EntryActionTypes.MANAGER_IN_CURRENT_PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerCreate = (projectManager) => ({
|
||||
type: EntryActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectManager = (id) => ({
|
||||
type: EntryActionTypes.PROJECT_MANAGER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerDelete = (projectManager) => ({
|
||||
type: EntryActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
@@ -1,15 +0,0 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createMembershipInCurrentProject = (data) => ({
|
||||
type: EntryActionTypes.MEMBERSHIP_IN_CURRENT_PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembership = (id) => ({
|
||||
type: EntryActionTypes.PROJECT_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
@@ -7,6 +7,13 @@ export const createProject = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectCreate = (project) => ({
|
||||
type: EntryActionTypes.PROJECT_CREATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentProject = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_PROJECT_UPDATE,
|
||||
payload: {
|
||||
@@ -14,6 +21,13 @@ export const updateCurrentProject = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectUpdate = (project) => ({
|
||||
type: EntryActionTypes.PROJECT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentProjectBackgroundImage = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_PROJECT_BACKGROUND_IMAGE_UPDATE,
|
||||
payload: {
|
||||
@@ -25,3 +39,10 @@ export const deleteCurrentProject = () => ({
|
||||
type: EntryActionTypes.CURRENT_PROJECT_DELETE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const handleProjectDelete = (project) => ({
|
||||
type: EntryActionTypes.PROJECT_DELETE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
11
client/src/actions/entry/socket.js
Normal file
11
client/src/actions/entry/socket.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const handleSocketDisconnect = () => ({
|
||||
type: EntryActionTypes.SOCKET_DISCONNECT_HANDLE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const handleSocketReconnect = () => ({
|
||||
type: EntryActionTypes.SOCKET_RECONNECT_HANDLE,
|
||||
payload: {},
|
||||
});
|
||||
@@ -7,6 +7,13 @@ export const createTaskInCurrentCard = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskCreate = (task) => ({
|
||||
type: EntryActionTypes.TASK_CREATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTask = (id, data) => ({
|
||||
type: EntryActionTypes.TASK_UPDATE,
|
||||
payload: {
|
||||
@@ -15,9 +22,23 @@ export const updateTask = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskUpdate = (task) => ({
|
||||
type: EntryActionTypes.TASK_UPDATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTask = (id) => ({
|
||||
type: EntryActionTypes.TASK_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskDelete = (task) => ({
|
||||
type: EntryActionTypes.TASK_DELETE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -7,6 +7,13 @@ export const createUser = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserCreate = (user) => ({
|
||||
type: EntryActionTypes.USER_CREATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserCreateError = () => ({
|
||||
type: EntryActionTypes.USER_CREATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
@@ -27,6 +34,13 @@ export const updateCurrentUser = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserUpdate = (user) => ({
|
||||
type: EntryActionTypes.USER_UPDATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentUserEmail = (data) => ({
|
||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
||||
payload: {
|
||||
@@ -77,6 +91,13 @@ export const deleteUser = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserDelete = (user) => ({
|
||||
type: EntryActionTypes.USER_DELETE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.USER_TO_CARD_ADD,
|
||||
payload: {
|
||||
@@ -92,6 +113,13 @@ export const addUserToCurrentCard = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserToCardAdd = (cardMembership) => ({
|
||||
type: EntryActionTypes.USER_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromCard = (id, cardId) => ({
|
||||
type: EntryActionTypes.USER_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
@@ -107,6 +135,13 @@ export const removeUserFromCurrentCard = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserFromCardRemove = (cardMembership) => ({
|
||||
type: EntryActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToFilterInCurrentBoard = (id) => ({
|
||||
type: EntryActionTypes.USER_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||
payload: {
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
export * from './router';
|
||||
export * from './socket';
|
||||
export * from './login';
|
||||
export * from './core';
|
||||
export * from './modal';
|
||||
export * from './users';
|
||||
export * from './user';
|
||||
export * from './projects';
|
||||
export * from './project';
|
||||
export * from './project-membership';
|
||||
export * from './project-manager';
|
||||
export * from './board';
|
||||
export * from './board-membership';
|
||||
export * from './label';
|
||||
export * from './list';
|
||||
export * from './card';
|
||||
export * from './card-membership';
|
||||
export * from './card-label';
|
||||
export * from './task';
|
||||
export * from './attachment';
|
||||
export * from './actions';
|
||||
export * from './action';
|
||||
export * from './comment-action';
|
||||
export * from './notifications';
|
||||
export * from './notification';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createLabel = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,29 @@ export const createLabel = (label) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createLabel.success = (localId, label) => ({
|
||||
type: ActionTypes.LABEL_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
createLabel.failure = (localId, error) => ({
|
||||
type: ActionTypes.LABEL_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelCreate = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabel = (id, data) => ({
|
||||
type: ActionTypes.LABEL_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +38,28 @@ export const updateLabel = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateLabel.success = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
updateLabel.failure = (id, error) => ({
|
||||
type: ActionTypes.LABEL_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelUpdate = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabel = (id) => ({
|
||||
type: ActionTypes.LABEL_DELETE,
|
||||
payload: {
|
||||
@@ -24,6 +67,28 @@ export const deleteLabel = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
deleteLabel.success = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE__SUCCESS,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
deleteLabel.failure = (id, error) => ({
|
||||
type: ActionTypes.LABEL_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelDelete = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToCard = (id, cardId) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD,
|
||||
payload: {
|
||||
@@ -32,6 +97,29 @@ export const addLabelToCard = (id, cardId) => ({
|
||||
},
|
||||
});
|
||||
|
||||
addLabelToCard.success = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD__SUCCESS,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
addLabelToCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelToCardAdd = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromCard = (id, cardId) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
@@ -40,6 +128,29 @@ export const removeLabelFromCard = (id, cardId) => ({
|
||||
},
|
||||
});
|
||||
|
||||
removeLabelFromCard.success = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE__SUCCESS,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
removeLabelFromCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelFromCardRemove = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToBoardFilter = (id, boardId) => ({
|
||||
type: ActionTypes.LABEL_TO_BOARD_FILTER_ADD,
|
||||
payload: {
|
||||
@@ -55,95 +166,3 @@ export const removeLabelFromBoardFilter = (id, boardId) => ({
|
||||
boardId,
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createLabelRequested = (localId, data) => ({
|
||||
type: ActionTypes.LABEL_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createLabelSucceeded = (localId, label) => ({
|
||||
type: ActionTypes.LABEL_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const createLabelFailed = (localId, error) => ({
|
||||
type: ActionTypes.LABEL_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createLabelReceived = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelRequested = (id, data) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelSucceeded = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelFailed = (id, error) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelReceived = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelRequested = (id) => ({
|
||||
type: ActionTypes.LABEL_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelSucceeded = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelFailed = (id, error) => ({
|
||||
type: ActionTypes.LABEL_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelReceived = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createList = (list) => ({
|
||||
type: ActionTypes.LIST_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,29 @@ export const createList = (list) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createList.success = (localId, list) => ({
|
||||
type: ActionTypes.LIST_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
createList.failure = (localId, error) => ({
|
||||
type: ActionTypes.LIST_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListCreate = (list) => ({
|
||||
type: ActionTypes.LIST_CREATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateList = (id, data) => ({
|
||||
type: ActionTypes.LIST_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +38,28 @@ export const updateList = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateList.success = (list) => ({
|
||||
type: ActionTypes.LIST_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
updateList.failure = (id, error) => ({
|
||||
type: ActionTypes.LIST_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleListUpdate = (list) => ({
|
||||
type: ActionTypes.LIST_UPDATE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteList = (id) => ({
|
||||
type: ActionTypes.LIST_DELETE,
|
||||
payload: {
|
||||
@@ -24,93 +67,23 @@ export const deleteList = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createListRequested = (localId, data) => ({
|
||||
type: ActionTypes.LIST_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createListSucceeded = (localId, list) => ({
|
||||
type: ActionTypes.LIST_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const createListFailed = (localId, error) => ({
|
||||
type: ActionTypes.LIST_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createListReceived = (list) => ({
|
||||
type: ActionTypes.LIST_CREATE_RECEIVED,
|
||||
deleteList.success = (list) => ({
|
||||
type: ActionTypes.LIST_DELETE__SUCCESS,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateListRequested = (id, data) => ({
|
||||
type: ActionTypes.LIST_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateListSucceeded = (list) => ({
|
||||
type: ActionTypes.LIST_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateListFailed = (id, error) => ({
|
||||
type: ActionTypes.LIST_UPDATE_FAILED,
|
||||
deleteList.failure = (id, error) => ({
|
||||
type: ActionTypes.LIST_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateListReceived = (list) => ({
|
||||
type: ActionTypes.LIST_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteListRequested = (id) => ({
|
||||
type: ActionTypes.LIST_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteListSucceeded = (list) => ({
|
||||
type: ActionTypes.LIST_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteListFailed = (id, error) => ({
|
||||
type: ActionTypes.LIST_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteListReceived = (list) => ({
|
||||
type: ActionTypes.LIST_DELETE_RECEIVED,
|
||||
export const handleListDelete = (list) => ({
|
||||
type: ActionTypes.LIST_DELETE_HANDLE,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const authenticate = (data) => ({
|
||||
type: ActionTypes.AUTHENTICATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,20 @@ export const authenticate = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
authenticate.success = (accessToken) => ({
|
||||
type: ActionTypes.AUTHENTICATE__SUCCESS,
|
||||
payload: {
|
||||
accessToken,
|
||||
},
|
||||
});
|
||||
|
||||
authenticate.failure = (error) => ({
|
||||
type: ActionTypes.AUTHENTICATE__FAILURE,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearAuthenticateError = () => ({
|
||||
type: ActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
@@ -18,26 +30,3 @@ export const logout = () => ({
|
||||
type: ActionTypes.LOGOUT,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const authenticateRequested = (data) => ({
|
||||
type: ActionTypes.AUTHENTICATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const authenticateSucceeded = (accessToken) => ({
|
||||
type: ActionTypes.AUTHENTICATE_SUCCEEDED,
|
||||
payload: {
|
||||
accessToken,
|
||||
},
|
||||
});
|
||||
|
||||
export const authenticateFailed = (error) => ({
|
||||
type: ActionTypes.AUTHENTICATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const openModal = (type) => ({
|
||||
type: ActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
|
||||
@@ -1,19 +1,39 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createNotificationReceived = (notification, user, card, action) => ({
|
||||
type: ActionTypes.NOTIFICATION_CREATE_RECEIVED,
|
||||
export const handleNotificationCreate = (notification, users, cards, actions) => ({
|
||||
type: ActionTypes.NOTIFICATION_CREATE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
user,
|
||||
card,
|
||||
action,
|
||||
users,
|
||||
cards,
|
||||
actions,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotificationReceived = (notification) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE_RECEIVED,
|
||||
export const deleteNotification = (id) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteNotification.success = (notification) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE__SUCCESS,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
});
|
||||
|
||||
deleteNotification.failure = (id, error) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleNotificationDelete = (notification) => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE_HANDLE,
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const deleteNotifications = (ids) => ({
|
||||
type: ActionTypes.NOTIFICATIONS_DELETE,
|
||||
payload: {
|
||||
ids,
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const fetchNotificationsRequested = () => ({
|
||||
type: ActionTypes.NOTIFICATIONS_FETCH_REQUESTED,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const fetchNotificationsSucceeded = (notifications, users, cards, actions) => ({
|
||||
type: ActionTypes.NOTIFICATIONS_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
notifications,
|
||||
users,
|
||||
cards,
|
||||
actions,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchNotificationsFailed = (error) => ({
|
||||
type: ActionTypes.NOTIFICATIONS_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotificationsRequested = (ids) => ({
|
||||
type: ActionTypes.NOTIFICATIONS_DELETE_REQUESTED,
|
||||
payload: {
|
||||
ids,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotificationsSucceeded = (notifications) => ({
|
||||
type: ActionTypes.NOTIFICATIONS_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
notifications,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotificationsFailed = (ids, error) => ({
|
||||
type: ActionTypes.NOTIFICATIONS_DELETE_FAILED,
|
||||
payload: {
|
||||
ids,
|
||||
error,
|
||||
},
|
||||
});
|
||||
101
client/src/actions/project-manager.js
Normal file
101
client/src/actions/project-manager.js
Normal file
@@ -0,0 +1,101 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
export const createProjectManager = (projectManager) => ({
|
||||
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,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerCreate = (
|
||||
projectManager,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
project,
|
||||
board,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
handleProjectManagerCreate.fetchProject = (id, currentUserId, currentBoardId) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_CREATE_HANDLE__PROJECT_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
currentUserId,
|
||||
currentBoardId,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectManager = (id, isCurrentUser, isCurrentProject) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
isCurrentUser,
|
||||
isCurrentProject,
|
||||
},
|
||||
});
|
||||
|
||||
deleteProjectManager.success = (projectManager) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE__SUCCESS,
|
||||
payload: {
|
||||
projectManager,
|
||||
},
|
||||
});
|
||||
|
||||
deleteProjectManager.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectManagerDelete = (projectManager, isCurrentUser, isCurrentProject) => ({
|
||||
type: ActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
||||
payload: {
|
||||
projectManager,
|
||||
isCurrentUser,
|
||||
isCurrentProject,
|
||||
},
|
||||
});
|
||||
@@ -1,80 +0,0 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createProjectMembership = (projectMembership) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_CREATE,
|
||||
payload: {
|
||||
projectMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembership = (id) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createProjectMembershipRequested = (localId, data) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createProjectMembershipSucceeded = (localId, projectMembership) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
projectMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const createProjectMembershipFailed = (localId, error) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createProjectMembershipReceived = (projectMembership, user) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_CREATE_RECEIVED,
|
||||
payload: {
|
||||
projectMembership,
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembershipRequested = (id) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembershipSucceeded = (projectMembership) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
projectMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembershipFailed = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembershipReceived = (projectMembership) => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE_RECEIVED,
|
||||
payload: {
|
||||
projectMembership,
|
||||
},
|
||||
});
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createProject = (data) => ({
|
||||
type: ActionTypes.PROJECT_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,32 @@ export const createProject = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createProject.success = (project, projectManagers) => ({
|
||||
type: ActionTypes.PROJECT_CREATE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
projectManagers,
|
||||
},
|
||||
});
|
||||
|
||||
createProject.failure = (error) => ({
|
||||
type: ActionTypes.PROJECT_CREATE__FAILURE,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectCreate = (project, users, projectManagers, boards, boardMemberships) => ({
|
||||
type: ActionTypes.PROJECT_CREATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
users,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProject = (id, data) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +41,50 @@ export const updateProject = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateProject.success = (project) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
updateProject.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleProjectUpdate = (project) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export 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,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProject = (id) => ({
|
||||
type: ActionTypes.PROJECT_DELETE,
|
||||
payload: {
|
||||
@@ -24,118 +92,23 @@ export const deleteProject = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createProjectRequested = (data) => ({
|
||||
type: ActionTypes.PROJECT_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createProjectSucceeded = (project, users, projectMemberships, boards) => ({
|
||||
type: ActionTypes.PROJECT_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
project,
|
||||
users,
|
||||
projectMemberships,
|
||||
boards,
|
||||
},
|
||||
});
|
||||
|
||||
export const createProjectFailed = (error) => ({
|
||||
type: ActionTypes.PROJECT_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createProjectReceived = (project, users, projectMemberships, boards) => ({
|
||||
type: ActionTypes.PROJECT_CREATE_RECEIVED,
|
||||
payload: {
|
||||
project,
|
||||
users,
|
||||
projectMemberships,
|
||||
boards,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectRequested = (id, data) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectSucceeded = (project) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_SUCCEEDED,
|
||||
deleteProject.success = (project) => ({
|
||||
type: ActionTypes.PROJECT_DELETE__SUCCESS,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectFailed = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_FAILED,
|
||||
deleteProject.failure = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectReceived = (project) => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectBackgroundImageRequested = (id) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectBackgroundImageSucceeded = (project) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateProjectBackgroundImageFailed = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectRequested = (id) => ({
|
||||
type: ActionTypes.PROJECT_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectSucceeded = (project) => ({
|
||||
type: ActionTypes.PROJECT_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectFailed = (id, error) => ({
|
||||
type: ActionTypes.PROJECT_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectReceived = (project) => ({
|
||||
type: ActionTypes.PROJECT_DELETE_RECEIVED,
|
||||
export const handleProjectDelete = (project) => ({
|
||||
type: ActionTypes.PROJECT_DELETE_HANDLE,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
export const fetchProjectsRequested = () => ({
|
||||
type: ActionTypes.PROJECTS_FETCH_REQUESTED,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const fetchProjectsSucceeded = (projects, users, projectMemberships, boards) => ({
|
||||
type: ActionTypes.PROJECTS_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
projects,
|
||||
users,
|
||||
projectMemberships,
|
||||
boards,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchProjectsFailed = (error) => ({
|
||||
type: ActionTypes.PROJECTS_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
40
client/src/actions/router.js
Normal file
40
client/src/actions/router.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const handleLocationChange = (
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
notifications,
|
||||
) => ({
|
||||
type: ActionTypes.LOCATION_CHANGE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
notifications,
|
||||
},
|
||||
});
|
||||
|
||||
handleLocationChange.fetchBoard = (id) => ({
|
||||
type: ActionTypes.LOCATION_CHANGE_HANDLE__BOARD_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
@@ -1,18 +1,53 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
import SocketStatuses from '../constants/SocketStatuses';
|
||||
|
||||
/* Events */
|
||||
export const handleSocketDisconnect = () => ({
|
||||
type: ActionTypes.SOCKET_DISCONNECT_HANDLE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const socketDisconnected = () => ({
|
||||
type: ActionTypes.SOCKET_STATUS_CHANGED,
|
||||
export const handleSocketReconnect = (
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
) => ({
|
||||
type: ActionTypes.SOCKET_RECONNECT_HANDLE,
|
||||
payload: {
|
||||
status: SocketStatuses.DISCONNECTED,
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
projectManagers,
|
||||
boards,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
notifications,
|
||||
},
|
||||
});
|
||||
|
||||
export const socketReconnected = () => ({
|
||||
type: ActionTypes.SOCKET_STATUS_CHANGED,
|
||||
handleSocketReconnect.fetchCore = (currentUserId, currentBoardId) => ({
|
||||
type: ActionTypes.SOCKET_RECONNECT_HANDLE__CORE_FETCH,
|
||||
payload: {
|
||||
status: SocketStatuses.RECONNECTED,
|
||||
currentUserId,
|
||||
currentBoardId,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createTask = (task) => ({
|
||||
type: ActionTypes.TASK_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,29 @@ export const createTask = (task) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createTask.success = (localId, task) => ({
|
||||
type: ActionTypes.TASK_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
createTask.failure = (localId, error) => ({
|
||||
type: ActionTypes.TASK_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskCreate = (task) => ({
|
||||
type: ActionTypes.TASK_CREATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTask = (id, data) => ({
|
||||
type: ActionTypes.TASK_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +38,28 @@ export const updateTask = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateTask.success = (task) => ({
|
||||
type: ActionTypes.TASK_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
updateTask.failure = (id, error) => ({
|
||||
type: ActionTypes.TASK_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleTaskUpdate = (task) => ({
|
||||
type: ActionTypes.TASK_UPDATE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTask = (id) => ({
|
||||
type: ActionTypes.TASK_DELETE,
|
||||
payload: {
|
||||
@@ -24,93 +67,23 @@ export const deleteTask = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createTaskRequested = (localId, data) => ({
|
||||
type: ActionTypes.TASK_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createTaskSucceeded = (localId, task) => ({
|
||||
type: ActionTypes.TASK_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const createTaskFailed = (localId, error) => ({
|
||||
type: ActionTypes.TASK_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createTaskReceived = (task) => ({
|
||||
type: ActionTypes.TASK_CREATE_RECEIVED,
|
||||
deleteTask.success = (task) => ({
|
||||
type: ActionTypes.TASK_DELETE__SUCCESS,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTaskRequested = (id, data) => ({
|
||||
type: ActionTypes.TASK_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTaskSucceeded = (task) => ({
|
||||
type: ActionTypes.TASK_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTaskFailed = (id, error) => ({
|
||||
type: ActionTypes.TASK_UPDATE_FAILED,
|
||||
deleteTask.failure = (id, error) => ({
|
||||
type: ActionTypes.TASK_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateTaskReceived = (task) => ({
|
||||
type: ActionTypes.TASK_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTaskRequested = (id) => ({
|
||||
type: ActionTypes.TASK_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTaskSucceeded = (task) => ({
|
||||
type: ActionTypes.TASK_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTaskFailed = (id, error) => ({
|
||||
type: ActionTypes.TASK_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTaskReceived = (task) => ({
|
||||
type: ActionTypes.TASK_DELETE_RECEIVED,
|
||||
export const handleTaskDelete = (task) => ({
|
||||
type: ActionTypes.TASK_DELETE_HANDLE,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createUser = (data) => ({
|
||||
type: ActionTypes.USER_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,27 @@ export const createUser = (data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createUser.success = (user) => ({
|
||||
type: ActionTypes.USER_CREATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
createUser.failure = (error) => ({
|
||||
type: ActionTypes.USER_CREATE__FAILURE,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserCreate = (user) => ({
|
||||
type: ActionTypes.USER_CREATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserCreateError = () => ({
|
||||
type: ActionTypes.USER_CREATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
@@ -22,6 +41,53 @@ export const updateUser = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateUser.success = (user) => ({
|
||||
type: ActionTypes.USER_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUser.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserUpdate = (user, users, isCurrent) => ({
|
||||
type: ActionTypes.USER_UPDATE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
users,
|
||||
isCurrent,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserEmail = (id, data) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserEmail.success = (user) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserEmail.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserEmailUpdateError = (id) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
@@ -29,6 +95,29 @@ export const clearUserEmailUpdateError = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserPassword = (id, data) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserPassword.success = (user) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserPassword.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserPasswordUpdateError = (id) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
@@ -36,6 +125,29 @@ export const clearUserPasswordUpdateError = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserUsername = (id, data) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserUsername.success = (user) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserUsername.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserUsernameUpdateError = (id) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
@@ -43,6 +155,28 @@ export const clearUserUsernameUpdateError = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserAvatar = (id) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserAvatar.success = (user) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
updateUserAvatar.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUser = (id) => ({
|
||||
type: ActionTypes.USER_DELETE,
|
||||
payload: {
|
||||
@@ -50,6 +184,28 @@ export const deleteUser = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
deleteUser.success = (user) => ({
|
||||
type: ActionTypes.USER_DELETE__SUCCESS,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
deleteUser.failure = (id, error) => ({
|
||||
type: ActionTypes.USER_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserDelete = (user) => ({
|
||||
type: ActionTypes.USER_DELETE_HANDLE,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToCard = (id, cardId, isCurrent) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD,
|
||||
payload: {
|
||||
@@ -59,6 +215,29 @@ export const addUserToCard = (id, cardId, isCurrent) => ({
|
||||
},
|
||||
});
|
||||
|
||||
addUserToCard.success = (cardMembership) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD__SUCCESS,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
addUserToCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserToCardAdd = (cardMembership) => ({
|
||||
type: ActionTypes.USER_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromCard = (id, cardId) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
@@ -67,6 +246,29 @@ export const removeUserFromCard = (id, cardId) => ({
|
||||
},
|
||||
});
|
||||
|
||||
removeUserFromCard.success = (cardMembership) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE__SUCCESS,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
removeUserFromCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleUserFromCardRemove = (cardMembership) => ({
|
||||
type: ActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToBoardFilter = (id, boardId) => ({
|
||||
type: ActionTypes.USER_TO_BOARD_FILTER_ADD,
|
||||
payload: {
|
||||
@@ -82,202 +284,3 @@ export const removeUserFromBoardFilter = (id, boardId) => ({
|
||||
boardId,
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createUserRequested = (data) => ({
|
||||
type: ActionTypes.USER_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createUserSucceeded = (user) => ({
|
||||
type: ActionTypes.USER_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const createUserFailed = (error) => ({
|
||||
type: ActionTypes.USER_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createUserReceived = (user) => ({
|
||||
type: ActionTypes.USER_CREATE_RECEIVED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCurrentUserRequested = () => ({
|
||||
type: ActionTypes.CURRENT_USER_FETCH_REQUESTED,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const fetchCurrentUserSucceeded = (user) => ({
|
||||
type: ActionTypes.CURRENT_USER_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCurrentUserFailed = (error) => ({
|
||||
type: ActionTypes.CURRENT_USER_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserRequested = (id, data) => ({
|
||||
type: ActionTypes.USER_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserSucceeded = (user) => ({
|
||||
type: ActionTypes.USER_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserFailed = (id, error) => ({
|
||||
type: ActionTypes.USER_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserReceived = (user) => ({
|
||||
type: ActionTypes.USER_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserEmailRequested = (id, data) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserEmailSucceeded = (user) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserEmailFailed = (id, error) => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserPasswordRequested = (id, data) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserPasswordSucceeded = (user) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserPasswordFailed = (id, error) => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserUsernameRequested = (id, data) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserUsernameSucceeded = (user) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserUsernameFailed = (id, error) => ({
|
||||
type: ActionTypes.USER_USERNAME_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserAvatarRequested = (id) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserAvatarSucceeded = (user) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUserAvatarFailed = (id, error) => ({
|
||||
type: ActionTypes.USER_AVATAR_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUserRequested = (id) => ({
|
||||
type: ActionTypes.USER_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUserSucceeded = (user) => ({
|
||||
type: ActionTypes.USER_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUserFailed = (id, error) => ({
|
||||
type: ActionTypes.USER_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUserReceived = (user) => ({
|
||||
type: ActionTypes.USER_DELETE_RECEIVED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Events */
|
||||
|
||||
export const fetchUsersRequested = () => ({
|
||||
type: ActionTypes.USERS_FETCH_REQUESTED,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export const fetchUsersSucceeded = (users) => ({
|
||||
type: ActionTypes.USERS_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
users,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchUsersFailed = (error) => ({
|
||||
type: ActionTypes.USERS_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user