mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 12:49:43 +02:00
Move from prettier-eslint to eslint-plugin-prettier, update dependencies
This commit is contained in:
parent
1f43d4f214
commit
45bde7e7c0
254 changed files with 5539 additions and 5170 deletions
|
@ -1 +0,0 @@
|
|||
SKIP_PREFLIGHT_CHECK=true
|
6186
client/package-lock.json
generated
6186
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -4,7 +4,6 @@
|
|||
"scripts": {
|
||||
"build": "react-scripts build",
|
||||
"eject": "react-scripts eject",
|
||||
"format": "prettier-eslint --write \"src/**/*.*(js|jsx)\"",
|
||||
"lint": "eslint --ext js,jsx src",
|
||||
"start": "react-scripts start",
|
||||
"test": "react-scripts test"
|
||||
|
@ -25,11 +24,26 @@
|
|||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"extends": [
|
||||
"airbnb",
|
||||
"airbnb/hooks"
|
||||
"airbnb/hooks",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier/react"
|
||||
],
|
||||
"parser": "babel-eslint"
|
||||
"rules": {
|
||||
"prettier/prettier": [
|
||||
"error",
|
||||
{
|
||||
"printWidth": 100,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.6",
|
||||
|
@ -37,7 +51,7 @@
|
|||
"date-fns": "^2.9.0",
|
||||
"dequal": "^1.0.0",
|
||||
"history": "^4.10.1",
|
||||
"i18next": "^19.0.3",
|
||||
"i18next": "^19.1.0",
|
||||
"i18next-browser-languagedetector": "^4.0.1",
|
||||
"initials": "^3.0.1",
|
||||
"lodash": "^4.17.15",
|
||||
|
@ -46,12 +60,12 @@
|
|||
"react-beautiful-dnd": "^12.2.0",
|
||||
"react-datepicker": "^2.11.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"react-i18next": "^11.3.0",
|
||||
"react-i18next": "^11.3.1",
|
||||
"react-input-mask": "^2.0.4",
|
||||
"react-markdown": "^4.3.1",
|
||||
"react-redux": "^7.1.3",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"react-scripts": "3.3.0",
|
||||
"react-scripts": "3.3.1",
|
||||
"react-textarea-autosize": "^7.1.2",
|
||||
"redux": "^4.0.5",
|
||||
"redux-logger": "^3.0.6",
|
||||
|
@ -61,17 +75,18 @@
|
|||
"sails.io.js": "^1.2.1",
|
||||
"semantic-ui-react": "^0.88.2",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"validator": "^12.1.0",
|
||||
"validator": "^12.2.0",
|
||||
"whatwg-fetch": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^5.16.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-airbnb": "^18.0.1",
|
||||
"eslint-plugin-import": "^2.20.0",
|
||||
"eslint-config-prettier": "^6.10.0",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||
"eslint-plugin-react": "^7.17.0",
|
||||
"eslint-plugin-react-hooks": "^1.7.0",
|
||||
"prettier-eslint": "^9.0.1",
|
||||
"prettier-eslint-cli": "^5.0.0"
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"eslint-plugin-react": "^7.18.3",
|
||||
"eslint-plugin-react-hooks": "^2.3.0",
|
||||
"prettier": "1.19.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
|
@ -2,21 +2,21 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Events */
|
||||
|
||||
export const createActionReceived = (action) => ({
|
||||
export const createActionReceived = action => ({
|
||||
type: ActionTypes.ACTION_CREATE_RECEIVED,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateActionReceived = (action) => ({
|
||||
export const updateActionReceived = action => ({
|
||||
type: ActionTypes.ACTION_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
action,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteActionReceived = (action) => ({
|
||||
export const deleteActionReceived = action => ({
|
||||
type: ActionTypes.ACTION_DELETE_RECEIVED,
|
||||
payload: {
|
||||
action,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Events */
|
||||
|
||||
export const fetchActionsRequested = (cardId) => ({
|
||||
export const fetchActionsRequested = cardId => ({
|
||||
type: ActionTypes.ACTIONS_FETCH_REQUESTED,
|
||||
payload: {
|
||||
cardId,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createBoard = (board) => ({
|
||||
export const createBoard = board => ({
|
||||
type: ActionTypes.BOARD_CREATE,
|
||||
payload: {
|
||||
board,
|
||||
|
@ -17,7 +17,7 @@ export const updateBoard = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteBoard = (id) => ({
|
||||
export const deleteBoard = id => ({
|
||||
type: ActionTypes.BOARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -61,7 +61,7 @@ export const createBoardReceived = (board, lists, labels) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const fetchBoardRequested = (id) => ({
|
||||
export const fetchBoardRequested = id => ({
|
||||
type: ActionTypes.BOARD_FETCH_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -105,7 +105,7 @@ export const updateBoardRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateBoardSucceeded = (board) => ({
|
||||
export const updateBoardSucceeded = board => ({
|
||||
type: ActionTypes.BOARD_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
board,
|
||||
|
@ -120,21 +120,21 @@ export const updateBoardFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateBoardReceived = (board) => ({
|
||||
export const updateBoardReceived = board => ({
|
||||
type: ActionTypes.BOARD_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardRequested = (id) => ({
|
||||
export const deleteBoardRequested = id => ({
|
||||
type: ActionTypes.BOARD_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteBoardSucceeded = (board) => ({
|
||||
export const deleteBoardSucceeded = board => ({
|
||||
type: ActionTypes.BOARD_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
board,
|
||||
|
@ -149,7 +149,7 @@ export const deleteBoardFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteBoardReceived = (board) => ({
|
||||
export const deleteBoardReceived = board => ({
|
||||
type: ActionTypes.BOARD_DELETE_RECEIVED,
|
||||
payload: {
|
||||
board,
|
||||
|
|
|
@ -2,28 +2,28 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Events */
|
||||
|
||||
export const createCardLabelRequested = (data) => ({
|
||||
export const createCardLabelRequested = data => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardLabelSucceeded = (cardLabel) => ({
|
||||
export const createCardLabelSucceeded = cardLabel => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardLabelFailed = (error) => ({
|
||||
export const createCardLabelFailed = error => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardLabelReceived = (cardLabel) => ({
|
||||
export const createCardLabelReceived = cardLabel => ({
|
||||
type: ActionTypes.CARD_LABEL_CREATE_RECEIVED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
|
@ -38,7 +38,7 @@ export const deleteCardLabelRequested = (cardId, labelId) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCardLabelSucceeded = (cardLabel) => ({
|
||||
export const deleteCardLabelSucceeded = cardLabel => ({
|
||||
type: ActionTypes.CARD_LABEL_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
|
@ -54,7 +54,7 @@ export const deleteCardLabelFailed = (cardId, labelId, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCardLabelReceived = (cardLabel) => ({
|
||||
export const deleteCardLabelReceived = cardLabel => ({
|
||||
type: ActionTypes.CARD_LABEL_DELETE_RECEIVED,
|
||||
payload: {
|
||||
cardLabel,
|
||||
|
|
|
@ -2,28 +2,28 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Events */
|
||||
|
||||
export const createCardMembershipRequested = (data) => ({
|
||||
export const createCardMembershipRequested = data => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardMembershipSucceeded = (cardMembership) => ({
|
||||
export const createCardMembershipSucceeded = cardMembership => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardMembershipFailed = (error) => ({
|
||||
export const createCardMembershipFailed = error => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createCardMembershipReceived = (cardMembership) => ({
|
||||
export const createCardMembershipReceived = cardMembership => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_CREATE_RECEIVED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
|
@ -38,7 +38,7 @@ export const deleteCardMembershipRequested = (cardId, userId) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCardMembershipSucceeded = (cardMembership) => ({
|
||||
export const deleteCardMembershipSucceeded = cardMembership => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
|
@ -54,7 +54,7 @@ export const deleteCardMembershipFailed = (cardId, userId, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCardMembershipReceived = (cardMembership) => ({
|
||||
export const deleteCardMembershipReceived = cardMembership => ({
|
||||
type: ActionTypes.CARD_MEMBERSHIP_DELETE_RECEIVED,
|
||||
payload: {
|
||||
cardMembership,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createCard = (card) => ({
|
||||
export const createCard = card => ({
|
||||
type: ActionTypes.CARD_CREATE,
|
||||
payload: {
|
||||
card,
|
||||
|
@ -17,7 +17,7 @@ export const updateCard = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCard = (id) => ({
|
||||
export const deleteCard = id => ({
|
||||
type: ActionTypes.CARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -50,21 +50,21 @@ export const createCardFailed = (localId, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const createCardReceived = (card) => ({
|
||||
export const createCardReceived = card => ({
|
||||
type: ActionTypes.CARD_CREATE_RECEIVED,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCardRequested = (id) => ({
|
||||
export const fetchCardRequested = id => ({
|
||||
type: ActionTypes.CARD_FETCH_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCardSucceeded = (card) => ({
|
||||
export const fetchCardSucceeded = card => ({
|
||||
type: ActionTypes.CARD_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
card,
|
||||
|
@ -87,7 +87,7 @@ export const updateCardRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateCardSucceeded = (card) => ({
|
||||
export const updateCardSucceeded = card => ({
|
||||
type: ActionTypes.CARD_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
card,
|
||||
|
@ -102,21 +102,21 @@ export const updateCardFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateCardReceived = (card) => ({
|
||||
export const updateCardReceived = card => ({
|
||||
type: ActionTypes.CARD_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
card,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardRequested = (id) => ({
|
||||
export const deleteCardRequested = id => ({
|
||||
type: ActionTypes.CARD_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCardSucceeded = (card) => ({
|
||||
export const deleteCardSucceeded = card => ({
|
||||
type: ActionTypes.CARD_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
card,
|
||||
|
@ -131,7 +131,7 @@ export const deleteCardFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCardReceived = (card) => ({
|
||||
export const deleteCardReceived = card => ({
|
||||
type: ActionTypes.CARD_DELETE_RECEIVED,
|
||||
payload: {
|
||||
card,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createCommentAction = (action) => ({
|
||||
export const createCommentAction = action => ({
|
||||
type: ActionTypes.COMMENT_ACTION_CREATE,
|
||||
payload: {
|
||||
action,
|
||||
|
@ -17,7 +17,7 @@ export const updateCommentAction = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCommentAction = (id) => ({
|
||||
export const deleteCommentAction = id => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -58,7 +58,7 @@ export const updateCommentActionRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateCommentActionSucceeded = (action) => ({
|
||||
export const updateCommentActionSucceeded = action => ({
|
||||
type: ActionTypes.COMMENT_ACTION_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
action,
|
||||
|
@ -73,14 +73,14 @@ export const updateCommentActionFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCommentActionRequested = (id) => ({
|
||||
export const deleteCommentActionRequested = id => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteCommentActionSucceeded = (action) => ({
|
||||
export const deleteCommentActionSucceeded = action => ({
|
||||
type: ActionTypes.COMMENT_ACTION_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
action,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createBoardInCurrentProject = (data) => ({
|
||||
export const createBoardInCurrentProject = data => ({
|
||||
type: EntryActionTypes.BOARD_IN_CURRENT_PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -23,7 +23,7 @@ export const moveBoard = (id, index) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteBoard = (id) => ({
|
||||
export const deleteBoard = id => ({
|
||||
type: EntryActionTypes.BOARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -16,7 +16,7 @@ export const updateCard = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateCurrentCard = (data) => ({
|
||||
export const updateCurrentCard = data => ({
|
||||
type: EntryActionTypes.CURRENT_CARD_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -32,7 +32,7 @@ export const moveCard = (id, listId, index) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCard = (id) => ({
|
||||
export const deleteCard = id => ({
|
||||
type: EntryActionTypes.CARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createCommentActionInCurrentCard = (data) => ({
|
||||
export const createCommentActionInCurrentCard = data => ({
|
||||
type: EntryActionTypes.COMMENT_ACTION_IN_CURRENT_CARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -15,7 +15,7 @@ export const updateCommentAction = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteCommentAction = (id) => ({
|
||||
export const deleteCommentAction = id => ({
|
||||
type: EntryActionTypes.COMMENT_ACTION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createLabelInCurrentBoard = (data) => ({
|
||||
export const createLabelInCurrentBoard = data => ({
|
||||
type: EntryActionTypes.LABEL_IN_CURRENT_BOARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -15,7 +15,7 @@ export const updateLabel = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteLabel = (id) => ({
|
||||
export const deleteLabel = id => ({
|
||||
type: EntryActionTypes.LABEL_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -30,7 +30,7 @@ export const addLabelToCard = (id, cardId) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const addLabelToCurrentCard = (id) => ({
|
||||
export const addLabelToCurrentCard = id => ({
|
||||
type: EntryActionTypes.LABEL_TO_CURRENT_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -45,21 +45,21 @@ export const removeLabelFromCard = (id, cardId) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromCurrentCard = (id) => ({
|
||||
export const removeLabelFromCurrentCard = id => ({
|
||||
type: EntryActionTypes.LABEL_FROM_CURRENT_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const addLabelToFilterInCurrentBoard = (id) => ({
|
||||
export const addLabelToFilterInCurrentBoard = id => ({
|
||||
type: EntryActionTypes.LABEL_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeLabelFromFilterInCurrentBoard = (id) => ({
|
||||
export const removeLabelFromFilterInCurrentBoard = id => ({
|
||||
type: EntryActionTypes.LABEL_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createListInCurrentBoard = (data) => ({
|
||||
export const createListInCurrentBoard = data => ({
|
||||
type: EntryActionTypes.LIST_IN_CURRENT_BOARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -23,7 +23,7 @@ export const moveList = (id, index) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteList = (id) => ({
|
||||
export const deleteList = id => ({
|
||||
type: EntryActionTypes.LIST_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const authenticate = (data) => ({
|
||||
export const authenticate = data => ({
|
||||
type: EntryActionTypes.AUTHENTICATE,
|
||||
payload: {
|
||||
data,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const deleteNotification = (id) => ({
|
||||
export const deleteNotification = id => ({
|
||||
type: EntryActionTypes.NOTIFICATION_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createMembershipInCurrentProject = (data) => ({
|
||||
export const createMembershipInCurrentProject = data => ({
|
||||
type: EntryActionTypes.MEMBERSHIP_IN_CURRENT_PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembership = (id) => ({
|
||||
export const deleteProjectMembership = id => ({
|
||||
type: EntryActionTypes.PROJECT_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createProject = (data) => ({
|
||||
export const createProject = data => ({
|
||||
type: EntryActionTypes.PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentProject = (data) => ({
|
||||
export const updateCurrentProject = data => ({
|
||||
type: EntryActionTypes.CURRENT_PROJECT_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createTaskInCurrentCard = (data) => ({
|
||||
export const createTaskInCurrentCard = data => ({
|
||||
type: EntryActionTypes.TASK_IN_CURRENT_CARD_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -15,7 +15,7 @@ export const updateTask = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteTask = (id) => ({
|
||||
export const deleteTask = id => ({
|
||||
type: EntryActionTypes.TASK_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import EntryActionTypes from '../../constants/EntryActionTypes';
|
||||
|
||||
export const createUser = (data) => ({
|
||||
export const createUser = data => ({
|
||||
type: EntryActionTypes.USER_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -20,14 +20,14 @@ export const updateUser = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateCurrentUser = (data) => ({
|
||||
export const updateCurrentUser = data => ({
|
||||
type: EntryActionTypes.CURRENT_USER_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateCurrentUserEmail = (data) => ({
|
||||
export const updateCurrentUserEmail = data => ({
|
||||
type: EntryActionTypes.CURRENT_USER_EMAIL_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -39,7 +39,7 @@ export const clearCurrentUserEmailUpdateError = () => ({
|
|||
payload: {},
|
||||
});
|
||||
|
||||
export const updateCurrentUserPassword = (data) => ({
|
||||
export const updateCurrentUserPassword = data => ({
|
||||
type: EntryActionTypes.CURRENT_USER_PASSWORD_UPDATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -51,14 +51,14 @@ export const clearCurrentUserPasswordUpdateError = () => ({
|
|||
payload: {},
|
||||
});
|
||||
|
||||
export const uploadCurrentUserAvatar = (file) => ({
|
||||
export const uploadCurrentUserAvatar = file => ({
|
||||
type: EntryActionTypes.CURRENT_USER_AVATAR_UPLOAD,
|
||||
payload: {
|
||||
file,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUser = (id) => ({
|
||||
export const deleteUser = id => ({
|
||||
type: EntryActionTypes.USER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -73,7 +73,7 @@ export const addUserToCard = (id, cardId) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const addUserToCurrentCard = (id) => ({
|
||||
export const addUserToCurrentCard = id => ({
|
||||
type: EntryActionTypes.USER_TO_CURRENT_CARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -88,21 +88,21 @@ export const removeUserFromCard = (id, cardId) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const removeUserFromCurrentCard = (id) => ({
|
||||
export const removeUserFromCurrentCard = id => ({
|
||||
type: EntryActionTypes.USER_FROM_CURRENT_CARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const addUserToFilterInCurrentBoard = (id) => ({
|
||||
export const addUserToFilterInCurrentBoard = id => ({
|
||||
type: EntryActionTypes.USER_TO_FILTER_IN_CURRENT_BOARD_ADD,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const removeUserFromFilterInCurrentBoard = (id) => ({
|
||||
export const removeUserFromFilterInCurrentBoard = id => ({
|
||||
type: EntryActionTypes.USER_FROM_FILTER_IN_CURRENT_BOARD_REMOVE,
|
||||
payload: {
|
||||
id,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createLabel = (label) => ({
|
||||
export const createLabel = label => ({
|
||||
type: ActionTypes.LABEL_CREATE,
|
||||
payload: {
|
||||
label,
|
||||
|
@ -17,7 +17,7 @@ export const updateLabel = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteLabel = (id) => ({
|
||||
export const deleteLabel = id => ({
|
||||
type: ActionTypes.LABEL_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -82,7 +82,7 @@ export const createLabelFailed = (localId, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const createLabelReceived = (label) => ({
|
||||
export const createLabelReceived = label => ({
|
||||
type: ActionTypes.LABEL_CREATE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
|
@ -97,7 +97,7 @@ export const updateLabelRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateLabelSucceeded = (label) => ({
|
||||
export const updateLabelSucceeded = label => ({
|
||||
type: ActionTypes.LABEL_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
label,
|
||||
|
@ -112,21 +112,21 @@ export const updateLabelFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateLabelReceived = (label) => ({
|
||||
export const updateLabelReceived = label => ({
|
||||
type: ActionTypes.LABEL_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelRequested = (id) => ({
|
||||
export const deleteLabelRequested = id => ({
|
||||
type: ActionTypes.LABEL_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteLabelSucceeded = (label) => ({
|
||||
export const deleteLabelSucceeded = label => ({
|
||||
type: ActionTypes.LABEL_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
label,
|
||||
|
@ -141,7 +141,7 @@ export const deleteLabelFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteLabelReceived = (label) => ({
|
||||
export const deleteLabelReceived = label => ({
|
||||
type: ActionTypes.LABEL_DELETE_RECEIVED,
|
||||
payload: {
|
||||
label,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createList = (list) => ({
|
||||
export const createList = list => ({
|
||||
type: ActionTypes.LIST_CREATE,
|
||||
payload: {
|
||||
list,
|
||||
|
@ -17,7 +17,7 @@ export const updateList = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteList = (id) => ({
|
||||
export const deleteList = id => ({
|
||||
type: ActionTypes.LIST_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -50,7 +50,7 @@ export const createListFailed = (localId, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const createListReceived = (list) => ({
|
||||
export const createListReceived = list => ({
|
||||
type: ActionTypes.LIST_CREATE_RECEIVED,
|
||||
payload: {
|
||||
list,
|
||||
|
@ -65,7 +65,7 @@ export const updateListRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateListSucceeded = (list) => ({
|
||||
export const updateListSucceeded = list => ({
|
||||
type: ActionTypes.LIST_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
list,
|
||||
|
@ -80,21 +80,21 @@ export const updateListFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateListReceived = (list) => ({
|
||||
export const updateListReceived = list => ({
|
||||
type: ActionTypes.LIST_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
list,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteListRequested = (id) => ({
|
||||
export const deleteListRequested = id => ({
|
||||
type: ActionTypes.LIST_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteListSucceeded = (list) => ({
|
||||
export const deleteListSucceeded = list => ({
|
||||
type: ActionTypes.LIST_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
list,
|
||||
|
@ -109,7 +109,7 @@ export const deleteListFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteListReceived = (list) => ({
|
||||
export const deleteListReceived = list => ({
|
||||
type: ActionTypes.LIST_DELETE_RECEIVED,
|
||||
payload: {
|
||||
list,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const authenticate = (data) => ({
|
||||
export const authenticate = data => ({
|
||||
type: ActionTypes.AUTHENTICATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -21,21 +21,21 @@ export const logout = () => ({
|
|||
|
||||
/* Events */
|
||||
|
||||
export const authenticateRequested = (data) => ({
|
||||
export const authenticateRequested = data => ({
|
||||
type: ActionTypes.AUTHENTICATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const authenticateSucceeded = (accessToken) => ({
|
||||
export const authenticateSucceeded = accessToken => ({
|
||||
type: ActionTypes.AUTHENTICATE_SUCCEEDED,
|
||||
payload: {
|
||||
accessToken,
|
||||
},
|
||||
});
|
||||
|
||||
export const authenticateFailed = (error) => ({
|
||||
export const authenticateFailed = error => ({
|
||||
type: ActionTypes.AUTHENTICATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const openModal = (type) => ({
|
||||
export const openModal = type => ({
|
||||
type: ActionTypes.MODAL_OPEN,
|
||||
payload: {
|
||||
type,
|
||||
|
|
|
@ -12,7 +12,7 @@ export const createNotificationReceived = (notification, user, card, action) =>
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteNotificationReceived = (notification) => ({
|
||||
export const deleteNotificationReceived = notification => ({
|
||||
type: ActionTypes.NOTIFICATION_DELETE_RECEIVED,
|
||||
payload: {
|
||||
notification,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const deleteNotifications = (ids) => ({
|
||||
export const deleteNotifications = ids => ({
|
||||
type: ActionTypes.NOTIFICATIONS_DELETE,
|
||||
payload: {
|
||||
ids,
|
||||
|
@ -26,21 +26,21 @@ export const fetchNotificationsSucceeded = (notifications, users, cards, actions
|
|||
},
|
||||
});
|
||||
|
||||
export const fetchNotificationsFailed = (error) => ({
|
||||
export const fetchNotificationsFailed = error => ({
|
||||
type: ActionTypes.NOTIFICATIONS_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotificationsRequested = (ids) => ({
|
||||
export const deleteNotificationsRequested = ids => ({
|
||||
type: ActionTypes.NOTIFICATIONS_DELETE_REQUESTED,
|
||||
payload: {
|
||||
ids,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteNotificationsSucceeded = (notifications) => ({
|
||||
export const deleteNotificationsSucceeded = notifications => ({
|
||||
type: ActionTypes.NOTIFICATIONS_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
notifications,
|
||||
|
|
|
@ -2,14 +2,14 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createProjectMembership = (projectMembership) => ({
|
||||
export const createProjectMembership = projectMembership => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_CREATE,
|
||||
payload: {
|
||||
projectMembership,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembership = (id) => ({
|
||||
export const deleteProjectMembership = id => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -50,14 +50,14 @@ export const createProjectMembershipReceived = (projectMembership, user) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembershipRequested = (id) => ({
|
||||
export const deleteProjectMembershipRequested = id => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembershipSucceeded = (projectMembership) => ({
|
||||
export const deleteProjectMembershipSucceeded = projectMembership => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
projectMembership,
|
||||
|
@ -72,7 +72,7 @@ export const deleteProjectMembershipFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteProjectMembershipReceived = (projectMembership) => ({
|
||||
export const deleteProjectMembershipReceived = projectMembership => ({
|
||||
type: ActionTypes.PROJECT_MEMBERSHIP_DELETE_RECEIVED,
|
||||
payload: {
|
||||
projectMembership,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createProject = (data) => ({
|
||||
export const createProject = data => ({
|
||||
type: ActionTypes.PROJECT_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -17,7 +17,7 @@ export const updateProject = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteProject = (id) => ({
|
||||
export const deleteProject = id => ({
|
||||
type: ActionTypes.PROJECT_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -26,7 +26,7 @@ export const deleteProject = (id) => ({
|
|||
|
||||
/* Events */
|
||||
|
||||
export const createProjectRequested = (data) => ({
|
||||
export const createProjectRequested = data => ({
|
||||
type: ActionTypes.PROJECT_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -43,7 +43,7 @@ export const createProjectSucceeded = (project, users, projectMemberships, board
|
|||
},
|
||||
});
|
||||
|
||||
export const createProjectFailed = (error) => ({
|
||||
export const createProjectFailed = error => ({
|
||||
type: ActionTypes.PROJECT_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
|
@ -68,7 +68,7 @@ export const updateProjectRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateProjectSucceeded = (project) => ({
|
||||
export const updateProjectSucceeded = project => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
project,
|
||||
|
@ -83,21 +83,21 @@ export const updateProjectFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateProjectReceived = (project) => ({
|
||||
export const updateProjectReceived = project => ({
|
||||
type: ActionTypes.PROJECT_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
project,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectRequested = (id) => ({
|
||||
export const deleteProjectRequested = id => ({
|
||||
type: ActionTypes.PROJECT_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteProjectSucceeded = (project) => ({
|
||||
export const deleteProjectSucceeded = project => ({
|
||||
type: ActionTypes.PROJECT_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
project,
|
||||
|
@ -112,7 +112,7 @@ export const deleteProjectFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteProjectReceived = (project) => ({
|
||||
export const deleteProjectReceived = project => ({
|
||||
type: ActionTypes.PROJECT_DELETE_RECEIVED,
|
||||
payload: {
|
||||
project,
|
||||
|
|
|
@ -17,7 +17,7 @@ export const fetchProjectsSucceeded = (projects, users, projectMemberships, boar
|
|||
},
|
||||
});
|
||||
|
||||
export const fetchProjectsFailed = (error) => ({
|
||||
export const fetchProjectsFailed = error => ({
|
||||
type: ActionTypes.PROJECTS_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createTask = (task) => ({
|
||||
export const createTask = task => ({
|
||||
type: ActionTypes.TASK_CREATE,
|
||||
payload: {
|
||||
task,
|
||||
|
@ -17,7 +17,7 @@ export const updateTask = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteTask = (id) => ({
|
||||
export const deleteTask = id => ({
|
||||
type: ActionTypes.TASK_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -50,7 +50,7 @@ export const createTaskFailed = (localId, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const createTaskReceived = (task) => ({
|
||||
export const createTaskReceived = task => ({
|
||||
type: ActionTypes.TASK_CREATE_RECEIVED,
|
||||
payload: {
|
||||
task,
|
||||
|
@ -65,7 +65,7 @@ export const updateTaskRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateTaskSucceeded = (task) => ({
|
||||
export const updateTaskSucceeded = task => ({
|
||||
type: ActionTypes.TASK_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
task,
|
||||
|
@ -80,21 +80,21 @@ export const updateTaskFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateTaskReceived = (task) => ({
|
||||
export const updateTaskReceived = task => ({
|
||||
type: ActionTypes.TASK_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
task,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTaskRequested = (id) => ({
|
||||
export const deleteTaskRequested = id => ({
|
||||
type: ActionTypes.TASK_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteTaskSucceeded = (task) => ({
|
||||
export const deleteTaskSucceeded = task => ({
|
||||
type: ActionTypes.TASK_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
task,
|
||||
|
@ -109,7 +109,7 @@ export const deleteTaskFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteTaskReceived = (task) => ({
|
||||
export const deleteTaskReceived = task => ({
|
||||
type: ActionTypes.TASK_DELETE_RECEIVED,
|
||||
payload: {
|
||||
task,
|
||||
|
|
|
@ -2,7 +2,7 @@ import ActionTypes from '../constants/ActionTypes';
|
|||
|
||||
/* Actions */
|
||||
|
||||
export const createUser = (data) => ({
|
||||
export const createUser = data => ({
|
||||
type: ActionTypes.USER_CREATE,
|
||||
payload: {
|
||||
data,
|
||||
|
@ -22,21 +22,21 @@ export const updateUser = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const clearUserEmailUpdateError = (id) => ({
|
||||
export const clearUserEmailUpdateError = id => ({
|
||||
type: ActionTypes.USER_EMAIL_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const clearUserPasswordUpdateError = (id) => ({
|
||||
export const clearUserPasswordUpdateError = id => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE_ERROR_CLEAR,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUser = (id) => ({
|
||||
export const deleteUser = id => ({
|
||||
type: ActionTypes.USER_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -78,28 +78,28 @@ export const removeUserFromBoardFilter = (id, boardId) => ({
|
|||
|
||||
/* Events */
|
||||
|
||||
export const createUserRequested = (data) => ({
|
||||
export const createUserRequested = data => ({
|
||||
type: ActionTypes.USER_CREATE_REQUESTED,
|
||||
payload: {
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
export const createUserSucceeded = (user) => ({
|
||||
export const createUserSucceeded = user => ({
|
||||
type: ActionTypes.USER_CREATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const createUserFailed = (error) => ({
|
||||
export const createUserFailed = error => ({
|
||||
type: ActionTypes.USER_CREATE_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
export const createUserReceived = (user) => ({
|
||||
export const createUserReceived = user => ({
|
||||
type: ActionTypes.USER_CREATE_RECEIVED,
|
||||
payload: {
|
||||
user,
|
||||
|
@ -111,14 +111,14 @@ export const fetchCurrentUserRequested = () => ({
|
|||
payload: {},
|
||||
});
|
||||
|
||||
export const fetchCurrentUserSucceeded = (user) => ({
|
||||
export const fetchCurrentUserSucceeded = user => ({
|
||||
type: ActionTypes.CURRENT_USER_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchCurrentUserFailed = (error) => ({
|
||||
export const fetchCurrentUserFailed = error => ({
|
||||
type: ActionTypes.CURRENT_USER_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
|
@ -133,7 +133,7 @@ export const updateUserRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateUserSucceeded = (user) => ({
|
||||
export const updateUserSucceeded = user => ({
|
||||
type: ActionTypes.USER_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
|
@ -148,7 +148,7 @@ export const updateUserFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateUserReceived = (user) => ({
|
||||
export const updateUserReceived = user => ({
|
||||
type: ActionTypes.USER_UPDATE_RECEIVED,
|
||||
payload: {
|
||||
user,
|
||||
|
@ -187,7 +187,7 @@ export const updateUserPasswordRequested = (id, data) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const updateUserPasswordSucceeded = (id) => ({
|
||||
export const updateUserPasswordSucceeded = id => ({
|
||||
type: ActionTypes.USER_PASSWORD_UPDATE_SUCCEEDED,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -202,7 +202,7 @@ export const updateUserPasswordFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const uploadUserAvatarRequested = (id) => ({
|
||||
export const uploadUserAvatarRequested = id => ({
|
||||
type: ActionTypes.USER_AVATAR_UPLOAD_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
|
@ -225,14 +225,14 @@ export const uploadUserAvatarFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteUserRequested = (id) => ({
|
||||
export const deleteUserRequested = id => ({
|
||||
type: ActionTypes.USER_DELETE_REQUESTED,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
export const deleteUserSucceeded = (user) => ({
|
||||
export const deleteUserSucceeded = user => ({
|
||||
type: ActionTypes.USER_DELETE_SUCCEEDED,
|
||||
payload: {
|
||||
user,
|
||||
|
@ -247,7 +247,7 @@ export const deleteUserFailed = (id, error) => ({
|
|||
},
|
||||
});
|
||||
|
||||
export const deleteUserReceived = (user) => ({
|
||||
export const deleteUserReceived = user => ({
|
||||
type: ActionTypes.USER_DELETE_RECEIVED,
|
||||
payload: {
|
||||
user,
|
||||
|
|
|
@ -7,14 +7,14 @@ export const fetchUsersRequested = () => ({
|
|||
payload: {},
|
||||
});
|
||||
|
||||
export const fetchUsersSucceeded = (users) => ({
|
||||
export const fetchUsersSucceeded = users => ({
|
||||
type: ActionTypes.USERS_FETCH_SUCCEEDED,
|
||||
payload: {
|
||||
users,
|
||||
},
|
||||
});
|
||||
|
||||
export const fetchUsersFailed = (error) => ({
|
||||
export const fetchUsersFailed = error => ({
|
||||
type: ActionTypes.USERS_FETCH_FAILED,
|
||||
payload: {
|
||||
error,
|
||||
|
|
|
@ -2,21 +2,22 @@ import socket from './socket';
|
|||
|
||||
/* Transformers */
|
||||
|
||||
export const transformAction = (action) => ({
|
||||
export const transformAction = action => ({
|
||||
...action,
|
||||
createdAt: new Date(action.createdAt),
|
||||
});
|
||||
|
||||
/* Actions */
|
||||
|
||||
const getActions = (cardId, data, headers) => socket.get(`/cards/${cardId}/actions`, data, headers).then((body) => ({
|
||||
...body,
|
||||
items: body.items.map(transformAction),
|
||||
}));
|
||||
const getActions = (cardId, data, headers) =>
|
||||
socket.get(`/cards/${cardId}/actions`, data, headers).then(body => ({
|
||||
...body,
|
||||
items: body.items.map(transformAction),
|
||||
}));
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleActionCreate = (next) => (body) => {
|
||||
const makeHandleActionCreate = next => body => {
|
||||
next({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
|
|
|
@ -3,15 +3,17 @@ import { transformCard } from './cards';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createBoard = (projectId, data, headers) => socket.post(`/projects/${projectId}/boards`, data, headers);
|
||||
const createBoard = (projectId, data, headers) =>
|
||||
socket.post(`/projects/${projectId}/boards`, data, headers);
|
||||
|
||||
const getBoard = (id, headers) => socket.get(`/boards/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
cards: body.included.cards.map(transformCard),
|
||||
},
|
||||
}));
|
||||
const getBoard = (id, headers) =>
|
||||
socket.get(`/boards/${id}`, undefined, headers).then(body => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
cards: body.included.cards.map(transformCard),
|
||||
},
|
||||
}));
|
||||
|
||||
const updateBoard = (id, data, headers) => socket.patch(`/boards/${id}`, data, headers);
|
||||
|
||||
|
|
|
@ -2,9 +2,11 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createCardLabel = (cardId, data, headers) => socket.post(`/cards/${cardId}/labels`, data, headers);
|
||||
const createCardLabel = (cardId, data, headers) =>
|
||||
socket.post(`/cards/${cardId}/labels`, data, headers);
|
||||
|
||||
const deleteCardLabel = (cardId, labelId, headers) => socket.delete(`/cards/${cardId}/labels/${labelId}`, undefined, headers);
|
||||
const deleteCardLabel = (cardId, labelId, headers) =>
|
||||
socket.delete(`/cards/${cardId}/labels/${labelId}`, undefined, headers);
|
||||
|
||||
export default {
|
||||
createCardLabel,
|
||||
|
|
|
@ -2,9 +2,11 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createCardMembership = (cardId, data, headers) => socket.post(`/cards/${cardId}/memberships`, data, headers);
|
||||
const createCardMembership = (cardId, data, headers) =>
|
||||
socket.post(`/cards/${cardId}/memberships`, data, headers);
|
||||
|
||||
const deleteCardMembership = (cardId, userId, headers) => socket.delete(`/cards/${cardId}/memberships?userId=${userId}`, undefined, headers);
|
||||
const deleteCardMembership = (cardId, userId, headers) =>
|
||||
socket.delete(`/cards/${cardId}/memberships?userId=${userId}`, undefined, headers);
|
||||
|
||||
export default {
|
||||
createCardMembership,
|
||||
|
|
|
@ -2,7 +2,7 @@ import socket from './socket';
|
|||
|
||||
/* Transformers */
|
||||
|
||||
export const transformCard = (card) => ({
|
||||
export const transformCard = card => ({
|
||||
...card,
|
||||
...(card.dueDate && {
|
||||
dueDate: new Date(card.dueDate),
|
||||
|
@ -17,7 +17,7 @@ export const transformCard = (card) => ({
|
|||
}),
|
||||
});
|
||||
|
||||
export const transformCardData = (data) => ({
|
||||
export const transformCardData = data => ({
|
||||
...data,
|
||||
...(data.dueDate && {
|
||||
dueDate: data.dueDate.toISOString(),
|
||||
|
@ -34,29 +34,33 @@ export const transformCardData = (data) => ({
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createCard = (listId, data, headers) => socket.post(`/lists/${listId}/cards`, transformCardData(data), headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
const createCard = (listId, data, headers) =>
|
||||
socket.post(`/lists/${listId}/cards`, transformCardData(data), headers).then(body => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const getCard = (id, headers) => socket.get(`/cards/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
const getCard = (id, headers) =>
|
||||
socket.get(`/cards/${id}`, undefined, headers).then(body => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const updateCard = (id, data, headers) => socket.patch(`/cards/${id}`, transformCardData(data), headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
const updateCard = (id, data, headers) =>
|
||||
socket.patch(`/cards/${id}`, transformCardData(data), headers).then(body => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const deleteCard = (id, headers) => socket.delete(`/cards/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
const deleteCard = (id, headers) =>
|
||||
socket.delete(`/cards/${id}`, undefined, headers).then(body => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleCardCreate = (next) => (body) => {
|
||||
const makeHandleCardCreate = next => body => {
|
||||
next({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
|
|
|
@ -3,20 +3,23 @@ import { transformAction } from './actions';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createCommentAction = (cardId, data, headers) => socket.post(`/cards/${cardId}/comment-actions`, data, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
const createCommentAction = (cardId, data, headers) =>
|
||||
socket.post(`/cards/${cardId}/comment-actions`, data, headers).then(body => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const updateCommentAction = (id, data, headers) => socket.patch(`/comment-actions/${id}`, data, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
const updateCommentAction = (id, data, headers) =>
|
||||
socket.patch(`/comment-actions/${id}`, data, headers).then(body => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const deleteCommentAction = (id, headers) => socket.delete(`/comment-actions/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
const deleteCommentAction = (id, headers) =>
|
||||
socket.delete(`/comment-actions/${id}`, undefined, headers).then(body => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
export default {
|
||||
createCommentAction,
|
||||
|
|
|
@ -5,7 +5,7 @@ import Config from '../constants/Config';
|
|||
const http = {};
|
||||
|
||||
// TODO: all methods
|
||||
['POST'].forEach((method) => {
|
||||
['POST'].forEach(method => {
|
||||
http[method.toLowerCase()] = (url, data, headers) => {
|
||||
const formData = Object.keys(data).reduce((result, key) => {
|
||||
result.append(key, data[key]);
|
||||
|
@ -18,10 +18,12 @@ const http = {};
|
|||
headers,
|
||||
body: formData,
|
||||
})
|
||||
.then((response) => response.json().then((body) => ({
|
||||
body,
|
||||
isError: response.status !== 200,
|
||||
})))
|
||||
.then(response =>
|
||||
response.json().then(body => ({
|
||||
body,
|
||||
isError: response.status !== 200,
|
||||
})),
|
||||
)
|
||||
.then(({ body, isError }) => {
|
||||
if (isError) {
|
||||
throw body;
|
||||
|
|
|
@ -2,7 +2,8 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createLabel = (boardId, data, headers) => socket.post(`/boards/${boardId}/labels`, data, headers);
|
||||
const createLabel = (boardId, data, headers) =>
|
||||
socket.post(`/boards/${boardId}/labels`, data, headers);
|
||||
|
||||
const updateLabel = (id, data, headers) => socket.patch(`/labels/${id}`, data, headers);
|
||||
|
||||
|
|
|
@ -2,7 +2,8 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createList = (boardId, data, headers) => socket.post(`/boards/${boardId}/lists`, data, headers);
|
||||
const createList = (boardId, data, headers) =>
|
||||
socket.post(`/boards/${boardId}/lists`, data, headers);
|
||||
|
||||
const updateList = (id, data, headers) => socket.patch(`/lists/${id}`, data, headers);
|
||||
|
||||
|
|
|
@ -4,20 +4,22 @@ import { transformAction } from './actions';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const getNotifications = (headers) => socket.get('/notifications', undefined, headers).then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
cards: body.included.cards.map(transformCard),
|
||||
actions: body.included.actions.map(transformAction),
|
||||
},
|
||||
}));
|
||||
const getNotifications = headers =>
|
||||
socket.get('/notifications', undefined, headers).then(body => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
cards: body.included.cards.map(transformCard),
|
||||
actions: body.included.actions.map(transformAction),
|
||||
},
|
||||
}));
|
||||
|
||||
const updateNotifications = (ids, data, headers) => socket.patch(`/notifications/${ids.join(',')}`, data, headers);
|
||||
const updateNotifications = (ids, data, headers) =>
|
||||
socket.patch(`/notifications/${ids.join(',')}`, data, headers);
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleNotificationCreate = (next) => (body) => {
|
||||
const makeHandleNotificationCreate = next => body => {
|
||||
next({
|
||||
...body,
|
||||
included: {
|
||||
|
|
|
@ -2,9 +2,11 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const createProjectMembership = (projectId, data, headers) => socket.post(`/projects/${projectId}/memberships`, data, headers);
|
||||
const createProjectMembership = (projectId, data, headers) =>
|
||||
socket.post(`/projects/${projectId}/memberships`, data, headers);
|
||||
|
||||
const deleteProjectMembership = (id, headers) => socket.delete(`/project-memberships/${id}`, undefined, headers);
|
||||
const deleteProjectMembership = (id, headers) =>
|
||||
socket.delete(`/project-memberships/${id}`, undefined, headers);
|
||||
|
||||
export default {
|
||||
createProjectMembership,
|
||||
|
|
|
@ -2,7 +2,7 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const getProjects = (headers) => socket.get('/projects', undefined, headers);
|
||||
const getProjects = headers => socket.get('/projects', undefined, headers);
|
||||
|
||||
const createProject = (data, headers) => socket.post('/projects', data, headers);
|
||||
|
||||
|
|
|
@ -15,24 +15,25 @@ const { socket } = io;
|
|||
|
||||
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
||||
|
||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
||||
socket[method.toLowerCase()] = (url, data, headers) => new Promise((resolve, reject) => {
|
||||
socket.request(
|
||||
{
|
||||
method,
|
||||
data,
|
||||
headers,
|
||||
url: `/api${url}`,
|
||||
},
|
||||
(_, { body, error }) => {
|
||||
if (error) {
|
||||
reject(body);
|
||||
} else {
|
||||
resolve(body);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach(method => {
|
||||
socket[method.toLowerCase()] = (url, data, headers) =>
|
||||
new Promise((resolve, reject) => {
|
||||
socket.request(
|
||||
{
|
||||
method,
|
||||
data,
|
||||
headers,
|
||||
url: `/api${url}`,
|
||||
},
|
||||
(_, { body, error }) => {
|
||||
if (error) {
|
||||
reject(body);
|
||||
} else {
|
||||
resolve(body);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
export default socket;
|
||||
|
|
|
@ -3,25 +3,27 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const getUsers = (headers) => socket.get('/users', undefined, headers);
|
||||
const getUsers = headers => socket.get('/users', undefined, headers);
|
||||
|
||||
const createUser = (data, headers) => socket.post('/users', data, headers);
|
||||
|
||||
const getCurrentUser = (headers) => socket.get('/users/me', undefined, headers);
|
||||
const getCurrentUser = headers => socket.get('/users/me', undefined, headers);
|
||||
|
||||
const updateUser = (id, data, headers) => socket.patch(`/users/${id}`, data, headers);
|
||||
|
||||
const updateUserEmail = (id, data, headers) => socket.patch(`/users/${id}/email`, data, headers);
|
||||
|
||||
const updateUserPassword = (id, data, headers) => socket.patch(`/users/${id}/password`, data, headers);
|
||||
const updateUserPassword = (id, data, headers) =>
|
||||
socket.patch(`/users/${id}/password`, data, headers);
|
||||
|
||||
const uploadUserAvatar = (id, file, headers) => http.post(
|
||||
`/users/${id}/upload-avatar`,
|
||||
{
|
||||
file,
|
||||
},
|
||||
headers,
|
||||
);
|
||||
const uploadUserAvatar = (id, file, headers) =>
|
||||
http.post(
|
||||
`/users/${id}/upload-avatar`,
|
||||
{
|
||||
file,
|
||||
},
|
||||
headers,
|
||||
);
|
||||
|
||||
const deleteUser = (id, headers) => socket.delete(`/users/${id}`, undefined, headers);
|
||||
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
import React, { useCallback, useEffect, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
Button, Form, Header, Modal,
|
||||
} from 'semantic-ui-react';
|
||||
import { Button, Form, Header, Modal } from 'semantic-ui-react';
|
||||
import { Input } from '../../lib/custom-ui';
|
||||
|
||||
import { useForm } from '../../hooks';
|
||||
|
||||
import styles from './AddProjectModal.module.css';
|
||||
|
||||
const AddProjectModal = React.memo(({
|
||||
defaultData, isSubmitting, onCreate, onClose,
|
||||
}) => {
|
||||
const AddProjectModal = React.memo(({ defaultData, isSubmitting, onCreate, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const [data, handleFieldChange] = useForm(() => ({
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import isEmail from 'validator/lib/isEmail';
|
||||
import React, {
|
||||
useCallback, useEffect, useMemo, useRef,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Message } from 'semantic-ui-react';
|
||||
|
@ -13,7 +11,7 @@ import { useForm } from '../../hooks';
|
|||
|
||||
import styles from './AddUserPopup.module.css';
|
||||
|
||||
const createMessage = (error) => {
|
||||
const createMessage = error => {
|
||||
if (!error) {
|
||||
return error;
|
||||
}
|
||||
|
@ -32,9 +30,7 @@ const createMessage = (error) => {
|
|||
};
|
||||
|
||||
const AddUserPopup = React.memo(
|
||||
({
|
||||
defaultData, isSubmitting, error, onCreate, onMessageDismiss, onClose,
|
||||
}) => {
|
||||
({ defaultData, isSubmitting, error, onCreate, onMessageDismiss, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const wasSubmitting = usePrevious(isSubmitting);
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Input } from 'semantic-ui-react';
|
||||
|
@ -44,7 +42,7 @@ const AddList = React.forwardRef(({ children, onCreate }, ref) => {
|
|||
}, [open]);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
if (event.key === 'Escape') {
|
||||
close();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-ic
|
|||
|
||||
import styles from './Board.module.css';
|
||||
|
||||
const parseDndId = (dndId) => dndId.split(':')[1];
|
||||
const parseDndId = dndId => dndId.split(':')[1];
|
||||
|
||||
const Board = React.memo(
|
||||
({
|
||||
|
@ -41,12 +41,10 @@ const Board = React.memo(
|
|||
}, []);
|
||||
|
||||
const handleDragEnd = useCallback(
|
||||
({
|
||||
draggableId, type, source, destination,
|
||||
}) => {
|
||||
({ draggableId, type, source, destination }) => {
|
||||
if (
|
||||
!destination
|
||||
|| (source.droppableId === destination.droppableId && source.index === destination.index)
|
||||
!destination ||
|
||||
(source.droppableId === destination.droppableId && source.index === destination.index)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -26,14 +26,14 @@ const Filter = React.memo(
|
|||
const [t] = useTranslation();
|
||||
|
||||
const handleUserRemoveClick = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onUserRemove(id);
|
||||
},
|
||||
[onUserRemove],
|
||||
);
|
||||
|
||||
const handleLabelRemoveClick = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onLabelRemove(id);
|
||||
},
|
||||
[onLabelRemove],
|
||||
|
@ -44,7 +44,7 @@ const Filter = React.memo(
|
|||
<span className={styles.filter}>
|
||||
<ProjectMembershipsPopup
|
||||
items={allProjectMemberships}
|
||||
currentUserIds={users.map((user) => user.id)}
|
||||
currentUserIds={users.map(user => user.id)}
|
||||
title={t('common.filterByMembers', {
|
||||
context: 'title',
|
||||
})}
|
||||
|
@ -56,7 +56,7 @@ const Filter = React.memo(
|
|||
{users.length === 0 && <span className={styles.filterLabel}>{t('common.all')}</span>}
|
||||
</button>
|
||||
</ProjectMembershipsPopup>
|
||||
{users.map((user) => (
|
||||
{users.map(user => (
|
||||
<span key={user.id} className={styles.filterItem}>
|
||||
<User
|
||||
name={user.name}
|
||||
|
@ -70,7 +70,7 @@ const Filter = React.memo(
|
|||
<span className={styles.filter}>
|
||||
<LabelsPopup
|
||||
items={allLabels}
|
||||
currentIds={labels.map((label) => label.id)}
|
||||
currentIds={labels.map(label => label.id)}
|
||||
title={t('common.filterByLabels', {
|
||||
context: 'title',
|
||||
})}
|
||||
|
@ -85,7 +85,7 @@ const Filter = React.memo(
|
|||
{labels.length === 0 && <span className={styles.filterLabel}>{t('common.all')}</span>}
|
||||
</button>
|
||||
</LabelsPopup>
|
||||
{labels.map((label) => (
|
||||
{labels.map(label => (
|
||||
<span key={label.id} className={styles.filterItem}>
|
||||
<Label
|
||||
name={label.name}
|
||||
|
|
|
@ -18,9 +18,7 @@ import EditPopup from './EditPopup';
|
|||
import styles from './Boards.module.css';
|
||||
|
||||
const Boards = React.memo(
|
||||
({
|
||||
items, currentId, isEditable, onCreate, onUpdate, onMove, onDelete,
|
||||
}) => {
|
||||
({ items, currentId, isEditable, onCreate, onUpdate, onMove, onDelete }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleDragStart = useCallback(() => {
|
||||
|
@ -46,76 +44,78 @@ const Boards = React.memo(
|
|||
);
|
||||
|
||||
const handleDelete = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
);
|
||||
|
||||
const renderItems = useCallback(
|
||||
(safeItems) => safeItems.map((item) => (
|
||||
<div key={item.id} className={styles.tabWrapper}>
|
||||
<div className={classNames(styles.tab, item.id === currentId && styles.tabActive)}>
|
||||
{item.isPersisted ? (
|
||||
<Link
|
||||
to={Paths.BOARDS.replace(':id', item.id)}
|
||||
title={item.name}
|
||||
className={styles.link}
|
||||
>
|
||||
{item.name}
|
||||
</Link>
|
||||
) : (
|
||||
<span className={styles.link}>{item.name}</span>
|
||||
)}
|
||||
safeItems =>
|
||||
safeItems.map(item => (
|
||||
<div key={item.id} className={styles.tabWrapper}>
|
||||
<div className={classNames(styles.tab, item.id === currentId && styles.tabActive)}>
|
||||
{item.isPersisted ? (
|
||||
<Link
|
||||
to={Paths.BOARDS.replace(':id', item.id)}
|
||||
title={item.name}
|
||||
className={styles.link}
|
||||
>
|
||||
{item.name}
|
||||
</Link>
|
||||
) : (
|
||||
<span className={styles.link}>{item.name}</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)),
|
||||
)),
|
||||
[currentId],
|
||||
);
|
||||
|
||||
const renderEditableItems = useCallback(
|
||||
(safeItems) => safeItems.map((item, index) => (
|
||||
<Draggable
|
||||
key={item.id}
|
||||
draggableId={item.id}
|
||||
index={index}
|
||||
isDragDisabled={!item.isPersisted}
|
||||
>
|
||||
{({ innerRef, draggableProps, dragHandleProps }) => (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<div {...draggableProps} ref={innerRef} className={styles.tabWrapper}>
|
||||
<div className={classNames(styles.tab, item.id === currentId && styles.tabActive)}>
|
||||
{item.isPersisted ? (
|
||||
<Link
|
||||
{...dragHandleProps} // eslint-disable-line react/jsx-props-no-spreading
|
||||
to={Paths.BOARDS.replace(':id', item.id)}
|
||||
title={item.name}
|
||||
className={styles.link}
|
||||
>
|
||||
{item.name}
|
||||
</Link>
|
||||
) : (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<span {...dragHandleProps} className={styles.link}>
|
||||
{item.name}
|
||||
</span>
|
||||
)}
|
||||
{item.isPersisted && (
|
||||
<EditPopup
|
||||
defaultData={pick(item, 'name')}
|
||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
>
|
||||
<Button className={classNames(styles.editButton, styles.target)}>
|
||||
<Icon fitted name="pencil" size="small" />
|
||||
</Button>
|
||||
</EditPopup>
|
||||
)}
|
||||
safeItems =>
|
||||
safeItems.map((item, index) => (
|
||||
<Draggable
|
||||
key={item.id}
|
||||
draggableId={item.id}
|
||||
index={index}
|
||||
isDragDisabled={!item.isPersisted}
|
||||
>
|
||||
{({ innerRef, draggableProps, dragHandleProps }) => (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<div {...draggableProps} ref={innerRef} className={styles.tabWrapper}>
|
||||
<div className={classNames(styles.tab, item.id === currentId && styles.tabActive)}>
|
||||
{item.isPersisted ? (
|
||||
<Link
|
||||
{...dragHandleProps} // eslint-disable-line react/jsx-props-no-spreading
|
||||
to={Paths.BOARDS.replace(':id', item.id)}
|
||||
title={item.name}
|
||||
className={styles.link}
|
||||
>
|
||||
{item.name}
|
||||
</Link>
|
||||
) : (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<span {...dragHandleProps} className={styles.link}>
|
||||
{item.name}
|
||||
</span>
|
||||
)}
|
||||
{item.isPersisted && (
|
||||
<EditPopup
|
||||
defaultData={pick(item, 'name')}
|
||||
onUpdate={data => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
>
|
||||
<Button className={classNames(styles.editButton, styles.target)}>
|
||||
<Icon fitted name="pencil" size="small" />
|
||||
</Button>
|
||||
</EditPopup>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Draggable>
|
||||
)),
|
||||
)}
|
||||
</Draggable>
|
||||
)),
|
||||
[currentId, handleUpdate, handleDelete],
|
||||
);
|
||||
|
||||
|
|
|
@ -15,9 +15,7 @@ const StepTypes = {
|
|||
DELETE: 'DELETE',
|
||||
};
|
||||
|
||||
const EditStep = React.memo(({
|
||||
defaultData, onUpdate, onDelete, onClose,
|
||||
}) => {
|
||||
const EditStep = React.memo(({ defaultData, onUpdate, onDelete, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const [data, handleFieldChange] = useForm(() => ({
|
||||
|
|
|
@ -70,7 +70,7 @@ const ActionsStep = React.memo(
|
|||
}, [openStep]);
|
||||
|
||||
const handleDueDateUpdate = useCallback(
|
||||
(dueDate) => {
|
||||
dueDate => {
|
||||
onUpdate({
|
||||
dueDate,
|
||||
});
|
||||
|
@ -79,7 +79,7 @@ const ActionsStep = React.memo(
|
|||
);
|
||||
|
||||
const handleTimerUpdate = useCallback(
|
||||
(timer) => {
|
||||
timer => {
|
||||
onUpdate({
|
||||
timer,
|
||||
});
|
||||
|
|
|
@ -49,7 +49,7 @@ const Card = React.memo(
|
|||
}, []);
|
||||
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
newName => {
|
||||
onUpdate({
|
||||
name: newName,
|
||||
});
|
||||
|
@ -65,7 +65,7 @@ const Card = React.memo(
|
|||
<>
|
||||
{labels.length > 0 && (
|
||||
<span className={styles.labels}>
|
||||
{labels.map((label) => (
|
||||
{labels.map(label => (
|
||||
<span key={label.id} className={classNames(styles.attachment, styles.attachmentLeft)}>
|
||||
<Label name={label.name} color={label.color} size="tiny" />
|
||||
</span>
|
||||
|
@ -101,7 +101,7 @@ const Card = React.memo(
|
|||
)}
|
||||
{users.length > 0 && (
|
||||
<span className={classNames(styles.attachments, styles.attachmentsRight)}>
|
||||
{users.map((user) => (
|
||||
{users.map(user => (
|
||||
<span key={user.id} className={classNames(styles.attachment, styles.attachmentRight)}>
|
||||
<User name={user.name} avatar={user.avatar} size="tiny" />
|
||||
</span>
|
||||
|
@ -136,9 +136,9 @@ const Card = React.memo(
|
|||
isPersisted,
|
||||
}}
|
||||
projectMemberships={allProjectMemberships}
|
||||
currentUserIds={users.map((user) => user.id)}
|
||||
currentUserIds={users.map(user => user.id)}
|
||||
labels={allLabels}
|
||||
currentLabelIds={labels.map((label) => label.id)}
|
||||
currentLabelIds={labels.map(label => label.id)}
|
||||
onNameEdit={handleNameEdit}
|
||||
onUpdate={onUpdate}
|
||||
onDelete={onDelete}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
|
@ -52,7 +50,7 @@ const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||
);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
switch (event.key) {
|
||||
case 'Enter':
|
||||
event.preventDefault();
|
||||
|
|
|
@ -10,7 +10,7 @@ const Tasks = React.memo(({ items }) => {
|
|||
const [isOpened, toggleOpened] = useToggle();
|
||||
|
||||
const handleToggleClick = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
event.preventDefault();
|
||||
|
||||
toggleOpened();
|
||||
|
@ -18,7 +18,7 @@ const Tasks = React.memo(({ items }) => {
|
|||
[toggleOpened],
|
||||
);
|
||||
|
||||
const completedItems = items.filter((item) => item.isCompleted);
|
||||
const completedItems = items.filter(item => item.isCompleted);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -47,7 +47,7 @@ const Tasks = React.memo(({ items }) => {
|
|||
</div>
|
||||
{isOpened && (
|
||||
<ul className={styles.tasks}>
|
||||
{items.map((item) => (
|
||||
{items.map(item => (
|
||||
<li
|
||||
key={item.id}
|
||||
className={classNames(styles.task, item.isCompleted && styles.taskCompleted)}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
Comment, Icon, Loader, Visibility,
|
||||
} from 'semantic-ui-react';
|
||||
import { Comment, Icon, Loader, Visibility } from 'semantic-ui-react';
|
||||
|
||||
import { ActionTypes } from '../../../constants/Enums';
|
||||
import AddComment from './AddComment';
|
||||
|
@ -32,7 +30,7 @@ const Actions = React.memo(
|
|||
);
|
||||
|
||||
const handleCommentDelete = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onCommentDelete(id);
|
||||
},
|
||||
[onCommentDelete],
|
||||
|
@ -53,26 +51,28 @@ const Actions = React.memo(
|
|||
<div className={styles.moduleHeader}>{t('common.actions')}</div>
|
||||
<div className={styles.wrapper}>
|
||||
<Comment.Group>
|
||||
{items.map((item) => (item.type === ActionTypes.COMMENT_CARD ? (
|
||||
<Item.Comment
|
||||
key={item.id}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
isPersisted={item.isPersisted}
|
||||
user={item.user}
|
||||
isEditable={isEditable}
|
||||
onUpdate={(data) => handleCommentUpdate(item.id, data)}
|
||||
onDelete={() => handleCommentDelete(item.id)}
|
||||
/>
|
||||
) : (
|
||||
<Item
|
||||
key={item.id}
|
||||
type={item.type}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
user={item.user}
|
||||
/>
|
||||
)))}
|
||||
{items.map(item =>
|
||||
item.type === ActionTypes.COMMENT_CARD ? (
|
||||
<Item.Comment
|
||||
key={item.id}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
isPersisted={item.isPersisted}
|
||||
user={item.user}
|
||||
isEditable={isEditable}
|
||||
onUpdate={data => handleCommentUpdate(item.id, data)}
|
||||
onDelete={() => handleCommentDelete(item.id)}
|
||||
/>
|
||||
) : (
|
||||
<Item
|
||||
key={item.id}
|
||||
type={item.type}
|
||||
data={item.data}
|
||||
createdAt={item.createdAt}
|
||||
user={item.user}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
</Comment.Group>
|
||||
</div>
|
||||
{isFetching ? (
|
||||
|
|
|
@ -35,7 +35,7 @@ const AddComment = React.memo(({ onCreate }) => {
|
|||
}, [onCreate, data, setData]);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
if (event.ctrlKey && event.key === 'Enter') {
|
||||
submit();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import dequal from 'dequal';
|
||||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
|
@ -59,7 +57,7 @@ const EditComment = React.forwardRef(({ children, defaultData, onUpdate }, ref)
|
|||
);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
if (event.ctrlKey && event.key === 'Enter') {
|
||||
submit();
|
||||
}
|
||||
|
|
|
@ -10,9 +10,7 @@ import User from '../../User';
|
|||
|
||||
import styles from './Item.module.css';
|
||||
|
||||
const Item = React.memo(({
|
||||
type, data, createdAt, user,
|
||||
}) => {
|
||||
const Item = React.memo(({ type, data, createdAt, user }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
let contentNode;
|
||||
|
|
|
@ -12,9 +12,7 @@ import DeletePopup from '../../DeletePopup';
|
|||
import styles from './ItemComment.module.css';
|
||||
|
||||
const ItemComment = React.memo(
|
||||
({
|
||||
data, createdAt, isPersisted, user, isEditable, onUpdate, onDelete,
|
||||
}) => {
|
||||
({ data, createdAt, isPersisted, user, isEditable, onUpdate, onDelete }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const editComment = useRef(null);
|
||||
|
|
|
@ -2,9 +2,7 @@ import React, { useCallback } from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
Button, Grid, Icon, Modal,
|
||||
} from 'semantic-ui-react';
|
||||
import { Button, Grid, Icon, Modal } from 'semantic-ui-react';
|
||||
import { Markdown } from '../../lib/custom-ui';
|
||||
|
||||
import NameField from './NameField';
|
||||
|
@ -60,7 +58,7 @@ const CardModal = React.memo(
|
|||
const [t] = useTranslation();
|
||||
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
newName => {
|
||||
onUpdate({
|
||||
name: newName,
|
||||
});
|
||||
|
@ -69,7 +67,7 @@ const CardModal = React.memo(
|
|||
);
|
||||
|
||||
const handleDescriptionUpdate = useCallback(
|
||||
(newDescription) => {
|
||||
newDescription => {
|
||||
onUpdate({
|
||||
description: newDescription,
|
||||
});
|
||||
|
@ -78,7 +76,7 @@ const CardModal = React.memo(
|
|||
);
|
||||
|
||||
const handleDueDateUpdate = useCallback(
|
||||
(newDueDate) => {
|
||||
newDueDate => {
|
||||
onUpdate({
|
||||
dueDate: newDueDate,
|
||||
});
|
||||
|
@ -87,7 +85,7 @@ const CardModal = React.memo(
|
|||
);
|
||||
|
||||
const handleTimerUpdate = useCallback(
|
||||
(newTimer) => {
|
||||
newTimer => {
|
||||
onUpdate({
|
||||
timer: newTimer,
|
||||
});
|
||||
|
@ -101,8 +99,8 @@ const CardModal = React.memo(
|
|||
});
|
||||
}, [isSubscribed, onUpdate]);
|
||||
|
||||
const userIds = users.map((user) => user.id);
|
||||
const labelIds = labels.map((label) => label.id);
|
||||
const userIds = users.map(user => user.id);
|
||||
const labelIds = labels.map(label => label.id);
|
||||
|
||||
return (
|
||||
<Modal open closeIcon size="small" centered={false} onClose={onClose}>
|
||||
|
@ -128,7 +126,7 @@ const CardModal = React.memo(
|
|||
context: 'title',
|
||||
})}
|
||||
</div>
|
||||
{users.map((user) => (
|
||||
{users.map(user => (
|
||||
<span key={user.id} className={styles.attachment}>
|
||||
<ProjectMembershipsPopup
|
||||
items={allProjectMemberships}
|
||||
|
@ -162,7 +160,7 @@ const CardModal = React.memo(
|
|||
context: 'title',
|
||||
})}
|
||||
</div>
|
||||
{labels.map((label) => (
|
||||
{labels.map(label => (
|
||||
<span key={label.id} className={styles.attachment}>
|
||||
<LabelsPopup
|
||||
key={label.id}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
|
@ -53,7 +51,7 @@ const EditDescription = React.forwardRef(({ children, defaultValue, onUpdate },
|
|||
}, [open]);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
if (event.ctrlKey && event.key === 'Enter') {
|
||||
submit();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ const NameField = React.memo(({ defaultValue, onUpdate }) => {
|
|||
isFocused.current = true;
|
||||
}, []);
|
||||
|
||||
const handleKeyDown = useCallback((event) => {
|
||||
const handleKeyDown = useCallback(event => {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
|
@ -62,7 +60,7 @@ const Add = React.forwardRef(({ children, onCreate }, ref) => {
|
|||
}, [open]);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
|
@ -52,7 +50,7 @@ const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||
);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
|
||||
|
|
|
@ -8,9 +8,7 @@ import ActionsPopup from './ActionsPopup';
|
|||
|
||||
import styles from './Item.module.css';
|
||||
|
||||
const Item = React.memo(({
|
||||
name, isCompleted, isPersisted, onUpdate, onDelete,
|
||||
}) => {
|
||||
const Item = React.memo(({ name, isCompleted, isPersisted, onUpdate, onDelete }) => {
|
||||
const editName = useRef(null);
|
||||
|
||||
const handleClick = useCallback(() => {
|
||||
|
@ -20,7 +18,7 @@ const Item = React.memo(({
|
|||
}, [isPersisted]);
|
||||
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
newName => {
|
||||
onUpdate({
|
||||
name: newName,
|
||||
});
|
||||
|
|
|
@ -8,9 +8,7 @@ import Add from './Add';
|
|||
|
||||
import styles from './Tasks.module.css';
|
||||
|
||||
const Tasks = React.memo(({
|
||||
items, onCreate, onUpdate, onDelete,
|
||||
}) => {
|
||||
const Tasks = React.memo(({ items, onCreate, onUpdate, onDelete }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleUpdate = useCallback(
|
||||
|
@ -21,13 +19,13 @@ const Tasks = React.memo(({
|
|||
);
|
||||
|
||||
const handleDelete = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
);
|
||||
|
||||
const completedItems = items.filter((item) => item.isCompleted);
|
||||
const completedItems = items.filter(item => item.isCompleted);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -41,13 +39,13 @@ const Tasks = React.memo(({
|
|||
className={styles.progress}
|
||||
/>
|
||||
)}
|
||||
{items.map((item) => (
|
||||
{items.map(item => (
|
||||
<Item
|
||||
key={item.id}
|
||||
name={item.name}
|
||||
isCompleted={item.isCompleted}
|
||||
isPersisted={item.isPersisted}
|
||||
onUpdate={(data) => handleUpdate(item.id, data)}
|
||||
onUpdate={data => handleUpdate(item.id, data)}
|
||||
onDelete={() => handleDelete(item.id)}
|
||||
/>
|
||||
))}
|
||||
|
|
|
@ -5,9 +5,7 @@ import { Popup } from '../../lib/custom-ui';
|
|||
|
||||
import styles from './DeleteStep.module.css';
|
||||
|
||||
const DeleteStep = React.memo(({
|
||||
title, content, buttonContent, onConfirm, onBack,
|
||||
}) => (
|
||||
const DeleteStep = React.memo(({ title, content, buttonContent, onConfirm, onBack }) => (
|
||||
<>
|
||||
<Popup.Header onBack={onBack}>{title}</Popup.Header>
|
||||
<Popup.Content>
|
||||
|
|
|
@ -35,9 +35,7 @@ const FORMATS = {
|
|||
medium: 'longDateTime',
|
||||
};
|
||||
|
||||
const DueDate = React.memo(({
|
||||
value, size, isDisabled, onClick,
|
||||
}) => {
|
||||
const DueDate = React.memo(({ value, size, isDisabled, onClick }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const style = {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useMemo, useRef,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import DatePicker from 'react-datepicker';
|
||||
|
@ -12,9 +10,7 @@ import { useForm } from '../../hooks';
|
|||
|
||||
import styles from './EditDueDateStep.module.css';
|
||||
|
||||
const EditDueDateStep = React.memo(({
|
||||
defaultValue, onUpdate, onBack, onClose,
|
||||
}) => {
|
||||
const EditDueDateStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const [data, handleFieldChange, setData] = useForm(() => {
|
||||
|
@ -51,8 +47,8 @@ const EditDueDateStep = React.memo(({
|
|||
}, [data.date, t]);
|
||||
|
||||
const handleDatePickerChange = useCallback(
|
||||
(date) => {
|
||||
setData((prevData) => ({
|
||||
date => {
|
||||
setData(prevData => ({
|
||||
...prevData,
|
||||
date: t('format:date', {
|
||||
postProcess: 'formatDate',
|
||||
|
|
|
@ -7,13 +7,11 @@ import { useToggle } from '../../lib/hooks';
|
|||
import { Input, Popup } from '../../lib/custom-ui';
|
||||
|
||||
import { useForm } from '../../hooks';
|
||||
import {
|
||||
createTimer, getTimerParts, startTimer, stopTimer, updateTimer,
|
||||
} from '../../utils/timer';
|
||||
import { createTimer, getTimerParts, startTimer, stopTimer, updateTimer } from '../../utils/timer';
|
||||
|
||||
import styles from './EditTimerStep.module.css';
|
||||
|
||||
const createData = (timer) => {
|
||||
const createData = timer => {
|
||||
if (!timer) {
|
||||
return {
|
||||
hours: '0',
|
||||
|
@ -31,9 +29,7 @@ const createData = (timer) => {
|
|||
};
|
||||
};
|
||||
|
||||
const EditTimerStep = React.memo(({
|
||||
defaultValue, onUpdate, onBack, onClose,
|
||||
}) => {
|
||||
const EditTimerStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [data, handleFieldChange, setData] = useForm(() => createData(defaultValue));
|
||||
const [isEditing, toggleEdit] = useToggle();
|
||||
|
@ -158,8 +154,8 @@ const EditTimerStep = React.memo(({
|
|||
</div>
|
||||
{isEditing && <Button positive content={t('action.save')} />}
|
||||
</Form>
|
||||
{!isEditing
|
||||
&& (defaultValue && defaultValue.startedAt ? (
|
||||
{!isEditing &&
|
||||
(defaultValue && defaultValue.startedAt ? (
|
||||
<Button positive content={t('action.stop')} icon="pause" onClick={handleStopClick} />
|
||||
) : (
|
||||
<Button positive content={t('action.start')} icon="play" onClick={handleStartClick} />
|
||||
|
|
|
@ -16,7 +16,7 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
|
|||
const [t] = useTranslation();
|
||||
|
||||
const handleDelete = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
|
@ -77,28 +77,28 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
|
|||
<Popup.Header>{t('common.notifications')}</Popup.Header>
|
||||
<Popup.Content>
|
||||
{items.length > 0
|
||||
? items.map((item) => (
|
||||
<div key={item.id} className={styles.wrapper}>
|
||||
{item.card && item.action ? (
|
||||
<>
|
||||
<User
|
||||
name={item.action.user.name}
|
||||
avatar={item.action.user.avatar}
|
||||
size="large"
|
||||
/>
|
||||
<span className={styles.content}>{renderItemContent(item)}</span>
|
||||
</>
|
||||
) : (
|
||||
<div className={styles.deletedContent}>{t('common.cardOrActionAreDeleted')}</div>
|
||||
)}
|
||||
<Button
|
||||
type="button"
|
||||
icon="close"
|
||||
className={styles.button}
|
||||
onClick={() => handleDelete(item.id)}
|
||||
/>
|
||||
</div>
|
||||
))
|
||||
? items.map(item => (
|
||||
<div key={item.id} className={styles.wrapper}>
|
||||
{item.card && item.action ? (
|
||||
<>
|
||||
<User
|
||||
name={item.action.user.name}
|
||||
avatar={item.action.user.avatar}
|
||||
size="large"
|
||||
/>
|
||||
<span className={styles.content}>{renderItemContent(item)}</span>
|
||||
</>
|
||||
) : (
|
||||
<div className={styles.deletedContent}>{t('common.cardOrActionAreDeleted')}</div>
|
||||
)}
|
||||
<Button
|
||||
type="button"
|
||||
icon="close"
|
||||
className={styles.button}
|
||||
onClick={() => handleDelete(item.id)}
|
||||
/>
|
||||
</div>
|
||||
))
|
||||
: t('common.noUnreadNotifications')}
|
||||
</Popup.Content>
|
||||
</>
|
||||
|
|
|
@ -34,9 +34,7 @@ const STYLES = {
|
|||
},
|
||||
};
|
||||
|
||||
const Label = React.memo(({
|
||||
name, color, size, isDisabled, onClick,
|
||||
}) => {
|
||||
const Label = React.memo(({ name, color, size, isDisabled, onClick }) => {
|
||||
const style = {
|
||||
...STYLES[size],
|
||||
background: LabelColors.MAP[color],
|
||||
|
|
|
@ -16,9 +16,7 @@ const StepTypes = {
|
|||
DELETE: 'DELETE',
|
||||
};
|
||||
|
||||
const EditStep = React.memo(({
|
||||
defaultData, onUpdate, onDelete, onBack,
|
||||
}) => {
|
||||
const EditStep = React.memo(({ defaultData, onUpdate, onDelete, onBack }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const [data, handleFieldChange] = useForm(() => ({
|
||||
|
|
|
@ -7,9 +7,7 @@ import LabelColors from '../../constants/LabelColors';
|
|||
|
||||
import styles from './Item.module.css';
|
||||
|
||||
const Item = React.memo(({
|
||||
name, color, isPersisted, isActive, onSelect, onDeselect, onEdit,
|
||||
}) => {
|
||||
const Item = React.memo(({ name, color, isPersisted, isActive, onSelect, onDeselect, onEdit }) => {
|
||||
const handleToggleClick = useCallback(() => {
|
||||
if (isActive) {
|
||||
onDeselect();
|
||||
|
|
|
@ -18,9 +18,7 @@ const StepTypes = {
|
|||
};
|
||||
|
||||
const LabelsStep = React.memo(
|
||||
({
|
||||
items, currentIds, title, onSelect, onDeselect, onCreate, onUpdate, onDelete, onBack,
|
||||
}) => {
|
||||
({ items, currentIds, title, onSelect, onDeselect, onCreate, onUpdate, onDelete, onBack }) => {
|
||||
const [t] = useTranslation();
|
||||
const [step, openStep, handleBack] = useSteps();
|
||||
|
||||
|
@ -29,7 +27,7 @@ const LabelsStep = React.memo(
|
|||
}, [openStep]);
|
||||
|
||||
const handleEdit = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
openStep(StepTypes.EDIT, {
|
||||
id,
|
||||
});
|
||||
|
@ -38,14 +36,14 @@ const LabelsStep = React.memo(
|
|||
);
|
||||
|
||||
const handleSelect = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onSelect(id);
|
||||
},
|
||||
[onSelect],
|
||||
);
|
||||
|
||||
const handleDeselect = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onDeselect(id);
|
||||
},
|
||||
[onDeselect],
|
||||
|
@ -59,7 +57,7 @@ const LabelsStep = React.memo(
|
|||
);
|
||||
|
||||
const handleDelete = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onDelete(id);
|
||||
},
|
||||
[onDelete],
|
||||
|
@ -70,13 +68,13 @@ const LabelsStep = React.memo(
|
|||
case StepTypes.ADD:
|
||||
return <AddStep onCreate={onCreate} onBack={handleBack} />;
|
||||
case StepTypes.EDIT: {
|
||||
const currentItem = items.find((item) => item.id === step.params.id);
|
||||
const currentItem = items.find(item => item.id === step.params.id);
|
||||
|
||||
if (currentItem) {
|
||||
return (
|
||||
<EditStep
|
||||
defaultData={pick(currentItem, ['name', 'color'])}
|
||||
onUpdate={(data) => handleUpdate(currentItem.id, data)}
|
||||
onUpdate={data => handleUpdate(currentItem.id, data)}
|
||||
onDelete={() => handleDelete(currentItem.id)}
|
||||
onBack={handleBack}
|
||||
/>
|
||||
|
@ -95,7 +93,7 @@ const LabelsStep = React.memo(
|
|||
<>
|
||||
<Popup.Header onBack={onBack}>{t(title)}</Popup.Header>
|
||||
<Popup.Content>
|
||||
{items.map((item) => (
|
||||
{items.map(item => (
|
||||
<Item
|
||||
key={item.id}
|
||||
name={item.name}
|
||||
|
|
|
@ -14,9 +14,7 @@ const StepTypes = {
|
|||
DELETE: 'DELETE',
|
||||
};
|
||||
|
||||
const ActionsStep = React.memo(({
|
||||
onNameEdit, onCardAdd, onDelete, onClose,
|
||||
}) => {
|
||||
const ActionsStep = React.memo(({ onNameEdit, onCardAdd, onDelete, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [step, openStep, handleBack] = useSteps();
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
|
@ -62,7 +60,7 @@ const AddCard = React.forwardRef(({ children, onCreate }, ref) => {
|
|||
}, [open]);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
switch (event.key) {
|
||||
case 'Enter':
|
||||
event.preventDefault();
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useImperativeHandle, useRef, useState,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
import { TextArea } from 'semantic-ui-react';
|
||||
|
@ -44,12 +42,12 @@ const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
|||
[open, close],
|
||||
);
|
||||
|
||||
const handleFieldClick = useCallback((event) => {
|
||||
const handleFieldClick = useCallback(event => {
|
||||
event.stopPropagation();
|
||||
}, []);
|
||||
|
||||
const handleFieldKeyDown = useCallback(
|
||||
(event) => {
|
||||
event => {
|
||||
switch (event.key) {
|
||||
case 'Enter':
|
||||
event.preventDefault();
|
||||
|
|
|
@ -15,9 +15,7 @@ import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-ic
|
|||
import styles from './List.module.css';
|
||||
|
||||
const List = React.memo(
|
||||
({
|
||||
id, index, name, isPersisted, cardIds, onUpdate, onDelete, onCardCreate,
|
||||
}) => {
|
||||
({ id, index, name, isPersisted, cardIds, onUpdate, onDelete, onCardCreate }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const addCard = useRef(null);
|
||||
|
@ -30,7 +28,7 @@ const List = React.memo(
|
|||
}, [isPersisted]);
|
||||
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
newName => {
|
||||
onUpdate({
|
||||
name: newName,
|
||||
});
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useMemo, useRef,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import isEmail from 'validator/lib/isEmail';
|
||||
import {
|
||||
Form, Grid, Header, Message,
|
||||
} from 'semantic-ui-react';
|
||||
import { Form, Grid, Header, Message } from 'semantic-ui-react';
|
||||
import { useDidUpdate, usePrevious, useToggle } from '../../lib/hooks';
|
||||
import { Input } from '../../lib/custom-ui';
|
||||
|
||||
|
@ -15,7 +11,7 @@ import { useForm } from '../../hooks';
|
|||
|
||||
import styles from './Login.module.css';
|
||||
|
||||
const createMessage = (error) => {
|
||||
const createMessage = error => {
|
||||
if (!error) {
|
||||
return error;
|
||||
}
|
||||
|
@ -50,9 +46,7 @@ const createMessage = (error) => {
|
|||
};
|
||||
|
||||
const Login = React.memo(
|
||||
({
|
||||
defaultData, isSubmitting, error, onAuthenticate, onMessageDismiss,
|
||||
}) => {
|
||||
({ defaultData, isSubmitting, error, onAuthenticate, onMessageDismiss }) => {
|
||||
const [t] = useTranslation();
|
||||
const wasSubmitting = usePrevious(isSubmitting);
|
||||
|
||||
|
@ -99,7 +93,7 @@ const Login = React.memo(
|
|||
|
||||
break;
|
||||
case 'Password is not valid':
|
||||
setData((prevData) => ({
|
||||
setData(prevData => ({
|
||||
...prevData,
|
||||
password: '',
|
||||
}));
|
||||
|
|
|
@ -8,13 +8,11 @@ import UserItem from './UserItem';
|
|||
|
||||
import styles from './AddMembershipPopup.module.css';
|
||||
|
||||
const AddMembershipStep = React.memo(({
|
||||
users, currentUserIds, onCreate, onClose,
|
||||
}) => {
|
||||
const AddMembershipStep = React.memo(({ users, currentUserIds, onCreate, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleUserSelect = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onCreate({
|
||||
userId: id,
|
||||
});
|
||||
|
@ -33,7 +31,7 @@ const AddMembershipStep = React.memo(({
|
|||
</Popup.Header>
|
||||
<Popup.Content>
|
||||
<div className={styles.menu}>
|
||||
{users.map((user) => (
|
||||
{users.map(user => (
|
||||
<UserItem
|
||||
key={user.id}
|
||||
name={user.name}
|
||||
|
|
|
@ -6,9 +6,7 @@ import User from '../../User';
|
|||
|
||||
import styles from './UserItem.module.css';
|
||||
|
||||
const UserItem = React.memo(({
|
||||
name, avatar, isActive, onSelect,
|
||||
}) => (
|
||||
const UserItem = React.memo(({ name, avatar, isActive, onSelect }) => (
|
||||
<button
|
||||
type="button"
|
||||
disabled={isActive}
|
||||
|
|
|
@ -15,9 +15,7 @@ const StepTypes = {
|
|||
DELETE: 'DELETE',
|
||||
};
|
||||
|
||||
const EditStep = React.memo(({
|
||||
defaultData, onUpdate, onDelete, onClose,
|
||||
}) => {
|
||||
const EditStep = React.memo(({ defaultData, onUpdate, onDelete, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const [data, handleFieldChange] = useForm(() => ({
|
||||
|
|
|
@ -22,7 +22,7 @@ const Project = React.memo(
|
|||
onMembershipDelete,
|
||||
}) => {
|
||||
const handleMembershipDelete = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onMembershipDelete(id);
|
||||
},
|
||||
[onMembershipDelete],
|
||||
|
@ -47,7 +47,7 @@ const Project = React.memo(
|
|||
<span className={styles.name}>{name}</span>
|
||||
)}
|
||||
<span className={styles.users}>
|
||||
{memberships.map((membership) => (
|
||||
{memberships.map(membership => (
|
||||
<span key={membership.id} className={styles.user}>
|
||||
<EditMembershipPopup
|
||||
user={membership.user}
|
||||
|
@ -67,7 +67,7 @@ const Project = React.memo(
|
|||
{isEditable && (
|
||||
<AddMembershipPopup
|
||||
users={allUsers}
|
||||
currentUserIds={memberships.map((membership) => membership.user.id)}
|
||||
currentUserIds={memberships.map(membership => membership.user.id)}
|
||||
onCreate={onMembershipCreate}
|
||||
>
|
||||
<Button icon="add user" className={styles.addUser} />
|
||||
|
|
|
@ -7,9 +7,7 @@ import User from '../User';
|
|||
|
||||
import styles from './Item.module.css';
|
||||
|
||||
const Item = React.memo(({
|
||||
isPersisted, isActive, user, onUserSelect, onUserDeselect,
|
||||
}) => {
|
||||
const Item = React.memo(({ isPersisted, isActive, user, onUserSelect, onUserDeselect }) => {
|
||||
const handleToggleClick = useCallback(() => {
|
||||
if (isActive) {
|
||||
onUserDeselect();
|
||||
|
|
|
@ -9,20 +9,18 @@ import Item from './Item';
|
|||
import styles from './ProjectMembershipsStep.module.css';
|
||||
|
||||
const ProjectMembershipsStep = React.memo(
|
||||
({
|
||||
items, currentUserIds, title, onUserSelect, onUserDeselect, onBack,
|
||||
}) => {
|
||||
({ items, currentUserIds, title, onUserSelect, onUserDeselect, onBack }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleUserSelect = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onUserSelect(id);
|
||||
},
|
||||
[onUserSelect],
|
||||
);
|
||||
|
||||
const handleUserDeselect = useCallback(
|
||||
(id) => {
|
||||
id => {
|
||||
onUserDeselect(id);
|
||||
},
|
||||
[onUserDeselect],
|
||||
|
@ -33,7 +31,7 @@ const ProjectMembershipsStep = React.memo(
|
|||
<Popup.Header onBack={onBack}>{t(title)}</Popup.Header>
|
||||
<Popup.Content>
|
||||
<Menu secondary vertical className={styles.menu}>
|
||||
{items.map((item) => (
|
||||
{items.map(item => (
|
||||
<Item
|
||||
key={item.id}
|
||||
isPersisted={item.isPersisted}
|
||||
|
|
|
@ -12,16 +12,14 @@ import { ReactComponent as PlusIcon } from '../../assets/images/plus-icon.svg';
|
|||
|
||||
import styles from './Projects.module.css';
|
||||
|
||||
const Projects = React.memo(({
|
||||
items, currentId, isEditable, onAdd,
|
||||
}) => {
|
||||
const Projects = React.memo(({ items, currentId, isEditable, onAdd }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
if (isUndefined(currentId)) {
|
||||
return (
|
||||
<Container className={styles.cardsWrapper}>
|
||||
<Grid className={styles.gridFix}>
|
||||
{items.map((item) => (
|
||||
{items.map(item => (
|
||||
<Grid.Column key={item.id} mobile={8} computer={4}>
|
||||
<Link
|
||||
to={
|
||||
|
|
|
@ -32,9 +32,7 @@ const STYLES = {
|
|||
},
|
||||
};
|
||||
|
||||
const Timer = React.memo(({
|
||||
startedAt, total, size, isDisabled, onClick,
|
||||
}) => {
|
||||
const Timer = React.memo(({ startedAt, total, size, isDisabled, onClick }) => {
|
||||
const prevStartedAt = usePrevious(startedAt);
|
||||
const forceUpdate = useForceUpdate();
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ const COLORS = [
|
|||
'#2c3e50', // Midnight blue
|
||||
];
|
||||
|
||||
const getColor = (name) => {
|
||||
const getColor = name => {
|
||||
let sum = 0;
|
||||
for (let i = 0; i < name.length; i += 1) {
|
||||
sum += name.charCodeAt(i);
|
||||
|
@ -64,9 +64,7 @@ const getColor = (name) => {
|
|||
return COLORS[sum % COLORS.length];
|
||||
};
|
||||
|
||||
const User = React.memo(({
|
||||
name, avatar, size, isDisabled, onClick,
|
||||
}) => {
|
||||
const User = React.memo(({ name, avatar, size, isDisabled, onClick }) => {
|
||||
const style = {
|
||||
...STYLES[size],
|
||||
background: avatar ? `url("${avatar}")` : getColor(name),
|
||||
|
|
|
@ -9,9 +9,7 @@ import User from '../User';
|
|||
import styles from './EditAvatarStep.module.css';
|
||||
|
||||
const EditAvatarStep = React.memo(
|
||||
({
|
||||
defaultValue, name, isUploading, onUpload, onClear, onBack,
|
||||
}) => {
|
||||
({ defaultValue, name, isUploading, onUpload, onClear, onBack }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const field = useRef(null);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import isEmail from 'validator/lib/isEmail';
|
||||
import React, {
|
||||
useCallback, useEffect, useMemo, useRef,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Message } from 'semantic-ui-react';
|
||||
|
@ -12,7 +10,7 @@ import { useForm } from '../../hooks';
|
|||
|
||||
import styles from './EditNameStep.module.css';
|
||||
|
||||
const createMessage = (error) => {
|
||||
const createMessage = error => {
|
||||
if (!error) {
|
||||
return error;
|
||||
}
|
||||
|
@ -37,9 +35,7 @@ const createMessage = (error) => {
|
|||
};
|
||||
|
||||
const EditEmailStep = React.memo(
|
||||
({
|
||||
defaultData, email, isSubmitting, error, onUpdate, onMessageDismiss, onBack, onClose,
|
||||
}) => {
|
||||
({ defaultData, email, isSubmitting, error, onUpdate, onMessageDismiss, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const wasSubmitting = usePrevious(isSubmitting);
|
||||
|
||||
|
@ -92,7 +88,7 @@ const EditEmailStep = React.memo(
|
|||
|
||||
break;
|
||||
case 'Current password is not valid':
|
||||
setData((prevData) => ({
|
||||
setData(prevData => ({
|
||||
...prevData,
|
||||
currentPassword: '',
|
||||
}));
|
||||
|
|
|
@ -8,9 +8,7 @@ import { useField } from '../../hooks';
|
|||
|
||||
import styles from './EditNameStep.module.css';
|
||||
|
||||
const EditNameStep = React.memo(({
|
||||
defaultValue, onUpdate, onBack, onClose,
|
||||
}) => {
|
||||
const EditNameStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const [value, handleFieldChange] = useField(defaultValue);
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import React, {
|
||||
useCallback, useEffect, useMemo, useRef,
|
||||
} from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Message } from 'semantic-ui-react';
|
||||
|
@ -11,7 +9,7 @@ import { useForm } from '../../hooks';
|
|||
|
||||
import styles from './EditNameStep.module.css';
|
||||
|
||||
const createMessage = (error) => {
|
||||
const createMessage = error => {
|
||||
if (!error) {
|
||||
return error;
|
||||
}
|
||||
|
@ -31,9 +29,7 @@ const createMessage = (error) => {
|
|||
};
|
||||
|
||||
const EditPasswordStep = React.memo(
|
||||
({
|
||||
defaultData, isSubmitting, error, onUpdate, onMessageDismiss, onBack, onClose,
|
||||
}) => {
|
||||
({ defaultData, isSubmitting, error, onUpdate, onMessageDismiss, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const wasSubmitting = usePrevious(isSubmitting);
|
||||
|
||||
|
@ -72,7 +68,7 @@ const EditPasswordStep = React.memo(
|
|||
if (!error) {
|
||||
onClose();
|
||||
} else if (error.message === 'Current password is not valid') {
|
||||
setData((prevData) => ({
|
||||
setData(prevData => ({
|
||||
...prevData,
|
||||
currentPassword: '',
|
||||
}));
|
||||
|
|
|
@ -57,7 +57,7 @@ const UserStep = React.memo(
|
|||
}, [openStep]);
|
||||
|
||||
const handleNameUpdate = useCallback(
|
||||
(newName) => {
|
||||
newName => {
|
||||
onUpdate({
|
||||
name: newName,
|
||||
});
|
||||
|
|
|
@ -7,9 +7,7 @@ import DeletePopup from '../DeletePopup';
|
|||
|
||||
import styles from './Item.module.css';
|
||||
|
||||
const Item = React.memo(({
|
||||
name, email, isAdmin, onUpdate, onDelete,
|
||||
}) => {
|
||||
const Item = React.memo(({ name, email, isAdmin, onUpdate, onDelete }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleIsAdminChange = useCallback(() => {
|
||||
|
|
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