mirror of
https://github.com/plankanban/planka.git
synced 2025-07-20 13:49:43 +02:00
Prepare for collection board type, refactoring, update dependencies
This commit is contained in:
parent
2d92ade8dc
commit
c6ee7d54bb
190 changed files with 2144 additions and 1817 deletions
1877
client/package-lock.json
generated
1877
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -48,47 +48,47 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"connected-react-router": "^6.8.0",
|
"connected-react-router": "^6.8.0",
|
||||||
"date-fns": "^2.14.0",
|
"date-fns": "^2.15.0",
|
||||||
"dequal": "^1.0.0",
|
"dequal": "^1.0.1",
|
||||||
"history": "^4.10.1",
|
"history": "^4.10.1",
|
||||||
"i18next": "^19.4.5",
|
"i18next": "^19.6.3",
|
||||||
"i18next-browser-languagedetector": "^4.2.0",
|
"i18next-browser-languagedetector": "^5.0.0",
|
||||||
"initials": "^3.1.0",
|
"initials": "^3.1.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.19",
|
||||||
"node-sass": "^4.14.1",
|
"node-sass": "^4.14.1",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react": "^16.13.1",
|
"react": "^16.13.1",
|
||||||
"react-beautiful-dnd": "^13.0.0",
|
"react-beautiful-dnd": "^13.0.0",
|
||||||
"react-datepicker": "^3.0.0",
|
"react-datepicker": "^3.1.3",
|
||||||
"react-dom": "^16.13.1",
|
"react-dom": "^16.13.1",
|
||||||
"react-dropzone": "^11.0.1",
|
"react-dropzone": "^11.0.2",
|
||||||
"react-i18next": "^11.5.0",
|
"react-i18next": "^11.7.0",
|
||||||
"react-input-mask": "^2.0.4",
|
"react-input-mask": "^2.0.4",
|
||||||
"react-markdown": "^4.3.1",
|
"react-markdown": "^4.3.1",
|
||||||
"react-redux": "^7.2.0",
|
"react-redux": "^7.2.1",
|
||||||
"react-router-dom": "^5.2.0",
|
"react-router-dom": "^5.2.0",
|
||||||
"react-scripts": "3.4.1",
|
"react-scripts": "3.4.1",
|
||||||
"react-textarea-autosize": "^8.0.1",
|
"react-textarea-autosize": "^8.2.0",
|
||||||
"redux": "^4.0.5",
|
"redux": "^4.0.5",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"redux-orm": "^0.16.1",
|
"redux-orm": "^0.16.1",
|
||||||
"redux-saga": "^1.1.3",
|
"redux-saga": "^1.1.3",
|
||||||
"reselect": "^4.0.0",
|
"reselect": "^4.0.0",
|
||||||
"sails.io.js": "^1.2.1",
|
"sails.io.js": "^1.2.1",
|
||||||
"semantic-ui-react": "^0.88.2",
|
"semantic-ui-react": "^1.1.1",
|
||||||
"socket.io-client": "^2.3.0",
|
"socket.io-client": "^2.3.0",
|
||||||
"validator": "^13.0.0",
|
"validator": "^13.1.1",
|
||||||
"whatwg-fetch": "^3.0.0"
|
"whatwg-fetch": "^3.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-config-airbnb": "^18.1.0",
|
"eslint-config-airbnb": "^18.2.0",
|
||||||
"eslint-config-prettier": "^6.11.0",
|
"eslint-config-prettier": "^6.11.0",
|
||||||
"eslint-plugin-import": "^2.21.1",
|
"eslint-plugin-import": "^2.22.0",
|
||||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
"eslint-plugin-jsx-a11y": "^6.3.1",
|
||||||
"eslint-plugin-prettier": "^3.1.3",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"eslint-plugin-react": "^7.20.0",
|
"eslint-plugin-react": "^7.20.5",
|
||||||
"eslint-plugin-react-hooks": "^4.0.4",
|
"eslint-plugin-react-hooks": "^4.0.8",
|
||||||
"prettier": "2.0.5"
|
"prettier": "2.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ export const fetchBoardRequested = (id) => ({
|
||||||
|
|
||||||
export const fetchBoardSucceeded = (
|
export const fetchBoardSucceeded = (
|
||||||
board,
|
board,
|
||||||
lists,
|
|
||||||
labels,
|
labels,
|
||||||
|
lists,
|
||||||
cards,
|
cards,
|
||||||
cardMemberships,
|
cardMemberships,
|
||||||
cardLabels,
|
cardLabels,
|
||||||
|
@ -81,8 +81,8 @@ export const fetchBoardSucceeded = (
|
||||||
type: ActionTypes.BOARD_FETCH_SUCCEEDED,
|
type: ActionTypes.BOARD_FETCH_SUCCEEDED,
|
||||||
payload: {
|
payload: {
|
||||||
board,
|
board,
|
||||||
lists,
|
|
||||||
labels,
|
labels,
|
||||||
|
lists,
|
||||||
cards,
|
cards,
|
||||||
cardMemberships,
|
cardMemberships,
|
||||||
cardLabels,
|
cardLabels,
|
||||||
|
|
|
@ -4,8 +4,8 @@ export * from './user';
|
||||||
export * from './project';
|
export * from './project';
|
||||||
export * from './project-membership';
|
export * from './project-membership';
|
||||||
export * from './board';
|
export * from './board';
|
||||||
export * from './list';
|
|
||||||
export * from './label';
|
export * from './label';
|
||||||
|
export * from './list';
|
||||||
export * from './card';
|
export * from './card';
|
||||||
export * from './task';
|
export * from './task';
|
||||||
export * from './attachment';
|
export * from './attachment';
|
||||||
|
|
|
@ -15,10 +15,10 @@ export const openUserSettingsModal = () => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const openAddProjectModal = () => ({
|
export const openProjectAddModal = () => ({
|
||||||
type: EntryActionTypes.MODAL_OPEN,
|
type: EntryActionTypes.MODAL_OPEN,
|
||||||
payload: {
|
payload: {
|
||||||
type: ModalTypes.ADD_PROJECT,
|
type: ModalTypes.PROJECT_ADD,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ export * from './projects';
|
||||||
export * from './project';
|
export * from './project';
|
||||||
export * from './project-membership';
|
export * from './project-membership';
|
||||||
export * from './board';
|
export * from './board';
|
||||||
export * from './list';
|
|
||||||
export * from './label';
|
export * from './label';
|
||||||
|
export * from './list';
|
||||||
export * from './card';
|
export * from './card';
|
||||||
export * from './card-membership';
|
export * from './card-membership';
|
||||||
export * from './card-label';
|
export * from './card-label';
|
||||||
|
|
|
@ -35,8 +35,18 @@ export const transformCardData = (data) => ({
|
||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
const createCard = (listId, data, headers) =>
|
const getCards = (boardId, data, headers) =>
|
||||||
socket.post(`/lists/${listId}/cards`, transformCardData(data), headers).then((body) => ({
|
socket.get(`/board/${boardId}/cards`, data, headers).then((body) => ({
|
||||||
|
...body,
|
||||||
|
items: body.items.map(transformCard),
|
||||||
|
included: {
|
||||||
|
...body.included,
|
||||||
|
attachments: body.included.attachments.map(transformAttachment),
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
const createCard = (boardId, data, headers) =>
|
||||||
|
socket.post(`/boards/${boardId}/cards`, transformCardData(data), headers).then((body) => ({
|
||||||
...body,
|
...body,
|
||||||
item: transformCard(body.item),
|
item: transformCard(body.item),
|
||||||
included: {
|
included: {
|
||||||
|
@ -86,6 +96,7 @@ const makeHandleCardUpdate = (next) => (body) => {
|
||||||
const makeHandleCardDelete = makeHandleCardUpdate;
|
const makeHandleCardDelete = makeHandleCardUpdate;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
getCards,
|
||||||
createCard,
|
createCard,
|
||||||
getCard,
|
getCard,
|
||||||
updateCard,
|
updateCard,
|
||||||
|
|
|
@ -5,8 +5,8 @@ import users from './users';
|
||||||
import projects from './projects';
|
import projects from './projects';
|
||||||
import projectMemberships from './project-memberships';
|
import projectMemberships from './project-memberships';
|
||||||
import boards from './boards';
|
import boards from './boards';
|
||||||
import lists from './lists';
|
|
||||||
import labels from './labels';
|
import labels from './labels';
|
||||||
|
import lists from './lists';
|
||||||
import cards from './cards';
|
import cards from './cards';
|
||||||
import cardMemberships from './card-memberships';
|
import cardMemberships from './card-memberships';
|
||||||
import cardLabels from './card-labels';
|
import cardLabels from './card-labels';
|
||||||
|
@ -24,8 +24,8 @@ export default {
|
||||||
...projects,
|
...projects,
|
||||||
...projectMemberships,
|
...projectMemberships,
|
||||||
...boards,
|
...boards,
|
||||||
...lists,
|
|
||||||
...labels,
|
...labels,
|
||||||
|
...lists,
|
||||||
...cards,
|
...cards,
|
||||||
...cardMemberships,
|
...cardMemberships,
|
||||||
...cardLabels,
|
...cardLabels,
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
import AddProjectModal from './AddProjectModal';
|
|
||||||
|
|
||||||
export default AddProjectModal;
|
|
|
@ -1,3 +0,0 @@
|
||||||
import AddUserPopup from './AddUserPopup';
|
|
||||||
|
|
||||||
export default AddUserPopup;
|
|
|
@ -1,3 +0,0 @@
|
||||||
import Board from './Board';
|
|
||||||
|
|
||||||
export default Board;
|
|
|
@ -7,15 +7,15 @@ import { closePopup } from '../../lib/popup';
|
||||||
import DroppableTypes from '../../constants/DroppableTypes';
|
import DroppableTypes from '../../constants/DroppableTypes';
|
||||||
import ListContainer from '../../containers/ListContainer';
|
import ListContainer from '../../containers/ListContainer';
|
||||||
import CardModalContainer from '../../containers/CardModalContainer';
|
import CardModalContainer from '../../containers/CardModalContainer';
|
||||||
import AddList from './AddList';
|
import ListAdd from './ListAdd';
|
||||||
import Filter from './Filter';
|
import Filter from './Filter';
|
||||||
import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-icon.svg';
|
import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-icon.svg';
|
||||||
|
|
||||||
import styles from './Board.module.scss';
|
import styles from './BoardKanban.module.scss';
|
||||||
|
|
||||||
const parseDndId = (dndId) => dndId.split(':')[1];
|
const parseDndId = (dndId) => dndId.split(':')[1];
|
||||||
|
|
||||||
const Board = React.memo(
|
const BoardKanban = React.memo(
|
||||||
({
|
({
|
||||||
listIds,
|
listIds,
|
||||||
filterUsers,
|
filterUsers,
|
||||||
|
@ -167,7 +167,7 @@ const Board = React.memo(
|
||||||
{placeholder}
|
{placeholder}
|
||||||
<div data-drag-scroller className={styles.list}>
|
<div data-drag-scroller className={styles.list}>
|
||||||
{isAddListOpened ? (
|
{isAddListOpened ? (
|
||||||
<AddList
|
<ListAdd
|
||||||
isOpened={isAddListOpened}
|
isOpened={isAddListOpened}
|
||||||
onCreate={onListCreate}
|
onCreate={onListCreate}
|
||||||
onClose={handleAddListClose}
|
onClose={handleAddListClose}
|
||||||
|
@ -197,7 +197,7 @@ const Board = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
Board.propTypes = {
|
BoardKanban.propTypes = {
|
||||||
/* eslint-disable react/forbid-prop-types */
|
/* eslint-disable react/forbid-prop-types */
|
||||||
listIds: PropTypes.array.isRequired,
|
listIds: PropTypes.array.isRequired,
|
||||||
filterUsers: PropTypes.array.isRequired,
|
filterUsers: PropTypes.array.isRequired,
|
||||||
|
@ -218,4 +218,4 @@ Board.propTypes = {
|
||||||
onLabelDelete: PropTypes.func.isRequired,
|
onLabelDelete: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Board;
|
export default BoardKanban;
|
|
@ -6,13 +6,13 @@ import { useDidUpdate, useToggle } from '../../lib/hooks';
|
||||||
|
|
||||||
import { useClosableForm, useForm } from '../../hooks';
|
import { useClosableForm, useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './AddList.module.scss';
|
import styles from './ListAdd.module.scss';
|
||||||
|
|
||||||
const DEFAULT_DATA = {
|
const DEFAULT_DATA = {
|
||||||
name: '',
|
name: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
const AddList = React.memo(({ onCreate, onClose }) => {
|
const ListAdd = React.memo(({ onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||||
const [selectNameFieldState, selectNameField] = useToggle();
|
const [selectNameFieldState, selectNameField] = useToggle();
|
||||||
|
@ -81,9 +81,9 @@ const AddList = React.memo(({ onCreate, onClose }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddList.propTypes = {
|
ListAdd.propTypes = {
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddList;
|
export default ListAdd;
|
3
client/src/components/BoardKanban/index.js
Executable file
3
client/src/components/BoardKanban/index.js
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
import BoardKanban from './BoardKanban';
|
||||||
|
|
||||||
|
export default BoardKanban;
|
|
@ -2,17 +2,23 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Loader } from 'semantic-ui-react';
|
import { Loader } from 'semantic-ui-react';
|
||||||
|
|
||||||
import BoardContainer from '../containers/BoardContainer';
|
import { BoardTypes } from '../constants/Enums';
|
||||||
|
import BoardKanbanContainer from '../containers/BoardKanbanContainer';
|
||||||
|
|
||||||
const BoardWrapper = React.memo(({ isFetching }) => {
|
const BoardWrapper = React.memo(({ type, isFetching }) => {
|
||||||
if (isFetching) {
|
if (isFetching) {
|
||||||
return <Loader active />;
|
return <Loader active />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <BoardContainer />;
|
if (type === BoardTypes.KANBAN) {
|
||||||
|
return <BoardKanbanContainer />;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
BoardWrapper.propTypes = {
|
BoardWrapper.propTypes = {
|
||||||
|
type: PropTypes.string.isRequired,
|
||||||
isFetching: PropTypes.bool.isRequired,
|
isFetching: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ const AddStep = React.memo(({ onCreate, onClose }) => {
|
||||||
const handleSubmit = useCallback(() => {
|
const handleSubmit = useCallback(() => {
|
||||||
const cleanData = {
|
const cleanData = {
|
||||||
...data,
|
...data,
|
||||||
|
type: 'kanban',
|
||||||
name: data.name.trim(),
|
name: data.name.trim(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ import { Popup } from '../../lib/custom-ui';
|
||||||
import { useSteps } from '../../hooks';
|
import { useSteps } from '../../hooks';
|
||||||
import ProjectMembershipsStep from '../ProjectMembershipsStep';
|
import ProjectMembershipsStep from '../ProjectMembershipsStep';
|
||||||
import LabelsStep from '../LabelsStep';
|
import LabelsStep from '../LabelsStep';
|
||||||
import EditDueDateStep from '../EditDueDateStep';
|
import DueDateEditStep from '../DueDateEditStep';
|
||||||
import EditTimerStep from '../EditTimerStep';
|
import TimerEditStep from '../TimerEditStep';
|
||||||
import MoveCardStep from '../MoveCardStep';
|
import CardMoveStep from '../CardMoveStep';
|
||||||
import DeleteStep from '../DeleteStep';
|
import DeleteStep from '../DeleteStep';
|
||||||
|
|
||||||
import styles from './ActionsPopup.module.scss';
|
import styles from './ActionsPopup.module.scss';
|
||||||
|
@ -125,7 +125,7 @@ const ActionsStep = React.memo(
|
||||||
);
|
);
|
||||||
case StepTypes.EDIT_DUE_DATE:
|
case StepTypes.EDIT_DUE_DATE:
|
||||||
return (
|
return (
|
||||||
<EditDueDateStep
|
<DueDateEditStep
|
||||||
defaultValue={card.dueDate}
|
defaultValue={card.dueDate}
|
||||||
onUpdate={handleDueDateUpdate}
|
onUpdate={handleDueDateUpdate}
|
||||||
onBack={handleBack}
|
onBack={handleBack}
|
||||||
|
@ -134,7 +134,7 @@ const ActionsStep = React.memo(
|
||||||
);
|
);
|
||||||
case StepTypes.EDIT_TIMER:
|
case StepTypes.EDIT_TIMER:
|
||||||
return (
|
return (
|
||||||
<EditTimerStep
|
<TimerEditStep
|
||||||
defaultValue={card.timer}
|
defaultValue={card.timer}
|
||||||
onUpdate={handleTimerUpdate}
|
onUpdate={handleTimerUpdate}
|
||||||
onBack={handleBack}
|
onBack={handleBack}
|
||||||
|
@ -143,7 +143,7 @@ const ActionsStep = React.memo(
|
||||||
);
|
);
|
||||||
case StepTypes.MOVE:
|
case StepTypes.MOVE:
|
||||||
return (
|
return (
|
||||||
<MoveCardStep
|
<CardMoveStep
|
||||||
projectsToLists={projectsToLists}
|
projectsToLists={projectsToLists}
|
||||||
defaultPath={pick(card, ['projectId', 'boardId', 'listId'])}
|
defaultPath={pick(card, ['projectId', 'boardId', 'listId'])}
|
||||||
onMove={onMove}
|
onMove={onMove}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Draggable } from 'react-beautiful-dnd';
|
||||||
|
|
||||||
import Paths from '../../constants/Paths';
|
import Paths from '../../constants/Paths';
|
||||||
import Tasks from './Tasks';
|
import Tasks from './Tasks';
|
||||||
import EditName from './EditName';
|
import NameEdit from './NameEdit';
|
||||||
import ActionsPopup from './ActionsPopup';
|
import ActionsPopup from './ActionsPopup';
|
||||||
import User from '../User';
|
import User from '../User';
|
||||||
import Label from '../Label';
|
import Label from '../Label';
|
||||||
|
@ -24,8 +24,8 @@ const Card = React.memo(
|
||||||
dueDate,
|
dueDate,
|
||||||
timer,
|
timer,
|
||||||
coverUrl,
|
coverUrl,
|
||||||
listId,
|
|
||||||
boardId,
|
boardId,
|
||||||
|
listId,
|
||||||
projectId,
|
projectId,
|
||||||
isPersisted,
|
isPersisted,
|
||||||
notificationsTotal,
|
notificationsTotal,
|
||||||
|
@ -48,7 +48,7 @@ const Card = React.memo(
|
||||||
onLabelUpdate,
|
onLabelUpdate,
|
||||||
onLabelDelete,
|
onLabelDelete,
|
||||||
}) => {
|
}) => {
|
||||||
const editName = useRef(null);
|
const nameEdit = useRef(null);
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (document.activeElement) {
|
if (document.activeElement) {
|
||||||
|
@ -66,7 +66,7 @@ const Card = React.memo(
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleNameEdit = useCallback(() => {
|
const handleNameEdit = useCallback(() => {
|
||||||
editName.current.open();
|
nameEdit.current.open();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const contentNode = (
|
const contentNode = (
|
||||||
|
@ -133,7 +133,7 @@ const Card = React.memo(
|
||||||
{({ innerRef, draggableProps, dragHandleProps }) => (
|
{({ innerRef, draggableProps, dragHandleProps }) => (
|
||||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
<div {...draggableProps} {...dragHandleProps} ref={innerRef} className={styles.wrapper}>
|
<div {...draggableProps} {...dragHandleProps} ref={innerRef} className={styles.wrapper}>
|
||||||
<EditName ref={editName} defaultValue={name} onUpdate={handleNameUpdate}>
|
<NameEdit ref={nameEdit} defaultValue={name} onUpdate={handleNameUpdate}>
|
||||||
<div className={styles.card}>
|
<div className={styles.card}>
|
||||||
{isPersisted ? (
|
{isPersisted ? (
|
||||||
<>
|
<>
|
||||||
|
@ -150,8 +150,8 @@ const Card = React.memo(
|
||||||
name,
|
name,
|
||||||
dueDate,
|
dueDate,
|
||||||
timer,
|
timer,
|
||||||
listId,
|
|
||||||
boardId,
|
boardId,
|
||||||
|
listId,
|
||||||
projectId,
|
projectId,
|
||||||
isPersisted,
|
isPersisted,
|
||||||
}}
|
}}
|
||||||
|
@ -183,7 +183,7 @@ const Card = React.memo(
|
||||||
<span className={styles.content}>{contentNode}</span>
|
<span className={styles.content}>{contentNode}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</EditName>
|
</NameEdit>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Draggable>
|
</Draggable>
|
||||||
|
@ -198,8 +198,8 @@ Card.propTypes = {
|
||||||
dueDate: PropTypes.instanceOf(Date),
|
dueDate: PropTypes.instanceOf(Date),
|
||||||
timer: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
timer: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
coverUrl: PropTypes.string,
|
coverUrl: PropTypes.string,
|
||||||
listId: PropTypes.string.isRequired,
|
|
||||||
boardId: PropTypes.string.isRequired,
|
boardId: PropTypes.string.isRequired,
|
||||||
|
listId: PropTypes.string.isRequired,
|
||||||
projectId: PropTypes.string.isRequired,
|
projectId: PropTypes.string.isRequired,
|
||||||
isPersisted: PropTypes.bool.isRequired,
|
isPersisted: PropTypes.bool.isRequired,
|
||||||
notificationsTotal: PropTypes.number.isRequired,
|
notificationsTotal: PropTypes.number.isRequired,
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useClosableForm, useField } from '../../hooks';
|
import { useClosableForm, useField } from '../../hooks';
|
||||||
|
|
||||||
import styles from './EditName.module.scss';
|
import styles from './NameEdit.module.scss';
|
||||||
|
|
||||||
const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [isOpened, setIsOpened] = useState(false);
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [value, handleFieldChange, setValue] = useField(defaultValue);
|
const [value, handleFieldChange, setValue] = useField(defaultValue);
|
||||||
|
@ -117,10 +117,10 @@ const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditName.propTypes = {
|
NameEdit.propTypes = {
|
||||||
children: PropTypes.element.isRequired,
|
children: PropTypes.element.isRequired,
|
||||||
defaultValue: PropTypes.string.isRequired,
|
defaultValue: PropTypes.string.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(EditName);
|
export default React.memo(NameEdit);
|
|
@ -4,7 +4,7 @@ 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 { ActionTypes } from '../../../constants/Enums';
|
||||||
import AddComment from './AddComment';
|
import CommentAdd from './CommentAdd';
|
||||||
import Item from './Item';
|
import Item from './Item';
|
||||||
|
|
||||||
import styles from './Actions.module.scss';
|
import styles from './Actions.module.scss';
|
||||||
|
@ -42,7 +42,7 @@ const Actions = React.memo(
|
||||||
<div className={styles.moduleWrapper}>
|
<div className={styles.moduleWrapper}>
|
||||||
<Icon name="comment outline" className={styles.moduleIcon} />
|
<Icon name="comment outline" className={styles.moduleIcon} />
|
||||||
<div className={styles.moduleHeader}>{t('common.addComment')}</div>
|
<div className={styles.moduleHeader}>{t('common.addComment')}</div>
|
||||||
<AddComment onCreate={onCommentCreate} />
|
<CommentAdd onCreate={onCommentCreate} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.contentModule}>
|
<div className={styles.contentModule}>
|
||||||
|
|
|
@ -6,13 +6,13 @@ import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './AddComment.module.scss';
|
import styles from './CommentAdd.module.scss';
|
||||||
|
|
||||||
const DEFAULT_DATA = {
|
const DEFAULT_DATA = {
|
||||||
text: '',
|
text: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
const AddComment = React.memo(({ onCreate }) => {
|
const CommentAdd = React.memo(({ onCreate }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@ const AddComment = React.memo(({ onCreate }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddComment.propTypes = {
|
CommentAdd.propTypes = {
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddComment;
|
export default CommentAdd;
|
|
@ -7,9 +7,9 @@ import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useClosableForm, useForm } from '../../../hooks';
|
import { useClosableForm, useForm } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './EditComment.module.scss';
|
import styles from './CommentEdit.module.scss';
|
||||||
|
|
||||||
const EditComment = React.forwardRef(({ children, defaultData, onUpdate }, ref) => {
|
const CommentEdit = React.forwardRef(({ children, defaultData, onUpdate }, ref) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [isOpened, setIsOpened] = useState(false);
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [data, handleFieldChange, setData] = useForm(null);
|
const [data, handleFieldChange, setData] = useForm(null);
|
||||||
|
@ -111,10 +111,10 @@ const EditComment = React.forwardRef(({ children, defaultData, onUpdate }, ref)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditComment.propTypes = {
|
CommentEdit.propTypes = {
|
||||||
children: PropTypes.element.isRequired,
|
children: PropTypes.element.isRequired,
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(EditComment);
|
export default React.memo(CommentEdit);
|
|
@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
|
||||||
import { Comment } from 'semantic-ui-react';
|
import { Comment } from 'semantic-ui-react';
|
||||||
import { Markdown } from '../../../lib/custom-ui';
|
import { Markdown } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import EditComment from './EditComment';
|
import CommentEdit from './CommentEdit';
|
||||||
import User from '../../User';
|
import User from '../../User';
|
||||||
import DeletePopup from '../../DeletePopup';
|
import DeletePopup from '../../DeletePopup';
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ const ItemComment = React.memo(
|
||||||
({ data, createdAt, isPersisted, user, isEditable, onUpdate, onDelete }) => {
|
({ data, createdAt, isPersisted, user, isEditable, onUpdate, onDelete }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const editComment = useRef(null);
|
const commentEdit = useRef(null);
|
||||||
|
|
||||||
const handleEditClick = useCallback(() => {
|
const handleEditClick = useCallback(() => {
|
||||||
editComment.current.open();
|
commentEdit.current.open();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -36,7 +36,7 @@ const ItemComment = React.memo(
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<EditComment ref={editComment} defaultData={data} onUpdate={onUpdate}>
|
<CommentEdit ref={commentEdit} defaultData={data} onUpdate={onUpdate}>
|
||||||
<>
|
<>
|
||||||
<Markdown source={data.text} linkTarget="_blank" className={styles.text} />
|
<Markdown source={data.text} linkTarget="_blank" className={styles.text} />
|
||||||
<Comment.Actions>
|
<Comment.Actions>
|
||||||
|
@ -66,7 +66,7 @@ const ItemComment = React.memo(
|
||||||
)}
|
)}
|
||||||
</Comment.Actions>
|
</Comment.Actions>
|
||||||
</>
|
</>
|
||||||
</EditComment>
|
</CommentEdit>
|
||||||
</div>
|
</div>
|
||||||
</Comment>
|
</Comment>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
import AddAttachmentZone from './AddAttachmentZone';
|
|
||||||
|
|
||||||
export default AddAttachmentZone;
|
|
|
@ -5,9 +5,9 @@ import { Menu } from 'semantic-ui-react';
|
||||||
import { withPopup } from '../../lib/popup';
|
import { withPopup } from '../../lib/popup';
|
||||||
import { FilePicker, Popup } from '../../lib/custom-ui';
|
import { FilePicker, Popup } from '../../lib/custom-ui';
|
||||||
|
|
||||||
import styles from './AddAttachmentPopup.module.scss';
|
import styles from './AttachmentAddPopup.module.scss';
|
||||||
|
|
||||||
const AddAttachmentStep = React.memo(({ onCreate, onClose }) => {
|
const AttachmentAddStep = React.memo(({ onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const handleFileSelect = useCallback(
|
const handleFileSelect = useCallback(
|
||||||
|
@ -46,9 +46,9 @@ const AddAttachmentStep = React.memo(({ onCreate, onClose }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAttachmentStep.propTypes = {
|
AttachmentAddStep.propTypes = {
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(AddAttachmentStep);
|
export default withPopup(AttachmentAddStep);
|
|
@ -5,11 +5,11 @@ import { useTranslation } from 'react-i18next';
|
||||||
import { closePopup } from '../../../lib/popup';
|
import { closePopup } from '../../../lib/popup';
|
||||||
|
|
||||||
import { useModal } from '../../../hooks';
|
import { useModal } from '../../../hooks';
|
||||||
import AddTextFileModal from './AddTextFileModal';
|
import TextFileAddModal from './TextFileAddModal';
|
||||||
|
|
||||||
import styles from './AddAttachmentZone.module.scss';
|
import styles from './AttachmentAddZone.module.scss';
|
||||||
|
|
||||||
const AddAttachmentZone = React.memo(({ children, onCreate }) => {
|
const AttachmentAddZone = React.memo(({ children, onCreate }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [modal, openModal, handleModalClose] = useModal();
|
const [modal, openModal, handleModalClose] = useModal();
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ const AddAttachmentZone = React.memo(({ children, onCreate }) => {
|
||||||
<input {...getInputProps()} />
|
<input {...getInputProps()} />
|
||||||
</div>
|
</div>
|
||||||
{modal && (
|
{modal && (
|
||||||
<AddTextFileModal
|
<TextFileAddModal
|
||||||
content={modal.content}
|
content={modal.content}
|
||||||
onCreate={handleFileCreate}
|
onCreate={handleFileCreate}
|
||||||
onClose={handleModalClose}
|
onClose={handleModalClose}
|
||||||
|
@ -100,9 +100,9 @@ const AddAttachmentZone = React.memo(({ children, onCreate }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAttachmentZone.propTypes = {
|
AttachmentAddZone.propTypes = {
|
||||||
children: PropTypes.element.isRequired,
|
children: PropTypes.element.isRequired,
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddAttachmentZone;
|
export default AttachmentAddZone;
|
|
@ -6,9 +6,9 @@ import { Input } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './AddTextFileModal.module.scss';
|
import styles from './TextFileAddModal.module.scss';
|
||||||
|
|
||||||
const AddTextFileModal = React.memo(({ content, onCreate, onClose }) => {
|
const TextFileAddModal = React.memo(({ content, onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const [data, handleFieldChange] = useForm(() => ({
|
const [data, handleFieldChange] = useForm(() => ({
|
||||||
|
@ -74,10 +74,10 @@ const AddTextFileModal = React.memo(({ content, onCreate, onClose }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddTextFileModal.propTypes = {
|
TextFileAddModal.propTypes = {
|
||||||
content: PropTypes.string.isRequired,
|
content: PropTypes.string.isRequired,
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddTextFileModal;
|
export default TextFileAddModal;
|
|
@ -0,0 +1,3 @@
|
||||||
|
import AttachmentAddZone from './AttachmentAddZone';
|
||||||
|
|
||||||
|
export default AttachmentAddZone;
|
|
@ -6,11 +6,11 @@ import { Button, Grid, Icon, Modal } from 'semantic-ui-react';
|
||||||
import { Markdown } from '../../lib/custom-ui';
|
import { Markdown } from '../../lib/custom-ui';
|
||||||
|
|
||||||
import NameField from './NameField';
|
import NameField from './NameField';
|
||||||
import EditDescription from './EditDescription';
|
import DescriptionEdit from './DescriptionEdit';
|
||||||
import Tasks from './Tasks';
|
import Tasks from './Tasks';
|
||||||
import Attachments from './Attachments';
|
import Attachments from './Attachments';
|
||||||
import AddAttachmentZone from './AddAttachmentZone';
|
import AttachmentAddZone from './AttachmentAddZone';
|
||||||
import AddAttachmentPopup from './AddAttachmentPopup';
|
import AttachmentAddPopup from './AttachmentAddPopup';
|
||||||
import Actions from './Actions';
|
import Actions from './Actions';
|
||||||
import User from '../User';
|
import User from '../User';
|
||||||
import Label from '../Label';
|
import Label from '../Label';
|
||||||
|
@ -18,9 +18,9 @@ import DueDate from '../DueDate';
|
||||||
import Timer from '../Timer';
|
import Timer from '../Timer';
|
||||||
import ProjectMembershipsPopup from '../ProjectMembershipsPopup';
|
import ProjectMembershipsPopup from '../ProjectMembershipsPopup';
|
||||||
import LabelsPopup from '../LabelsPopup';
|
import LabelsPopup from '../LabelsPopup';
|
||||||
import EditDueDatePopup from '../EditDueDatePopup';
|
import DueDateEditPopup from '../DueDateEditPopup';
|
||||||
import EditTimerPopup from '../EditTimerPopup';
|
import TimerEditPopup from '../TimerEditPopup';
|
||||||
import MoveCardPopup from '../MoveCardPopup';
|
import CardMovePopup from '../CardMovePopup';
|
||||||
import DeletePopup from '../DeletePopup';
|
import DeletePopup from '../DeletePopup';
|
||||||
|
|
||||||
import styles from './CardModal.module.scss';
|
import styles from './CardModal.module.scss';
|
||||||
|
@ -128,7 +128,7 @@ const CardModal = React.memo(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal open closeIcon size="small" centered={false} onClose={onClose}>
|
<Modal open closeIcon size="small" centered={false} onClose={onClose}>
|
||||||
<AddAttachmentZone onCreate={onAttachmentCreate}>
|
<AttachmentAddZone onCreate={onAttachmentCreate}>
|
||||||
<Grid className={styles.grid}>
|
<Grid className={styles.grid}>
|
||||||
<Grid.Row className={styles.headerPadding}>
|
<Grid.Row className={styles.headerPadding}>
|
||||||
<Grid.Column width={16} className={styles.headerPadding}>
|
<Grid.Column width={16} className={styles.headerPadding}>
|
||||||
|
@ -227,9 +227,9 @@ const CardModal = React.memo(
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<span className={styles.attachment}>
|
<span className={styles.attachment}>
|
||||||
<EditDueDatePopup defaultValue={dueDate} onUpdate={handleDueDateUpdate}>
|
<DueDateEditPopup defaultValue={dueDate} onUpdate={handleDueDateUpdate}>
|
||||||
<DueDate value={dueDate} />
|
<DueDate value={dueDate} />
|
||||||
</EditDueDatePopup>
|
</DueDateEditPopup>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -241,9 +241,9 @@ const CardModal = React.memo(
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<span className={styles.attachment}>
|
<span className={styles.attachment}>
|
||||||
<EditTimerPopup defaultValue={timer} onUpdate={handleTimerUpdate}>
|
<TimerEditPopup defaultValue={timer} onUpdate={handleTimerUpdate}>
|
||||||
<Timer startedAt={timer.startedAt} total={timer.total} />
|
<Timer startedAt={timer.startedAt} total={timer.total} />
|
||||||
</EditTimerPopup>
|
</TimerEditPopup>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -253,7 +253,7 @@ const CardModal = React.memo(
|
||||||
<div className={styles.moduleWrapper}>
|
<div className={styles.moduleWrapper}>
|
||||||
<Icon name="align justify" className={styles.moduleIcon} />
|
<Icon name="align justify" className={styles.moduleIcon} />
|
||||||
<div className={styles.moduleHeader}>{t('common.description')}</div>
|
<div className={styles.moduleHeader}>{t('common.description')}</div>
|
||||||
<EditDescription defaultValue={description} onUpdate={handleDescriptionUpdate}>
|
<DescriptionEdit defaultValue={description} onUpdate={handleDescriptionUpdate}>
|
||||||
{description ? (
|
{description ? (
|
||||||
<button type="button" className={styles.descriptionText}>
|
<button type="button" className={styles.descriptionText}>
|
||||||
<Markdown linkStopPropagation source={description} linkTarget="_blank" />
|
<Markdown linkStopPropagation source={description} linkTarget="_blank" />
|
||||||
|
@ -265,7 +265,7 @@ const CardModal = React.memo(
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</EditDescription>
|
</DescriptionEdit>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.contentModule}>
|
<div className={styles.contentModule}>
|
||||||
|
@ -333,26 +333,26 @@ const CardModal = React.memo(
|
||||||
{t('common.labels')}
|
{t('common.labels')}
|
||||||
</Button>
|
</Button>
|
||||||
</LabelsPopup>
|
</LabelsPopup>
|
||||||
<EditDueDatePopup defaultValue={dueDate} onUpdate={handleDueDateUpdate}>
|
<DueDateEditPopup defaultValue={dueDate} onUpdate={handleDueDateUpdate}>
|
||||||
<Button fluid className={styles.actionButton}>
|
<Button fluid className={styles.actionButton}>
|
||||||
<Icon name="calendar check outline" className={styles.actionIcon} />
|
<Icon name="calendar check outline" className={styles.actionIcon} />
|
||||||
{t('common.dueDate', {
|
{t('common.dueDate', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</EditDueDatePopup>
|
</DueDateEditPopup>
|
||||||
<EditTimerPopup defaultValue={timer} onUpdate={handleTimerUpdate}>
|
<TimerEditPopup defaultValue={timer} onUpdate={handleTimerUpdate}>
|
||||||
<Button fluid className={styles.actionButton}>
|
<Button fluid className={styles.actionButton}>
|
||||||
<Icon name="clock outline" className={styles.actionIcon} />
|
<Icon name="clock outline" className={styles.actionIcon} />
|
||||||
{t('common.timer')}
|
{t('common.timer')}
|
||||||
</Button>
|
</Button>
|
||||||
</EditTimerPopup>
|
</TimerEditPopup>
|
||||||
<AddAttachmentPopup onCreate={onAttachmentCreate}>
|
<AttachmentAddPopup onCreate={onAttachmentCreate}>
|
||||||
<Button fluid className={styles.actionButton}>
|
<Button fluid className={styles.actionButton}>
|
||||||
<Icon name="attach" className={styles.actionIcon} />
|
<Icon name="attach" className={styles.actionIcon} />
|
||||||
{t('common.attachment')}
|
{t('common.attachment')}
|
||||||
</Button>
|
</Button>
|
||||||
</AddAttachmentPopup>
|
</AttachmentAddPopup>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.actions}>
|
<div className={styles.actions}>
|
||||||
<span className={styles.actionsTitle}>{t('common.actions')}</span>
|
<span className={styles.actionsTitle}>{t('common.actions')}</span>
|
||||||
|
@ -364,7 +364,7 @@ const CardModal = React.memo(
|
||||||
<Icon name="paper plane outline" className={styles.actionIcon} />
|
<Icon name="paper plane outline" className={styles.actionIcon} />
|
||||||
{isSubscribed ? t('action.unsubscribe') : t('action.subscribe')}
|
{isSubscribed ? t('action.unsubscribe') : t('action.subscribe')}
|
||||||
</Button>
|
</Button>
|
||||||
<MoveCardPopup
|
<CardMovePopup
|
||||||
projectsToLists={allProjectsToLists}
|
projectsToLists={allProjectsToLists}
|
||||||
defaultPath={{
|
defaultPath={{
|
||||||
projectId,
|
projectId,
|
||||||
|
@ -383,7 +383,7 @@ const CardModal = React.memo(
|
||||||
<Icon name="share square outline" className={styles.actionIcon} />
|
<Icon name="share square outline" className={styles.actionIcon} />
|
||||||
{t('action.move')}
|
{t('action.move')}
|
||||||
</Button>
|
</Button>
|
||||||
</MoveCardPopup>
|
</CardMovePopup>
|
||||||
<DeletePopup
|
<DeletePopup
|
||||||
title={t('common.deleteCard', {
|
title={t('common.deleteCard', {
|
||||||
context: 'title',
|
context: 'title',
|
||||||
|
@ -401,7 +401,7 @@ const CardModal = React.memo(
|
||||||
</Grid.Column>
|
</Grid.Column>
|
||||||
</Grid.Row>
|
</Grid.Row>
|
||||||
</Grid>
|
</Grid>
|
||||||
</AddAttachmentZone>
|
</AttachmentAddZone>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useClosableForm, useField } from '../../hooks';
|
import { useClosableForm, useField } from '../../hooks';
|
||||||
|
|
||||||
import styles from './EditDescription.module.scss';
|
import styles from './DescriptionEdit.module.scss';
|
||||||
|
|
||||||
const EditDescription = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
const DescriptionEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [isOpened, setIsOpened] = useState(false);
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [value, handleFieldChange, setValue] = useField(null);
|
const [value, handleFieldChange, setValue] = useField(null);
|
||||||
|
@ -103,14 +103,14 @@ const EditDescription = React.forwardRef(({ children, defaultValue, onUpdate },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditDescription.propTypes = {
|
DescriptionEdit.propTypes = {
|
||||||
children: PropTypes.element.isRequired,
|
children: PropTypes.element.isRequired,
|
||||||
defaultValue: PropTypes.string,
|
defaultValue: PropTypes.string,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditDescription.defaultProps = {
|
DescriptionEdit.defaultProps = {
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(EditDescription);
|
export default React.memo(DescriptionEdit);
|
|
@ -3,17 +3,17 @@ import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Button, Checkbox, Icon } from 'semantic-ui-react';
|
import { Button, Checkbox, Icon } from 'semantic-ui-react';
|
||||||
|
|
||||||
import EditName from './EditName';
|
import NameEdit from './NameEdit';
|
||||||
import ActionsPopup from './ActionsPopup';
|
import ActionsPopup from './ActionsPopup';
|
||||||
|
|
||||||
import styles from './Item.module.scss';
|
import styles from './Item.module.scss';
|
||||||
|
|
||||||
const Item = React.memo(({ name, isCompleted, isPersisted, onUpdate, onDelete }) => {
|
const Item = React.memo(({ name, isCompleted, isPersisted, onUpdate, onDelete }) => {
|
||||||
const editName = useRef(null);
|
const nameEdit = useRef(null);
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (isPersisted) {
|
if (isPersisted) {
|
||||||
editName.current.open();
|
nameEdit.current.open();
|
||||||
}
|
}
|
||||||
}, [isPersisted]);
|
}, [isPersisted]);
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ const Item = React.memo(({ name, isCompleted, isPersisted, onUpdate, onDelete })
|
||||||
}, [isCompleted, onUpdate]);
|
}, [isCompleted, onUpdate]);
|
||||||
|
|
||||||
const handleNameEdit = useCallback(() => {
|
const handleNameEdit = useCallback(() => {
|
||||||
editName.current.open();
|
nameEdit.current.open();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -46,7 +46,7 @@ const Item = React.memo(({ name, isCompleted, isPersisted, onUpdate, onDelete })
|
||||||
onChange={handleToggleChange}
|
onChange={handleToggleChange}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<EditName ref={editName} defaultValue={name} onUpdate={handleNameUpdate}>
|
<NameEdit ref={nameEdit} defaultValue={name} onUpdate={handleNameUpdate}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
{/* eslint-disable jsx-a11y/click-events-have-key-events,
|
{/* eslint-disable jsx-a11y/click-events-have-key-events,
|
||||||
jsx-a11y/no-static-element-interactions */}
|
jsx-a11y/no-static-element-interactions */}
|
||||||
|
@ -65,7 +65,7 @@ const Item = React.memo(({ name, isCompleted, isPersisted, onUpdate, onDelete })
|
||||||
</ActionsPopup>
|
</ActionsPopup>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</EditName>
|
</NameEdit>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useClosableForm, useField } from '../../../hooks';
|
import { useClosableForm, useField } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './EditName.module.scss';
|
import styles from './NameEdit.module.scss';
|
||||||
|
|
||||||
const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [isOpened, setIsOpened] = useState(false);
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [value, handleFieldChange, setValue] = useField(null);
|
const [value, handleFieldChange, setValue] = useField(null);
|
||||||
|
@ -105,10 +105,10 @@ const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditName.propTypes = {
|
NameEdit.propTypes = {
|
||||||
children: PropTypes.element.isRequired,
|
children: PropTypes.element.isRequired,
|
||||||
defaultValue: PropTypes.string.isRequired,
|
defaultValue: PropTypes.string.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(EditName);
|
export default React.memo(NameEdit);
|
5
client/src/components/CardMovePopup.jsx
Normal file
5
client/src/components/CardMovePopup.jsx
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import { withPopup } from '../lib/popup';
|
||||||
|
|
||||||
|
import CardMoveStep from './CardMoveStep';
|
||||||
|
|
||||||
|
export default withPopup(CardMoveStep);
|
|
@ -6,9 +6,9 @@ import { Popup } from '../../lib/custom-ui';
|
||||||
|
|
||||||
import { useForm } from '../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './MoveCardStep.module.scss';
|
import styles from './CardMoveStep.module.scss';
|
||||||
|
|
||||||
const MoveCardStep = React.memo(
|
const CardMoveStep = React.memo(
|
||||||
({ projectsToLists, defaultPath, onMove, onTransfer, onBoardFetch, onBack, onClose }) => {
|
({ projectsToLists, defaultPath, onMove, onTransfer, onBoardFetch, onBack, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ const MoveCardStep = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
MoveCardStep.propTypes = {
|
CardMoveStep.propTypes = {
|
||||||
/* eslint-disable react/forbid-prop-types */
|
/* eslint-disable react/forbid-prop-types */
|
||||||
projectsToLists: PropTypes.array.isRequired,
|
projectsToLists: PropTypes.array.isRequired,
|
||||||
defaultPath: PropTypes.object.isRequired,
|
defaultPath: PropTypes.object.isRequired,
|
||||||
|
@ -154,8 +154,8 @@ MoveCardStep.propTypes = {
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
MoveCardStep.defaultProps = {
|
CardMoveStep.defaultProps = {
|
||||||
onBack: undefined,
|
onBack: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default MoveCardStep;
|
export default CardMoveStep;
|
3
client/src/components/CardMoveStep/index.js
Normal file
3
client/src/components/CardMoveStep/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import CardMoveStep from './CardMoveStep';
|
||||||
|
|
||||||
|
export default CardMoveStep;
|
|
@ -6,7 +6,7 @@ import FixedContainer from '../containers/FixedContainer';
|
||||||
import StaticContainer from '../containers/StaticContainer';
|
import StaticContainer from '../containers/StaticContainer';
|
||||||
import UsersModalContainer from '../containers/UsersModalContainer';
|
import UsersModalContainer from '../containers/UsersModalContainer';
|
||||||
import UserSettingsModalContainer from '../containers/UserSettingsModalContainer';
|
import UserSettingsModalContainer from '../containers/UserSettingsModalContainer';
|
||||||
import AddProjectModalContainer from '../containers/AddProjectModalContainer';
|
import ProjectAddModalContainer from '../containers/ProjectAddModalContainer';
|
||||||
import Background from './Background';
|
import Background from './Background';
|
||||||
|
|
||||||
const Core = ({ currentModal, currentProject }) => (
|
const Core = ({ currentModal, currentProject }) => (
|
||||||
|
@ -22,7 +22,7 @@ const Core = ({ currentModal, currentProject }) => (
|
||||||
<StaticContainer />
|
<StaticContainer />
|
||||||
{currentModal === ModalTypes.USERS && <UsersModalContainer />}
|
{currentModal === ModalTypes.USERS && <UsersModalContainer />}
|
||||||
{currentModal === ModalTypes.USER_SETTINGS && <UserSettingsModalContainer />}
|
{currentModal === ModalTypes.USER_SETTINGS && <UserSettingsModalContainer />}
|
||||||
{currentModal === ModalTypes.ADD_PROJECT && <AddProjectModalContainer />}
|
{currentModal === ModalTypes.ADD_PROJECT && <ProjectAddModalContainer />}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
5
client/src/components/DueDateEditPopup.jsx
Normal file
5
client/src/components/DueDateEditPopup.jsx
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import { withPopup } from '../lib/popup';
|
||||||
|
|
||||||
|
import DueDateEditStep from './DueDateEditStep';
|
||||||
|
|
||||||
|
export default withPopup(DueDateEditStep);
|
|
@ -8,9 +8,9 @@ import { Input, Popup } from '../../lib/custom-ui';
|
||||||
|
|
||||||
import { useForm } from '../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './EditDueDateStep.module.scss';
|
import styles from './DueDateEditStep.module.scss';
|
||||||
|
|
||||||
const EditDueDateStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
const DueDateEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const [data, handleFieldChange, setData] = useForm(() => {
|
const [data, handleFieldChange, setData] = useForm(() => {
|
||||||
|
@ -132,16 +132,16 @@ const EditDueDateStep = React.memo(({ defaultValue, onUpdate, onBack, onClose })
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditDueDateStep.propTypes = {
|
DueDateEditStep.propTypes = {
|
||||||
defaultValue: PropTypes.instanceOf(Date),
|
defaultValue: PropTypes.instanceOf(Date),
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onBack: PropTypes.func,
|
onBack: PropTypes.func,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditDueDateStep.defaultProps = {
|
DueDateEditStep.defaultProps = {
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
onBack: undefined,
|
onBack: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EditDueDateStep;
|
export default DueDateEditStep;
|
3
client/src/components/DueDateEditStep/index.js
Normal file
3
client/src/components/DueDateEditStep/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import DueDateEditStep from './DueDateEditStep';
|
||||||
|
|
||||||
|
export default DueDateEditStep;
|
|
@ -1,5 +0,0 @@
|
||||||
import { withPopup } from '../lib/popup';
|
|
||||||
|
|
||||||
import EditDueDateStep from './EditDueDateStep';
|
|
||||||
|
|
||||||
export default withPopup(EditDueDateStep);
|
|
|
@ -1,3 +0,0 @@
|
||||||
import EditDueDateStep from './EditDueDateStep';
|
|
||||||
|
|
||||||
export default EditDueDateStep;
|
|
|
@ -1,5 +0,0 @@
|
||||||
import { withPopup } from '../lib/popup';
|
|
||||||
|
|
||||||
import EditTimerStep from './EditTimerStep';
|
|
||||||
|
|
||||||
export default withPopup(EditTimerStep);
|
|
|
@ -1,3 +0,0 @@
|
||||||
import EditTimerStep from './EditTimerStep';
|
|
||||||
|
|
||||||
export default EditTimerStep;
|
|
|
@ -8,13 +8,13 @@ import { useDidUpdate, useToggle } from '../../lib/hooks';
|
||||||
|
|
||||||
import { useClosableForm, useForm } from '../../hooks';
|
import { useClosableForm, useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './AddCard.module.scss';
|
import styles from './CardAdd.module.scss';
|
||||||
|
|
||||||
const DEFAULT_DATA = {
|
const DEFAULT_DATA = {
|
||||||
name: '',
|
name: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
const AddCard = React.memo(({ isOpened, onCreate, onClose }) => {
|
const CardAdd = React.memo(({ isOpened, onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
const [data, handleFieldChange, setData] = useForm(DEFAULT_DATA);
|
||||||
const [selectNameFieldState, selectNameField] = useToggle();
|
const [selectNameFieldState, selectNameField] = useToggle();
|
||||||
|
@ -107,10 +107,10 @@ const AddCard = React.memo(({ isOpened, onCreate, onClose }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddCard.propTypes = {
|
CardAdd.propTypes = {
|
||||||
isOpened: PropTypes.bool.isRequired,
|
isOpened: PropTypes.bool.isRequired,
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddCard;
|
export default CardAdd;
|
|
@ -7,8 +7,8 @@ import { Button, Icon } from 'semantic-ui-react';
|
||||||
|
|
||||||
import DroppableTypes from '../../constants/DroppableTypes';
|
import DroppableTypes from '../../constants/DroppableTypes';
|
||||||
import CardContainer from '../../containers/CardContainer';
|
import CardContainer from '../../containers/CardContainer';
|
||||||
import EditName from './EditName';
|
import NameEdit from './NameEdit';
|
||||||
import AddCard from './AddCard';
|
import CardAdd from './CardAdd';
|
||||||
import ActionsPopup from './ActionsPopup';
|
import ActionsPopup from './ActionsPopup';
|
||||||
import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-icon.svg';
|
import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-icon.svg';
|
||||||
|
|
||||||
|
@ -19,12 +19,12 @@ const List = React.memo(
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [isAddCardOpened, setIsAddCardOpened] = useState(false);
|
const [isAddCardOpened, setIsAddCardOpened] = useState(false);
|
||||||
|
|
||||||
const editName = useRef(null);
|
const nameEdit = useRef(null);
|
||||||
const listWrapper = useRef(null);
|
const listWrapper = useRef(null);
|
||||||
|
|
||||||
const handleHeaderClick = useCallback(() => {
|
const handleHeaderClick = useCallback(() => {
|
||||||
if (isPersisted) {
|
if (isPersisted) {
|
||||||
editName.current.open();
|
nameEdit.current.open();
|
||||||
}
|
}
|
||||||
}, [isPersisted]);
|
}, [isPersisted]);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ const List = React.memo(
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleNameEdit = useCallback(() => {
|
const handleNameEdit = useCallback(() => {
|
||||||
editName.current.open();
|
nameEdit.current.open();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleCardAdd = useCallback(() => {
|
const handleCardAdd = useCallback(() => {
|
||||||
|
@ -73,7 +73,7 @@ const List = React.memo(
|
||||||
<CardContainer key={cardId} id={cardId} index={cardIndex} />
|
<CardContainer key={cardId} id={cardId} index={cardIndex} />
|
||||||
))}
|
))}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
<AddCard
|
<CardAdd
|
||||||
isOpened={isAddCardOpened}
|
isOpened={isAddCardOpened}
|
||||||
onCreate={onCardCreate}
|
onCreate={onCardCreate}
|
||||||
onClose={handleAddCardClose}
|
onClose={handleAddCardClose}
|
||||||
|
@ -96,9 +96,9 @@ const List = React.memo(
|
||||||
{/* eslint-enable jsx-a11y/click-events-have-key-events,
|
{/* eslint-enable jsx-a11y/click-events-have-key-events,
|
||||||
jsx-a11y/no-static-element-interactions,
|
jsx-a11y/no-static-element-interactions,
|
||||||
react/jsx-props-no-spreading */}
|
react/jsx-props-no-spreading */}
|
||||||
<EditName ref={editName} defaultValue={name} onUpdate={handleNameUpdate}>
|
<NameEdit ref={nameEdit} defaultValue={name} onUpdate={handleNameUpdate}>
|
||||||
<div className={styles.headerName}>{name}</div>
|
<div className={styles.headerName}>{name}</div>
|
||||||
</EditName>
|
</NameEdit>
|
||||||
{isPersisted && (
|
{isPersisted && (
|
||||||
<ActionsPopup
|
<ActionsPopup
|
||||||
onNameEdit={handleNameEdit}
|
onNameEdit={handleNameEdit}
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { TextArea } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useField } from '../../hooks';
|
import { useField } from '../../hooks';
|
||||||
|
|
||||||
import styles from './EditName.module.scss';
|
import styles from './NameEdit.module.scss';
|
||||||
|
|
||||||
const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
const NameEdit = React.forwardRef(({ children, defaultValue, onUpdate }, ref) => {
|
||||||
const [isOpened, setIsOpened] = useState(false);
|
const [isOpened, setIsOpened] = useState(false);
|
||||||
const [value, handleFieldChange, setValue] = useField(defaultValue);
|
const [value, handleFieldChange, setValue] = useField(defaultValue);
|
||||||
|
|
||||||
|
@ -94,10 +94,10 @@ const EditName = React.forwardRef(({ children, defaultValue, onUpdate }, ref) =>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditName.propTypes = {
|
NameEdit.propTypes = {
|
||||||
children: PropTypes.element.isRequired,
|
children: PropTypes.element.isRequired,
|
||||||
defaultValue: PropTypes.string.isRequired,
|
defaultValue: PropTypes.string.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(EditName);
|
export default React.memo(NameEdit);
|
|
@ -1,5 +0,0 @@
|
||||||
import { withPopup } from '../lib/popup';
|
|
||||||
|
|
||||||
import MoveCardStep from './MoveCardStep';
|
|
||||||
|
|
||||||
export default withPopup(MoveCardStep);
|
|
|
@ -1,3 +0,0 @@
|
||||||
import MoveCardStep from './MoveCardStep';
|
|
||||||
|
|
||||||
export default MoveCardStep;
|
|
|
@ -6,8 +6,8 @@ import { withPopup } from '../../../lib/popup';
|
||||||
import { Popup } from '../../../lib/custom-ui';
|
import { Popup } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import { useSteps } from '../../../hooks';
|
import { useSteps } from '../../../hooks';
|
||||||
import EditNameStep from './EditNameStep';
|
import NameEditStep from './NameEditStep';
|
||||||
import EditBackgroundStep from './EditBackgroundStep';
|
import BackgroundEditStep from './BackgroundEditStep';
|
||||||
import DeleteStep from '../../DeleteStep';
|
import DeleteStep from '../../DeleteStep';
|
||||||
|
|
||||||
import styles from './ActionsPopup.module.scss';
|
import styles from './ActionsPopup.module.scss';
|
||||||
|
@ -64,7 +64,7 @@ const ActionsStep = React.memo(
|
||||||
switch (step.type) {
|
switch (step.type) {
|
||||||
case StepTypes.EDIT_NAME:
|
case StepTypes.EDIT_NAME:
|
||||||
return (
|
return (
|
||||||
<EditNameStep
|
<NameEditStep
|
||||||
defaultValue={project.name}
|
defaultValue={project.name}
|
||||||
onUpdate={handleNameUpdate}
|
onUpdate={handleNameUpdate}
|
||||||
onBack={handleBack}
|
onBack={handleBack}
|
||||||
|
@ -73,7 +73,7 @@ const ActionsStep = React.memo(
|
||||||
);
|
);
|
||||||
case StepTypes.EDIT_BACKGROUND:
|
case StepTypes.EDIT_BACKGROUND:
|
||||||
return (
|
return (
|
||||||
<EditBackgroundStep
|
<BackgroundEditStep
|
||||||
defaultValue={project.background}
|
defaultValue={project.background}
|
||||||
imageCoverUrl={project.backgroundImage && project.backgroundImage.coverUrl}
|
imageCoverUrl={project.backgroundImage && project.backgroundImage.coverUrl}
|
||||||
isImageUpdating={project.isBackgroundImageUpdating}
|
isImageUpdating={project.isBackgroundImageUpdating}
|
||||||
|
|
|
@ -11,10 +11,10 @@ import { FilePicker, Popup } from '../../../lib/custom-ui';
|
||||||
import ProjectBackgroundGradients from '../../../constants/ProjectBackgroundGradients';
|
import ProjectBackgroundGradients from '../../../constants/ProjectBackgroundGradients';
|
||||||
import { ProjectBackgroundTypes } from '../../../constants/Enums';
|
import { ProjectBackgroundTypes } from '../../../constants/Enums';
|
||||||
|
|
||||||
import styles from './EditBackgroundStep.module.scss';
|
import styles from './BackgroundEditStep.module.scss';
|
||||||
import globalStyles from '../../../styles.module.scss';
|
import globalStyles from '../../../styles.module.scss';
|
||||||
|
|
||||||
const EditBackgroundStep = React.memo(
|
const BackgroundEditStep = React.memo(
|
||||||
({
|
({
|
||||||
defaultValue,
|
defaultValue,
|
||||||
imageCoverUrl,
|
imageCoverUrl,
|
||||||
|
@ -158,7 +158,7 @@ const EditBackgroundStep = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
EditBackgroundStep.propTypes = {
|
BackgroundEditStep.propTypes = {
|
||||||
defaultValue: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
defaultValue: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
imageCoverUrl: PropTypes.string,
|
imageCoverUrl: PropTypes.string,
|
||||||
isImageUpdating: PropTypes.bool.isRequired,
|
isImageUpdating: PropTypes.bool.isRequired,
|
||||||
|
@ -168,9 +168,9 @@ EditBackgroundStep.propTypes = {
|
||||||
onBack: PropTypes.func.isRequired,
|
onBack: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditBackgroundStep.defaultProps = {
|
BackgroundEditStep.defaultProps = {
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
imageCoverUrl: undefined,
|
imageCoverUrl: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EditBackgroundStep;
|
export default BackgroundEditStep;
|
|
@ -6,9 +6,9 @@ import { Input, Popup } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import { useField } from '../../../hooks';
|
import { useField } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './EditNameStep.module.scss';
|
import styles from './NameEditStep.module.scss';
|
||||||
|
|
||||||
const EditNameStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
const NameEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [value, handleFieldChange] = useField(defaultValue);
|
const [value, handleFieldChange] = useField(defaultValue);
|
||||||
|
|
||||||
|
@ -57,11 +57,11 @@ const EditNameStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) =>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditNameStep.propTypes = {
|
NameEditStep.propTypes = {
|
||||||
defaultValue: PropTypes.string.isRequired,
|
defaultValue: PropTypes.string.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onBack: PropTypes.func.isRequired,
|
onBack: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EditNameStep;
|
export default NameEditStep;
|
|
@ -1,3 +0,0 @@
|
||||||
import AddMembershipPopup from './AddMembershipPopup';
|
|
||||||
|
|
||||||
export default AddMembershipPopup;
|
|
|
@ -6,9 +6,9 @@ import { Popup } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import UserItem from './UserItem';
|
import UserItem from './UserItem';
|
||||||
|
|
||||||
import styles from './AddMembershipPopup.module.scss';
|
import styles from './MembershipAddPopup.module.scss';
|
||||||
|
|
||||||
const AddMembershipStep = React.memo(({ users, currentUserIds, onCreate, onClose }) => {
|
const MembershipAddStep = React.memo(({ users, currentUserIds, onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const handleUserSelect = useCallback(
|
const handleUserSelect = useCallback(
|
||||||
|
@ -46,7 +46,7 @@ const AddMembershipStep = React.memo(({ users, currentUserIds, onCreate, onClose
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddMembershipStep.propTypes = {
|
MembershipAddStep.propTypes = {
|
||||||
/* eslint-disable react/forbid-prop-types */
|
/* eslint-disable react/forbid-prop-types */
|
||||||
users: PropTypes.array.isRequired,
|
users: PropTypes.array.isRequired,
|
||||||
currentUserIds: PropTypes.array.isRequired,
|
currentUserIds: PropTypes.array.isRequired,
|
||||||
|
@ -55,4 +55,4 @@ AddMembershipStep.propTypes = {
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(AddMembershipStep);
|
export default withPopup(MembershipAddStep);
|
|
@ -0,0 +1,3 @@
|
||||||
|
import MembershipAddPopup from './MembershipAddPopup';
|
||||||
|
|
||||||
|
export default MembershipAddPopup;
|
|
@ -8,13 +8,13 @@ import { useSteps } from '../../hooks';
|
||||||
import User from '../User';
|
import User from '../User';
|
||||||
import DeleteStep from '../DeleteStep';
|
import DeleteStep from '../DeleteStep';
|
||||||
|
|
||||||
import styles from './EditMembershipPopup.module.scss';
|
import styles from './MembershipEditPopup.module.scss';
|
||||||
|
|
||||||
const StepTypes = {
|
const StepTypes = {
|
||||||
DELETE: 'DELETE',
|
DELETE: 'DELETE',
|
||||||
};
|
};
|
||||||
|
|
||||||
const EditMembershipStep = React.memo(({ user, isEditable, onDelete }) => {
|
const MembershipEditStep = React.memo(({ user, isEditable, onDelete }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [step, openStep, handleBack] = useSteps();
|
const [step, openStep, handleBack] = useSteps();
|
||||||
|
|
||||||
|
@ -56,10 +56,10 @@ const EditMembershipStep = React.memo(({ user, isEditable, onDelete }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditMembershipStep.propTypes = {
|
MembershipEditStep.propTypes = {
|
||||||
user: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
user: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
isEditable: PropTypes.bool.isRequired,
|
isEditable: PropTypes.bool.isRequired,
|
||||||
onDelete: PropTypes.func.isRequired,
|
onDelete: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(EditMembershipStep);
|
export default withPopup(MembershipEditStep);
|
|
@ -4,8 +4,8 @@ import { Button, Grid } from 'semantic-ui-react';
|
||||||
|
|
||||||
import BoardsContainer from '../../containers/BoardsContainer';
|
import BoardsContainer from '../../containers/BoardsContainer';
|
||||||
import ActionsPopup from './ActionsPopup';
|
import ActionsPopup from './ActionsPopup';
|
||||||
import AddMembershipPopup from './AddMembershipPopup';
|
import MembershipAddPopup from './MembershipAddPopup';
|
||||||
import EditMembershipPopup from './EditMembershipPopup';
|
import MembershipEditPopup from './MembershipEditPopup';
|
||||||
import User from '../User';
|
import User from '../User';
|
||||||
|
|
||||||
import styles from './Project.module.scss';
|
import styles from './Project.module.scss';
|
||||||
|
@ -63,7 +63,7 @@ const Project = React.memo(
|
||||||
<span className={styles.users}>
|
<span className={styles.users}>
|
||||||
{memberships.map((membership) => (
|
{memberships.map((membership) => (
|
||||||
<span key={membership.id} className={styles.user}>
|
<span key={membership.id} className={styles.user}>
|
||||||
<EditMembershipPopup
|
<MembershipEditPopup
|
||||||
user={membership.user}
|
user={membership.user}
|
||||||
isEditable={isEditable}
|
isEditable={isEditable}
|
||||||
onDelete={() => handleMembershipDelete(membership.id)}
|
onDelete={() => handleMembershipDelete(membership.id)}
|
||||||
|
@ -74,18 +74,18 @@ const Project = React.memo(
|
||||||
size="large"
|
size="large"
|
||||||
isDisabled={!membership.isPersisted}
|
isDisabled={!membership.isPersisted}
|
||||||
/>
|
/>
|
||||||
</EditMembershipPopup>
|
</MembershipEditPopup>
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</span>
|
</span>
|
||||||
{isEditable && (
|
{isEditable && (
|
||||||
<AddMembershipPopup
|
<MembershipAddPopup
|
||||||
users={allUsers}
|
users={allUsers}
|
||||||
currentUserIds={memberships.map((membership) => membership.user.id)}
|
currentUserIds={memberships.map((membership) => membership.user.id)}
|
||||||
onCreate={onMembershipCreate}
|
onCreate={onMembershipCreate}
|
||||||
>
|
>
|
||||||
<Button icon="add user" className={styles.addUser} />
|
<Button icon="add user" className={styles.addUser} />
|
||||||
</AddMembershipPopup>
|
</MembershipAddPopup>
|
||||||
)}
|
)}
|
||||||
</Grid.Column>
|
</Grid.Column>
|
||||||
</Grid.Row>
|
</Grid.Row>
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { Input } from '../../lib/custom-ui';
|
||||||
|
|
||||||
import { useForm } from '../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
|
|
||||||
import styles from './AddProjectModal.module.scss';
|
import styles from './ProjectAddModal.module.scss';
|
||||||
|
|
||||||
const AddProjectModal = React.memo(({ defaultData, isSubmitting, onCreate, onClose }) => {
|
const ProjectAddModal = React.memo(({ defaultData, isSubmitting, onCreate, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const [data, handleFieldChange] = useForm(() => ({
|
const [data, handleFieldChange] = useForm(() => ({
|
||||||
|
@ -71,11 +71,11 @@ const AddProjectModal = React.memo(({ defaultData, isSubmitting, onCreate, onClo
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddProjectModal.propTypes = {
|
ProjectAddModal.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
onCreate: PropTypes.func.isRequired,
|
onCreate: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddProjectModal;
|
export default ProjectAddModal;
|
3
client/src/components/ProjectAddModal/index.js
Normal file
3
client/src/components/ProjectAddModal/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import ProjectAddModal from './ProjectAddModal';
|
||||||
|
|
||||||
|
export default ProjectAddModal;
|
5
client/src/components/TimerEditPopup.jsx
Normal file
5
client/src/components/TimerEditPopup.jsx
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import { withPopup } from '../lib/popup';
|
||||||
|
|
||||||
|
import TimerEditStep from './TimerEditStep';
|
||||||
|
|
||||||
|
export default withPopup(TimerEditStep);
|
|
@ -9,7 +9,7 @@ import { Input, Popup } from '../../lib/custom-ui';
|
||||||
import { useForm } from '../../hooks';
|
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.scss';
|
import styles from './TimerEditStep.module.scss';
|
||||||
|
|
||||||
const createData = (timer) => {
|
const createData = (timer) => {
|
||||||
if (!timer) {
|
if (!timer) {
|
||||||
|
@ -29,7 +29,7 @@ const createData = (timer) => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const EditTimerStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
const TimerEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [data, handleFieldChange, setData] = useForm(() => createData(defaultValue));
|
const [data, handleFieldChange, setData] = useForm(() => createData(defaultValue));
|
||||||
const [isEditing, toggleEdit] = useToggle();
|
const [isEditing, toggleEdit] = useToggle();
|
||||||
|
@ -171,16 +171,16 @@ const EditTimerStep = React.memo(({ defaultValue, onUpdate, onBack, onClose }) =
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditTimerStep.propTypes = {
|
TimerEditStep.propTypes = {
|
||||||
defaultValue: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
defaultValue: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onBack: PropTypes.func,
|
onBack: PropTypes.func,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditTimerStep.defaultProps = {
|
TimerEditStep.defaultProps = {
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
onBack: undefined,
|
onBack: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EditTimerStep;
|
export default TimerEditStep;
|
3
client/src/components/TimerEditStep/index.js
Normal file
3
client/src/components/TimerEditStep/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import TimerEditStep from './TimerEditStep';
|
||||||
|
|
||||||
|
export default TimerEditStep;
|
|
@ -10,7 +10,7 @@ import { Input, Popup } from '../../lib/custom-ui';
|
||||||
import { useForm } from '../../hooks';
|
import { useForm } from '../../hooks';
|
||||||
import { isUsername } from '../../utils/validator';
|
import { isUsername } from '../../utils/validator';
|
||||||
|
|
||||||
import styles from './AddUserPopup.module.scss';
|
import styles from './UserAddPopup.module.scss';
|
||||||
|
|
||||||
const createMessage = (error) => {
|
const createMessage = (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
@ -36,7 +36,7 @@ const createMessage = (error) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const AddUserPopup = React.memo(
|
const UserAddStep = React.memo(
|
||||||
({ defaultData, isSubmitting, error, onCreate, onMessageDismiss, onClose }) => {
|
({ defaultData, isSubmitting, error, onCreate, onMessageDismiss, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const wasSubmitting = usePrevious(isSubmitting);
|
const wasSubmitting = usePrevious(isSubmitting);
|
||||||
|
@ -190,7 +190,7 @@ const AddUserPopup = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
AddUserPopup.propTypes = {
|
UserAddStep.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
@ -199,8 +199,8 @@ AddUserPopup.propTypes = {
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
AddUserPopup.defaultProps = {
|
UserAddStep.defaultProps = {
|
||||||
error: undefined,
|
error: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(AddUserPopup);
|
export default withPopup(UserAddStep);
|
3
client/src/components/UserAddPopup/index.js
Normal file
3
client/src/components/UserAddPopup/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import UserAddPopup from './UserAddPopup';
|
||||||
|
|
||||||
|
export default UserAddPopup;
|
|
@ -3,11 +3,11 @@ import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Divider, Header, Tab } from 'semantic-ui-react';
|
import { Button, Divider, Header, Tab } from 'semantic-ui-react';
|
||||||
|
|
||||||
import EditInformation from './EditInformation';
|
import InformationEdit from './InformationEdit';
|
||||||
import EditAvatarPopup from './EditAvatarPopup';
|
import AvatarEditPopup from './AvatarEditPopup';
|
||||||
import EditUsernamePopup from './EditUsernamePopup';
|
import UsernameEditPopup from './UsernameEditPopup';
|
||||||
import EditEmailPopup from './EditEmailPopup';
|
import EmailEditPopup from './EmailEditPopup';
|
||||||
import EditPasswordPopup from './EditPasswordPopup';
|
import PasswordEditPopup from './PasswordEditPopup';
|
||||||
import User from '../../User';
|
import User from '../../User';
|
||||||
|
|
||||||
import styles from './AccountPane.module.scss';
|
import styles from './AccountPane.module.scss';
|
||||||
|
@ -43,16 +43,16 @@ const AccountPane = React.memo(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tab.Pane attached={false} className={styles.wrapper}>
|
<Tab.Pane attached={false} className={styles.wrapper}>
|
||||||
<EditAvatarPopup
|
<AvatarEditPopup
|
||||||
defaultValue={avatarUrl}
|
defaultValue={avatarUrl}
|
||||||
onUpdate={onAvatarUpdate}
|
onUpdate={onAvatarUpdate}
|
||||||
onDelete={handleAvatarDelete}
|
onDelete={handleAvatarDelete}
|
||||||
>
|
>
|
||||||
<User name={name} avatarUrl={avatarUrl} size="massive" isDisabled={isAvatarUpdating} />
|
<User name={name} avatarUrl={avatarUrl} size="massive" isDisabled={isAvatarUpdating} />
|
||||||
</EditAvatarPopup>
|
</AvatarEditPopup>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<EditInformation
|
<InformationEdit
|
||||||
defaultData={{
|
defaultData={{
|
||||||
name,
|
name,
|
||||||
phone,
|
phone,
|
||||||
|
@ -68,7 +68,7 @@ const AccountPane = React.memo(
|
||||||
</Header>
|
</Header>
|
||||||
</Divider>
|
</Divider>
|
||||||
<div className={styles.action}>
|
<div className={styles.action}>
|
||||||
<EditUsernamePopup
|
<UsernameEditPopup
|
||||||
defaultData={usernameUpdateForm.data}
|
defaultData={usernameUpdateForm.data}
|
||||||
username={username}
|
username={username}
|
||||||
isSubmitting={usernameUpdateForm.isSubmitting}
|
isSubmitting={usernameUpdateForm.isSubmitting}
|
||||||
|
@ -81,10 +81,10 @@ const AccountPane = React.memo(
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</EditUsernamePopup>
|
</UsernameEditPopup>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.action}>
|
<div className={styles.action}>
|
||||||
<EditEmailPopup
|
<EmailEditPopup
|
||||||
defaultData={emailUpdateForm.data}
|
defaultData={emailUpdateForm.data}
|
||||||
email={email}
|
email={email}
|
||||||
isSubmitting={emailUpdateForm.isSubmitting}
|
isSubmitting={emailUpdateForm.isSubmitting}
|
||||||
|
@ -97,10 +97,10 @@ const AccountPane = React.memo(
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</EditEmailPopup>
|
</EmailEditPopup>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.action}>
|
<div className={styles.action}>
|
||||||
<EditPasswordPopup
|
<PasswordEditPopup
|
||||||
defaultData={passwordUpdateForm.data}
|
defaultData={passwordUpdateForm.data}
|
||||||
isSubmitting={passwordUpdateForm.isSubmitting}
|
isSubmitting={passwordUpdateForm.isSubmitting}
|
||||||
error={passwordUpdateForm.error}
|
error={passwordUpdateForm.error}
|
||||||
|
@ -112,7 +112,7 @@ const AccountPane = React.memo(
|
||||||
context: 'title',
|
context: 'title',
|
||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</EditPasswordPopup>
|
</PasswordEditPopup>
|
||||||
</div>
|
</div>
|
||||||
</Tab.Pane>
|
</Tab.Pane>
|
||||||
);
|
);
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { Button } from 'semantic-ui-react';
|
||||||
import { withPopup } from '../../../lib/popup';
|
import { withPopup } from '../../../lib/popup';
|
||||||
import { FilePicker, Popup } from '../../../lib/custom-ui';
|
import { FilePicker, Popup } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import styles from './EditAvatarPopup.module.scss';
|
import styles from './AvatarEditPopup.module.scss';
|
||||||
|
|
||||||
const EditAvatarStep = React.memo(({ defaultValue, onUpdate, onDelete, onClose }) => {
|
const AvatarEditStep = React.memo(({ defaultValue, onUpdate, onDelete, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const field = useRef(null);
|
const field = useRef(null);
|
||||||
|
@ -57,15 +57,15 @@ const EditAvatarStep = React.memo(({ defaultValue, onUpdate, onDelete, onClose }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditAvatarStep.propTypes = {
|
AvatarEditStep.propTypes = {
|
||||||
defaultValue: PropTypes.string,
|
defaultValue: PropTypes.string,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onDelete: PropTypes.func.isRequired,
|
onDelete: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditAvatarStep.defaultProps = {
|
AvatarEditStep.defaultProps = {
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(EditAvatarStep);
|
export default withPopup(AvatarEditStep);
|
|
@ -9,7 +9,7 @@ import { Input, Popup } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './EditEmailPopup.module.scss';
|
import styles from './EmailEditPopup.module.scss';
|
||||||
|
|
||||||
const createMessage = (error) => {
|
const createMessage = (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
@ -35,7 +35,7 @@ const createMessage = (error) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const EditEmailStep = React.memo(
|
const EmailEditStep = React.memo(
|
||||||
({ defaultData, email, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
({ defaultData, email, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const wasSubmitting = usePrevious(isSubmitting);
|
const wasSubmitting = usePrevious(isSubmitting);
|
||||||
|
@ -160,7 +160,7 @@ const EditEmailStep = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
EditEmailStep.propTypes = {
|
EmailEditStep.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
email: PropTypes.string.isRequired,
|
email: PropTypes.string.isRequired,
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
|
@ -170,8 +170,8 @@ EditEmailStep.propTypes = {
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditEmailStep.defaultProps = {
|
EmailEditStep.defaultProps = {
|
||||||
error: undefined,
|
error: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(EditEmailStep);
|
export default withPopup(EmailEditStep);
|
|
@ -7,9 +7,9 @@ import { Button, Form, Input } from 'semantic-ui-react';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './EditInformation.module.scss';
|
import styles from './InformationEdit.module.scss';
|
||||||
|
|
||||||
const EditInformation = React.memo(({ defaultData, onUpdate }) => {
|
const InformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const [data, handleFieldChange] = useForm(() => ({
|
const [data, handleFieldChange] = useForm(() => ({
|
||||||
|
@ -72,9 +72,9 @@ const EditInformation = React.memo(({ defaultData, onUpdate }) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
EditInformation.propTypes = {
|
InformationEdit.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default EditInformation;
|
export default InformationEdit;
|
|
@ -8,7 +8,7 @@ import { Input, Popup } from '../../../lib/custom-ui';
|
||||||
|
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../../hooks';
|
||||||
|
|
||||||
import styles from './EditPasswordPopup.module.scss';
|
import styles from './PasswordEditPopup.module.scss';
|
||||||
|
|
||||||
const createMessage = (error) => {
|
const createMessage = (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
@ -29,7 +29,7 @@ const createMessage = (error) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const EditPasswordStep = React.memo(
|
const PasswordEditStep = React.memo(
|
||||||
({ defaultData, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
({ defaultData, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const wasSubmitting = usePrevious(isSubmitting);
|
const wasSubmitting = usePrevious(isSubmitting);
|
||||||
|
@ -133,7 +133,7 @@ const EditPasswordStep = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
EditPasswordStep.propTypes = {
|
PasswordEditStep.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
@ -142,8 +142,8 @@ EditPasswordStep.propTypes = {
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditPasswordStep.defaultProps = {
|
PasswordEditStep.defaultProps = {
|
||||||
error: undefined,
|
error: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(EditPasswordStep);
|
export default withPopup(PasswordEditStep);
|
|
@ -9,7 +9,7 @@ import { Input, Popup } from '../../../lib/custom-ui';
|
||||||
import { useForm } from '../../../hooks';
|
import { useForm } from '../../../hooks';
|
||||||
import { isUsername } from '../../../utils/validator';
|
import { isUsername } from '../../../utils/validator';
|
||||||
|
|
||||||
import styles from './EditUsernamePopup.module.scss';
|
import styles from './UsernameEditPopup.module.scss';
|
||||||
|
|
||||||
const createMessage = (error) => {
|
const createMessage = (error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
@ -35,7 +35,7 @@ const createMessage = (error) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const EditUsernameStep = React.memo(
|
const UsernameEditStep = React.memo(
|
||||||
({ defaultData, username, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
({ defaultData, username, isSubmitting, error, onUpdate, onMessageDismiss, onClose }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const wasSubmitting = usePrevious(isSubmitting);
|
const wasSubmitting = usePrevious(isSubmitting);
|
||||||
|
@ -160,7 +160,7 @@ const EditUsernameStep = React.memo(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
EditUsernameStep.propTypes = {
|
UsernameEditStep.propTypes = {
|
||||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
username: PropTypes.string,
|
username: PropTypes.string,
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
|
@ -170,9 +170,9 @@ EditUsernameStep.propTypes = {
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
EditUsernameStep.defaultProps = {
|
UsernameEditStep.defaultProps = {
|
||||||
username: undefined,
|
username: undefined,
|
||||||
error: undefined,
|
error: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withPopup(EditUsernameStep);
|
export default withPopup(UsernameEditStep);
|
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Modal, Table } from 'semantic-ui-react';
|
import { Button, Modal, Table } from 'semantic-ui-react';
|
||||||
|
|
||||||
import AddUserPopupContainer from '../../containers/AddUserPopupContainer';
|
import UserAddPopupContainer from '../../containers/UserAddPopupContainer';
|
||||||
import Item from './Item';
|
import Item from './Item';
|
||||||
|
|
||||||
const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
||||||
|
@ -57,9 +57,9 @@ const UsersModal = React.memo(({ items, onUpdate, onDelete, onClose }) => {
|
||||||
</Table>
|
</Table>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
<Modal.Actions>
|
<Modal.Actions>
|
||||||
<AddUserPopupContainer>
|
<UserAddPopupContainer>
|
||||||
<Button positive content={t('action.addUser')} />
|
<Button positive content={t('action.addUser')} />
|
||||||
</AddUserPopupContainer>
|
</UserAddPopupContainer>
|
||||||
</Modal.Actions>
|
</Modal.Actions>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|
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