Prepare for collection board type, refactoring, update dependencies
This commit is contained in:
@@ -9,9 +9,9 @@ import { Popup } from '../../lib/custom-ui';
|
||||
import { useSteps } from '../../hooks';
|
||||
import ProjectMembershipsStep from '../ProjectMembershipsStep';
|
||||
import LabelsStep from '../LabelsStep';
|
||||
import EditDueDateStep from '../EditDueDateStep';
|
||||
import EditTimerStep from '../EditTimerStep';
|
||||
import MoveCardStep from '../MoveCardStep';
|
||||
import DueDateEditStep from '../DueDateEditStep';
|
||||
import TimerEditStep from '../TimerEditStep';
|
||||
import CardMoveStep from '../CardMoveStep';
|
||||
import DeleteStep from '../DeleteStep';
|
||||
|
||||
import styles from './ActionsPopup.module.scss';
|
||||
@@ -125,7 +125,7 @@ const ActionsStep = React.memo(
|
||||
);
|
||||
case StepTypes.EDIT_DUE_DATE:
|
||||
return (
|
||||
<EditDueDateStep
|
||||
<DueDateEditStep
|
||||
defaultValue={card.dueDate}
|
||||
onUpdate={handleDueDateUpdate}
|
||||
onBack={handleBack}
|
||||
@@ -134,7 +134,7 @@ const ActionsStep = React.memo(
|
||||
);
|
||||
case StepTypes.EDIT_TIMER:
|
||||
return (
|
||||
<EditTimerStep
|
||||
<TimerEditStep
|
||||
defaultValue={card.timer}
|
||||
onUpdate={handleTimerUpdate}
|
||||
onBack={handleBack}
|
||||
@@ -143,7 +143,7 @@ const ActionsStep = React.memo(
|
||||
);
|
||||
case StepTypes.MOVE:
|
||||
return (
|
||||
<MoveCardStep
|
||||
<CardMoveStep
|
||||
projectsToLists={projectsToLists}
|
||||
defaultPath={pick(card, ['projectId', 'boardId', 'listId'])}
|
||||
onMove={onMove}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Draggable } from 'react-beautiful-dnd';
|
||||
|
||||
import Paths from '../../constants/Paths';
|
||||
import Tasks from './Tasks';
|
||||
import EditName from './EditName';
|
||||
import NameEdit from './NameEdit';
|
||||
import ActionsPopup from './ActionsPopup';
|
||||
import User from '../User';
|
||||
import Label from '../Label';
|
||||
@@ -24,8 +24,8 @@ const Card = React.memo(
|
||||
dueDate,
|
||||
timer,
|
||||
coverUrl,
|
||||
listId,
|
||||
boardId,
|
||||
listId,
|
||||
projectId,
|
||||
isPersisted,
|
||||
notificationsTotal,
|
||||
@@ -48,7 +48,7 @@ const Card = React.memo(
|
||||
onLabelUpdate,
|
||||
onLabelDelete,
|
||||
}) => {
|
||||
const editName = useRef(null);
|
||||
const nameEdit = useRef(null);
|
||||
|
||||
const handleClick = useCallback(() => {
|
||||
if (document.activeElement) {
|
||||
@@ -66,7 +66,7 @@ const Card = React.memo(
|
||||
);
|
||||
|
||||
const handleNameEdit = useCallback(() => {
|
||||
editName.current.open();
|
||||
nameEdit.current.open();
|
||||
}, []);
|
||||
|
||||
const contentNode = (
|
||||
@@ -133,7 +133,7 @@ const Card = React.memo(
|
||||
{({ innerRef, draggableProps, dragHandleProps }) => (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<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}>
|
||||
{isPersisted ? (
|
||||
<>
|
||||
@@ -150,8 +150,8 @@ const Card = React.memo(
|
||||
name,
|
||||
dueDate,
|
||||
timer,
|
||||
listId,
|
||||
boardId,
|
||||
listId,
|
||||
projectId,
|
||||
isPersisted,
|
||||
}}
|
||||
@@ -183,7 +183,7 @@ const Card = React.memo(
|
||||
<span className={styles.content}>{contentNode}</span>
|
||||
)}
|
||||
</div>
|
||||
</EditName>
|
||||
</NameEdit>
|
||||
</div>
|
||||
)}
|
||||
</Draggable>
|
||||
@@ -198,8 +198,8 @@ Card.propTypes = {
|
||||
dueDate: PropTypes.instanceOf(Date),
|
||||
timer: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||
coverUrl: PropTypes.string,
|
||||
listId: PropTypes.string.isRequired,
|
||||
boardId: PropTypes.string.isRequired,
|
||||
listId: PropTypes.string.isRequired,
|
||||
projectId: PropTypes.string.isRequired,
|
||||
isPersisted: PropTypes.bool.isRequired,
|
||||
notificationsTotal: PropTypes.number.isRequired,
|
||||
|
||||
@@ -6,9 +6,9 @@ import { Button, Form, TextArea } from 'semantic-ui-react';
|
||||
|
||||
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 [isOpened, setIsOpened] = useState(false);
|
||||
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,
|
||||
defaultValue: PropTypes.string.isRequired,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default React.memo(EditName);
|
||||
export default React.memo(NameEdit);
|
||||
Reference in New Issue
Block a user