mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 07:39:44 +02:00
ref: Refactoring
This commit is contained in:
parent
1f569bdb61
commit
3714bbc06f
189 changed files with 3781 additions and 3486 deletions
|
@ -1,22 +0,0 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
|
||||||
|
|
||||||
export const handleActionCreate = (action) => ({
|
|
||||||
type: ActionTypes.ACTION_CREATE_HANDLE,
|
|
||||||
payload: {
|
|
||||||
action,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const handleActionUpdate = (action) => ({
|
|
||||||
type: ActionTypes.ACTION_UPDATE_HANDLE,
|
|
||||||
payload: {
|
|
||||||
action,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const handleActionDelete = (action) => ({
|
|
||||||
type: ActionTypes.ACTION_DELETE_HANDLE,
|
|
||||||
payload: {
|
|
||||||
action,
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,50 +0,0 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
|
||||||
|
|
||||||
export const fetchActions = (cardId) => ({
|
|
||||||
type: ActionTypes.ACTIONS_FETCH,
|
|
||||||
payload: {
|
|
||||||
cardId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
fetchActions.success = (cardId, actions, users) => ({
|
|
||||||
type: ActionTypes.ACTIONS_FETCH__SUCCESS,
|
|
||||||
payload: {
|
|
||||||
cardId,
|
|
||||||
actions,
|
|
||||||
users,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
fetchActions.failure = (cardId, error) => ({
|
|
||||||
type: ActionTypes.ACTIONS_FETCH__FAILURE,
|
|
||||||
payload: {
|
|
||||||
cardId,
|
|
||||||
error,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const toggleActionsDetails = (cardId, isVisible) => ({
|
|
||||||
type: ActionTypes.ACTIONS_DETAILS_TOGGLE,
|
|
||||||
payload: {
|
|
||||||
cardId,
|
|
||||||
isVisible,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
toggleActionsDetails.success = (cardId, actions, users) => ({
|
|
||||||
type: ActionTypes.ACTIONS_DETAILS_TOGGLE__SUCCESS,
|
|
||||||
payload: {
|
|
||||||
cardId,
|
|
||||||
actions,
|
|
||||||
users,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
toggleActionsDetails.failure = (cardId, error) => ({
|
|
||||||
type: ActionTypes.ACTIONS_DETAILS_TOGGLE__FAILURE,
|
|
||||||
payload: {
|
|
||||||
cardId,
|
|
||||||
error,
|
|
||||||
},
|
|
||||||
});
|
|
79
client/src/actions/activities.js
Normal file
79
client/src/actions/activities.js
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
|
const fetchActivities = (cardId) => ({
|
||||||
|
type: ActionTypes.ACTIVITIES_FETCH,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fetchActivities.success = (cardId, activities, users) => ({
|
||||||
|
type: ActionTypes.ACTIVITIES_FETCH__SUCCESS,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
activities,
|
||||||
|
users,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fetchActivities.failure = (cardId, error) => ({
|
||||||
|
type: ActionTypes.ACTIVITIES_FETCH__FAILURE,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
error,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const toggleActivitiesDetails = (cardId, isVisible) => ({
|
||||||
|
type: ActionTypes.ACTIVITIES_DETAILS_TOGGLE,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
isVisible,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
toggleActivitiesDetails.success = (cardId, activities, users) => ({
|
||||||
|
type: ActionTypes.ACTIVITIES_DETAILS_TOGGLE__SUCCESS,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
activities,
|
||||||
|
users,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
toggleActivitiesDetails.failure = (cardId, error) => ({
|
||||||
|
type: ActionTypes.ACTIVITIES_DETAILS_TOGGLE__FAILURE,
|
||||||
|
payload: {
|
||||||
|
cardId,
|
||||||
|
error,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleActivityCreate = (activity) => ({
|
||||||
|
type: ActionTypes.ACTIVITY_CREATE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleActivityUpdate = (activity) => ({
|
||||||
|
type: ActionTypes.ACTIVITY_UPDATE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleActivityDelete = (activity) => ({
|
||||||
|
type: ActionTypes.ACTIVITY_DELETE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
fetchActivities,
|
||||||
|
toggleActivitiesDetails,
|
||||||
|
handleActivityCreate,
|
||||||
|
handleActivityUpdate,
|
||||||
|
handleActivityDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createAttachment = (attachment) => ({
|
const createAttachment = (attachment) => ({
|
||||||
type: ActionTypes.ATTACHMENT_CREATE,
|
type: ActionTypes.ATTACHMENT_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
attachment,
|
attachment,
|
||||||
|
@ -23,14 +23,14 @@ createAttachment.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleAttachmentCreate = (attachment) => ({
|
const handleAttachmentCreate = (attachment) => ({
|
||||||
type: ActionTypes.ATTACHMENT_CREATE_HANDLE,
|
type: ActionTypes.ATTACHMENT_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
attachment,
|
attachment,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateAttachment = (id, data) => ({
|
const updateAttachment = (id, data) => ({
|
||||||
type: ActionTypes.ATTACHMENT_UPDATE,
|
type: ActionTypes.ATTACHMENT_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -53,14 +53,14 @@ updateAttachment.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleAttachmentUpdate = (attachment) => ({
|
const handleAttachmentUpdate = (attachment) => ({
|
||||||
type: ActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
type: ActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
attachment,
|
attachment,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteAttachment = (id) => ({
|
const deleteAttachment = (id) => ({
|
||||||
type: ActionTypes.ATTACHMENT_DELETE,
|
type: ActionTypes.ATTACHMENT_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -82,9 +82,18 @@ deleteAttachment.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleAttachmentDelete = (attachment) => ({
|
const handleAttachmentDelete = (attachment) => ({
|
||||||
type: ActionTypes.ATTACHMENT_DELETE_HANDLE,
|
type: ActionTypes.ATTACHMENT_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
attachment,
|
attachment,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createAttachment,
|
||||||
|
handleAttachmentCreate,
|
||||||
|
updateAttachment,
|
||||||
|
handleAttachmentUpdate,
|
||||||
|
deleteAttachment,
|
||||||
|
handleAttachmentDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createBoardMembership = (boardMembership) => ({
|
const createBoardMembership = (boardMembership) => ({
|
||||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE,
|
type: ActionTypes.BOARD_MEMBERSHIP_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
boardMembership,
|
boardMembership,
|
||||||
|
@ -23,7 +23,7 @@ createBoardMembership.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardMembershipCreate = (
|
const handleBoardMembershipCreate = (
|
||||||
boardMembership,
|
boardMembership,
|
||||||
project,
|
project,
|
||||||
board,
|
board,
|
||||||
|
@ -38,6 +38,7 @@ export const handleBoardMembershipCreate = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
|
deletedNotifications,
|
||||||
) => ({
|
) => ({
|
||||||
type: ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE,
|
type: ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
|
@ -55,6 +56,7 @@ export const handleBoardMembershipCreate = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
|
deletedNotifications,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -67,7 +69,7 @@ handleBoardMembershipCreate.fetchProject = (id, currentUserId, currentBoardId) =
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteBoardMembership = (id) => ({
|
const deleteBoardMembership = (id) => ({
|
||||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE,
|
type: ActionTypes.BOARD_MEMBERSHIP_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -89,9 +91,16 @@ deleteBoardMembership.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardMembershipDelete = (boardMembership) => ({
|
const handleBoardMembershipDelete = (boardMembership) => ({
|
||||||
type: ActionTypes.BOARD_MEMBERSHIP_DELETE_HANDLE,
|
type: ActionTypes.BOARD_MEMBERSHIP_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
boardMembership,
|
boardMembership,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createBoardMembership,
|
||||||
|
handleBoardMembershipCreate,
|
||||||
|
deleteBoardMembership,
|
||||||
|
handleBoardMembershipDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createBoard = (board) => ({
|
const createBoard = (board) => ({
|
||||||
type: ActionTypes.BOARD_CREATE,
|
type: ActionTypes.BOARD_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
|
@ -24,14 +24,14 @@ createBoard.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardCreate = (board) => ({
|
const handleBoardCreate = (board) => ({
|
||||||
type: ActionTypes.BOARD_CREATE_HANDLE,
|
type: ActionTypes.BOARD_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchBoard = (id) => ({
|
const fetchBoard = (id) => ({
|
||||||
type: ActionTypes.BOARD_FETCH,
|
type: ActionTypes.BOARD_FETCH,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -75,7 +75,7 @@ fetchBoard.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateBoard = (id, data) => ({
|
const updateBoard = (id, data) => ({
|
||||||
type: ActionTypes.BOARD_UPDATE,
|
type: ActionTypes.BOARD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -98,14 +98,14 @@ updateBoard.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardUpdate = (board) => ({
|
const handleBoardUpdate = (board) => ({
|
||||||
type: ActionTypes.BOARD_UPDATE_HANDLE,
|
type: ActionTypes.BOARD_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteBoard = (id) => ({
|
const deleteBoard = (id) => ({
|
||||||
type: ActionTypes.BOARD_DELETE,
|
type: ActionTypes.BOARD_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -127,9 +127,19 @@ deleteBoard.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardDelete = (board) => ({
|
const handleBoardDelete = (board) => ({
|
||||||
type: ActionTypes.BOARD_DELETE_HANDLE,
|
type: ActionTypes.BOARD_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createBoard,
|
||||||
|
handleBoardCreate,
|
||||||
|
fetchBoard,
|
||||||
|
updateBoard,
|
||||||
|
handleBoardUpdate,
|
||||||
|
deleteBoard,
|
||||||
|
handleBoardDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createCard = (card) => ({
|
const createCard = (card) => ({
|
||||||
type: ActionTypes.CARD_CREATE,
|
type: ActionTypes.CARD_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
card,
|
card,
|
||||||
|
@ -23,14 +23,14 @@ createCard.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleCardCreate = (card) => ({
|
const handleCardCreate = (card) => ({
|
||||||
type: ActionTypes.CARD_CREATE_HANDLE,
|
type: ActionTypes.CARD_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
card,
|
card,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCard = (id, data) => ({
|
const updateCard = (id, data) => ({
|
||||||
type: ActionTypes.CARD_UPDATE,
|
type: ActionTypes.CARD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -53,14 +53,14 @@ updateCard.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleCardUpdate = (card) => ({
|
const handleCardUpdate = (card) => ({
|
||||||
type: ActionTypes.CARD_UPDATE_HANDLE,
|
type: ActionTypes.CARD_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
card,
|
card,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteCard = (id) => ({
|
const deleteCard = (id) => ({
|
||||||
type: ActionTypes.CARD_DELETE,
|
type: ActionTypes.CARD_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -82,9 +82,18 @@ deleteCard.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleCardDelete = (card) => ({
|
const handleCardDelete = (card) => ({
|
||||||
type: ActionTypes.CARD_DELETE_HANDLE,
|
type: ActionTypes.CARD_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
card,
|
card,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createCard,
|
||||||
|
handleCardCreate,
|
||||||
|
updateCard,
|
||||||
|
handleCardUpdate,
|
||||||
|
deleteCard,
|
||||||
|
handleCardDelete,
|
||||||
|
};
|
|
@ -1,69 +0,0 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
|
||||||
|
|
||||||
export const createCommentAction = (action) => ({
|
|
||||||
type: ActionTypes.COMMENT_ACTION_CREATE,
|
|
||||||
payload: {
|
|
||||||
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: {
|
|
||||||
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: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
deleteCommentAction.success = (action) => ({
|
|
||||||
type: ActionTypes.COMMENT_ACTION_DELETE__SUCCESS,
|
|
||||||
payload: {
|
|
||||||
action,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
deleteCommentAction.failure = (id, error) => ({
|
|
||||||
type: ActionTypes.COMMENT_ACTION_DELETE__FAILURE,
|
|
||||||
payload: {
|
|
||||||
id,
|
|
||||||
error,
|
|
||||||
},
|
|
||||||
});
|
|
75
client/src/actions/comment-activities.js
Normal file
75
client/src/actions/comment-activities.js
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
|
const createCommentActivity = (activity) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_CREATE,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
createCommentActivity.success = (localId, activity) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_CREATE__SUCCESS,
|
||||||
|
payload: {
|
||||||
|
localId,
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
createCommentActivity.failure = (localId, error) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_CREATE__FAILURE,
|
||||||
|
payload: {
|
||||||
|
localId,
|
||||||
|
error,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateCommentActivity = (id, data) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_UPDATE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
updateCommentActivity.success = (activity) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_UPDATE__SUCCESS,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
updateCommentActivity.failure = (id, error) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_UPDATE__FAILURE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
error,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const deleteCommentActivity = (id) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_DELETE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
deleteCommentActivity.success = (activity) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_DELETE__SUCCESS,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
deleteCommentActivity.failure = (id, error) => ({
|
||||||
|
type: ActionTypes.COMMENT_ACTIVITY_DELETE__FAILURE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
error,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createCommentActivity,
|
||||||
|
updateCommentActivity,
|
||||||
|
deleteCommentActivity,
|
||||||
|
};
|
|
@ -1,7 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
// eslint-disable-next-line import/prefer-default-export
|
const initializeCore = (
|
||||||
export const initializeCore = (
|
|
||||||
user,
|
user,
|
||||||
board,
|
board,
|
||||||
users,
|
users,
|
||||||
|
@ -16,7 +15,7 @@ export const initializeCore = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
actions,
|
activities,
|
||||||
notifications,
|
notifications,
|
||||||
) => ({
|
) => ({
|
||||||
type: ActionTypes.CORE_INITIALIZE,
|
type: ActionTypes.CORE_INITIALIZE,
|
||||||
|
@ -35,7 +34,17 @@ export const initializeCore = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
actions,
|
activities,
|
||||||
notifications,
|
notifications,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const logout = () => ({
|
||||||
|
type: ActionTypes.LOGOUT,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
initializeCore,
|
||||||
|
logout,
|
||||||
|
};
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
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,
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,13 +0,0 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
|
||||||
|
|
||||||
export const fetchActionsInCurrentCard = () => ({
|
|
||||||
type: EntryActionTypes.ACTIONS_IN_CURRENT_CARD_FETCH,
|
|
||||||
payload: {},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const toggleActionsDetailsInCurrentCard = (isVisible) => ({
|
|
||||||
type: EntryActionTypes.ACTIONS_DETAILS_IN_CURRENT_CARD_TOGGLE,
|
|
||||||
payload: {
|
|
||||||
isVisible,
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,29 +0,0 @@
|
||||||
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,
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,23 +0,0 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
|
||||||
|
|
||||||
export const createCommentActionInCurrentCard = (data) => ({
|
|
||||||
type: EntryActionTypes.COMMENT_ACTION_IN_CURRENT_CARD_CREATE,
|
|
||||||
payload: {
|
|
||||||
data,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const updateCommentAction = (id, data) => ({
|
|
||||||
type: EntryActionTypes.COMMENT_ACTION_UPDATE,
|
|
||||||
payload: {
|
|
||||||
id,
|
|
||||||
data,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const deleteCommentAction = (id) => ({
|
|
||||||
type: EntryActionTypes.COMMENT_ACTION_DELETE,
|
|
||||||
payload: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,7 +0,0 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
|
||||||
|
|
||||||
// eslint-disable-next-line import/prefer-default-export
|
|
||||||
export const initializeCore = () => ({
|
|
||||||
type: EntryActionTypes.CORE_INITIALIZE,
|
|
||||||
payload: {},
|
|
||||||
});
|
|
|
@ -1,18 +0,0 @@
|
||||||
export * from './socket';
|
|
||||||
export * from './login';
|
|
||||||
export * from './core';
|
|
||||||
export * from './modal';
|
|
||||||
export * from './user';
|
|
||||||
export * from './project';
|
|
||||||
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';
|
|
|
@ -1,18 +0,0 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
|
||||||
|
|
||||||
export const authenticate = (data) => ({
|
|
||||||
type: EntryActionTypes.AUTHENTICATE,
|
|
||||||
payload: {
|
|
||||||
data,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const clearAuthenticateError = () => ({
|
|
||||||
type: EntryActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
|
||||||
payload: {},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const logout = () => ({
|
|
||||||
type: EntryActionTypes.LOGOUT,
|
|
||||||
payload: {},
|
|
||||||
});
|
|
|
@ -1,22 +0,0 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
|
||||||
|
|
||||||
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,
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,29 +0,0 @@
|
||||||
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,11 +0,0 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
|
||||||
|
|
||||||
export const handleSocketDisconnect = () => ({
|
|
||||||
type: EntryActionTypes.SOCKET_DISCONNECT_HANDLE,
|
|
||||||
payload: {},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const handleSocketReconnect = () => ({
|
|
||||||
type: EntryActionTypes.SOCKET_RECONNECT_HANDLE,
|
|
||||||
payload: {},
|
|
||||||
});
|
|
|
@ -1,19 +1,39 @@
|
||||||
export * from './router';
|
import router from './router';
|
||||||
export * from './socket';
|
import socket from './socket';
|
||||||
export * from './login';
|
import login from './login';
|
||||||
export * from './core';
|
import core from './core';
|
||||||
export * from './modal';
|
import modals from './modals';
|
||||||
export * from './user';
|
import users from './users';
|
||||||
export * from './project';
|
import projects from './projects';
|
||||||
export * from './project-manager';
|
import projectManagers from './project-managers';
|
||||||
export * from './board';
|
import boards from './boards';
|
||||||
export * from './board-membership';
|
import boardMemberships from './board-memberships';
|
||||||
export * from './label';
|
import labels from './labels';
|
||||||
export * from './list';
|
import lists from './lists';
|
||||||
export * from './card';
|
import cards from './cards';
|
||||||
export * from './task';
|
import tasks from './tasks';
|
||||||
export * from './attachment';
|
import attachments from './attachments';
|
||||||
export * from './actions';
|
import activities from './activities';
|
||||||
export * from './action';
|
import commentActivities from './comment-activities';
|
||||||
export * from './comment-action';
|
import notifications from './notifications';
|
||||||
export * from './notification';
|
|
||||||
|
export default {
|
||||||
|
...router,
|
||||||
|
...socket,
|
||||||
|
...login,
|
||||||
|
...core,
|
||||||
|
...modals,
|
||||||
|
...users,
|
||||||
|
...projects,
|
||||||
|
...projectManagers,
|
||||||
|
...boards,
|
||||||
|
...boardMemberships,
|
||||||
|
...labels,
|
||||||
|
...lists,
|
||||||
|
...cards,
|
||||||
|
...tasks,
|
||||||
|
...attachments,
|
||||||
|
...activities,
|
||||||
|
...commentActivities,
|
||||||
|
...notifications,
|
||||||
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createLabel = (label) => ({
|
const createLabel = (label) => ({
|
||||||
type: ActionTypes.LABEL_CREATE,
|
type: ActionTypes.LABEL_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
label,
|
label,
|
||||||
|
@ -23,14 +23,14 @@ createLabel.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelCreate = (label) => ({
|
const handleLabelCreate = (label) => ({
|
||||||
type: ActionTypes.LABEL_CREATE_HANDLE,
|
type: ActionTypes.LABEL_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateLabel = (id, data) => ({
|
const updateLabel = (id, data) => ({
|
||||||
type: ActionTypes.LABEL_UPDATE,
|
type: ActionTypes.LABEL_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -53,14 +53,14 @@ updateLabel.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelUpdate = (label) => ({
|
const handleLabelUpdate = (label) => ({
|
||||||
type: ActionTypes.LABEL_UPDATE_HANDLE,
|
type: ActionTypes.LABEL_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteLabel = (id) => ({
|
const deleteLabel = (id) => ({
|
||||||
type: ActionTypes.LABEL_DELETE,
|
type: ActionTypes.LABEL_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -82,14 +82,14 @@ deleteLabel.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelDelete = (label) => ({
|
const handleLabelDelete = (label) => ({
|
||||||
type: ActionTypes.LABEL_DELETE_HANDLE,
|
type: ActionTypes.LABEL_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addLabelToCard = (id, cardId) => ({
|
const addLabelToCard = (id, cardId) => ({
|
||||||
type: ActionTypes.LABEL_TO_CARD_ADD,
|
type: ActionTypes.LABEL_TO_CARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -113,14 +113,14 @@ addLabelToCard.failure = (id, cardId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelToCardAdd = (cardLabel) => ({
|
const handleLabelToCardAdd = (cardLabel) => ({
|
||||||
type: ActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
type: ActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardLabel,
|
cardLabel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeLabelFromCard = (id, cardId) => ({
|
const removeLabelFromCard = (id, cardId) => ({
|
||||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE,
|
type: ActionTypes.LABEL_FROM_CARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -144,14 +144,14 @@ removeLabelFromCard.failure = (id, cardId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelFromCardRemove = (cardLabel) => ({
|
const handleLabelFromCardRemove = (cardLabel) => ({
|
||||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
type: ActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardLabel,
|
cardLabel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addLabelToBoardFilter = (id, boardId) => ({
|
const addLabelToBoardFilter = (id, boardId) => ({
|
||||||
type: ActionTypes.LABEL_TO_BOARD_FILTER_ADD,
|
type: ActionTypes.LABEL_TO_BOARD_FILTER_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -159,10 +159,25 @@ export const addLabelToBoardFilter = (id, boardId) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeLabelFromBoardFilter = (id, boardId) => ({
|
const removeLabelFromBoardFilter = (id, boardId) => ({
|
||||||
type: ActionTypes.LABEL_FROM_BOARD_FILTER_REMOVE,
|
type: ActionTypes.LABEL_FROM_BOARD_FILTER_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
boardId,
|
boardId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createLabel,
|
||||||
|
handleLabelCreate,
|
||||||
|
updateLabel,
|
||||||
|
handleLabelUpdate,
|
||||||
|
deleteLabel,
|
||||||
|
handleLabelDelete,
|
||||||
|
addLabelToCard,
|
||||||
|
handleLabelToCardAdd,
|
||||||
|
removeLabelFromCard,
|
||||||
|
handleLabelFromCardRemove,
|
||||||
|
addLabelToBoardFilter,
|
||||||
|
removeLabelFromBoardFilter,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createList = (list) => ({
|
const createList = (list) => ({
|
||||||
type: ActionTypes.LIST_CREATE,
|
type: ActionTypes.LIST_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
list,
|
list,
|
||||||
|
@ -23,14 +23,14 @@ createList.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleListCreate = (list) => ({
|
const handleListCreate = (list) => ({
|
||||||
type: ActionTypes.LIST_CREATE_HANDLE,
|
type: ActionTypes.LIST_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
list,
|
list,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateList = (id, data) => ({
|
const updateList = (id, data) => ({
|
||||||
type: ActionTypes.LIST_UPDATE,
|
type: ActionTypes.LIST_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -53,14 +53,14 @@ updateList.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleListUpdate = (list) => ({
|
const handleListUpdate = (list) => ({
|
||||||
type: ActionTypes.LIST_UPDATE_HANDLE,
|
type: ActionTypes.LIST_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
list,
|
list,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteList = (id) => ({
|
const deleteList = (id) => ({
|
||||||
type: ActionTypes.LIST_DELETE,
|
type: ActionTypes.LIST_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -82,9 +82,18 @@ deleteList.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleListDelete = (list) => ({
|
const handleListDelete = (list) => ({
|
||||||
type: ActionTypes.LIST_DELETE_HANDLE,
|
type: ActionTypes.LIST_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
list,
|
list,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createList,
|
||||||
|
handleListCreate,
|
||||||
|
updateList,
|
||||||
|
handleListUpdate,
|
||||||
|
deleteList,
|
||||||
|
handleListDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const authenticate = (data) => ({
|
const authenticate = (data) => ({
|
||||||
type: ActionTypes.AUTHENTICATE,
|
type: ActionTypes.AUTHENTICATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
|
@ -21,12 +21,12 @@ authenticate.failure = (error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearAuthenticateError = () => ({
|
const clearAuthenticateError = () => ({
|
||||||
type: ActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
type: ActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const logout = () => ({
|
export default {
|
||||||
type: ActionTypes.LOGOUT,
|
authenticate,
|
||||||
payload: {},
|
clearAuthenticateError,
|
||||||
});
|
};
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const openModal = (type) => ({
|
const openModal = (type) => ({
|
||||||
type: ActionTypes.MODAL_OPEN,
|
type: ActionTypes.MODAL_OPEN,
|
||||||
payload: {
|
payload: {
|
||||||
type,
|
type,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const closeModal = () => ({
|
const closeModal = () => ({
|
||||||
type: ActionTypes.MODAL_CLOSE,
|
type: ActionTypes.MODAL_CLOSE,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
openModal,
|
||||||
|
closeModal,
|
||||||
|
};
|
|
@ -1,16 +1,16 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const handleNotificationCreate = (notification, users, cards, actions) => ({
|
const handleNotificationCreate = (notification, users, cards, activities) => ({
|
||||||
type: ActionTypes.NOTIFICATION_CREATE_HANDLE,
|
type: ActionTypes.NOTIFICATION_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
notification,
|
notification,
|
||||||
users,
|
users,
|
||||||
cards,
|
cards,
|
||||||
actions,
|
activities,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteNotification = (id) => ({
|
const deleteNotification = (id) => ({
|
||||||
type: ActionTypes.NOTIFICATION_DELETE,
|
type: ActionTypes.NOTIFICATION_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -32,9 +32,15 @@ deleteNotification.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleNotificationDelete = (notification) => ({
|
const handleNotificationDelete = (notification) => ({
|
||||||
type: ActionTypes.NOTIFICATION_DELETE_HANDLE,
|
type: ActionTypes.NOTIFICATION_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
notification,
|
notification,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
handleNotificationCreate,
|
||||||
|
deleteNotification,
|
||||||
|
handleNotificationDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createProjectManager = (projectManager) => ({
|
const createProjectManager = (projectManager) => ({
|
||||||
type: ActionTypes.PROJECT_MANAGER_CREATE,
|
type: ActionTypes.PROJECT_MANAGER_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
projectManager,
|
projectManager,
|
||||||
|
@ -23,7 +23,7 @@ createProjectManager.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectManagerCreate = (
|
const handleProjectManagerCreate = (
|
||||||
projectManager,
|
projectManager,
|
||||||
project,
|
project,
|
||||||
board,
|
board,
|
||||||
|
@ -38,6 +38,7 @@ export const handleProjectManagerCreate = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
|
deletedNotifications,
|
||||||
) => ({
|
) => ({
|
||||||
type: ActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
type: ActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
|
@ -55,6 +56,7 @@ export const handleProjectManagerCreate = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
|
deletedNotifications,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -67,7 +69,7 @@ handleProjectManagerCreate.fetchProject = (id, currentUserId, currentBoardId) =>
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteProjectManager = (id, isCurrentUser, isCurrentProject) => ({
|
const deleteProjectManager = (id, isCurrentUser, isCurrentProject) => ({
|
||||||
type: ActionTypes.PROJECT_MANAGER_DELETE,
|
type: ActionTypes.PROJECT_MANAGER_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -91,7 +93,7 @@ deleteProjectManager.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectManagerDelete = (projectManager, isCurrentUser, isCurrentProject) => ({
|
const handleProjectManagerDelete = (projectManager, isCurrentUser, isCurrentProject) => ({
|
||||||
type: ActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
type: ActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
projectManager,
|
projectManager,
|
||||||
|
@ -99,3 +101,10 @@ export const handleProjectManagerDelete = (projectManager, isCurrentUser, isCurr
|
||||||
isCurrentProject,
|
isCurrentProject,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createProjectManager,
|
||||||
|
handleProjectManagerCreate,
|
||||||
|
deleteProjectManager,
|
||||||
|
handleProjectManagerDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createProject = (data) => ({
|
const createProject = (data) => ({
|
||||||
type: ActionTypes.PROJECT_CREATE,
|
type: ActionTypes.PROJECT_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
|
@ -22,7 +22,7 @@ createProject.failure = (error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectCreate = (project, users, projectManagers, boards, boardMemberships) => ({
|
const handleProjectCreate = (project, users, projectManagers, boards, boardMemberships) => ({
|
||||||
type: ActionTypes.PROJECT_CREATE_HANDLE,
|
type: ActionTypes.PROJECT_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
project,
|
project,
|
||||||
|
@ -33,7 +33,7 @@ export const handleProjectCreate = (project, users, projectManagers, boards, boa
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateProject = (id, data) => ({
|
const updateProject = (id, data) => ({
|
||||||
type: ActionTypes.PROJECT_UPDATE,
|
type: ActionTypes.PROJECT_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -56,14 +56,14 @@ updateProject.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectUpdate = (project) => ({
|
const handleProjectUpdate = (project) => ({
|
||||||
type: ActionTypes.PROJECT_UPDATE_HANDLE,
|
type: ActionTypes.PROJECT_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
project,
|
project,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateProjectBackgroundImage = (id) => ({
|
const updateProjectBackgroundImage = (id) => ({
|
||||||
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE,
|
type: ActionTypes.PROJECT_BACKGROUND_IMAGE_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -85,7 +85,7 @@ updateProjectBackgroundImage.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteProject = (id) => ({
|
const deleteProject = (id) => ({
|
||||||
type: ActionTypes.PROJECT_DELETE,
|
type: ActionTypes.PROJECT_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -107,9 +107,19 @@ deleteProject.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectDelete = (project) => ({
|
const handleProjectDelete = (project) => ({
|
||||||
type: ActionTypes.PROJECT_DELETE_HANDLE,
|
type: ActionTypes.PROJECT_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
project,
|
project,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createProject,
|
||||||
|
handleProjectCreate,
|
||||||
|
updateProject,
|
||||||
|
handleProjectUpdate,
|
||||||
|
updateProjectBackgroundImage,
|
||||||
|
deleteProject,
|
||||||
|
handleProjectDelete,
|
||||||
|
};
|
|
@ -1,7 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
// eslint-disable-next-line import/prefer-default-export
|
const handleLocationChange = (
|
||||||
export const handleLocationChange = (
|
|
||||||
board,
|
board,
|
||||||
users,
|
users,
|
||||||
projects,
|
projects,
|
||||||
|
@ -13,7 +12,7 @@ export const handleLocationChange = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
notifications,
|
deletedNotifications,
|
||||||
) => ({
|
) => ({
|
||||||
type: ActionTypes.LOCATION_CHANGE_HANDLE,
|
type: ActionTypes.LOCATION_CHANGE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
|
@ -28,7 +27,7 @@ export const handleLocationChange = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
notifications,
|
deletedNotifications,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -38,3 +37,7 @@ handleLocationChange.fetchBoard = (id) => ({
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
handleLocationChange,
|
||||||
|
};
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const handleSocketDisconnect = () => ({
|
const handleSocketDisconnect = () => ({
|
||||||
type: ActionTypes.SOCKET_DISCONNECT_HANDLE,
|
type: ActionTypes.SOCKET_DISCONNECT_HANDLE,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleSocketReconnect = (
|
const handleSocketReconnect = (
|
||||||
user,
|
user,
|
||||||
board,
|
board,
|
||||||
users,
|
users,
|
||||||
|
@ -20,7 +20,7 @@ export const handleSocketReconnect = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
actions,
|
activities,
|
||||||
notifications,
|
notifications,
|
||||||
) => ({
|
) => ({
|
||||||
type: ActionTypes.SOCKET_RECONNECT_HANDLE,
|
type: ActionTypes.SOCKET_RECONNECT_HANDLE,
|
||||||
|
@ -39,7 +39,7 @@ export const handleSocketReconnect = (
|
||||||
cardLabels,
|
cardLabels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
actions,
|
activities,
|
||||||
notifications,
|
notifications,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -51,3 +51,8 @@ handleSocketReconnect.fetchCore = (currentUserId, currentBoardId) => ({
|
||||||
currentBoardId,
|
currentBoardId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
handleSocketDisconnect,
|
||||||
|
handleSocketReconnect,
|
||||||
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createTask = (task) => ({
|
const createTask = (task) => ({
|
||||||
type: ActionTypes.TASK_CREATE,
|
type: ActionTypes.TASK_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
task,
|
task,
|
||||||
|
@ -23,14 +23,14 @@ createTask.failure = (localId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleTaskCreate = (task) => ({
|
const handleTaskCreate = (task) => ({
|
||||||
type: ActionTypes.TASK_CREATE_HANDLE,
|
type: ActionTypes.TASK_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
task,
|
task,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateTask = (id, data) => ({
|
const updateTask = (id, data) => ({
|
||||||
type: ActionTypes.TASK_UPDATE,
|
type: ActionTypes.TASK_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -53,14 +53,14 @@ updateTask.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleTaskUpdate = (task) => ({
|
const handleTaskUpdate = (task) => ({
|
||||||
type: ActionTypes.TASK_UPDATE_HANDLE,
|
type: ActionTypes.TASK_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
task,
|
task,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteTask = (id) => ({
|
const deleteTask = (id) => ({
|
||||||
type: ActionTypes.TASK_DELETE,
|
type: ActionTypes.TASK_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -82,9 +82,18 @@ deleteTask.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleTaskDelete = (task) => ({
|
const handleTaskDelete = (task) => ({
|
||||||
type: ActionTypes.TASK_DELETE_HANDLE,
|
type: ActionTypes.TASK_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
task,
|
task,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createTask,
|
||||||
|
handleTaskCreate,
|
||||||
|
updateTask,
|
||||||
|
handleTaskUpdate,
|
||||||
|
deleteTask,
|
||||||
|
handleTaskDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
export const createUser = (data) => ({
|
const createUser = (data) => ({
|
||||||
type: ActionTypes.USER_CREATE,
|
type: ActionTypes.USER_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
|
@ -21,19 +21,19 @@ createUser.failure = (error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserCreate = (user) => ({
|
const handleUserCreate = (user) => ({
|
||||||
type: ActionTypes.USER_CREATE_HANDLE,
|
type: ActionTypes.USER_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
user,
|
user,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserCreateError = () => ({
|
const clearUserCreateError = () => ({
|
||||||
type: ActionTypes.USER_CREATE_ERROR_CLEAR,
|
type: ActionTypes.USER_CREATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUser = (id, data) => ({
|
const updateUser = (id, data) => ({
|
||||||
type: ActionTypes.USER_UPDATE,
|
type: ActionTypes.USER_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -56,7 +56,7 @@ updateUser.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserUpdate = (user, users, isCurrent) => ({
|
const handleUserUpdate = (user, users, isCurrent) => ({
|
||||||
type: ActionTypes.USER_UPDATE_HANDLE,
|
type: ActionTypes.USER_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
user,
|
user,
|
||||||
|
@ -65,7 +65,7 @@ export const handleUserUpdate = (user, users, isCurrent) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUserEmail = (id, data) => ({
|
const updateUserEmail = (id, data) => ({
|
||||||
type: ActionTypes.USER_EMAIL_UPDATE,
|
type: ActionTypes.USER_EMAIL_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -88,14 +88,14 @@ updateUserEmail.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserEmailUpdateError = (id) => ({
|
const clearUserEmailUpdateError = (id) => ({
|
||||||
type: ActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
type: ActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUserPassword = (id, data) => ({
|
const updateUserPassword = (id, data) => ({
|
||||||
type: ActionTypes.USER_PASSWORD_UPDATE,
|
type: ActionTypes.USER_PASSWORD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -118,14 +118,14 @@ updateUserPassword.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserPasswordUpdateError = (id) => ({
|
const clearUserPasswordUpdateError = (id) => ({
|
||||||
type: ActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
type: ActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUserUsername = (id, data) => ({
|
const updateUserUsername = (id, data) => ({
|
||||||
type: ActionTypes.USER_USERNAME_UPDATE,
|
type: ActionTypes.USER_USERNAME_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -148,14 +148,14 @@ updateUserUsername.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserUsernameUpdateError = (id) => ({
|
const clearUserUsernameUpdateError = (id) => ({
|
||||||
type: ActionTypes.USER_USERNAME_UPDATE_ERROR_CLEAR,
|
type: ActionTypes.USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUserAvatar = (id) => ({
|
const updateUserAvatar = (id) => ({
|
||||||
type: ActionTypes.USER_AVATAR_UPDATE,
|
type: ActionTypes.USER_AVATAR_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -177,7 +177,7 @@ updateUserAvatar.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteUser = (id) => ({
|
const deleteUser = (id) => ({
|
||||||
type: ActionTypes.USER_DELETE,
|
type: ActionTypes.USER_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -199,14 +199,14 @@ deleteUser.failure = (id, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserDelete = (user) => ({
|
const handleUserDelete = (user) => ({
|
||||||
type: ActionTypes.USER_DELETE_HANDLE,
|
type: ActionTypes.USER_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
user,
|
user,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addUserToCard = (id, cardId, isCurrent) => ({
|
const addUserToCard = (id, cardId, isCurrent) => ({
|
||||||
type: ActionTypes.USER_TO_CARD_ADD,
|
type: ActionTypes.USER_TO_CARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -231,14 +231,14 @@ addUserToCard.failure = (id, cardId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserToCardAdd = (cardMembership) => ({
|
const handleUserToCardAdd = (cardMembership) => ({
|
||||||
type: ActionTypes.USER_TO_CARD_ADD_HANDLE,
|
type: ActionTypes.USER_TO_CARD_ADD_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardMembership,
|
cardMembership,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeUserFromCard = (id, cardId) => ({
|
const removeUserFromCard = (id, cardId) => ({
|
||||||
type: ActionTypes.USER_FROM_CARD_REMOVE,
|
type: ActionTypes.USER_FROM_CARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -262,14 +262,14 @@ removeUserFromCard.failure = (id, cardId, error) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserFromCardRemove = (cardMembership) => ({
|
const handleUserFromCardRemove = (cardMembership) => ({
|
||||||
type: ActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
type: ActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardMembership,
|
cardMembership,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addUserToBoardFilter = (id, boardId) => ({
|
const addUserToBoardFilter = (id, boardId) => ({
|
||||||
type: ActionTypes.USER_TO_BOARD_FILTER_ADD,
|
type: ActionTypes.USER_TO_BOARD_FILTER_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -277,10 +277,33 @@ export const addUserToBoardFilter = (id, boardId) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeUserFromBoardFilter = (id, boardId) => ({
|
const removeUserFromBoardFilter = (id, boardId) => ({
|
||||||
type: ActionTypes.USER_FROM_BOARD_FILTER_REMOVE,
|
type: ActionTypes.USER_FROM_BOARD_FILTER_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
boardId,
|
boardId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createUser,
|
||||||
|
handleUserCreate,
|
||||||
|
clearUserCreateError,
|
||||||
|
updateUser,
|
||||||
|
handleUserUpdate,
|
||||||
|
updateUserEmail,
|
||||||
|
clearUserEmailUpdateError,
|
||||||
|
updateUserPassword,
|
||||||
|
clearUserPasswordUpdateError,
|
||||||
|
updateUserUsername,
|
||||||
|
clearUserUsernameUpdateError,
|
||||||
|
updateUserAvatar,
|
||||||
|
deleteUser,
|
||||||
|
handleUserDelete,
|
||||||
|
addUserToCard,
|
||||||
|
handleUserToCardAdd,
|
||||||
|
removeUserFromCard,
|
||||||
|
handleUserFromCardRemove,
|
||||||
|
addUserToBoardFilter,
|
||||||
|
removeUserFromBoardFilter,
|
||||||
|
};
|
|
@ -1,36 +0,0 @@
|
||||||
import socket from './socket';
|
|
||||||
|
|
||||||
/* Transformers */
|
|
||||||
|
|
||||||
export const transformAction = (action) => ({
|
|
||||||
...action,
|
|
||||||
createdAt: new Date(action.createdAt),
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Actions */
|
|
||||||
|
|
||||||
const getActions = (cardId, data) =>
|
|
||||||
socket.get(`/cards/${cardId}/actions`, data).then((body) => ({
|
|
||||||
...body,
|
|
||||||
items: body.items.map(transformAction),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/* Event handlers */
|
|
||||||
|
|
||||||
const makeHandleActionCreate = (next) => (body) => {
|
|
||||||
next({
|
|
||||||
...body,
|
|
||||||
item: transformAction(body.item),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const makeHandleActionUpdate = makeHandleActionCreate;
|
|
||||||
|
|
||||||
const makeHandleActionDelete = makeHandleActionCreate;
|
|
||||||
|
|
||||||
export default {
|
|
||||||
getActions,
|
|
||||||
makeHandleActionCreate,
|
|
||||||
makeHandleActionUpdate,
|
|
||||||
makeHandleActionDelete,
|
|
||||||
};
|
|
36
client/src/api/activities.js
Executable file
36
client/src/api/activities.js
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
import socket from './socket';
|
||||||
|
|
||||||
|
/* Transformers */
|
||||||
|
|
||||||
|
export const transformActivity = (activity) => ({
|
||||||
|
...activity,
|
||||||
|
createdAt: new Date(activity.createdAt),
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Actions */
|
||||||
|
|
||||||
|
const getActivities = (cardId, data) =>
|
||||||
|
socket.get(`/cards/${cardId}/actions`, data).then((body) => ({
|
||||||
|
...body,
|
||||||
|
items: body.items.map(transformActivity),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/* Event handlers */
|
||||||
|
|
||||||
|
const makeHandleActivityCreate = (next) => (body) => {
|
||||||
|
next({
|
||||||
|
...body,
|
||||||
|
item: transformActivity(body.item),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const makeHandleActivityUpdate = makeHandleActivityCreate;
|
||||||
|
|
||||||
|
const makeHandleActivityDelete = makeHandleActivityCreate;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getActivities,
|
||||||
|
makeHandleActivityCreate,
|
||||||
|
makeHandleActivityUpdate,
|
||||||
|
makeHandleActivityDelete,
|
||||||
|
};
|
|
@ -78,14 +78,9 @@ const makeHandleCardCreate = (next) => (body) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const makeHandleCardUpdate = (next) => (body) => {
|
const makeHandleCardUpdate = makeHandleCardCreate;
|
||||||
next({
|
|
||||||
...body,
|
|
||||||
item: transformCard(body.item),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const makeHandleCardDelete = makeHandleCardUpdate;
|
const makeHandleCardDelete = makeHandleCardCreate;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getCards,
|
getCards,
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
import socket from './socket';
|
|
||||||
import { transformAction } from './actions';
|
|
||||||
|
|
||||||
/* Actions */
|
|
||||||
|
|
||||||
const createCommentAction = (cardId, data) =>
|
|
||||||
socket.post(`/cards/${cardId}/comment-actions`, data).then((body) => ({
|
|
||||||
...body,
|
|
||||||
item: transformAction(body.item),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const updateCommentAction = (id, data) =>
|
|
||||||
socket.patch(`/comment-actions/${id}`, data).then((body) => ({
|
|
||||||
...body,
|
|
||||||
item: transformAction(body.item),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const deleteCommentAction = (id) =>
|
|
||||||
socket.delete(`/comment-actions/${id}`).then((body) => ({
|
|
||||||
...body,
|
|
||||||
item: transformAction(body.item),
|
|
||||||
}));
|
|
||||||
|
|
||||||
export default {
|
|
||||||
createCommentAction,
|
|
||||||
updateCommentAction,
|
|
||||||
deleteCommentAction,
|
|
||||||
};
|
|
28
client/src/api/comment-activities.js
Executable file
28
client/src/api/comment-activities.js
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
import socket from './socket';
|
||||||
|
import { transformActivity } from './activities';
|
||||||
|
|
||||||
|
/* Actions */
|
||||||
|
|
||||||
|
const createCommentActivity = (cardId, data) =>
|
||||||
|
socket.post(`/cards/${cardId}/comment-actions`, data).then((body) => ({
|
||||||
|
...body,
|
||||||
|
item: transformActivity(body.item),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const updateCommentActivity = (id, data) =>
|
||||||
|
socket.patch(`/comment-actions/${id}`, data).then((body) => ({
|
||||||
|
...body,
|
||||||
|
item: transformActivity(body.item),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const deleteCommentActivity = (id) =>
|
||||||
|
socket.delete(`/comment-actions/${id}`).then((body) => ({
|
||||||
|
...body,
|
||||||
|
item: transformActivity(body.item),
|
||||||
|
}));
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createCommentActivity,
|
||||||
|
updateCommentActivity,
|
||||||
|
deleteCommentActivity,
|
||||||
|
};
|
|
@ -13,8 +13,8 @@ import cardMemberships from './card-memberships';
|
||||||
import cardLabels from './card-labels';
|
import cardLabels from './card-labels';
|
||||||
import tasks from './tasks';
|
import tasks from './tasks';
|
||||||
import attachments from './attachments';
|
import attachments from './attachments';
|
||||||
import actions from './actions';
|
import activities from './activities';
|
||||||
import commentActions from './comment-actions';
|
import commentActivities from './comment-activities';
|
||||||
import notifications from './notifications';
|
import notifications from './notifications';
|
||||||
|
|
||||||
export { http, socket };
|
export { http, socket };
|
||||||
|
@ -33,7 +33,7 @@ export default {
|
||||||
...cardLabels,
|
...cardLabels,
|
||||||
...tasks,
|
...tasks,
|
||||||
...attachments,
|
...attachments,
|
||||||
...actions,
|
...activities,
|
||||||
...commentActions,
|
...commentActivities,
|
||||||
...notifications,
|
...notifications,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,33 +1,61 @@
|
||||||
|
import omit from 'lodash/omit';
|
||||||
|
|
||||||
import socket from './socket';
|
import socket from './socket';
|
||||||
import { transformCard } from './cards';
|
import { transformCard } from './cards';
|
||||||
import { transformAction } from './actions';
|
import { transformActivity } from './activities';
|
||||||
|
|
||||||
|
/* Transformers */
|
||||||
|
|
||||||
|
export const transformNotification = (notification) => ({
|
||||||
|
...omit(notification, 'actionId'),
|
||||||
|
activityId: notification.actionId,
|
||||||
|
});
|
||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const getNotifications = () =>
|
const getNotifications = () =>
|
||||||
socket.get('/notifications').then((body) => ({
|
socket.get('/notifications').then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
|
items: body.items.map(transformNotification),
|
||||||
included: {
|
included: {
|
||||||
...body.included,
|
...omit(body.included, 'actions'),
|
||||||
cards: body.included.cards.map(transformCard),
|
cards: body.included.cards.map(transformCard),
|
||||||
actions: body.included.actions.map(transformAction),
|
activities: body.included.actions.map(transformActivity),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const getNotification = (id) =>
|
const getNotification = (id) =>
|
||||||
socket.get(`/notifications/${id}`).then((body) => ({
|
socket.get(`/notifications/${id}`).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
|
item: transformNotification(body.item),
|
||||||
included: {
|
included: {
|
||||||
...body.included,
|
...omit(body.included, 'actions'),
|
||||||
cards: body.included.cards.map(transformCard),
|
cards: body.included.cards.map(transformCard),
|
||||||
actions: body.included.actions.map(transformAction),
|
activities: body.included.actions.map(transformActivity),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const updateNotifications = (ids, data) => socket.patch(`/notifications/${ids.join(',')}`, data);
|
const updateNotifications = (ids, data) =>
|
||||||
|
socket.patch(`/notifications/${ids.join(',')}`, data).then((body) => ({
|
||||||
|
...body,
|
||||||
|
items: body.items.map(transformNotification),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/* Event handlers */
|
||||||
|
|
||||||
|
const makeHandleNotificationCreate = (next) => (body) => {
|
||||||
|
next({
|
||||||
|
...body,
|
||||||
|
item: transformNotification(body.item),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const makeHandleNotificationUpdate = makeHandleNotificationCreate;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getNotifications,
|
getNotifications,
|
||||||
getNotification,
|
getNotification,
|
||||||
updateNotifications,
|
updateNotifications,
|
||||||
|
makeHandleNotificationCreate,
|
||||||
|
makeHandleNotificationUpdate,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
import Actions from './Actions';
|
|
||||||
|
|
||||||
export default Actions;
|
|
|
@ -3,13 +3,13 @@ import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Comment, Icon, Loader, Visibility } from 'semantic-ui-react';
|
import { Button, Comment, Icon, Loader, Visibility } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { ActionTypes } from '../../../constants/Enums';
|
import { ActivityTypes } from '../../../constants/Enums';
|
||||||
import CommentAdd from './CommentAdd';
|
import CommentAdd from './CommentAdd';
|
||||||
import Item from './Item';
|
import Item from './Item';
|
||||||
|
|
||||||
import styles from './Actions.module.scss';
|
import styles from './Activities.module.scss';
|
||||||
|
|
||||||
const Actions = React.memo(
|
const Activities = React.memo(
|
||||||
({
|
({
|
||||||
items,
|
items,
|
||||||
isFetching,
|
isFetching,
|
||||||
|
@ -60,7 +60,7 @@ const Actions = React.memo(
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
<Comment.Group>
|
<Comment.Group>
|
||||||
{items.map((item) =>
|
{items.map((item) =>
|
||||||
item.type === ActionTypes.COMMENT_CARD ? (
|
item.type === ActivityTypes.COMMENT_CARD ? (
|
||||||
<Item.Comment
|
<Item.Comment
|
||||||
key={item.id}
|
key={item.id}
|
||||||
data={item.data}
|
data={item.data}
|
||||||
|
@ -94,7 +94,7 @@ const Actions = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
Actions.propTypes = {
|
Activities.propTypes = {
|
||||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
isFetching: PropTypes.bool.isRequired,
|
isFetching: PropTypes.bool.isRequired,
|
||||||
isAllFetched: PropTypes.bool.isRequired,
|
isAllFetched: PropTypes.bool.isRequired,
|
||||||
|
@ -109,4 +109,4 @@ Actions.propTypes = {
|
||||||
onCommentDelete: PropTypes.func.isRequired,
|
onCommentDelete: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Actions;
|
export default Activities;
|
|
@ -4,7 +4,7 @@ import classNames from 'classnames';
|
||||||
import { useTranslation, Trans } from 'react-i18next';
|
import { useTranslation, Trans } from 'react-i18next';
|
||||||
import { Comment } from 'semantic-ui-react';
|
import { Comment } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { ActionTypes } from '../../../constants/Enums';
|
import { ActivityTypes } from '../../../constants/Enums';
|
||||||
import ItemComment from './ItemComment';
|
import ItemComment from './ItemComment';
|
||||||
import User from '../../User';
|
import User from '../../User';
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ const Item = React.memo(({ type, data, createdAt, user }) => {
|
||||||
let contentNode;
|
let contentNode;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ActionTypes.CREATE_CARD:
|
case ActivityTypes.CREATE_CARD:
|
||||||
contentNode = (
|
contentNode = (
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey="common.userAddedThisCardToList"
|
i18nKey="common.userAddedThisCardToList"
|
||||||
|
@ -34,7 +34,7 @@ const Item = React.memo(({ type, data, createdAt, user }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ActionTypes.MOVE_CARD:
|
case ActivityTypes.MOVE_CARD:
|
||||||
contentNode = (
|
contentNode = (
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey="common.userMovedThisCardFromListToList"
|
i18nKey="common.userMovedThisCardFromListToList"
|
3
client/src/components/CardModal/Activities/index.js
Executable file
3
client/src/components/CardModal/Activities/index.js
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
import Activities from './Activities';
|
||||||
|
|
||||||
|
export default Activities;
|
|
@ -11,7 +11,7 @@ import Tasks from './Tasks';
|
||||||
import Attachments from './Attachments';
|
import Attachments from './Attachments';
|
||||||
import AttachmentAddZone from './AttachmentAddZone';
|
import AttachmentAddZone from './AttachmentAddZone';
|
||||||
import AttachmentAddPopup from './AttachmentAddPopup';
|
import AttachmentAddPopup from './AttachmentAddPopup';
|
||||||
import Actions from './Actions';
|
import Activities from './Activities';
|
||||||
import User from '../User';
|
import User from '../User';
|
||||||
import Label from '../Label';
|
import Label from '../Label';
|
||||||
import DueDate from '../DueDate';
|
import DueDate from '../DueDate';
|
||||||
|
@ -32,10 +32,10 @@ const CardModal = React.memo(
|
||||||
dueDate,
|
dueDate,
|
||||||
timer,
|
timer,
|
||||||
isSubscribed,
|
isSubscribed,
|
||||||
isActionsFetching,
|
isActivitiesFetching,
|
||||||
isAllActionsFetched,
|
isAllActivitiesFetched,
|
||||||
isActionsDetailsVisible,
|
isActivitiesDetailsVisible,
|
||||||
isActionsDetailsFetching,
|
isActivitiesDetailsFetching,
|
||||||
listId,
|
listId,
|
||||||
boardId,
|
boardId,
|
||||||
projectId,
|
projectId,
|
||||||
|
@ -43,12 +43,12 @@ const CardModal = React.memo(
|
||||||
labels,
|
labels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
actions,
|
activities,
|
||||||
allProjectsToLists,
|
allProjectsToLists,
|
||||||
allBoardMemberships,
|
allBoardMemberships,
|
||||||
allLabels,
|
allLabels,
|
||||||
canEdit,
|
canEdit,
|
||||||
canEditAllCommentActions,
|
canEditAllCommentActivities,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
onMove,
|
onMove,
|
||||||
onTransfer,
|
onTransfer,
|
||||||
|
@ -68,11 +68,11 @@ const CardModal = React.memo(
|
||||||
onAttachmentCreate,
|
onAttachmentCreate,
|
||||||
onAttachmentUpdate,
|
onAttachmentUpdate,
|
||||||
onAttachmentDelete,
|
onAttachmentDelete,
|
||||||
onActionsFetch,
|
onActivitiesFetch,
|
||||||
onActionsDetailsToggle,
|
onActivitiesDetailsToggle,
|
||||||
onCommentActionCreate,
|
onCommentActivityCreate,
|
||||||
onCommentActionUpdate,
|
onCommentActivityUpdate,
|
||||||
onCommentActionDelete,
|
onCommentActivityDelete,
|
||||||
onClose,
|
onClose,
|
||||||
}) => {
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
@ -357,19 +357,19 @@ const CardModal = React.memo(
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Actions
|
<Activities
|
||||||
items={actions}
|
items={activities}
|
||||||
isFetching={isActionsFetching}
|
isFetching={isActivitiesFetching}
|
||||||
isAllFetched={isAllActionsFetched}
|
isAllFetched={isAllActivitiesFetched}
|
||||||
isDetailsVisible={isActionsDetailsVisible}
|
isDetailsVisible={isActivitiesDetailsVisible}
|
||||||
isDetailsFetching={isActionsDetailsFetching}
|
isDetailsFetching={isActivitiesDetailsFetching}
|
||||||
canEdit={canEdit}
|
canEdit={canEdit}
|
||||||
canEditAllComments={canEditAllCommentActions}
|
canEditAllComments={canEditAllCommentActivities}
|
||||||
onFetch={onActionsFetch}
|
onFetch={onActivitiesFetch}
|
||||||
onDetailsToggle={onActionsDetailsToggle}
|
onDetailsToggle={onActivitiesDetailsToggle}
|
||||||
onCommentCreate={onCommentActionCreate}
|
onCommentCreate={onCommentActivityCreate}
|
||||||
onCommentUpdate={onCommentActionUpdate}
|
onCommentUpdate={onCommentActivityUpdate}
|
||||||
onCommentDelete={onCommentActionDelete}
|
onCommentDelete={onCommentActivityDelete}
|
||||||
/>
|
/>
|
||||||
</Grid.Column>
|
</Grid.Column>
|
||||||
{canEdit && (
|
{canEdit && (
|
||||||
|
@ -490,10 +490,10 @@ CardModal.propTypes = {
|
||||||
dueDate: PropTypes.instanceOf(Date),
|
dueDate: PropTypes.instanceOf(Date),
|
||||||
timer: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
timer: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
isSubscribed: PropTypes.bool.isRequired,
|
isSubscribed: PropTypes.bool.isRequired,
|
||||||
isActionsFetching: PropTypes.bool.isRequired,
|
isActivitiesFetching: PropTypes.bool.isRequired,
|
||||||
isAllActionsFetched: PropTypes.bool.isRequired,
|
isAllActivitiesFetched: PropTypes.bool.isRequired,
|
||||||
isActionsDetailsVisible: PropTypes.bool.isRequired,
|
isActivitiesDetailsVisible: PropTypes.bool.isRequired,
|
||||||
isActionsDetailsFetching: PropTypes.bool.isRequired,
|
isActivitiesDetailsFetching: PropTypes.bool.isRequired,
|
||||||
listId: PropTypes.string.isRequired,
|
listId: PropTypes.string.isRequired,
|
||||||
boardId: PropTypes.string.isRequired,
|
boardId: PropTypes.string.isRequired,
|
||||||
projectId: PropTypes.string.isRequired,
|
projectId: PropTypes.string.isRequired,
|
||||||
|
@ -502,13 +502,13 @@ CardModal.propTypes = {
|
||||||
labels: PropTypes.array.isRequired,
|
labels: PropTypes.array.isRequired,
|
||||||
tasks: PropTypes.array.isRequired,
|
tasks: PropTypes.array.isRequired,
|
||||||
attachments: PropTypes.array.isRequired,
|
attachments: PropTypes.array.isRequired,
|
||||||
actions: PropTypes.array.isRequired,
|
activities: PropTypes.array.isRequired,
|
||||||
allProjectsToLists: PropTypes.array.isRequired,
|
allProjectsToLists: PropTypes.array.isRequired,
|
||||||
allBoardMemberships: PropTypes.array.isRequired,
|
allBoardMemberships: PropTypes.array.isRequired,
|
||||||
allLabels: PropTypes.array.isRequired,
|
allLabels: PropTypes.array.isRequired,
|
||||||
/* eslint-enable react/forbid-prop-types */
|
/* eslint-enable react/forbid-prop-types */
|
||||||
canEdit: PropTypes.bool.isRequired,
|
canEdit: PropTypes.bool.isRequired,
|
||||||
canEditAllCommentActions: PropTypes.bool.isRequired,
|
canEditAllCommentActivities: PropTypes.bool.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onMove: PropTypes.func.isRequired,
|
onMove: PropTypes.func.isRequired,
|
||||||
onTransfer: PropTypes.func.isRequired,
|
onTransfer: PropTypes.func.isRequired,
|
||||||
|
@ -528,11 +528,11 @@ CardModal.propTypes = {
|
||||||
onAttachmentCreate: PropTypes.func.isRequired,
|
onAttachmentCreate: PropTypes.func.isRequired,
|
||||||
onAttachmentUpdate: PropTypes.func.isRequired,
|
onAttachmentUpdate: PropTypes.func.isRequired,
|
||||||
onAttachmentDelete: PropTypes.func.isRequired,
|
onAttachmentDelete: PropTypes.func.isRequired,
|
||||||
onActionsFetch: PropTypes.func.isRequired,
|
onActivitiesFetch: PropTypes.func.isRequired,
|
||||||
onActionsDetailsToggle: PropTypes.func.isRequired,
|
onActivitiesDetailsToggle: PropTypes.func.isRequired,
|
||||||
onCommentActionCreate: PropTypes.func.isRequired,
|
onCommentActivityCreate: PropTypes.func.isRequired,
|
||||||
onCommentActionUpdate: PropTypes.func.isRequired,
|
onCommentActivityUpdate: PropTypes.func.isRequired,
|
||||||
onCommentActionDelete: PropTypes.func.isRequired,
|
onCommentActivityDelete: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { withPopup } from '../../lib/popup';
|
||||||
import { Popup } from '../../lib/custom-ui';
|
import { Popup } from '../../lib/custom-ui';
|
||||||
|
|
||||||
import Paths from '../../constants/Paths';
|
import Paths from '../../constants/Paths';
|
||||||
import { ActionTypes } from '../../constants/Enums';
|
import { ActivityTypes } from '../../constants/Enums';
|
||||||
import User from '../User';
|
import User from '../User';
|
||||||
|
|
||||||
import styles from './NotificationsPopup.module.scss';
|
import styles from './NotificationsPopup.module.scss';
|
||||||
|
@ -23,42 +23,42 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
const renderItemContent = useCallback(
|
const renderItemContent = useCallback(
|
||||||
({ action, card }) => {
|
({ activity, card }) => {
|
||||||
switch (action.type) {
|
switch (activity.type) {
|
||||||
case ActionTypes.MOVE_CARD:
|
case ActivityTypes.MOVE_CARD:
|
||||||
return (
|
return (
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey="common.userMovedCardFromListToList"
|
i18nKey="common.userMovedCardFromListToList"
|
||||||
values={{
|
values={{
|
||||||
user: action.user.name,
|
user: activity.user.name,
|
||||||
card: card.name,
|
card: card.name,
|
||||||
fromList: action.data.fromList.name,
|
fromList: activity.data.fromList.name,
|
||||||
toList: action.data.toList.name,
|
toList: activity.data.toList.name,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{action.user.name}
|
{activity.user.name}
|
||||||
{' moved '}
|
{' moved '}
|
||||||
<Link to={Paths.CARDS.replace(':id', card.id)} onClick={onClose}>
|
<Link to={Paths.CARDS.replace(':id', card.id)} onClick={onClose}>
|
||||||
{card.name}
|
{card.name}
|
||||||
</Link>
|
</Link>
|
||||||
{' from '}
|
{' from '}
|
||||||
{action.data.fromList.name}
|
{activity.data.fromList.name}
|
||||||
{' to '}
|
{' to '}
|
||||||
{action.data.toList.name}
|
{activity.data.toList.name}
|
||||||
</Trans>
|
</Trans>
|
||||||
);
|
);
|
||||||
case ActionTypes.COMMENT_CARD:
|
case ActivityTypes.COMMENT_CARD:
|
||||||
return (
|
return (
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey="common.userLeftNewCommentToCard"
|
i18nKey="common.userLeftNewCommentToCard"
|
||||||
values={{
|
values={{
|
||||||
user: action.user.name,
|
user: activity.user.name,
|
||||||
comment: action.data.text,
|
comment: activity.data.text,
|
||||||
card: card.name,
|
card: card.name,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{action.user.name}
|
{activity.user.name}
|
||||||
{` left a new comment «${action.data.text}» to `}
|
{` left a new comment «${activity.data.text}» to `}
|
||||||
<Link to={Paths.CARDS.replace(':id', card.id)} onClick={onClose}>
|
<Link to={Paths.CARDS.replace(':id', card.id)} onClick={onClose}>
|
||||||
{card.name}
|
{card.name}
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -79,11 +79,11 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
|
||||||
{items.length > 0
|
{items.length > 0
|
||||||
? items.map((item) => (
|
? items.map((item) => (
|
||||||
<div key={item.id} className={styles.wrapper}>
|
<div key={item.id} className={styles.wrapper}>
|
||||||
{item.card && item.action ? (
|
{item.card && item.activity ? (
|
||||||
<>
|
<>
|
||||||
<User
|
<User
|
||||||
name={item.action.user.name}
|
name={item.activity.user.name}
|
||||||
avatarUrl={item.action.user.avatarUrl}
|
avatarUrl={item.activity.user.avatarUrl}
|
||||||
size="large"
|
size="large"
|
||||||
/>
|
/>
|
||||||
<span className={styles.content}>{renderItemContent(item)}</span>
|
<span className={styles.content}>{renderItemContent(item)}</span>
|
||||||
|
|
|
@ -101,7 +101,7 @@ const ActionsStep = React.memo(
|
||||||
<UserPasswordEditStep
|
<UserPasswordEditStep
|
||||||
defaultData={user.passwordUpdateForm.data}
|
defaultData={user.passwordUpdateForm.data}
|
||||||
isSubmitting={user.passwordUpdateForm.isSubmitting}
|
isSubmitting={user.passwordUpdateForm.isSubmitting}
|
||||||
error={user.emailUpdateForm.error}
|
error={user.passwordUpdateForm.error}
|
||||||
onUpdate={onPasswordUpdate}
|
onUpdate={onPasswordUpdate}
|
||||||
onMessageDismiss={onPasswordUpdateMessageDismiss}
|
onMessageDismiss={onPasswordUpdateMessageDismiss}
|
||||||
onBack={handleBack}
|
onBack={handleBack}
|
||||||
|
|
|
@ -17,18 +17,17 @@ export default {
|
||||||
AUTHENTICATE__FAILURE: 'AUTHENTICATE__FAILURE',
|
AUTHENTICATE__FAILURE: 'AUTHENTICATE__FAILURE',
|
||||||
AUTHENTICATE_ERROR_CLEAR: 'AUTHENTICATE_ERROR_CLEAR',
|
AUTHENTICATE_ERROR_CLEAR: 'AUTHENTICATE_ERROR_CLEAR',
|
||||||
|
|
||||||
LOGOUT: 'LOGOUT',
|
|
||||||
|
|
||||||
/* Core */
|
/* Core */
|
||||||
|
|
||||||
CORE_INITIALIZE: 'CORE_INITIALIZE',
|
CORE_INITIALIZE: 'CORE_INITIALIZE',
|
||||||
|
LOGOUT: 'LOGOUT',
|
||||||
|
|
||||||
/* Modal */
|
/* Modals */
|
||||||
|
|
||||||
MODAL_OPEN: 'MODAL_OPEN',
|
MODAL_OPEN: 'MODAL_OPEN',
|
||||||
MODAL_CLOSE: 'MODAL_CLOSE',
|
MODAL_CLOSE: 'MODAL_CLOSE',
|
||||||
|
|
||||||
/* User */
|
/* Users */
|
||||||
|
|
||||||
USER_CREATE: 'USER_CREATE',
|
USER_CREATE: 'USER_CREATE',
|
||||||
USER_CREATE__SUCCESS: 'USER_CREATE__SUCCESS',
|
USER_CREATE__SUCCESS: 'USER_CREATE__SUCCESS',
|
||||||
|
@ -69,7 +68,7 @@ export default {
|
||||||
USER_TO_BOARD_FILTER_ADD: 'USER_TO_BOARD_FILTER_ADD',
|
USER_TO_BOARD_FILTER_ADD: 'USER_TO_BOARD_FILTER_ADD',
|
||||||
USER_FROM_BOARD_FILTER_REMOVE: 'USER_FROM_BOARD_FILTER_REMOVE',
|
USER_FROM_BOARD_FILTER_REMOVE: 'USER_FROM_BOARD_FILTER_REMOVE',
|
||||||
|
|
||||||
/* Project */
|
/* Projects */
|
||||||
|
|
||||||
PROJECT_CREATE: 'PROJECT_CREATE',
|
PROJECT_CREATE: 'PROJECT_CREATE',
|
||||||
PROJECT_CREATE__SUCCESS: 'PROJECT_CREATE__SUCCESS',
|
PROJECT_CREATE__SUCCESS: 'PROJECT_CREATE__SUCCESS',
|
||||||
|
@ -87,7 +86,7 @@ export default {
|
||||||
PROJECT_DELETE__FAILURE: 'PROJECT_DELETE__FAILURE',
|
PROJECT_DELETE__FAILURE: 'PROJECT_DELETE__FAILURE',
|
||||||
PROJECT_DELETE_HANDLE: 'PROJECT_DELETE_HANDLE',
|
PROJECT_DELETE_HANDLE: 'PROJECT_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Project manager */
|
/* Project managers */
|
||||||
|
|
||||||
PROJECT_MANAGER_CREATE: 'PROJECT_MANAGER_CREATE',
|
PROJECT_MANAGER_CREATE: 'PROJECT_MANAGER_CREATE',
|
||||||
PROJECT_MANAGER_CREATE__SUCCESS: 'PROJECT_MANAGER_CREATE__SUCCESS',
|
PROJECT_MANAGER_CREATE__SUCCESS: 'PROJECT_MANAGER_CREATE__SUCCESS',
|
||||||
|
@ -99,7 +98,7 @@ export default {
|
||||||
PROJECT_MANAGER_DELETE__FAILURE: 'PROJECT_MANAGER_DELETE__FAILURE',
|
PROJECT_MANAGER_DELETE__FAILURE: 'PROJECT_MANAGER_DELETE__FAILURE',
|
||||||
PROJECT_MANAGER_DELETE_HANDLE: 'PROJECT_MANAGER_DELETE_HANDLE',
|
PROJECT_MANAGER_DELETE_HANDLE: 'PROJECT_MANAGER_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Board */
|
/* Boards */
|
||||||
|
|
||||||
BOARD_CREATE: 'BOARD_CREATE',
|
BOARD_CREATE: 'BOARD_CREATE',
|
||||||
BOARD_CREATE__SUCCESS: 'BOARD_CREATE__SUCCESS',
|
BOARD_CREATE__SUCCESS: 'BOARD_CREATE__SUCCESS',
|
||||||
|
@ -117,7 +116,7 @@ export default {
|
||||||
BOARD_DELETE__FAILURE: 'BOARD_DELETE__FAILURE',
|
BOARD_DELETE__FAILURE: 'BOARD_DELETE__FAILURE',
|
||||||
BOARD_DELETE_HANDLE: 'BOARD_DELETE_HANDLE',
|
BOARD_DELETE_HANDLE: 'BOARD_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Board membership */
|
/* Board memberships */
|
||||||
|
|
||||||
BOARD_MEMBERSHIP_CREATE: 'BOARD_MEMBERSHIP_CREATE',
|
BOARD_MEMBERSHIP_CREATE: 'BOARD_MEMBERSHIP_CREATE',
|
||||||
BOARD_MEMBERSHIP_CREATE__SUCCESS: 'BOARD_MEMBERSHIP_CREATE__SUCCESS',
|
BOARD_MEMBERSHIP_CREATE__SUCCESS: 'BOARD_MEMBERSHIP_CREATE__SUCCESS',
|
||||||
|
@ -129,7 +128,7 @@ export default {
|
||||||
BOARD_MEMBERSHIP_DELETE__FAILURE: 'BOARD_MEMBERSHIP_DELETE__FAILURE',
|
BOARD_MEMBERSHIP_DELETE__FAILURE: 'BOARD_MEMBERSHIP_DELETE__FAILURE',
|
||||||
BOARD_MEMBERSHIP_DELETE_HANDLE: 'BOARD_MEMBERSHIP_DELETE_HANDLE',
|
BOARD_MEMBERSHIP_DELETE_HANDLE: 'BOARD_MEMBERSHIP_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Label */
|
/* Labels */
|
||||||
|
|
||||||
LABEL_CREATE: 'LABEL_CREATE',
|
LABEL_CREATE: 'LABEL_CREATE',
|
||||||
LABEL_CREATE__SUCCESS: 'LABEL_CREATE__SUCCESS',
|
LABEL_CREATE__SUCCESS: 'LABEL_CREATE__SUCCESS',
|
||||||
|
@ -154,7 +153,7 @@ export default {
|
||||||
LABEL_TO_BOARD_FILTER_ADD: 'LABEL_TO_BOARD_FILTER_ADD',
|
LABEL_TO_BOARD_FILTER_ADD: 'LABEL_TO_BOARD_FILTER_ADD',
|
||||||
LABEL_FROM_BOARD_FILTER_REMOVE: 'LABEL_FROM_BOARD_FILTER_REMOVE',
|
LABEL_FROM_BOARD_FILTER_REMOVE: 'LABEL_FROM_BOARD_FILTER_REMOVE',
|
||||||
|
|
||||||
/* List */
|
/* Lists */
|
||||||
|
|
||||||
LIST_CREATE: 'LIST_CREATE',
|
LIST_CREATE: 'LIST_CREATE',
|
||||||
LIST_CREATE__SUCCESS: 'LIST_CREATE__SUCCESS',
|
LIST_CREATE__SUCCESS: 'LIST_CREATE__SUCCESS',
|
||||||
|
@ -169,7 +168,7 @@ export default {
|
||||||
LIST_DELETE__FAILURE: 'LIST_DELETE__FAILURE',
|
LIST_DELETE__FAILURE: 'LIST_DELETE__FAILURE',
|
||||||
LIST_DELETE_HANDLE: 'LIST_DELETE_HANDLE',
|
LIST_DELETE_HANDLE: 'LIST_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Card */
|
/* Cards */
|
||||||
|
|
||||||
CARD_CREATE: 'CARD_CREATE',
|
CARD_CREATE: 'CARD_CREATE',
|
||||||
CARD_CREATE__SUCCESS: 'CARD_CREATE__SUCCESS',
|
CARD_CREATE__SUCCESS: 'CARD_CREATE__SUCCESS',
|
||||||
|
@ -190,7 +189,7 @@ export default {
|
||||||
CARD_DELETE__FAILURE: 'CARD_DELETE__FAILURE',
|
CARD_DELETE__FAILURE: 'CARD_DELETE__FAILURE',
|
||||||
CARD_DELETE_HANDLE: 'CARD_DELETE_HANDLE',
|
CARD_DELETE_HANDLE: 'CARD_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Task */
|
/* Tasks */
|
||||||
|
|
||||||
TASK_CREATE: 'TASK_CREATE',
|
TASK_CREATE: 'TASK_CREATE',
|
||||||
TASK_CREATE__SUCCESS: 'TASK_CREATE__SUCCESS',
|
TASK_CREATE__SUCCESS: 'TASK_CREATE__SUCCESS',
|
||||||
|
@ -205,7 +204,7 @@ export default {
|
||||||
TASK_DELETE__FAILURE: 'TASK_DELETE__FAILURE',
|
TASK_DELETE__FAILURE: 'TASK_DELETE__FAILURE',
|
||||||
TASK_DELETE_HANDLE: 'TASK_DELETE_HANDLE',
|
TASK_DELETE_HANDLE: 'TASK_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Attachment */
|
/* Attachments */
|
||||||
|
|
||||||
ATTACHMENT_CREATE: 'ATTACHMENT_CREATE',
|
ATTACHMENT_CREATE: 'ATTACHMENT_CREATE',
|
||||||
ATTACHMENT_CREATE__SUCCESS: 'ATTACHMENT_CREATE__SUCCESS',
|
ATTACHMENT_CREATE__SUCCESS: 'ATTACHMENT_CREATE__SUCCESS',
|
||||||
|
@ -220,34 +219,31 @@ export default {
|
||||||
ATTACHMENT_DELETE__FAILURE: 'ATTACHMENT_DELETE__FAILURE',
|
ATTACHMENT_DELETE__FAILURE: 'ATTACHMENT_DELETE__FAILURE',
|
||||||
ATTACHMENT_DELETE_HANDLE: 'ATTACHMENT_DELETE_HANDLE',
|
ATTACHMENT_DELETE_HANDLE: 'ATTACHMENT_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Actions */
|
/* Activities */
|
||||||
|
|
||||||
ACTIONS_FETCH: 'ACTIONS_FETCH',
|
ACTIVITIES_FETCH: 'ACTIVITIES_FETCH',
|
||||||
ACTIONS_FETCH__SUCCESS: 'ACTIONS_FETCH__SUCCESS',
|
ACTIVITIES_FETCH__SUCCESS: 'ACTIVITIES_FETCH__SUCCESS',
|
||||||
ACTIONS_FETCH__FAILURE: 'ACTIONS_FETCH__FAILURE',
|
ACTIVITIES_FETCH__FAILURE: 'ACTIVITIES_FETCH__FAILURE',
|
||||||
ACTIONS_DETAILS_TOGGLE: 'ACTIONS_DETAILS_TOGGLE',
|
ACTIVITIES_DETAILS_TOGGLE: 'ACTIVITIES_DETAILS_TOGGLE',
|
||||||
ACTIONS_DETAILS_TOGGLE__SUCCESS: 'ACTIONS_DETAILS_TOGGLE__SUCCESS',
|
ACTIVITIES_DETAILS_TOGGLE__SUCCESS: 'ACTIVITIES_DETAILS_TOGGLE__SUCCESS',
|
||||||
ACTIONS_DETAILS_TOGGLE__FAILURE: 'ACTIONS_DETAILS_TOGGLE__FAILURE',
|
ACTIVITIES_DETAILS_TOGGLE__FAILURE: 'ACTIVITIES_DETAILS_TOGGLE__FAILURE',
|
||||||
|
ACTIVITY_CREATE_HANDLE: 'ACTIVITY_CREATE_HANDLE',
|
||||||
|
ACTIVITY_UPDATE_HANDLE: 'ACTIVITY_UPDATE_HANDLE',
|
||||||
|
ACTIVITY_DELETE_HANDLE: 'ACTIVITY_DELETE_HANDLE',
|
||||||
|
|
||||||
/* Action */
|
/* Comment activities */
|
||||||
|
|
||||||
ACTION_CREATE_HANDLE: 'ACTION_CREATE_HANDLE',
|
COMMENT_ACTIVITY_CREATE: 'COMMENT_ACTIVITY_CREATE',
|
||||||
ACTION_UPDATE_HANDLE: 'ACTION_UPDATE_HANDLE',
|
COMMENT_ACTIVITY_CREATE__SUCCESS: 'COMMENT_ACTIVITY_CREATE__SUCCESS',
|
||||||
ACTION_DELETE_HANDLE: 'ACTION_DELETE_HANDLE',
|
COMMENT_ACTIVITY_CREATE__FAILURE: 'COMMENT_ACTIVITY_CREATE__FAILURE',
|
||||||
|
COMMENT_ACTIVITY_UPDATE: 'COMMENT_ACTIVITY_UPDATE',
|
||||||
|
COMMENT_ACTIVITY_UPDATE__SUCCESS: 'COMMENT_ACTIVITY_UPDATE__SUCCESS',
|
||||||
|
COMMENT_ACTIVITY_UPDATE__FAILURE: 'COMMENT_ACTIVITY_UPDATE__FAILURE',
|
||||||
|
COMMENT_ACTIVITY_DELETE: 'COMMENT_ACTIVITY_DELETE',
|
||||||
|
COMMENT_ACTIVITY_DELETE__SUCCESS: 'COMMENT_ACTIVITY_DELETE__SUCCESS',
|
||||||
|
COMMENT_ACTIVITY_DELETE__FAILURE: 'COMMENT_ACTIVITY_DELETE__FAILURE',
|
||||||
|
|
||||||
/* Comment action */
|
/* Notifications */
|
||||||
|
|
||||||
COMMENT_ACTION_CREATE: 'COMMENT_ACTION_CREATE',
|
|
||||||
COMMENT_ACTION_CREATE__SUCCESS: 'COMMENT_ACTION_CREATE__SUCCESS',
|
|
||||||
COMMENT_ACTION_CREATE__FAILURE: 'COMMENT_ACTION_CREATE__FAILURE',
|
|
||||||
COMMENT_ACTION_UPDATE: 'COMMENT_ACTION_UPDATE',
|
|
||||||
COMMENT_ACTION_UPDATE__SUCCESS: 'COMMENT_ACTION_UPDATE__SUCCESS',
|
|
||||||
COMMENT_ACTION_UPDATE__FAILURE: 'COMMENT_ACTION_UPDATE__FAILURE',
|
|
||||||
COMMENT_ACTION_DELETE: 'COMMENT_ACTION_DELETE',
|
|
||||||
COMMENT_ACTION_DELETE__SUCCESS: 'COMMENT_ACTION_DELETE__SUCCESS',
|
|
||||||
COMMENT_ACTION_DELETE__FAILURE: 'COMMENT_ACTION_DELETE__FAILURE',
|
|
||||||
|
|
||||||
/* Notification */
|
|
||||||
|
|
||||||
NOTIFICATION_CREATE_HANDLE: 'NOTIFICATION_CREATE_HANDLE',
|
NOTIFICATION_CREATE_HANDLE: 'NOTIFICATION_CREATE_HANDLE',
|
||||||
NOTIFICATION_DELETE: 'NOTIFICATION_DELETE',
|
NOTIFICATION_DELETE: 'NOTIFICATION_DELETE',
|
||||||
|
|
|
@ -13,7 +13,7 @@ const ACCESS_TOKEN_KEY = 'accessToken';
|
||||||
const ACCESS_TOKEN_EXPIRES = 365;
|
const ACCESS_TOKEN_EXPIRES = 365;
|
||||||
|
|
||||||
const POSITION_GAP = 65535;
|
const POSITION_GAP = 65535;
|
||||||
const ACTIONS_LIMIT = 50;
|
const ACTIVITIES_LIMIT = 50;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
SERVER_BASE_URL,
|
SERVER_BASE_URL,
|
||||||
|
@ -21,5 +21,5 @@ export default {
|
||||||
ACCESS_TOKEN_KEY,
|
ACCESS_TOKEN_KEY,
|
||||||
ACCESS_TOKEN_EXPIRES,
|
ACCESS_TOKEN_EXPIRES,
|
||||||
POSITION_GAP,
|
POSITION_GAP,
|
||||||
ACTIONS_LIMIT,
|
ACTIVITIES_LIMIT,
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,18 +12,18 @@ export default {
|
||||||
|
|
||||||
AUTHENTICATE: `${PREFIX}/AUTHENTICATE`,
|
AUTHENTICATE: `${PREFIX}/AUTHENTICATE`,
|
||||||
AUTHENTICATE_ERROR_CLEAR: `${PREFIX}/AUTHENTICATE_ERROR_CLEAR`,
|
AUTHENTICATE_ERROR_CLEAR: `${PREFIX}/AUTHENTICATE_ERROR_CLEAR`,
|
||||||
LOGOUT: `${PREFIX}/LOGOUT`,
|
|
||||||
|
|
||||||
/* Core */
|
/* Core */
|
||||||
|
|
||||||
CORE_INITIALIZE: `${PREFIX}/CORE_INITIALIZE`,
|
CORE_INITIALIZE: `${PREFIX}/CORE_INITIALIZE`,
|
||||||
|
LOGOUT: `${PREFIX}/LOGOUT`,
|
||||||
|
|
||||||
/* Modal */
|
/* Modals */
|
||||||
|
|
||||||
MODAL_OPEN: `${PREFIX}/MODAL_OPEN`,
|
MODAL_OPEN: `${PREFIX}/MODAL_OPEN`,
|
||||||
MODAL_CLOSE: `${PREFIX}/MODAL_CLOSE`,
|
MODAL_CLOSE: `${PREFIX}/MODAL_CLOSE`,
|
||||||
|
|
||||||
/* User */
|
/* Users */
|
||||||
|
|
||||||
USER_CREATE: `${PREFIX}/USER_CREATE`,
|
USER_CREATE: `${PREFIX}/USER_CREATE`,
|
||||||
USER_CREATE_HANDLE: `${PREFIX}/USER_CREATE_HANDLE`,
|
USER_CREATE_HANDLE: `${PREFIX}/USER_CREATE_HANDLE`,
|
||||||
|
@ -56,7 +56,7 @@ export default {
|
||||||
USER_TO_FILTER_IN_CURRENT_BOARD_ADD: `${PREFIX}/USER_TO_FILTER_IN_CURRENT_BOARD_ADD`,
|
USER_TO_FILTER_IN_CURRENT_BOARD_ADD: `${PREFIX}/USER_TO_FILTER_IN_CURRENT_BOARD_ADD`,
|
||||||
USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE: `${PREFIX}/USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE`,
|
USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE: `${PREFIX}/USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE`,
|
||||||
|
|
||||||
/* Project */
|
/* Projects */
|
||||||
|
|
||||||
PROJECT_CREATE: `${PREFIX}/PROJECT_CREATE`,
|
PROJECT_CREATE: `${PREFIX}/PROJECT_CREATE`,
|
||||||
PROJECT_CREATE_HANDLE: `${PREFIX}/PROJECT_CREATE_HANDLE`,
|
PROJECT_CREATE_HANDLE: `${PREFIX}/PROJECT_CREATE_HANDLE`,
|
||||||
|
@ -66,14 +66,14 @@ export default {
|
||||||
CURRENT_PROJECT_DELETE: `${PREFIX}/CURRENT_PROJECT_DELETE`,
|
CURRENT_PROJECT_DELETE: `${PREFIX}/CURRENT_PROJECT_DELETE`,
|
||||||
PROJECT_DELETE_HANDLE: `${PREFIX}/PROJECT_DELETE_HANDLE`,
|
PROJECT_DELETE_HANDLE: `${PREFIX}/PROJECT_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Project manager */
|
/* Project managers */
|
||||||
|
|
||||||
MANAGER_IN_CURRENT_PROJECT_CREATE: `${PREFIX}/MANAGER_IN_CURRENT_PROJECT_CREATE`,
|
MANAGER_IN_CURRENT_PROJECT_CREATE: `${PREFIX}/MANAGER_IN_CURRENT_PROJECT_CREATE`,
|
||||||
PROJECT_MANAGER_CREATE_HANDLE: `${PREFIX}/PROJECT_MANAGER_CREATE_HANDLE`,
|
PROJECT_MANAGER_CREATE_HANDLE: `${PREFIX}/PROJECT_MANAGER_CREATE_HANDLE`,
|
||||||
PROJECT_MANAGER_DELETE: `${PREFIX}/PROJECT_MANAGER_DELETE`,
|
PROJECT_MANAGER_DELETE: `${PREFIX}/PROJECT_MANAGER_DELETE`,
|
||||||
PROJECT_MANAGER_DELETE_HANDLE: `${PREFIX}/PROJECT_MANAGER_DELETE_HANDLE`,
|
PROJECT_MANAGER_DELETE_HANDLE: `${PREFIX}/PROJECT_MANAGER_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Board */
|
/* Boards */
|
||||||
|
|
||||||
BOARD_IN_CURRENT_PROJECT_CREATE: `${PREFIX}/BOARD_IN_CURRENT_PROJECT_CREATE`,
|
BOARD_IN_CURRENT_PROJECT_CREATE: `${PREFIX}/BOARD_IN_CURRENT_PROJECT_CREATE`,
|
||||||
BOARD_CREATE_HANDLE: `${PREFIX}/BOARD_CREATE_HANDLE`,
|
BOARD_CREATE_HANDLE: `${PREFIX}/BOARD_CREATE_HANDLE`,
|
||||||
|
@ -84,14 +84,14 @@ export default {
|
||||||
BOARD_DELETE: `${PREFIX}/BOARD_DELETE`,
|
BOARD_DELETE: `${PREFIX}/BOARD_DELETE`,
|
||||||
BOARD_DELETE_HANDLE: `${PREFIX}/BOARD_DELETE_HANDLE`,
|
BOARD_DELETE_HANDLE: `${PREFIX}/BOARD_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Board membership */
|
/* Board memberships */
|
||||||
|
|
||||||
MEMBERSHIP_IN_CURRENT_BOARD_CREATE: `${PREFIX}/MEMBERSHIP_IN_CURRENT_BOARD_CREATE`,
|
MEMBERSHIP_IN_CURRENT_BOARD_CREATE: `${PREFIX}/MEMBERSHIP_IN_CURRENT_BOARD_CREATE`,
|
||||||
BOARD_MEMBERSHIP_CREATE_HANDLE: `${PREFIX}/BOARD_MEMBERSHIP_CREATE_HANDLE`,
|
BOARD_MEMBERSHIP_CREATE_HANDLE: `${PREFIX}/BOARD_MEMBERSHIP_CREATE_HANDLE`,
|
||||||
BOARD_MEMBERSHIP_DELETE: `${PREFIX}/BOARD_MEMBERSHIP_DELETE`,
|
BOARD_MEMBERSHIP_DELETE: `${PREFIX}/BOARD_MEMBERSHIP_DELETE`,
|
||||||
BOARD_MEMBERSHIP_DELETE_HANDLE: `${PREFIX}/BOARD_MEMBERSHIP_DELETE_HANDLE`,
|
BOARD_MEMBERSHIP_DELETE_HANDLE: `${PREFIX}/BOARD_MEMBERSHIP_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Label */
|
/* Labels */
|
||||||
|
|
||||||
LABEL_IN_CURRENT_BOARD_CREATE: `${PREFIX}/LABEL_IN_CURRENT_BOARD_CREATE`,
|
LABEL_IN_CURRENT_BOARD_CREATE: `${PREFIX}/LABEL_IN_CURRENT_BOARD_CREATE`,
|
||||||
LABEL_CREATE_HANDLE: `${PREFIX}/LABEL_CREATE_HANDLE`,
|
LABEL_CREATE_HANDLE: `${PREFIX}/LABEL_CREATE_HANDLE`,
|
||||||
|
@ -108,7 +108,7 @@ export default {
|
||||||
LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD: `${PREFIX}/LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD`,
|
LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD: `${PREFIX}/LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD`,
|
||||||
LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE: `${PREFIX}/LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE`,
|
LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE: `${PREFIX}/LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE`,
|
||||||
|
|
||||||
/* List */
|
/* Lists */
|
||||||
|
|
||||||
LIST_IN_CURRENT_BOARD_CREATE: `${PREFIX}/LIST_IN_CURRENT_BOARD_CREATE`,
|
LIST_IN_CURRENT_BOARD_CREATE: `${PREFIX}/LIST_IN_CURRENT_BOARD_CREATE`,
|
||||||
LIST_CREATE_HANDLE: `${PREFIX}/LIST_CREATE_HANDLE`,
|
LIST_CREATE_HANDLE: `${PREFIX}/LIST_CREATE_HANDLE`,
|
||||||
|
@ -118,7 +118,7 @@ export default {
|
||||||
LIST_DELETE: `${PREFIX}/LIST_DELETE`,
|
LIST_DELETE: `${PREFIX}/LIST_DELETE`,
|
||||||
LIST_DELETE_HANDLE: `${PREFIX}/LIST_DELETE_HANDLE`,
|
LIST_DELETE_HANDLE: `${PREFIX}/LIST_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Card */
|
/* Cards */
|
||||||
|
|
||||||
CARD_CREATE: `${PREFIX}/CARD_CREATE`,
|
CARD_CREATE: `${PREFIX}/CARD_CREATE`,
|
||||||
CARD_CREATE_HANDLE: `${PREFIX}/CARD_CREATE_HANDLE`,
|
CARD_CREATE_HANDLE: `${PREFIX}/CARD_CREATE_HANDLE`,
|
||||||
|
@ -133,7 +133,7 @@ export default {
|
||||||
CURRENT_CARD_DELETE: `${PREFIX}/CURRENT_CARD_DELETE`,
|
CURRENT_CARD_DELETE: `${PREFIX}/CURRENT_CARD_DELETE`,
|
||||||
CARD_DELETE_HANDLE: `${PREFIX}/CARD_DELETE_HANDLE`,
|
CARD_DELETE_HANDLE: `${PREFIX}/CARD_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Task */
|
/* Tasks */
|
||||||
|
|
||||||
TASK_IN_CURRENT_CARD_CREATE: `${PREFIX}/TASK_IN_CURRENT_CARD_CREATE`,
|
TASK_IN_CURRENT_CARD_CREATE: `${PREFIX}/TASK_IN_CURRENT_CARD_CREATE`,
|
||||||
TASK_CREATE_HANDLE: `${PREFIX}/TASK_CREATE_HANDLE`,
|
TASK_CREATE_HANDLE: `${PREFIX}/TASK_CREATE_HANDLE`,
|
||||||
|
@ -143,7 +143,7 @@ export default {
|
||||||
TASK_DELETE: `${PREFIX}/TASK_DELETE`,
|
TASK_DELETE: `${PREFIX}/TASK_DELETE`,
|
||||||
TASK_DELETE_HANDLE: `${PREFIX}/TASK_DELETE_HANDLE`,
|
TASK_DELETE_HANDLE: `${PREFIX}/TASK_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Attachment */
|
/* Attachments */
|
||||||
|
|
||||||
ATTACHMENT_IN_CURRENT_CARD_CREATE: `${PREFIX}/ATTACHMENT_IN_CURRENT_CARD_CREATE`,
|
ATTACHMENT_IN_CURRENT_CARD_CREATE: `${PREFIX}/ATTACHMENT_IN_CURRENT_CARD_CREATE`,
|
||||||
ATTACHMENT_CREATE_HANDLE: `${PREFIX}/ATTACHMENT_CREATE_HANDLE`,
|
ATTACHMENT_CREATE_HANDLE: `${PREFIX}/ATTACHMENT_CREATE_HANDLE`,
|
||||||
|
@ -152,24 +152,21 @@ export default {
|
||||||
ATTACHMENT_DELETE: `${PREFIX}/ATTACHMENT_DELETE`,
|
ATTACHMENT_DELETE: `${PREFIX}/ATTACHMENT_DELETE`,
|
||||||
ATTACHMENT_DELETE_HANDLE: `${PREFIX}/ATTACHMENT_DELETE_HANDLE`,
|
ATTACHMENT_DELETE_HANDLE: `${PREFIX}/ATTACHMENT_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Actions */
|
/* Activities */
|
||||||
|
|
||||||
ACTIONS_IN_CURRENT_CARD_FETCH: `${PREFIX}/ACTIONS_IN_CURRENT_CARD_FETCH`,
|
ACTIVITIES_IN_CURRENT_CARD_FETCH: `${PREFIX}/ACTIVITIES_IN_CURRENT_CARD_FETCH`,
|
||||||
ACTIONS_DETAILS_IN_CURRENT_CARD_TOGGLE: `${PREFIX}/ACTIONS_DETAILS_IN_CURRENT_CARD_TOGGLE`,
|
ACTIVITIES_DETAILS_IN_CURRENT_CARD_TOGGLE: `${PREFIX}/ACTIVITIES_DETAILS_IN_CURRENT_CARD_TOGGLE`,
|
||||||
|
ACTIVITY_CREATE_HANDLE: `${PREFIX}/ACTIVITY_CREATE_HANDLE`,
|
||||||
|
ACTIVITY_UPDATE_HANDLE: `${PREFIX}/ACTIVITY_UPDATE_HANDLE`,
|
||||||
|
ACTIVITY_DELETE_HANDLE: `${PREFIX}/ACTIVITY_DELETE_HANDLE`,
|
||||||
|
|
||||||
/* Action */
|
/* Comment activities */
|
||||||
|
|
||||||
ACTION_CREATE_HANDLE: `${PREFIX}/ACTION_CREATE_HANDLE`,
|
COMMENT_ACTIVITY_IN_CURRENT_CARD_CREATE: `${PREFIX}/COMMENT_ACTIVITY_IN_CURRENT_CARD_CREATE`,
|
||||||
ACTION_UPDATE_HANDLE: `${PREFIX}/ACTION_UPDATE_HANDLE`,
|
COMMENT_ACTIVITY_UPDATE: `${PREFIX}/COMMENT_ACTIVITY_UPDATE`,
|
||||||
ACTION_DELETE_HANDLE: `${PREFIX}/ACTION_DELETE_HANDLE`,
|
COMMENT_ACTIVITY_DELETE: `${PREFIX}/COMMENT_ACTIVITY_DELETE`,
|
||||||
|
|
||||||
/* Comment action */
|
/* Notifications */
|
||||||
|
|
||||||
COMMENT_ACTION_IN_CURRENT_CARD_CREATE: `${PREFIX}/COMMENT_ACTION_IN_CURRENT_CARD_CREATE`,
|
|
||||||
COMMENT_ACTION_UPDATE: `${PREFIX}/COMMENT_ACTION_UPDATE`,
|
|
||||||
COMMENT_ACTION_DELETE: `${PREFIX}/COMMENT_ACTION_DELETE`,
|
|
||||||
|
|
||||||
/* Notification */
|
|
||||||
|
|
||||||
NOTIFICATION_CREATE_HANDLE: `${PREFIX}/NOTIFICATION_CREATE_HANDLE`,
|
NOTIFICATION_CREATE_HANDLE: `${PREFIX}/NOTIFICATION_CREATE_HANDLE`,
|
||||||
NOTIFICATION_DELETE: `${PREFIX}/NOTIFICATION_DELETE`,
|
NOTIFICATION_DELETE: `${PREFIX}/NOTIFICATION_DELETE`,
|
||||||
|
|
|
@ -7,7 +7,7 @@ export const BoardTypes = {
|
||||||
KANBAN: 'kanban',
|
KANBAN: 'kanban',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ActionTypes = {
|
export const ActivityTypes = {
|
||||||
CREATE_CARD: 'createCard',
|
CREATE_CARD: 'createCard',
|
||||||
MOVE_CARD: 'moveCard',
|
MOVE_CARD: 'moveCard',
|
||||||
COMMENT_CARD: 'commentCard',
|
COMMENT_CARD: 'commentCard',
|
||||||
|
|
|
@ -1,34 +1,17 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
filterLabelsForCurrentBoardSelector,
|
import entryActions from '../entry-actions';
|
||||||
filterUsersForCurrentBoardSelector,
|
|
||||||
isCurrentUserManagerForCurrentProjectSelector,
|
|
||||||
labelsForCurrentBoardSelector,
|
|
||||||
membershipsForCurrentBoardSelector,
|
|
||||||
usersSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import {
|
|
||||||
addLabelToFilterInCurrentBoard,
|
|
||||||
addUserToFilterInCurrentBoard,
|
|
||||||
createLabelInCurrentBoard,
|
|
||||||
createMembershipInCurrentBoard,
|
|
||||||
deleteBoardMembership,
|
|
||||||
deleteLabel,
|
|
||||||
removeLabelFromFilterInCurrentBoard,
|
|
||||||
removeUserFromFilterInCurrentBoard,
|
|
||||||
updateLabel,
|
|
||||||
} from '../actions/entry';
|
|
||||||
import BoardActions from '../components/BoardActions';
|
import BoardActions from '../components/BoardActions';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const allUsers = usersSelector(state);
|
const allUsers = selectors.selectUsers(state);
|
||||||
const isCurrentUserManager = isCurrentUserManagerForCurrentProjectSelector(state);
|
const isCurrentUserManager = selectors.selectIsCurrentUserManagerForCurrentProject(state);
|
||||||
const memberships = membershipsForCurrentBoardSelector(state);
|
const memberships = selectors.selectMembershipsForCurrentBoard(state);
|
||||||
const labels = labelsForCurrentBoardSelector(state);
|
const labels = selectors.selectLabelsForCurrentBoard(state);
|
||||||
const filterUsers = filterUsersForCurrentBoardSelector(state);
|
const filterUsers = selectors.selectFilterUsersForCurrentBoard(state);
|
||||||
const filterLabels = filterLabelsForCurrentBoardSelector(state);
|
const filterLabels = selectors.selectFilterLabelsForCurrentBoard(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
memberships,
|
memberships,
|
||||||
|
@ -43,15 +26,15 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onMembershipCreate: createMembershipInCurrentBoard,
|
onMembershipCreate: entryActions.createMembershipInCurrentBoard,
|
||||||
onMembershipDelete: deleteBoardMembership,
|
onMembershipDelete: entryActions.deleteBoardMembership,
|
||||||
onUserToFilterAdd: addUserToFilterInCurrentBoard,
|
onUserToFilterAdd: entryActions.addUserToFilterInCurrentBoard,
|
||||||
onUserFromFilterRemove: removeUserFromFilterInCurrentBoard,
|
onUserFromFilterRemove: entryActions.removeUserFromFilterInCurrentBoard,
|
||||||
onLabelToFilterAdd: addLabelToFilterInCurrentBoard,
|
onLabelToFilterAdd: entryActions.addLabelToFilterInCurrentBoard,
|
||||||
onLabelFromFilterRemove: removeLabelFromFilterInCurrentBoard,
|
onLabelFromFilterRemove: entryActions.removeLabelFromFilterInCurrentBoard,
|
||||||
onLabelCreate: createLabelInCurrentBoard,
|
onLabelCreate: entryActions.createLabelInCurrentBoard,
|
||||||
onLabelUpdate: updateLabel,
|
onLabelUpdate: entryActions.updateLabel,
|
||||||
onLabelDelete: deleteLabel,
|
onLabelDelete: entryActions.deleteLabel,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
isCurrentUserMemberForCurrentBoardSelector,
|
import entryActions from '../entry-actions';
|
||||||
listIdsForCurrentBoardSelector,
|
|
||||||
pathSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import { createListInCurrentBoard, moveCard, moveList } from '../actions/entry';
|
|
||||||
import BoardKanban from '../components/BoardKanban';
|
import BoardKanban from '../components/BoardKanban';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const { cardId } = pathSelector(state);
|
const { cardId } = selectors.selectPath(state);
|
||||||
const isCurrentUserMember = isCurrentUserMemberForCurrentBoardSelector(state);
|
const isCurrentUserMember = selectors.selectIsCurrentUserMemberForCurrentBoard(state);
|
||||||
const listIds = listIdsForCurrentBoardSelector(state);
|
const listIds = selectors.selectListIdsForCurrentBoard(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
listIds,
|
listIds,
|
||||||
|
@ -24,9 +20,9 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onListCreate: createListInCurrentBoard,
|
onListCreate: entryActions.createListInCurrentBoard,
|
||||||
onListMove: moveList,
|
onListMove: entryActions.moveList,
|
||||||
onCardMove: moveCard,
|
onCardMove: entryActions.moveCard,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { currentBoardSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import BoardWrapper from '../components/BoardWrapper';
|
import BoardWrapper from '../components/BoardWrapper';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const { type, isFetching } = currentBoardSelector(state);
|
const { type, isFetching } = selectors.selectCurrentBoard(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type,
|
type,
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
boardsForCurrentProjectSelector,
|
import entryActions from '../entry-actions';
|
||||||
isCurrentUserManagerForCurrentProjectSelector,
|
|
||||||
pathSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import { createBoardInCurrentProject, deleteBoard, moveBoard, updateBoard } from '../actions/entry';
|
|
||||||
import Boards from '../components/Boards';
|
import Boards from '../components/Boards';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const { boardId } = pathSelector(state);
|
const { boardId } = selectors.selectPath(state);
|
||||||
const boards = boardsForCurrentProjectSelector(state);
|
const boards = selectors.selectBoardsForCurrentProject(state);
|
||||||
const isCurrentUserManager = isCurrentUserManagerForCurrentProjectSelector(state);
|
const isCurrentUserManager = selectors.selectIsCurrentUserManagerForCurrentProject(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items: boards,
|
items: boards,
|
||||||
|
@ -24,10 +20,10 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onCreate: createBoardInCurrentProject,
|
onCreate: entryActions.createBoardInCurrentProject,
|
||||||
onUpdate: updateBoard,
|
onUpdate: entryActions.updateBoard,
|
||||||
onMove: moveBoard,
|
onMove: entryActions.moveBoard,
|
||||||
onDelete: deleteBoard,
|
onDelete: entryActions.deleteBoard,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,57 +1,33 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
isCurrentUserMemberForCurrentBoardSelector,
|
import entryActions from '../entry-actions';
|
||||||
labelsForCurrentBoardSelector,
|
|
||||||
makeCardByIdSelector,
|
|
||||||
makeLabelsByCardIdSelector,
|
|
||||||
makeNotificationsTotalByCardIdSelector,
|
|
||||||
makeTasksByCardIdSelector,
|
|
||||||
makeUsersByCardIdSelector,
|
|
||||||
membershipsForCurrentBoardSelector,
|
|
||||||
pathSelector,
|
|
||||||
projectsToListsForCurrentUserSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import {
|
|
||||||
addLabelToCard,
|
|
||||||
addUserToCard,
|
|
||||||
createLabelInCurrentBoard,
|
|
||||||
deleteCard,
|
|
||||||
deleteLabel,
|
|
||||||
fetchBoard,
|
|
||||||
moveCard,
|
|
||||||
removeLabelFromCard,
|
|
||||||
removeUserFromCard,
|
|
||||||
transferCard,
|
|
||||||
updateLabel,
|
|
||||||
updateCard,
|
|
||||||
} from '../actions/entry';
|
|
||||||
import Card from '../components/Card';
|
import Card from '../components/Card';
|
||||||
|
|
||||||
const makeMapStateToProps = () => {
|
const makeMapStateToProps = () => {
|
||||||
const cardByIdSelector = makeCardByIdSelector();
|
const selectCardById = selectors.makeSelectCardById();
|
||||||
const usersByCardIdSelector = makeUsersByCardIdSelector();
|
const selectUsersByCardId = selectors.makeSelectUsersByCardId();
|
||||||
const labelsByCardIdSelector = makeLabelsByCardIdSelector();
|
const selectLabelsByCardId = selectors.makeSelectLabelsByCardId();
|
||||||
const tasksByCardIdSelector = makeTasksByCardIdSelector();
|
const selectTasksByCardId = selectors.makeSelectTasksByCardId();
|
||||||
const notificationsTotalByCardIdSelector = makeNotificationsTotalByCardIdSelector();
|
const selectNotificationsTotalByCardId = selectors.makeSelectNotificationsTotalByCardId();
|
||||||
|
|
||||||
return (state, { id, index }) => {
|
return (state, { id, index }) => {
|
||||||
const { projectId } = pathSelector(state);
|
const { projectId } = selectors.selectPath(state);
|
||||||
const allProjectsToLists = projectsToListsForCurrentUserSelector(state);
|
const allProjectsToLists = selectors.selectProjectsToListsForCurrentUser(state);
|
||||||
const allBoardMemberships = membershipsForCurrentBoardSelector(state);
|
const allBoardMemberships = selectors.selectMembershipsForCurrentBoard(state);
|
||||||
const allLabels = labelsForCurrentBoardSelector(state);
|
const allLabels = selectors.selectLabelsForCurrentBoard(state);
|
||||||
const isCurrentUserMember = isCurrentUserMemberForCurrentBoardSelector(state);
|
const isCurrentUserMember = selectors.selectIsCurrentUserMemberForCurrentBoard(state);
|
||||||
|
|
||||||
const { name, dueDate, timer, coverUrl, boardId, listId, isPersisted } = cardByIdSelector(
|
const { name, dueDate, timer, coverUrl, boardId, listId, isPersisted } = selectCardById(
|
||||||
state,
|
state,
|
||||||
id,
|
id,
|
||||||
);
|
);
|
||||||
|
|
||||||
const users = usersByCardIdSelector(state, id);
|
const users = selectUsersByCardId(state, id);
|
||||||
const labels = labelsByCardIdSelector(state, id);
|
const labels = selectLabelsByCardId(state, id);
|
||||||
const tasks = tasksByCardIdSelector(state, id);
|
const tasks = selectTasksByCardId(state, id);
|
||||||
const notificationsTotal = notificationsTotalByCardIdSelector(state, id);
|
const notificationsTotal = selectNotificationsTotalByCardId(state, id);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
|
@ -79,18 +55,18 @@ const makeMapStateToProps = () => {
|
||||||
const mapDispatchToProps = (dispatch, { id }) =>
|
const mapDispatchToProps = (dispatch, { id }) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onUpdate: (data) => updateCard(id, data),
|
onUpdate: (data) => entryActions.updateCard(id, data),
|
||||||
onMove: (listId, index) => moveCard(id, listId, index),
|
onMove: (listId, index) => entryActions.moveCard(id, listId, index),
|
||||||
onTransfer: (boardId, listId) => transferCard(id, boardId, listId),
|
onTransfer: (boardId, listId) => entryActions.transferCard(id, boardId, listId),
|
||||||
onDelete: () => deleteCard(id),
|
onDelete: () => entryActions.deleteCard(id),
|
||||||
onUserAdd: (userId) => addUserToCard(userId, id),
|
onUserAdd: (userId) => entryActions.addUserToCard(userId, id),
|
||||||
onUserRemove: (userId) => removeUserFromCard(userId, id),
|
onUserRemove: (userId) => entryActions.removeUserFromCard(userId, id),
|
||||||
onBoardFetch: fetchBoard,
|
onBoardFetch: entryActions.fetchBoard,
|
||||||
onLabelAdd: (labelId) => addLabelToCard(labelId, id),
|
onLabelAdd: (labelId) => entryActions.addLabelToCard(labelId, id),
|
||||||
onLabelRemove: (labelId) => removeLabelFromCard(labelId, id),
|
onLabelRemove: (labelId) => entryActions.removeLabelFromCard(labelId, id),
|
||||||
onLabelCreate: (data) => createLabelInCurrentBoard(data),
|
onLabelCreate: (data) => entryActions.createLabelInCurrentBoard(data),
|
||||||
onLabelUpdate: (labelId, data) => updateLabel(labelId, data),
|
onLabelUpdate: (labelId, data) => entryActions.updateLabel(labelId, data),
|
||||||
onLabelDelete: (labelId) => deleteLabel(labelId),
|
onLabelDelete: (labelId) => entryActions.deleteLabel(labelId),
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,56 +3,18 @@ import { connect } from 'react-redux';
|
||||||
import { push } from 'connected-react-router';
|
import { push } from 'connected-react-router';
|
||||||
import omit from 'lodash/omit';
|
import omit from 'lodash/omit';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
actionsForCurrentCardSelector,
|
import entryActions from '../entry-actions';
|
||||||
attachmentsForCurrentCardSelector,
|
|
||||||
currentCardSelector,
|
|
||||||
isCurrentUserManagerForCurrentProjectSelector,
|
|
||||||
isCurrentUserMemberForCurrentBoardSelector,
|
|
||||||
labelsForCurrentBoardSelector,
|
|
||||||
labelsForCurrentCardSelector,
|
|
||||||
membershipsForCurrentBoardSelector,
|
|
||||||
pathSelector,
|
|
||||||
projectsToListsForCurrentUserSelector,
|
|
||||||
tasksForCurrentCardSelector,
|
|
||||||
usersForCurrentCardSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import {
|
|
||||||
addLabelToCurrentCard,
|
|
||||||
addUserToCurrentCard,
|
|
||||||
createAttachmentInCurrentCard,
|
|
||||||
createCommentActionInCurrentCard,
|
|
||||||
createLabelInCurrentBoard,
|
|
||||||
createTaskInCurrentCard,
|
|
||||||
deleteAttachment,
|
|
||||||
deleteCommentAction,
|
|
||||||
deleteCurrentCard,
|
|
||||||
deleteLabel,
|
|
||||||
deleteTask,
|
|
||||||
fetchActionsInCurrentCard,
|
|
||||||
fetchBoard,
|
|
||||||
moveCurrentCard,
|
|
||||||
moveTask,
|
|
||||||
removeLabelFromCurrentCard,
|
|
||||||
removeUserFromCurrentCard,
|
|
||||||
toggleActionsDetailsInCurrentCard,
|
|
||||||
transferCurrentCard,
|
|
||||||
updateAttachment,
|
|
||||||
updateCommentAction,
|
|
||||||
updateCurrentCard,
|
|
||||||
updateLabel,
|
|
||||||
updateTask,
|
|
||||||
} from '../actions/entry';
|
|
||||||
import Paths from '../constants/Paths';
|
import Paths from '../constants/Paths';
|
||||||
import CardModal from '../components/CardModal';
|
import CardModal from '../components/CardModal';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const { projectId } = pathSelector(state);
|
const { projectId } = selectors.selectPath(state);
|
||||||
const allProjectsToLists = projectsToListsForCurrentUserSelector(state);
|
const allProjectsToLists = selectors.selectProjectsToListsForCurrentUser(state);
|
||||||
const isCurrentUserManager = isCurrentUserManagerForCurrentProjectSelector(state);
|
const isCurrentUserManager = selectors.selectIsCurrentUserManagerForCurrentProject(state);
|
||||||
const allBoardMemberships = membershipsForCurrentBoardSelector(state);
|
const allBoardMemberships = selectors.selectMembershipsForCurrentBoard(state);
|
||||||
const allLabels = labelsForCurrentBoardSelector(state);
|
const allLabels = selectors.selectLabelsForCurrentBoard(state);
|
||||||
const isCurrentUserMember = isCurrentUserMemberForCurrentBoardSelector(state);
|
const isCurrentUserMember = selectors.selectIsCurrentUserMemberForCurrentBoard(state);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
|
@ -60,19 +22,19 @@ const mapStateToProps = (state) => {
|
||||||
dueDate,
|
dueDate,
|
||||||
timer,
|
timer,
|
||||||
isSubscribed,
|
isSubscribed,
|
||||||
isActionsFetching,
|
isActivitiesFetching,
|
||||||
isActionsDetailsVisible,
|
isAllActivitiesFetched,
|
||||||
isActionsDetailsFetching,
|
isActivitiesDetailsVisible,
|
||||||
isAllActionsFetched,
|
isActivitiesDetailsFetching,
|
||||||
boardId,
|
boardId,
|
||||||
listId,
|
listId,
|
||||||
} = currentCardSelector(state);
|
} = selectors.selectCurrentCard(state);
|
||||||
|
|
||||||
const users = usersForCurrentCardSelector(state);
|
const users = selectors.selectUsersForCurrentCard(state);
|
||||||
const labels = labelsForCurrentCardSelector(state);
|
const labels = selectors.selectLabelsForCurrentCard(state);
|
||||||
const tasks = tasksForCurrentCardSelector(state);
|
const tasks = selectors.selectTasksForCurrentCard(state);
|
||||||
const attachments = attachmentsForCurrentCardSelector(state);
|
const attachments = selectors.selectAttachmentsForCurrentCard(state);
|
||||||
const actions = actionsForCurrentCardSelector(state);
|
const activities = selectors.selectActivitiesForCurrentCard(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
|
@ -80,10 +42,10 @@ const mapStateToProps = (state) => {
|
||||||
dueDate,
|
dueDate,
|
||||||
timer,
|
timer,
|
||||||
isSubscribed,
|
isSubscribed,
|
||||||
isActionsFetching,
|
isActivitiesFetching,
|
||||||
isAllActionsFetched,
|
isAllActivitiesFetched,
|
||||||
isActionsDetailsVisible,
|
isActivitiesDetailsVisible,
|
||||||
isActionsDetailsFetching,
|
isActivitiesDetailsFetching,
|
||||||
listId,
|
listId,
|
||||||
boardId,
|
boardId,
|
||||||
projectId,
|
projectId,
|
||||||
|
@ -91,42 +53,42 @@ const mapStateToProps = (state) => {
|
||||||
labels,
|
labels,
|
||||||
tasks,
|
tasks,
|
||||||
attachments,
|
attachments,
|
||||||
actions,
|
activities,
|
||||||
allProjectsToLists,
|
allProjectsToLists,
|
||||||
allBoardMemberships,
|
allBoardMemberships,
|
||||||
allLabels,
|
allLabels,
|
||||||
canEdit: isCurrentUserMember,
|
canEdit: isCurrentUserMember,
|
||||||
canEditAllCommentActions: isCurrentUserManager,
|
canEditAllCommentActivities: isCurrentUserManager,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onUpdate: updateCurrentCard,
|
onUpdate: entryActions.updateCurrentCard,
|
||||||
onMove: moveCurrentCard,
|
onMove: entryActions.moveCurrentCard,
|
||||||
onTransfer: transferCurrentCard,
|
onTransfer: entryActions.transferCurrentCard,
|
||||||
onDelete: deleteCurrentCard,
|
onDelete: entryActions.deleteCurrentCard,
|
||||||
onUserAdd: addUserToCurrentCard,
|
onUserAdd: entryActions.addUserToCurrentCard,
|
||||||
onUserRemove: removeUserFromCurrentCard,
|
onUserRemove: entryActions.removeUserFromCurrentCard,
|
||||||
onBoardFetch: fetchBoard,
|
onBoardFetch: entryActions.fetchBoard,
|
||||||
onLabelAdd: addLabelToCurrentCard,
|
onLabelAdd: entryActions.addLabelToCurrentCard,
|
||||||
onLabelRemove: removeLabelFromCurrentCard,
|
onLabelRemove: entryActions.removeLabelFromCurrentCard,
|
||||||
onLabelCreate: createLabelInCurrentBoard,
|
onLabelCreate: entryActions.createLabelInCurrentBoard,
|
||||||
onLabelUpdate: updateLabel,
|
onLabelUpdate: entryActions.updateLabel,
|
||||||
onLabelDelete: deleteLabel,
|
onLabelDelete: entryActions.deleteLabel,
|
||||||
onTaskCreate: createTaskInCurrentCard,
|
onTaskCreate: entryActions.createTaskInCurrentCard,
|
||||||
onTaskUpdate: updateTask,
|
onTaskUpdate: entryActions.updateTask,
|
||||||
onTaskMove: moveTask,
|
onTaskMove: entryActions.moveTask,
|
||||||
onTaskDelete: deleteTask,
|
onTaskDelete: entryActions.deleteTask,
|
||||||
onAttachmentCreate: createAttachmentInCurrentCard,
|
onAttachmentCreate: entryActions.createAttachmentInCurrentCard,
|
||||||
onAttachmentUpdate: updateAttachment,
|
onAttachmentUpdate: entryActions.updateAttachment,
|
||||||
onAttachmentDelete: deleteAttachment,
|
onAttachmentDelete: entryActions.deleteAttachment,
|
||||||
onActionsFetch: fetchActionsInCurrentCard,
|
onActivitiesFetch: entryActions.fetchActivitiesInCurrentCard,
|
||||||
onActionsDetailsToggle: toggleActionsDetailsInCurrentCard,
|
onActivitiesDetailsToggle: entryActions.toggleActivitiesDetailsInCurrentCard,
|
||||||
onCommentActionCreate: createCommentActionInCurrentCard,
|
onCommentActivityCreate: entryActions.createCommentActivityInCurrentCard,
|
||||||
onCommentActionUpdate: updateCommentAction,
|
onCommentActivityUpdate: entryActions.updateCommentActivity,
|
||||||
onCommentActionDelete: deleteCommentAction,
|
onCommentActivityDelete: entryActions.deleteCommentActivity,
|
||||||
push,
|
push,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { currentModalSelector, currentProjectSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import Core from '../components/Core';
|
import Core from '../components/Core';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const currentModal = currentModalSelector(state);
|
const currentModal = selectors.selectCurrentModal(state);
|
||||||
const currentProject = currentProjectSelector(state);
|
const currentProject = selectors.selectCurrentProject(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentModal,
|
currentModal,
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { isCoreInitializingSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import CoreWrapper from '../components/CoreWrapper';
|
import CoreWrapper from '../components/CoreWrapper';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const isCoreInitializing = isCoreInitializingSelector(state);
|
const isCoreInitializing = selectors.selectIsCoreInitializing(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isInitializing: isCoreInitializing,
|
isInitializing: isCoreInitializing,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { currentBoardSelector, pathSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import Fixed from '../components/Fixed';
|
import Fixed from '../components/Fixed';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const { projectId } = pathSelector(state);
|
const { projectId } = selectors.selectPath(state);
|
||||||
const currentBoard = currentBoardSelector(state);
|
const currentBoard = selectors.selectCurrentBoard(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
projectId,
|
projectId,
|
||||||
|
|
|
@ -1,26 +1,15 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
currentProjectSelector,
|
import entryActions from '../entry-actions';
|
||||||
currentUserSelector,
|
|
||||||
isCurrentUserManagerForCurrentProjectSelector,
|
|
||||||
notificationsForCurrentUserSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import {
|
|
||||||
deleteNotification,
|
|
||||||
logout,
|
|
||||||
openProjectSettingsModal,
|
|
||||||
openUserSettingsModal,
|
|
||||||
openUsersModal,
|
|
||||||
} from '../actions/entry';
|
|
||||||
import Header from '../components/Header';
|
import Header from '../components/Header';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const currentUser = currentUserSelector(state);
|
const currentUser = selectors.selectCurrentUser(state);
|
||||||
const currentProject = currentProjectSelector(state);
|
const currentProject = selectors.selectCurrentProject(state);
|
||||||
const notifications = notificationsForCurrentUserSelector(state);
|
const notifications = selectors.selectNotificationsForCurrentUser(state);
|
||||||
const isCurrentUserManager = isCurrentUserManagerForCurrentProjectSelector(state);
|
const isCurrentUserManager = selectors.selectIsCurrentUserManagerForCurrentProject(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
notifications,
|
notifications,
|
||||||
|
@ -34,11 +23,11 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onProjectSettingsClick: openProjectSettingsModal,
|
onProjectSettingsClick: entryActions.openProjectSettingsModal,
|
||||||
onUsersClick: openUsersModal,
|
onUsersClick: entryActions.openUsersModal,
|
||||||
onNotificationDelete: deleteNotification,
|
onNotificationDelete: entryActions.deleteNotification,
|
||||||
onUserSettingsClick: openUserSettingsModal,
|
onUserSettingsClick: entryActions.openUserSettingsModal,
|
||||||
onLogout: logout,
|
onLogout: entryActions.logout,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
isCurrentUserMemberForCurrentBoardSelector,
|
import entryActions from '../entry-actions';
|
||||||
makeCardIdsByListIdSelector,
|
|
||||||
makeListByIdSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import { createCard, deleteList, updateList } from '../actions/entry';
|
|
||||||
import List from '../components/List';
|
import List from '../components/List';
|
||||||
|
|
||||||
const makeMapStateToProps = () => {
|
const makeMapStateToProps = () => {
|
||||||
const listByIdSelector = makeListByIdSelector();
|
const selectListById = selectors.makeSelectListById();
|
||||||
const cardIdsByListIdSelector = makeCardIdsByListIdSelector();
|
const selectCardIdsByListId = selectors.makeSelectCardIdsByListId();
|
||||||
|
|
||||||
return (state, { id, index }) => {
|
return (state, { id, index }) => {
|
||||||
const { name, isPersisted } = listByIdSelector(state, id);
|
const { name, isPersisted } = selectListById(state, id);
|
||||||
const cardIds = cardIdsByListIdSelector(state, id);
|
const cardIds = selectCardIdsByListId(state, id);
|
||||||
const isCurrentUserMember = isCurrentUserMemberForCurrentBoardSelector(state);
|
const isCurrentUserMember = selectors.selectIsCurrentUserMemberForCurrentBoard(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
|
@ -32,9 +28,9 @@ const makeMapStateToProps = () => {
|
||||||
const mapDispatchToProps = (dispatch, { id }) =>
|
const mapDispatchToProps = (dispatch, { id }) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onUpdate: (data) => updateList(id, data),
|
onUpdate: (data) => entryActions.updateList(id, data),
|
||||||
onDelete: () => deleteList(id),
|
onDelete: () => entryActions.deleteList(id),
|
||||||
onCardCreate: (data) => createCard(id, data),
|
onCardCreate: (data) => entryActions.createCard(id, data),
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { authenticate, clearAuthenticateError } from '../actions/entry';
|
import entryActions from '../entry-actions';
|
||||||
import Login from '../components/Login';
|
import Login from '../components/Login';
|
||||||
|
|
||||||
const mapStateToProps = ({
|
const mapStateToProps = ({
|
||||||
|
@ -17,8 +17,8 @@ const mapStateToProps = ({
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onAuthenticate: authenticate,
|
onAuthenticate: entryActions.authenticate,
|
||||||
onMessageDismiss: clearAuthenticateError,
|
onMessageDismiss: entryActions.clearAuthenticateError,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { closeModal, createProject } from '../actions/entry';
|
import entryActions from '../entry-actions';
|
||||||
import ProjectAddModal from '../components/ProjectAddModal';
|
import ProjectAddModal from '../components/ProjectAddModal';
|
||||||
|
|
||||||
const mapStateToProps = ({
|
const mapStateToProps = ({
|
||||||
|
@ -16,8 +16,8 @@ const mapStateToProps = ({
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onCreate: createProject,
|
onCreate: entryActions.createProject,
|
||||||
onClose: closeModal,
|
onClose: entryActions.closeModal,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { currentModalSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import ModalTypes from '../constants/ModalTypes';
|
import ModalTypes from '../constants/ModalTypes';
|
||||||
import Project from '../components/Project';
|
import Project from '../components/Project';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const currentModal = currentModalSelector(state);
|
const currentModal = selectors.selectCurrentModal(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isSettingsModalOpened: currentModal === ModalTypes.PROJECT_SETTINGS,
|
isSettingsModalOpened: currentModal === ModalTypes.PROJECT_SETTINGS,
|
||||||
|
|
|
@ -1,28 +1,17 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import {
|
import selectors from '../selectors';
|
||||||
currentProjectSelector,
|
import entryActions from '../entry-actions';
|
||||||
managersForCurrentProjectSelector,
|
|
||||||
usersSelector,
|
|
||||||
} from '../selectors';
|
|
||||||
import {
|
|
||||||
closeModal,
|
|
||||||
createManagerInCurrentProject,
|
|
||||||
deleteCurrentProject,
|
|
||||||
deleteProjectManager,
|
|
||||||
updateCurrentProject,
|
|
||||||
updateCurrentProjectBackgroundImage,
|
|
||||||
} from '../actions/entry';
|
|
||||||
import ProjectSettingsModal from '../components/ProjectSettingsModal';
|
import ProjectSettingsModal from '../components/ProjectSettingsModal';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const users = usersSelector(state);
|
const users = selectors.selectUsers(state);
|
||||||
|
|
||||||
const { name, background, backgroundImage, isBackgroundImageUpdating } =
|
const { name, background, backgroundImage, isBackgroundImageUpdating } =
|
||||||
currentProjectSelector(state);
|
selectors.selectCurrentProject(state);
|
||||||
|
|
||||||
const managers = managersForCurrentProjectSelector(state);
|
const managers = selectors.selectManagersForCurrentProject(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
|
@ -37,12 +26,12 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onUpdate: updateCurrentProject,
|
onUpdate: entryActions.updateCurrentProject,
|
||||||
onBackgroundImageUpdate: updateCurrentProjectBackgroundImage,
|
onBackgroundImageUpdate: entryActions.updateCurrentProjectBackgroundImage,
|
||||||
onDelete: deleteCurrentProject,
|
onDelete: entryActions.deleteCurrentProject,
|
||||||
onManagerCreate: createManagerInCurrentProject,
|
onManagerCreate: entryActions.createManagerInCurrentProject,
|
||||||
onManagerDelete: deleteProjectManager,
|
onManagerDelete: entryActions.deleteProjectManager,
|
||||||
onClose: closeModal,
|
onClose: entryActions.closeModal,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { currentUserSelector, projectsForCurrentUserSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import { openProjectAddModal } from '../actions/entry';
|
import entryActions from '../entry-actions';
|
||||||
import Projects from '../components/Projects';
|
import Projects from '../components/Projects';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const { isAdmin } = currentUserSelector(state);
|
const { isAdmin } = selectors.selectCurrentUser(state);
|
||||||
const project = projectsForCurrentUserSelector(state);
|
const projects = selectors.selectProjectsForCurrentUser(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items: project,
|
items: projects,
|
||||||
canAdd: isAdmin,
|
canAdd: isAdmin,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,7 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onAdd: openProjectAddModal,
|
onAdd: entryActions.openProjectAddModal,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { pathSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import Static from '../components/Static';
|
import Static from '../components/Static';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const { cardId, boardId, projectId } = pathSelector(state);
|
const { cardId, boardId, projectId } = selectors.selectPath(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cardId,
|
cardId,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { clearUserCreateError, createUser } from '../actions/entry';
|
import entryActions from '../entry-actions';
|
||||||
import UserAddPopup from '../components/UserAddPopup';
|
import UserAddPopup from '../components/UserAddPopup';
|
||||||
|
|
||||||
const mapStateToProps = ({
|
const mapStateToProps = ({
|
||||||
|
@ -17,8 +17,8 @@ const mapStateToProps = ({
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onCreate: createUser,
|
onCreate: entryActions.createUser,
|
||||||
onMessageDismiss: clearUserCreateError,
|
onMessageDismiss: entryActions.clearUserCreateError,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,19 +1,8 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { currentUserSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import {
|
import entryActions from '../entry-actions';
|
||||||
clearCurrentUserEmailUpdateError,
|
|
||||||
clearCurrentUserPasswordUpdateError,
|
|
||||||
clearCurrentUserUsernameUpdateError,
|
|
||||||
closeModal,
|
|
||||||
updateCurrentUser,
|
|
||||||
updateCurrentUserAvatar,
|
|
||||||
updateCurrentUserEmail,
|
|
||||||
updateCurrentUserLanguage,
|
|
||||||
updateCurrentUserPassword,
|
|
||||||
updateCurrentUserUsername,
|
|
||||||
} from '../actions/entry';
|
|
||||||
import UserSettingsModal from '../components/UserSettingsModal';
|
import UserSettingsModal from '../components/UserSettingsModal';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
@ -30,7 +19,7 @@ const mapStateToProps = (state) => {
|
||||||
emailUpdateForm,
|
emailUpdateForm,
|
||||||
passwordUpdateForm,
|
passwordUpdateForm,
|
||||||
usernameUpdateForm,
|
usernameUpdateForm,
|
||||||
} = currentUserSelector(state);
|
} = selectors.selectCurrentUser(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
email,
|
email,
|
||||||
|
@ -51,16 +40,16 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onUpdate: updateCurrentUser,
|
onUpdate: entryActions.updateCurrentUser,
|
||||||
onAvatarUpdate: updateCurrentUserAvatar,
|
onAvatarUpdate: entryActions.updateCurrentUserAvatar,
|
||||||
onLanguageUpdate: updateCurrentUserLanguage,
|
onLanguageUpdate: entryActions.updateCurrentUserLanguage,
|
||||||
onUsernameUpdate: updateCurrentUserUsername,
|
onUsernameUpdate: entryActions.updateCurrentUserUsername,
|
||||||
onUsernameUpdateMessageDismiss: clearCurrentUserUsernameUpdateError,
|
onUsernameUpdateMessageDismiss: entryActions.clearCurrentUserUsernameUpdateError,
|
||||||
onEmailUpdate: updateCurrentUserEmail,
|
onEmailUpdate: entryActions.updateCurrentUserEmail,
|
||||||
onEmailUpdateMessageDismiss: clearCurrentUserEmailUpdateError,
|
onEmailUpdateMessageDismiss: entryActions.clearCurrentUserEmailUpdateError,
|
||||||
onPasswordUpdate: updateCurrentUserPassword,
|
onPasswordUpdate: entryActions.updateCurrentUserPassword,
|
||||||
onPasswordUpdateMessageDismiss: clearCurrentUserPasswordUpdateError,
|
onPasswordUpdateMessageDismiss: entryActions.clearCurrentUserPasswordUpdateError,
|
||||||
onClose: closeModal,
|
onClose: entryActions.closeModal,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,22 +1,12 @@
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { usersExceptCurrentSelector } from '../selectors';
|
import selectors from '../selectors';
|
||||||
import {
|
import entryActions from '../entry-actions';
|
||||||
clearUserEmailUpdateError,
|
|
||||||
clearUserPasswordUpdateError,
|
|
||||||
clearUserUsernameUpdateError,
|
|
||||||
closeModal,
|
|
||||||
deleteUser,
|
|
||||||
updateUser,
|
|
||||||
updateUserEmail,
|
|
||||||
updateUserPassword,
|
|
||||||
updateUserUsername,
|
|
||||||
} from '../actions/entry';
|
|
||||||
import UsersModal from '../components/UsersModal';
|
import UsersModal from '../components/UsersModal';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
const users = usersExceptCurrentSelector(state);
|
const users = selectors.selectUsersExceptCurrent(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items: users,
|
items: users,
|
||||||
|
@ -26,15 +16,15 @@ const mapStateToProps = (state) => {
|
||||||
const mapDispatchToProps = (dispatch) =>
|
const mapDispatchToProps = (dispatch) =>
|
||||||
bindActionCreators(
|
bindActionCreators(
|
||||||
{
|
{
|
||||||
onUpdate: updateUser,
|
onUpdate: entryActions.updateUser,
|
||||||
onUsernameUpdate: updateUserUsername,
|
onUsernameUpdate: entryActions.updateUserUsername,
|
||||||
onUsernameUpdateMessageDismiss: clearUserUsernameUpdateError,
|
onUsernameUpdateMessageDismiss: entryActions.clearUserUsernameUpdateError,
|
||||||
onEmailUpdate: updateUserEmail,
|
onEmailUpdate: entryActions.updateUserEmail,
|
||||||
onEmailUpdateMessageDismiss: clearUserEmailUpdateError,
|
onEmailUpdateMessageDismiss: entryActions.clearUserEmailUpdateError,
|
||||||
onPasswordUpdate: updateUserPassword,
|
onPasswordUpdate: entryActions.updateUserPassword,
|
||||||
onPasswordUpdateMessageDismiss: clearUserPasswordUpdateError,
|
onPasswordUpdateMessageDismiss: entryActions.clearUserPasswordUpdateError,
|
||||||
onDelete: deleteUser,
|
onDelete: entryActions.deleteUser,
|
||||||
onClose: closeModal,
|
onClose: entryActions.closeModal,
|
||||||
},
|
},
|
||||||
dispatch,
|
dispatch,
|
||||||
);
|
);
|
||||||
|
|
42
client/src/entry-actions/activities.js
Executable file
42
client/src/entry-actions/activities.js
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const fetchActivitiesInCurrentCard = () => ({
|
||||||
|
type: EntryActionTypes.ACTIVITIES_IN_CURRENT_CARD_FETCH,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
const toggleActivitiesDetailsInCurrentCard = (isVisible) => ({
|
||||||
|
type: EntryActionTypes.ACTIVITIES_DETAILS_IN_CURRENT_CARD_TOGGLE,
|
||||||
|
payload: {
|
||||||
|
isVisible,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleActivityCreate = (activity) => ({
|
||||||
|
type: EntryActionTypes.ACTIVITY_CREATE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleActivityUpdate = (activity) => ({
|
||||||
|
type: EntryActionTypes.ACTIVITY_UPDATE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleActivityDelete = (activity) => ({
|
||||||
|
type: EntryActionTypes.ACTIVITY_DELETE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
activity,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
fetchActivitiesInCurrentCard,
|
||||||
|
toggleActivitiesDetailsInCurrentCard,
|
||||||
|
handleActivityCreate,
|
||||||
|
handleActivityUpdate,
|
||||||
|
handleActivityDelete,
|
||||||
|
};
|
|
@ -1,13 +1,13 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createAttachmentInCurrentCard = (data) => ({
|
const createAttachmentInCurrentCard = (data) => ({
|
||||||
type: EntryActionTypes.ATTACHMENT_IN_CURRENT_CARD_CREATE,
|
type: EntryActionTypes.ATTACHMENT_IN_CURRENT_CARD_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleAttachmentCreate = (attachment, requestId) => ({
|
const handleAttachmentCreate = (attachment, requestId) => ({
|
||||||
type: EntryActionTypes.ATTACHMENT_CREATE_HANDLE,
|
type: EntryActionTypes.ATTACHMENT_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
attachment,
|
attachment,
|
||||||
|
@ -15,7 +15,7 @@ export const handleAttachmentCreate = (attachment, requestId) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateAttachment = (id, data) => ({
|
const updateAttachment = (id, data) => ({
|
||||||
type: EntryActionTypes.ATTACHMENT_UPDATE,
|
type: EntryActionTypes.ATTACHMENT_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -23,23 +23,32 @@ export const updateAttachment = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleAttachmentUpdate = (attachment) => ({
|
const handleAttachmentUpdate = (attachment) => ({
|
||||||
type: EntryActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
type: EntryActionTypes.ATTACHMENT_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
attachment,
|
attachment,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteAttachment = (id) => ({
|
const deleteAttachment = (id) => ({
|
||||||
type: EntryActionTypes.ATTACHMENT_DELETE,
|
type: EntryActionTypes.ATTACHMENT_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleAttachmentDelete = (attachment) => ({
|
const handleAttachmentDelete = (attachment) => ({
|
||||||
type: EntryActionTypes.ATTACHMENT_DELETE_HANDLE,
|
type: EntryActionTypes.ATTACHMENT_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
attachment,
|
attachment,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createAttachmentInCurrentCard,
|
||||||
|
handleAttachmentCreate,
|
||||||
|
updateAttachment,
|
||||||
|
handleAttachmentUpdate,
|
||||||
|
deleteAttachment,
|
||||||
|
handleAttachmentDelete,
|
||||||
|
};
|
36
client/src/entry-actions/board-memberships.js
Normal file
36
client/src/entry-actions/board-memberships.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const createMembershipInCurrentBoard = (data) => ({
|
||||||
|
type: EntryActionTypes.MEMBERSHIP_IN_CURRENT_BOARD_CREATE,
|
||||||
|
payload: {
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleBoardMembershipCreate = (boardMembership) => ({
|
||||||
|
type: EntryActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
boardMembership,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const deleteBoardMembership = (id) => ({
|
||||||
|
type: EntryActionTypes.BOARD_MEMBERSHIP_DELETE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleBoardMembershipDelete = (boardMembership) => ({
|
||||||
|
type: EntryActionTypes.BOARD_MEMBERSHIP_DELETE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
boardMembership,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createMembershipInCurrentBoard,
|
||||||
|
handleBoardMembershipCreate,
|
||||||
|
deleteBoardMembership,
|
||||||
|
handleBoardMembershipDelete,
|
||||||
|
};
|
|
@ -1,27 +1,27 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createBoardInCurrentProject = (data) => ({
|
const createBoardInCurrentProject = (data) => ({
|
||||||
type: EntryActionTypes.BOARD_IN_CURRENT_PROJECT_CREATE,
|
type: EntryActionTypes.BOARD_IN_CURRENT_PROJECT_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardCreate = (board) => ({
|
const handleBoardCreate = (board) => ({
|
||||||
type: EntryActionTypes.BOARD_CREATE_HANDLE,
|
type: EntryActionTypes.BOARD_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchBoard = (id) => ({
|
const fetchBoard = (id) => ({
|
||||||
type: EntryActionTypes.BOARD_FETCH,
|
type: EntryActionTypes.BOARD_FETCH,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateBoard = (id, data) => ({
|
const updateBoard = (id, data) => ({
|
||||||
type: EntryActionTypes.BOARD_UPDATE,
|
type: EntryActionTypes.BOARD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -29,14 +29,14 @@ export const updateBoard = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardUpdate = (board) => ({
|
const handleBoardUpdate = (board) => ({
|
||||||
type: EntryActionTypes.BOARD_UPDATE_HANDLE,
|
type: EntryActionTypes.BOARD_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const moveBoard = (id, index) => ({
|
const moveBoard = (id, index) => ({
|
||||||
type: EntryActionTypes.BOARD_MOVE,
|
type: EntryActionTypes.BOARD_MOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -44,16 +44,27 @@ export const moveBoard = (id, index) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteBoard = (id) => ({
|
const deleteBoard = (id) => ({
|
||||||
type: EntryActionTypes.BOARD_DELETE,
|
type: EntryActionTypes.BOARD_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleBoardDelete = (board) => ({
|
const handleBoardDelete = (board) => ({
|
||||||
type: EntryActionTypes.BOARD_DELETE_HANDLE,
|
type: EntryActionTypes.BOARD_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createBoardInCurrentProject,
|
||||||
|
handleBoardCreate,
|
||||||
|
fetchBoard,
|
||||||
|
updateBoard,
|
||||||
|
handleBoardUpdate,
|
||||||
|
moveBoard,
|
||||||
|
deleteBoard,
|
||||||
|
handleBoardDelete,
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createCard = (listId, data) => ({
|
const createCard = (listId, data) => ({
|
||||||
type: EntryActionTypes.CARD_CREATE,
|
type: EntryActionTypes.CARD_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
listId,
|
listId,
|
||||||
|
@ -8,14 +8,14 @@ export const createCard = (listId, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleCardCreate = (card) => ({
|
const handleCardCreate = (card) => ({
|
||||||
type: EntryActionTypes.CARD_CREATE_HANDLE,
|
type: EntryActionTypes.CARD_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
card,
|
card,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCard = (id, data) => ({
|
const updateCard = (id, data) => ({
|
||||||
type: EntryActionTypes.CARD_UPDATE,
|
type: EntryActionTypes.CARD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -23,21 +23,21 @@ export const updateCard = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentCard = (data) => ({
|
const updateCurrentCard = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_CARD_UPDATE,
|
type: EntryActionTypes.CURRENT_CARD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleCardUpdate = (card) => ({
|
const handleCardUpdate = (card) => ({
|
||||||
type: EntryActionTypes.CARD_UPDATE_HANDLE,
|
type: EntryActionTypes.CARD_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
card,
|
card,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const moveCard = (id, listId, index = 0) => ({
|
const moveCard = (id, listId, index = 0) => ({
|
||||||
type: EntryActionTypes.CARD_MOVE,
|
type: EntryActionTypes.CARD_MOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -46,7 +46,7 @@ export const moveCard = (id, listId, index = 0) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const moveCurrentCard = (listId, index = 0) => ({
|
const moveCurrentCard = (listId, index = 0) => ({
|
||||||
type: EntryActionTypes.CURRENT_CARD_MOVE,
|
type: EntryActionTypes.CURRENT_CARD_MOVE,
|
||||||
payload: {
|
payload: {
|
||||||
listId,
|
listId,
|
||||||
|
@ -54,7 +54,7 @@ export const moveCurrentCard = (listId, index = 0) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const transferCard = (id, boardId, listId, index = 0) => ({
|
const transferCard = (id, boardId, listId, index = 0) => ({
|
||||||
type: EntryActionTypes.CARD_TRANSFER,
|
type: EntryActionTypes.CARD_TRANSFER,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -64,7 +64,7 @@ export const transferCard = (id, boardId, listId, index = 0) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const transferCurrentCard = (boardId, listId, index = 0) => ({
|
const transferCurrentCard = (boardId, listId, index = 0) => ({
|
||||||
type: EntryActionTypes.CURRENT_CARD_TRANSFER,
|
type: EntryActionTypes.CURRENT_CARD_TRANSFER,
|
||||||
payload: {
|
payload: {
|
||||||
boardId,
|
boardId,
|
||||||
|
@ -73,21 +73,36 @@ export const transferCurrentCard = (boardId, listId, index = 0) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteCard = (id) => ({
|
const deleteCard = (id) => ({
|
||||||
type: EntryActionTypes.CARD_DELETE,
|
type: EntryActionTypes.CARD_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteCurrentCard = () => ({
|
const deleteCurrentCard = () => ({
|
||||||
type: EntryActionTypes.CURRENT_CARD_DELETE,
|
type: EntryActionTypes.CURRENT_CARD_DELETE,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleCardDelete = (card) => ({
|
const handleCardDelete = (card) => ({
|
||||||
type: EntryActionTypes.CARD_DELETE_HANDLE,
|
type: EntryActionTypes.CARD_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
card,
|
card,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createCard,
|
||||||
|
handleCardCreate,
|
||||||
|
updateCard,
|
||||||
|
updateCurrentCard,
|
||||||
|
handleCardUpdate,
|
||||||
|
moveCard,
|
||||||
|
moveCurrentCard,
|
||||||
|
transferCard,
|
||||||
|
transferCurrentCard,
|
||||||
|
deleteCard,
|
||||||
|
deleteCurrentCard,
|
||||||
|
handleCardDelete,
|
||||||
|
};
|
29
client/src/entry-actions/comment-activities.js
Executable file
29
client/src/entry-actions/comment-activities.js
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const createCommentActivityInCurrentCard = (data) => ({
|
||||||
|
type: EntryActionTypes.COMMENT_ACTIVITY_IN_CURRENT_CARD_CREATE,
|
||||||
|
payload: {
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateCommentActivity = (id, data) => ({
|
||||||
|
type: EntryActionTypes.COMMENT_ACTIVITY_UPDATE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const deleteCommentActivity = (id) => ({
|
||||||
|
type: EntryActionTypes.COMMENT_ACTIVITY_DELETE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createCommentActivityInCurrentCard,
|
||||||
|
updateCommentActivity,
|
||||||
|
deleteCommentActivity,
|
||||||
|
};
|
16
client/src/entry-actions/core.js
Normal file
16
client/src/entry-actions/core.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const initializeCore = () => ({
|
||||||
|
type: EntryActionTypes.CORE_INITIALIZE,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
const logout = () => ({
|
||||||
|
type: EntryActionTypes.LOGOUT,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
initializeCore,
|
||||||
|
logout,
|
||||||
|
};
|
37
client/src/entry-actions/index.js
Executable file
37
client/src/entry-actions/index.js
Executable file
|
@ -0,0 +1,37 @@
|
||||||
|
import socket from './socket';
|
||||||
|
import login from './login';
|
||||||
|
import core from './core';
|
||||||
|
import modals from './modals';
|
||||||
|
import users from './users';
|
||||||
|
import projects from './projects';
|
||||||
|
import projectManagers from './project-managers';
|
||||||
|
import boards from './boards';
|
||||||
|
import boardMemberships from './board-memberships';
|
||||||
|
import labels from './labels';
|
||||||
|
import lists from './lists';
|
||||||
|
import cards from './cards';
|
||||||
|
import tasks from './tasks';
|
||||||
|
import attachments from './attachments';
|
||||||
|
import activities from './activities';
|
||||||
|
import commentActivities from './comment-activities';
|
||||||
|
import notifications from './notifications';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
...socket,
|
||||||
|
...login,
|
||||||
|
...core,
|
||||||
|
...modals,
|
||||||
|
...users,
|
||||||
|
...projects,
|
||||||
|
...projectManagers,
|
||||||
|
...boards,
|
||||||
|
...boardMemberships,
|
||||||
|
...labels,
|
||||||
|
...lists,
|
||||||
|
...cards,
|
||||||
|
...tasks,
|
||||||
|
...attachments,
|
||||||
|
...activities,
|
||||||
|
...commentActivities,
|
||||||
|
...notifications,
|
||||||
|
};
|
|
@ -1,20 +1,20 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createLabelInCurrentBoard = (data) => ({
|
const createLabelInCurrentBoard = (data) => ({
|
||||||
type: EntryActionTypes.LABEL_IN_CURRENT_BOARD_CREATE,
|
type: EntryActionTypes.LABEL_IN_CURRENT_BOARD_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelCreate = (label) => ({
|
const handleLabelCreate = (label) => ({
|
||||||
type: EntryActionTypes.LABEL_CREATE_HANDLE,
|
type: EntryActionTypes.LABEL_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateLabel = (id, data) => ({
|
const updateLabel = (id, data) => ({
|
||||||
type: EntryActionTypes.LABEL_UPDATE,
|
type: EntryActionTypes.LABEL_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -22,28 +22,28 @@ export const updateLabel = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelUpdate = (label) => ({
|
const handleLabelUpdate = (label) => ({
|
||||||
type: EntryActionTypes.LABEL_UPDATE_HANDLE,
|
type: EntryActionTypes.LABEL_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteLabel = (id) => ({
|
const deleteLabel = (id) => ({
|
||||||
type: EntryActionTypes.LABEL_DELETE,
|
type: EntryActionTypes.LABEL_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelDelete = (label) => ({
|
const handleLabelDelete = (label) => ({
|
||||||
type: EntryActionTypes.LABEL_DELETE_HANDLE,
|
type: EntryActionTypes.LABEL_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
label,
|
label,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addLabelToCard = (id, cardId) => ({
|
const addLabelToCard = (id, cardId) => ({
|
||||||
type: EntryActionTypes.LABEL_TO_CARD_ADD,
|
type: EntryActionTypes.LABEL_TO_CARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -51,21 +51,21 @@ export const addLabelToCard = (id, cardId) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addLabelToCurrentCard = (id) => ({
|
const addLabelToCurrentCard = (id) => ({
|
||||||
type: EntryActionTypes.LABEL_TO_CURRENT_CARD_ADD,
|
type: EntryActionTypes.LABEL_TO_CURRENT_CARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelToCardAdd = (cardLabel) => ({
|
const handleLabelToCardAdd = (cardLabel) => ({
|
||||||
type: EntryActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
type: EntryActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardLabel,
|
cardLabel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeLabelFromCard = (id, cardId) => ({
|
const removeLabelFromCard = (id, cardId) => ({
|
||||||
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE,
|
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -73,30 +73,47 @@ export const removeLabelFromCard = (id, cardId) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeLabelFromCurrentCard = (id) => ({
|
const removeLabelFromCurrentCard = (id) => ({
|
||||||
type: EntryActionTypes.LABEL_FROM_CURRENT_CARD_REMOVE,
|
type: EntryActionTypes.LABEL_FROM_CURRENT_CARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleLabelFromCardRemove = (cardLabel) => ({
|
const handleLabelFromCardRemove = (cardLabel) => ({
|
||||||
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
type: EntryActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardLabel,
|
cardLabel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addLabelToFilterInCurrentBoard = (id) => ({
|
const addLabelToFilterInCurrentBoard = (id) => ({
|
||||||
type: EntryActionTypes.LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
type: EntryActionTypes.LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeLabelFromFilterInCurrentBoard = (id) => ({
|
const removeLabelFromFilterInCurrentBoard = (id) => ({
|
||||||
type: EntryActionTypes.LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
type: EntryActionTypes.LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createLabelInCurrentBoard,
|
||||||
|
handleLabelCreate,
|
||||||
|
updateLabel,
|
||||||
|
handleLabelUpdate,
|
||||||
|
deleteLabel,
|
||||||
|
handleLabelDelete,
|
||||||
|
addLabelToCard,
|
||||||
|
addLabelToCurrentCard,
|
||||||
|
handleLabelToCardAdd,
|
||||||
|
removeLabelFromCard,
|
||||||
|
removeLabelFromCurrentCard,
|
||||||
|
handleLabelFromCardRemove,
|
||||||
|
addLabelToFilterInCurrentBoard,
|
||||||
|
removeLabelFromFilterInCurrentBoard,
|
||||||
|
};
|
|
@ -1,20 +1,20 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createListInCurrentBoard = (data) => ({
|
const createListInCurrentBoard = (data) => ({
|
||||||
type: EntryActionTypes.LIST_IN_CURRENT_BOARD_CREATE,
|
type: EntryActionTypes.LIST_IN_CURRENT_BOARD_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleListCreate = (list) => ({
|
const handleListCreate = (list) => ({
|
||||||
type: EntryActionTypes.LIST_CREATE_HANDLE,
|
type: EntryActionTypes.LIST_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
list,
|
list,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateList = (id, data) => ({
|
const updateList = (id, data) => ({
|
||||||
type: EntryActionTypes.LIST_UPDATE,
|
type: EntryActionTypes.LIST_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -22,14 +22,14 @@ export const updateList = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleListUpdate = (list) => ({
|
const handleListUpdate = (list) => ({
|
||||||
type: EntryActionTypes.LIST_UPDATE_HANDLE,
|
type: EntryActionTypes.LIST_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
list,
|
list,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const moveList = (id, index) => ({
|
const moveList = (id, index) => ({
|
||||||
type: EntryActionTypes.LIST_MOVE,
|
type: EntryActionTypes.LIST_MOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -37,16 +37,26 @@ export const moveList = (id, index) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteList = (id) => ({
|
const deleteList = (id) => ({
|
||||||
type: EntryActionTypes.LIST_DELETE,
|
type: EntryActionTypes.LIST_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleListDelete = (list) => ({
|
const handleListDelete = (list) => ({
|
||||||
type: EntryActionTypes.LIST_DELETE_HANDLE,
|
type: EntryActionTypes.LIST_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
list,
|
list,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createListInCurrentBoard,
|
||||||
|
handleListCreate,
|
||||||
|
updateList,
|
||||||
|
handleListUpdate,
|
||||||
|
moveList,
|
||||||
|
deleteList,
|
||||||
|
handleListDelete,
|
||||||
|
};
|
18
client/src/entry-actions/login.js
Executable file
18
client/src/entry-actions/login.js
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const authenticate = (data) => ({
|
||||||
|
type: EntryActionTypes.AUTHENTICATE,
|
||||||
|
payload: {
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const clearAuthenticateError = () => ({
|
||||||
|
type: EntryActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
authenticate,
|
||||||
|
clearAuthenticateError,
|
||||||
|
};
|
|
@ -1,35 +1,43 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
import ModalTypes from '../../constants/ModalTypes';
|
import ModalTypes from '../constants/ModalTypes';
|
||||||
|
|
||||||
export const openUsersModal = () => ({
|
const openUsersModal = () => ({
|
||||||
type: EntryActionTypes.MODAL_OPEN,
|
type: EntryActionTypes.MODAL_OPEN,
|
||||||
payload: {
|
payload: {
|
||||||
type: ModalTypes.USERS,
|
type: ModalTypes.USERS,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const openUserSettingsModal = () => ({
|
const openUserSettingsModal = () => ({
|
||||||
type: EntryActionTypes.MODAL_OPEN,
|
type: EntryActionTypes.MODAL_OPEN,
|
||||||
payload: {
|
payload: {
|
||||||
type: ModalTypes.USER_SETTINGS,
|
type: ModalTypes.USER_SETTINGS,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const openProjectAddModal = () => ({
|
const openProjectAddModal = () => ({
|
||||||
type: EntryActionTypes.MODAL_OPEN,
|
type: EntryActionTypes.MODAL_OPEN,
|
||||||
payload: {
|
payload: {
|
||||||
type: ModalTypes.PROJECT_ADD,
|
type: ModalTypes.PROJECT_ADD,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const openProjectSettingsModal = () => ({
|
const openProjectSettingsModal = () => ({
|
||||||
type: EntryActionTypes.MODAL_OPEN,
|
type: EntryActionTypes.MODAL_OPEN,
|
||||||
payload: {
|
payload: {
|
||||||
type: ModalTypes.PROJECT_SETTINGS,
|
type: ModalTypes.PROJECT_SETTINGS,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const closeModal = () => ({
|
const closeModal = () => ({
|
||||||
type: EntryActionTypes.MODAL_CLOSE,
|
type: EntryActionTypes.MODAL_CLOSE,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
openUsersModal,
|
||||||
|
openUserSettingsModal,
|
||||||
|
openProjectAddModal,
|
||||||
|
openProjectSettingsModal,
|
||||||
|
closeModal,
|
||||||
|
};
|
28
client/src/entry-actions/notifications.js
Executable file
28
client/src/entry-actions/notifications.js
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const handleNotificationCreate = (notification) => ({
|
||||||
|
type: EntryActionTypes.NOTIFICATION_CREATE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
notification,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const deleteNotification = (id) => ({
|
||||||
|
type: EntryActionTypes.NOTIFICATION_DELETE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleNotificationDelete = (notification) => ({
|
||||||
|
type: EntryActionTypes.NOTIFICATION_DELETE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
notification,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
handleNotificationCreate,
|
||||||
|
deleteNotification,
|
||||||
|
handleNotificationDelete,
|
||||||
|
};
|
36
client/src/entry-actions/project-managers.js
Executable file
36
client/src/entry-actions/project-managers.js
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const createManagerInCurrentProject = (data) => ({
|
||||||
|
type: EntryActionTypes.MANAGER_IN_CURRENT_PROJECT_CREATE,
|
||||||
|
payload: {
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleProjectManagerCreate = (projectManager) => ({
|
||||||
|
type: EntryActionTypes.PROJECT_MANAGER_CREATE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
projectManager,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const deleteProjectManager = (id) => ({
|
||||||
|
type: EntryActionTypes.PROJECT_MANAGER_DELETE,
|
||||||
|
payload: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleProjectManagerDelete = (projectManager) => ({
|
||||||
|
type: EntryActionTypes.PROJECT_MANAGER_DELETE_HANDLE,
|
||||||
|
payload: {
|
||||||
|
projectManager,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createManagerInCurrentProject,
|
||||||
|
handleProjectManagerCreate,
|
||||||
|
deleteProjectManager,
|
||||||
|
handleProjectManagerDelete,
|
||||||
|
};
|
|
@ -1,48 +1,58 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createProject = (data) => ({
|
const createProject = (data) => ({
|
||||||
type: EntryActionTypes.PROJECT_CREATE,
|
type: EntryActionTypes.PROJECT_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectCreate = (project) => ({
|
const handleProjectCreate = (project) => ({
|
||||||
type: EntryActionTypes.PROJECT_CREATE_HANDLE,
|
type: EntryActionTypes.PROJECT_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
project,
|
project,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentProject = (data) => ({
|
const updateCurrentProject = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_PROJECT_UPDATE,
|
type: EntryActionTypes.CURRENT_PROJECT_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectUpdate = (project) => ({
|
const handleProjectUpdate = (project) => ({
|
||||||
type: EntryActionTypes.PROJECT_UPDATE_HANDLE,
|
type: EntryActionTypes.PROJECT_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
project,
|
project,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentProjectBackgroundImage = (data) => ({
|
const updateCurrentProjectBackgroundImage = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_PROJECT_BACKGROUND_IMAGE_UPDATE,
|
type: EntryActionTypes.CURRENT_PROJECT_BACKGROUND_IMAGE_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteCurrentProject = () => ({
|
const deleteCurrentProject = () => ({
|
||||||
type: EntryActionTypes.CURRENT_PROJECT_DELETE,
|
type: EntryActionTypes.CURRENT_PROJECT_DELETE,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleProjectDelete = (project) => ({
|
const handleProjectDelete = (project) => ({
|
||||||
type: EntryActionTypes.PROJECT_DELETE_HANDLE,
|
type: EntryActionTypes.PROJECT_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
project,
|
project,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createProject,
|
||||||
|
handleProjectCreate,
|
||||||
|
updateCurrentProject,
|
||||||
|
handleProjectUpdate,
|
||||||
|
updateCurrentProjectBackgroundImage,
|
||||||
|
deleteCurrentProject,
|
||||||
|
handleProjectDelete,
|
||||||
|
};
|
16
client/src/entry-actions/socket.js
Normal file
16
client/src/entry-actions/socket.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
|
const handleSocketDisconnect = () => ({
|
||||||
|
type: EntryActionTypes.SOCKET_DISCONNECT_HANDLE,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleSocketReconnect = () => ({
|
||||||
|
type: EntryActionTypes.SOCKET_RECONNECT_HANDLE,
|
||||||
|
payload: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
handleSocketDisconnect,
|
||||||
|
handleSocketReconnect,
|
||||||
|
};
|
|
@ -1,20 +1,20 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createTaskInCurrentCard = (data) => ({
|
const createTaskInCurrentCard = (data) => ({
|
||||||
type: EntryActionTypes.TASK_IN_CURRENT_CARD_CREATE,
|
type: EntryActionTypes.TASK_IN_CURRENT_CARD_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleTaskCreate = (task) => ({
|
const handleTaskCreate = (task) => ({
|
||||||
type: EntryActionTypes.TASK_CREATE_HANDLE,
|
type: EntryActionTypes.TASK_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
task,
|
task,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateTask = (id, data) => ({
|
const updateTask = (id, data) => ({
|
||||||
type: EntryActionTypes.TASK_UPDATE,
|
type: EntryActionTypes.TASK_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -22,14 +22,14 @@ export const updateTask = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleTaskUpdate = (task) => ({
|
const handleTaskUpdate = (task) => ({
|
||||||
type: EntryActionTypes.TASK_UPDATE_HANDLE,
|
type: EntryActionTypes.TASK_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
task,
|
task,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const moveTask = (id, index) => ({
|
const moveTask = (id, index) => ({
|
||||||
type: EntryActionTypes.TASK_MOVE,
|
type: EntryActionTypes.TASK_MOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -37,16 +37,26 @@ export const moveTask = (id, index) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteTask = (id) => ({
|
const deleteTask = (id) => ({
|
||||||
type: EntryActionTypes.TASK_DELETE,
|
type: EntryActionTypes.TASK_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleTaskDelete = (task) => ({
|
const handleTaskDelete = (task) => ({
|
||||||
type: EntryActionTypes.TASK_DELETE_HANDLE,
|
type: EntryActionTypes.TASK_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
task,
|
task,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createTaskInCurrentCard,
|
||||||
|
handleTaskCreate,
|
||||||
|
updateTask,
|
||||||
|
handleTaskUpdate,
|
||||||
|
moveTask,
|
||||||
|
deleteTask,
|
||||||
|
handleTaskDelete,
|
||||||
|
};
|
|
@ -1,25 +1,25 @@
|
||||||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
import EntryActionTypes from '../constants/EntryActionTypes';
|
||||||
|
|
||||||
export const createUser = (data) => ({
|
const createUser = (data) => ({
|
||||||
type: EntryActionTypes.USER_CREATE,
|
type: EntryActionTypes.USER_CREATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserCreate = (user) => ({
|
const handleUserCreate = (user) => ({
|
||||||
type: EntryActionTypes.USER_CREATE_HANDLE,
|
type: EntryActionTypes.USER_CREATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
user,
|
user,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserCreateError = () => ({
|
const clearUserCreateError = () => ({
|
||||||
type: EntryActionTypes.USER_CREATE_ERROR_CLEAR,
|
type: EntryActionTypes.USER_CREATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUser = (id, data) => ({
|
const updateUser = (id, data) => ({
|
||||||
type: EntryActionTypes.USER_UPDATE,
|
type: EntryActionTypes.USER_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -27,28 +27,28 @@ export const updateUser = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentUser = (data) => ({
|
const updateCurrentUser = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserUpdate = (user) => ({
|
const handleUserUpdate = (user) => ({
|
||||||
type: EntryActionTypes.USER_UPDATE_HANDLE,
|
type: EntryActionTypes.USER_UPDATE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
user,
|
user,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentUserLanguage = (language) => ({
|
const updateCurrentUserLanguage = (language) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_LANGUAGE_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_LANGUAGE_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
language,
|
language,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUserEmail = (id, data) => ({
|
const updateUserEmail = (id, data) => ({
|
||||||
type: EntryActionTypes.USER_EMAIL_UPDATE,
|
type: EntryActionTypes.USER_EMAIL_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -56,26 +56,26 @@ export const updateUserEmail = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentUserEmail = (data) => ({
|
const updateCurrentUserEmail = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserEmailUpdateError = (id) => ({
|
const clearUserEmailUpdateError = (id) => ({
|
||||||
type: EntryActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearCurrentUserEmailUpdateError = () => ({
|
const clearCurrentUserEmailUpdateError = () => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUserPassword = (id, data) => ({
|
const updateUserPassword = (id, data) => ({
|
||||||
type: EntryActionTypes.USER_PASSWORD_UPDATE,
|
type: EntryActionTypes.USER_PASSWORD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -83,26 +83,26 @@ export const updateUserPassword = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentUserPassword = (data) => ({
|
const updateCurrentUserPassword = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserPasswordUpdateError = (id) => ({
|
const clearUserPasswordUpdateError = (id) => ({
|
||||||
type: EntryActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearCurrentUserPasswordUpdateError = () => ({
|
const clearCurrentUserPasswordUpdateError = () => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUserUsername = (id, data) => ({
|
const updateUserUsername = (id, data) => ({
|
||||||
type: EntryActionTypes.USER_USERNAME_UPDATE,
|
type: EntryActionTypes.USER_USERNAME_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -110,47 +110,47 @@ export const updateUserUsername = (id, data) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentUserUsername = (data) => ({
|
const updateCurrentUserUsername = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearUserUsernameUpdateError = (id) => ({
|
const clearUserUsernameUpdateError = (id) => ({
|
||||||
type: EntryActionTypes.USER_USERNAME_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clearCurrentUserUsernameUpdateError = () => ({
|
const clearCurrentUserUsernameUpdateError = () => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR,
|
type: EntryActionTypes.CURRENT_USER_USERNAME_UPDATE_ERROR_CLEAR,
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCurrentUserAvatar = (data) => ({
|
const updateCurrentUserAvatar = (data) => ({
|
||||||
type: EntryActionTypes.CURRENT_USER_AVATAR_UPDATE,
|
type: EntryActionTypes.CURRENT_USER_AVATAR_UPDATE,
|
||||||
payload: {
|
payload: {
|
||||||
data,
|
data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteUser = (id) => ({
|
const deleteUser = (id) => ({
|
||||||
type: EntryActionTypes.USER_DELETE,
|
type: EntryActionTypes.USER_DELETE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserDelete = (user) => ({
|
const handleUserDelete = (user) => ({
|
||||||
type: EntryActionTypes.USER_DELETE_HANDLE,
|
type: EntryActionTypes.USER_DELETE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
user,
|
user,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addUserToCard = (id, cardId) => ({
|
const addUserToCard = (id, cardId) => ({
|
||||||
type: EntryActionTypes.USER_TO_CARD_ADD,
|
type: EntryActionTypes.USER_TO_CARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -158,21 +158,21 @@ export const addUserToCard = (id, cardId) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addUserToCurrentCard = (id) => ({
|
const addUserToCurrentCard = (id) => ({
|
||||||
type: EntryActionTypes.USER_TO_CURRENT_CARD_ADD,
|
type: EntryActionTypes.USER_TO_CURRENT_CARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserToCardAdd = (cardMembership) => ({
|
const handleUserToCardAdd = (cardMembership) => ({
|
||||||
type: EntryActionTypes.USER_TO_CARD_ADD_HANDLE,
|
type: EntryActionTypes.USER_TO_CARD_ADD_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardMembership,
|
cardMembership,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeUserFromCard = (id, cardId) => ({
|
const removeUserFromCard = (id, cardId) => ({
|
||||||
type: EntryActionTypes.USER_FROM_CARD_REMOVE,
|
type: EntryActionTypes.USER_FROM_CARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
|
@ -180,30 +180,63 @@ export const removeUserFromCard = (id, cardId) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeUserFromCurrentCard = (id) => ({
|
const removeUserFromCurrentCard = (id) => ({
|
||||||
type: EntryActionTypes.USER_FROM_CURRENT_CARD_REMOVE,
|
type: EntryActionTypes.USER_FROM_CURRENT_CARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const handleUserFromCardRemove = (cardMembership) => ({
|
const handleUserFromCardRemove = (cardMembership) => ({
|
||||||
type: EntryActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
type: EntryActionTypes.USER_FROM_CARD_REMOVE_HANDLE,
|
||||||
payload: {
|
payload: {
|
||||||
cardMembership,
|
cardMembership,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const addUserToFilterInCurrentBoard = (id) => ({
|
const addUserToFilterInCurrentBoard = (id) => ({
|
||||||
type: EntryActionTypes.USER_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
type: EntryActionTypes.USER_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const removeUserFromFilterInCurrentBoard = (id) => ({
|
const removeUserFromFilterInCurrentBoard = (id) => ({
|
||||||
type: EntryActionTypes.USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
type: EntryActionTypes.USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
||||||
payload: {
|
payload: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
createUser,
|
||||||
|
handleUserCreate,
|
||||||
|
clearUserCreateError,
|
||||||
|
updateUser,
|
||||||
|
updateCurrentUser,
|
||||||
|
handleUserUpdate,
|
||||||
|
updateCurrentUserLanguage,
|
||||||
|
updateUserEmail,
|
||||||
|
updateCurrentUserEmail,
|
||||||
|
clearUserEmailUpdateError,
|
||||||
|
clearCurrentUserEmailUpdateError,
|
||||||
|
updateUserPassword,
|
||||||
|
updateCurrentUserPassword,
|
||||||
|
clearUserPasswordUpdateError,
|
||||||
|
clearCurrentUserPasswordUpdateError,
|
||||||
|
updateUserUsername,
|
||||||
|
updateCurrentUserUsername,
|
||||||
|
clearUserUsernameUpdateError,
|
||||||
|
clearCurrentUserUsernameUpdateError,
|
||||||
|
updateCurrentUserAvatar,
|
||||||
|
deleteUser,
|
||||||
|
handleUserDelete,
|
||||||
|
addUserToCard,
|
||||||
|
addUserToCurrentCard,
|
||||||
|
handleUserToCardAdd,
|
||||||
|
removeUserFromCard,
|
||||||
|
removeUserFromCurrentCard,
|
||||||
|
handleUserFromCardRemove,
|
||||||
|
addUserToFilterInCurrentBoard,
|
||||||
|
removeUserFromFilterInCurrentBoard,
|
||||||
|
};
|
|
@ -1,95 +0,0 @@
|
||||||
import { Model, attr, fk } from 'redux-orm';
|
|
||||||
|
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
|
||||||
|
|
||||||
export default class extends Model {
|
|
||||||
static modelName = 'Action';
|
|
||||||
|
|
||||||
static fields = {
|
|
||||||
id: attr(),
|
|
||||||
type: attr(),
|
|
||||||
data: attr(),
|
|
||||||
createdAt: attr({
|
|
||||||
getDefault: () => new Date(),
|
|
||||||
}),
|
|
||||||
isInCard: attr({
|
|
||||||
getDefault: () => true,
|
|
||||||
}),
|
|
||||||
cardId: fk({
|
|
||||||
to: 'Card',
|
|
||||||
as: 'card',
|
|
||||||
relatedName: 'actions',
|
|
||||||
}),
|
|
||||||
userId: fk({
|
|
||||||
to: 'User',
|
|
||||||
as: 'user',
|
|
||||||
relatedName: 'actions',
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
|
|
||||||
static reducer({ type, payload }, Action) {
|
|
||||||
switch (type) {
|
|
||||||
case ActionTypes.SOCKET_RECONNECT_HANDLE:
|
|
||||||
Action.all().delete();
|
|
||||||
|
|
||||||
payload.actions.forEach((action) => {
|
|
||||||
Action.upsert({
|
|
||||||
...action,
|
|
||||||
isInCard: false,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
case ActionTypes.CORE_INITIALIZE:
|
|
||||||
payload.actions.forEach((action) => {
|
|
||||||
Action.upsert({
|
|
||||||
...action,
|
|
||||||
isInCard: false,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
case ActionTypes.ACTIONS_FETCH__SUCCESS:
|
|
||||||
case ActionTypes.ACTIONS_DETAILS_TOGGLE__SUCCESS:
|
|
||||||
case ActionTypes.NOTIFICATION_CREATE_HANDLE:
|
|
||||||
payload.actions.forEach((action) => {
|
|
||||||
Action.upsert(action);
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
case ActionTypes.ACTION_CREATE_HANDLE:
|
|
||||||
case ActionTypes.ACTION_UPDATE_HANDLE:
|
|
||||||
case ActionTypes.COMMENT_ACTION_CREATE:
|
|
||||||
case ActionTypes.COMMENT_ACTION_UPDATE__SUCCESS:
|
|
||||||
Action.upsert(payload.action);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case ActionTypes.ACTION_DELETE_HANDLE:
|
|
||||||
case ActionTypes.COMMENT_ACTION_DELETE__SUCCESS: {
|
|
||||||
const actionModel = Action.withId(payload.action.id);
|
|
||||||
|
|
||||||
if (actionModel) {
|
|
||||||
actionModel.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ActionTypes.COMMENT_ACTION_CREATE__SUCCESS:
|
|
||||||
Action.withId(payload.localId).delete();
|
|
||||||
Action.upsert(payload.action);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case ActionTypes.COMMENT_ACTION_UPDATE:
|
|
||||||
Action.withId(payload.id).update({
|
|
||||||
data: payload.data,
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
case ActionTypes.COMMENT_ACTION_DELETE:
|
|
||||||
Action.withId(payload.id).delete();
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
95
client/src/models/Activity.js
Executable file
95
client/src/models/Activity.js
Executable file
|
@ -0,0 +1,95 @@
|
||||||
|
import { Model, attr, fk } from 'redux-orm';
|
||||||
|
|
||||||
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
|
|
||||||
|
export default class extends Model {
|
||||||
|
static modelName = 'Activity';
|
||||||
|
|
||||||
|
static fields = {
|
||||||
|
id: attr(),
|
||||||
|
type: attr(),
|
||||||
|
data: attr(),
|
||||||
|
createdAt: attr({
|
||||||
|
getDefault: () => new Date(),
|
||||||
|
}),
|
||||||
|
isInCard: attr({
|
||||||
|
getDefault: () => true,
|
||||||
|
}),
|
||||||
|
cardId: fk({
|
||||||
|
to: 'Card',
|
||||||
|
as: 'card',
|
||||||
|
relatedName: 'activities',
|
||||||
|
}),
|
||||||
|
userId: fk({
|
||||||
|
to: 'User',
|
||||||
|
as: 'user',
|
||||||
|
relatedName: 'activities',
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
static reducer({ type, payload }, Activity) {
|
||||||
|
switch (type) {
|
||||||
|
case ActionTypes.SOCKET_RECONNECT_HANDLE:
|
||||||
|
Activity.all().delete();
|
||||||
|
|
||||||
|
payload.activities.forEach((activity) => {
|
||||||
|
Activity.upsert({
|
||||||
|
...activity,
|
||||||
|
isInCard: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ActionTypes.CORE_INITIALIZE:
|
||||||
|
payload.activities.forEach((activity) => {
|
||||||
|
Activity.upsert({
|
||||||
|
...activity,
|
||||||
|
isInCard: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ActionTypes.ACTIVITIES_FETCH__SUCCESS:
|
||||||
|
case ActionTypes.ACTIVITIES_DETAILS_TOGGLE__SUCCESS:
|
||||||
|
case ActionTypes.NOTIFICATION_CREATE_HANDLE:
|
||||||
|
payload.activities.forEach((activity) => {
|
||||||
|
Activity.upsert(activity);
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ActionTypes.ACTIVITY_CREATE_HANDLE:
|
||||||
|
case ActionTypes.ACTIVITY_UPDATE_HANDLE:
|
||||||
|
case ActionTypes.COMMENT_ACTIVITY_CREATE:
|
||||||
|
case ActionTypes.COMMENT_ACTIVITY_UPDATE__SUCCESS:
|
||||||
|
Activity.upsert(payload.activity);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ActionTypes.ACTIVITY_DELETE_HANDLE:
|
||||||
|
case ActionTypes.COMMENT_ACTIVITY_DELETE__SUCCESS: {
|
||||||
|
const activityModel = Activity.withId(payload.activity.id);
|
||||||
|
|
||||||
|
if (activityModel) {
|
||||||
|
activityModel.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ActionTypes.COMMENT_ACTIVITY_CREATE__SUCCESS:
|
||||||
|
Activity.withId(payload.localId).delete();
|
||||||
|
Activity.upsert(payload.activity);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ActionTypes.COMMENT_ACTIVITY_UPDATE:
|
||||||
|
Activity.withId(payload.id).update({
|
||||||
|
data: payload.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
case ActionTypes.COMMENT_ACTIVITY_DELETE:
|
||||||
|
Activity.withId(payload.id).delete();
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@ import { Model, attr, fk, many, oneToOne } from 'redux-orm';
|
||||||
|
|
||||||
import ActionTypes from '../constants/ActionTypes';
|
import ActionTypes from '../constants/ActionTypes';
|
||||||
import Config from '../constants/Config';
|
import Config from '../constants/Config';
|
||||||
import { ActionTypes as ActionTypesEnum } from '../constants/Enums';
|
import { ActivityTypes } from '../constants/Enums';
|
||||||
|
|
||||||
export default class extends Model {
|
export default class extends Model {
|
||||||
static modelName = 'Card';
|
static modelName = 'Card';
|
||||||
|
@ -17,16 +17,16 @@ export default class extends Model {
|
||||||
isSubscribed: attr({
|
isSubscribed: attr({
|
||||||
getDefault: () => false,
|
getDefault: () => false,
|
||||||
}),
|
}),
|
||||||
isActionsFetching: attr({
|
isActivitiesFetching: attr({
|
||||||
getDefault: () => false,
|
getDefault: () => false,
|
||||||
}),
|
}),
|
||||||
isAllActionsFetched: attr({
|
isAllActivitiesFetched: attr({
|
||||||
getDefault: () => false,
|
getDefault: () => false,
|
||||||
}),
|
}),
|
||||||
isActionsDetailsVisible: attr({
|
isActivitiesDetailsVisible: attr({
|
||||||
getDefault: () => false,
|
getDefault: () => false,
|
||||||
}),
|
}),
|
||||||
isActionsDetailsFetching: attr({
|
isActivitiesDetailsFetching: attr({
|
||||||
getDefault: () => false,
|
getDefault: () => false,
|
||||||
}),
|
}),
|
||||||
boardId: fk({
|
boardId: fk({
|
||||||
|
@ -189,44 +189,44 @@ export default class extends Model {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ActionTypes.ACTIONS_FETCH:
|
case ActionTypes.ACTIVITIES_FETCH:
|
||||||
Card.withId(payload.cardId).update({
|
Card.withId(payload.cardId).update({
|
||||||
isActionsFetching: true,
|
isActivitiesFetching: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ActionTypes.ACTIONS_FETCH__SUCCESS:
|
case ActionTypes.ACTIVITIES_FETCH__SUCCESS:
|
||||||
Card.withId(payload.cardId).update({
|
Card.withId(payload.cardId).update({
|
||||||
isActionsFetching: false,
|
isActivitiesFetching: false,
|
||||||
isAllActionsFetched: payload.actions.length < Config.ACTIONS_LIMIT,
|
isAllActivitiesFetched: payload.activities.length < Config.ACTIVITIES_LIMIT,
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ActionTypes.ACTIONS_DETAILS_TOGGLE: {
|
case ActionTypes.ACTIVITIES_DETAILS_TOGGLE: {
|
||||||
const cardModel = Card.withId(payload.cardId);
|
const cardModel = Card.withId(payload.cardId);
|
||||||
cardModel.isActionsDetailsVisible = payload.isVisible;
|
cardModel.isActivitiesDetailsVisible = payload.isVisible;
|
||||||
|
|
||||||
if (payload.isVisible) {
|
if (payload.isVisible) {
|
||||||
cardModel.isActionsDetailsFetching = true;
|
cardModel.isActivitiesDetailsFetching = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ActionTypes.ACTIONS_DETAILS_TOGGLE__SUCCESS: {
|
case ActionTypes.ACTIVITIES_DETAILS_TOGGLE__SUCCESS: {
|
||||||
const cardModel = Card.withId(payload.cardId);
|
const cardModel = Card.withId(payload.cardId);
|
||||||
|
|
||||||
cardModel.update({
|
cardModel.update({
|
||||||
isAllActionsFetched: payload.actions.length < Config.ACTIONS_LIMIT,
|
isAllActivitiesFetched: payload.activities.length < Config.ACTIVITIES_LIMIT,
|
||||||
isActionsDetailsFetching: false,
|
isActivitiesDetailsFetching: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
cardModel.actions.toModelArray().forEach((actionModel) => {
|
cardModel.activities.toModelArray().forEach((activityModel) => {
|
||||||
if (actionModel.notification) {
|
if (activityModel.notification) {
|
||||||
actionModel.update({
|
activityModel.update({
|
||||||
isInCard: false,
|
isInCard: false,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
actionModel.delete();
|
activityModel.delete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -250,16 +250,16 @@ export default class extends Model {
|
||||||
return this.attachments.orderBy('id', false);
|
return this.attachments.orderBy('id', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFilteredOrderedInCardActionsQuerySet() {
|
getFilteredOrderedInCardActivitiesQuerySet() {
|
||||||
const filter = {
|
const filter = {
|
||||||
isInCard: true,
|
isInCard: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!this.isActionsDetailsVisible) {
|
if (!this.isActivitiesDetailsVisible) {
|
||||||
filter.type = ActionTypesEnum.COMMENT_CARD;
|
filter.type = ActivityTypes.COMMENT_CARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.actions.filter(filter).orderBy('id', false);
|
return this.activities.filter(filter).orderBy('id', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
getUnreadNotificationsQuerySet() {
|
getUnreadNotificationsQuerySet() {
|
||||||
|
@ -271,7 +271,7 @@ export default class extends Model {
|
||||||
deleteRelated() {
|
deleteRelated() {
|
||||||
this.tasks.delete();
|
this.tasks.delete();
|
||||||
this.attachments.delete();
|
this.attachments.delete();
|
||||||
this.actions.delete();
|
this.activities.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteWithRelated() {
|
deleteWithRelated() {
|
||||||
|
|
|
@ -20,9 +20,9 @@ export default class extends Model {
|
||||||
as: 'card',
|
as: 'card',
|
||||||
relatedName: 'notifications',
|
relatedName: 'notifications',
|
||||||
}),
|
}),
|
||||||
actionId: oneToOne({
|
activityId: oneToOne({
|
||||||
to: 'Action',
|
to: 'Activity',
|
||||||
as: 'action',
|
as: 'activity',
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ export default class extends Model {
|
||||||
case ActionTypes.LOCATION_CHANGE_HANDLE:
|
case ActionTypes.LOCATION_CHANGE_HANDLE:
|
||||||
case ActionTypes.PROJECT_MANAGER_CREATE_HANDLE:
|
case ActionTypes.PROJECT_MANAGER_CREATE_HANDLE:
|
||||||
case ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE:
|
case ActionTypes.BOARD_MEMBERSHIP_CREATE_HANDLE:
|
||||||
if (payload.notifications) {
|
if (payload.deletedNotifications) {
|
||||||
payload.notifications.forEach((notification) => {
|
payload.deletedNotifications.forEach((notification) => {
|
||||||
Notification.withId(notification.id).deleteWithRelated();
|
Notification.withId(notification.id).deleteWithRelated();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue