Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
+113
-94
@@ -1,7 +1,5 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
/* Actions */
|
||||
|
||||
export const createLabel = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE,
|
||||
payload: {
|
||||
@@ -9,6 +7,29 @@ export const createLabel = (label) => ({
|
||||
},
|
||||
});
|
||||
|
||||
createLabel.success = (localId, label) => ({
|
||||
type: ActionTypes.LABEL_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
createLabel.failure = (localId, error) => ({
|
||||
type: ActionTypes.LABEL_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelCreate = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabel = (id, data) => ({
|
||||
type: ActionTypes.LABEL_UPDATE,
|
||||
payload: {
|
||||
@@ -17,6 +38,28 @@ export const updateLabel = (id, data) => ({
|
||||
},
|
||||
});
|
||||
|
||||
updateLabel.success = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
updateLabel.failure = (id, error) => ({
|
||||
type: ActionTypes.LABEL_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelUpdate = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabel = (id) => ({
|
||||
type: ActionTypes.LABEL_DELETE,
|
||||
payload: {
|
||||
@@ -24,6 +67,28 @@ export const deleteLabel = (id) => ({
|
||||
},
|
||||
});
|
||||
|
||||
deleteLabel.success = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE__SUCCESS,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
deleteLabel.failure = (id, error) => ({
|
||||
type: ActionTypes.LABEL_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelDelete = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE_HANDLE,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToCard = (id, cardId) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD,
|
||||
payload: {
|
||||
@@ -32,6 +97,29 @@ export const addLabelToCard = (id, cardId) => ({
|
||||
},
|
||||
});
|
||||
|
||||
addLabelToCard.success = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD__SUCCESS,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
addLabelToCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelToCardAdd = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_TO_CARD_ADD_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromCard = (id, cardId) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE,
|
||||
payload: {
|
||||
@@ -40,6 +128,29 @@ export const removeLabelFromCard = (id, cardId) => ({
|
||||
},
|
||||
});
|
||||
|
||||
removeLabelFromCard.success = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE__SUCCESS,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
removeLabelFromCard.failure = (id, cardId, error) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
cardId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const handleLabelFromCardRemove = (cardLabel) => ({
|
||||
type: ActionTypes.LABEL_FROM_CARD_REMOVE_HANDLE,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToBoardFilter = (id, boardId) => ({
|
||||
type: ActionTypes.LABEL_TO_BOARD_FILTER_ADD,
|
||||
payload: {
|
||||
@@ -55,95 +166,3 @@ export const removeLabelFromBoardFilter = (id, boardId) => ({
|
||||
boardId,
|
||||
},
|
||||
});
|
||||
|
||||
/* Events */
|
||||
|
||||
export const createLabelRequested = (localId, data) => ({
|
||||
type: ActionTypes.LABEL_CREATE_REQUESTED,
|
||||
payload: {
|
||||
localId,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createLabelSucceeded = (localId, label) => ({
|
||||
type: ActionTypes.LABEL_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
localId,
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const createLabelFailed = (localId, error) => ({
|
||||
type: ActionTypes.LABEL_CREATE_FAILED,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createLabelReceived = (label) => ({
|
||||
type: ActionTypes.LABEL_CREATE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelRequested = (id, data) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelSucceeded = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelFailed = (id, error) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateLabelReceived = (label) => ({
|
||||
type: ActionTypes.LABEL_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelRequested = (id) => ({
|
||||
type: ActionTypes.LABEL_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelSucceeded = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelFailed = (id, error) => ({
|
||||
type: ActionTypes.LABEL_DELETE_FAILED,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelReceived = (label) => ({
|
||||
type: ActionTypes.LABEL_DELETE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user