1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00

Rename deadline to due date, update dependencies

This commit is contained in:
Maksim Eltyshev 2019-10-05 06:12:36 +05:00
parent 64acf0ac56
commit 51013b6a32
31 changed files with 113 additions and 115 deletions

View file

@ -11,7 +11,7 @@ A Trello-like application built with React and Redux.
## Features ## Features
- Create projects, boards, lists, cards, labels and tasks - Create projects, boards, lists, cards, labels and tasks
- Add card members, track time, set a deadline, write comments - Add card members, track time, set a due date, write comments
- Markdown support in a card description and comment - Markdown support in a card description and comment
- Filter by members and labels - Filter by members and labels
- Real-time updates - Real-time updates

View file

@ -1,4 +1,5 @@
{ {
"name": "planka-client",
"requires": true, "requires": true,
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
@ -6500,9 +6501,9 @@
} }
}, },
"i18next-browser-languagedetector": { "i18next-browser-languagedetector": {
"version": "3.0.3", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-3.0.3.tgz", "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-3.1.1.tgz",
"integrity": "sha512-1YuAogyQap0J6N4kM+6gAjZ6T7QWrp3xZCmSs0QedkNmgAKhj7FiQlCviHKl3IwbM6zJNgft4D7UDPWb1dTCMQ==" "integrity": "sha512-JBgFWijjI1t6as4WgGvDdX4GLJPZwC/SMHzLQQ3ef7XaJsEkomlXFqXifKvOVJg09Hj2BVWe6strDdIF4J/0ng=="
}, },
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
@ -10821,9 +10822,9 @@
"integrity": "sha512-JsecfN+JlckncVXTWFWjn0Vk6uInl8GSf4eEd9tTk5qXHlgqkPdILpnYpgZcISXNYAzvfvsCZviaDk8AxyS5sg==" "integrity": "sha512-JsecfN+JlckncVXTWFWjn0Vk6uInl8GSf4eEd9tTk5qXHlgqkPdILpnYpgZcISXNYAzvfvsCZviaDk8AxyS5sg=="
}, },
"react": { "react": {
"version": "16.10.1", "version": "16.10.2",
"resolved": "https://registry.npmjs.org/react/-/react-16.10.1.tgz", "resolved": "https://registry.npmjs.org/react/-/react-16.10.2.tgz",
"integrity": "sha512-2bisHwMhxQ3XQz4LiJJwG3360pY965pTl/MRrZYxIBKVj4fOHoDs5aZAkYXGxDRO1Li+SyjTAilQEbOmtQJHzA==", "integrity": "sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw==",
"requires": { "requires": {
"loose-envify": "^1.1.0", "loose-envify": "^1.1.0",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
@ -10932,14 +10933,14 @@
} }
}, },
"react-dom": { "react-dom": {
"version": "16.10.1", "version": "16.10.2",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.10.1.tgz", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.10.2.tgz",
"integrity": "sha512-SmM4ZW0uug0rn95U8uqr52I7UdNf6wdGLeXDmNLfg3y5q5H9eAbdjF5ubQc3bjDyRrvdAB2IKG7X0GzSpnn5Mg==", "integrity": "sha512-kWGDcH3ItJK4+6Pl9DZB16BXYAZyrYQItU4OMy0jAkv5aNqc+mAKb4TpFtAteI6TJZu+9ZlNhaeNQSVQDHJzkw==",
"requires": { "requires": {
"loose-envify": "^1.1.0", "loose-envify": "^1.1.0",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"scheduler": "^0.16.1" "scheduler": "^0.16.2"
} }
}, },
"react-error-overlay": { "react-error-overlay": {
@ -11806,9 +11807,9 @@
} }
}, },
"scheduler": { "scheduler": {
"version": "0.16.1", "version": "0.16.2",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.16.1.tgz", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.16.2.tgz",
"integrity": "sha512-MIuie7SgsqMYOdCXVFZa8SKoNorJZUWHW8dPgto7uEHn1lX3fg2Gu0TzgK8USj76uxV7vB5eRMnZs/cdEHg+cg==", "integrity": "sha512-BqYVWqwz6s1wZMhjFvLfVR5WXP7ZY32M/wYPo04CcuPM7XZEbV2TBNW7Z0UkguPTl0dWMA59VbNXxK6q+pHItg==",
"requires": { "requires": {
"loose-envify": "^1.1.0", "loose-envify": "^1.1.0",
"object-assign": "^4.1.1" "object-assign": "^4.1.1"

View file

@ -38,14 +38,14 @@
"dequal": "^1.0.0", "dequal": "^1.0.0",
"history": "^4.10.1", "history": "^4.10.1",
"i18next": "^17.0.18", "i18next": "^17.0.18",
"i18next-browser-languagedetector": "^3.0.3", "i18next-browser-languagedetector": "^3.1.1",
"initials": "^3.0.1", "initials": "^3.0.1",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^16.10.1", "react": "^16.10.2",
"react-beautiful-dnd": "^11.0.5", "react-beautiful-dnd": "^11.0.5",
"react-datepicker": "^2.9.6", "react-datepicker": "^2.9.6",
"react-dom": "^16.10.1", "react-dom": "^16.10.2",
"react-i18next": "^10.13.1", "react-i18next": "^10.13.1",
"react-input-mask": "^2.0.4", "react-input-mask": "^2.0.4",
"react-markdown": "^4.2.2", "react-markdown": "^4.2.2",

View file

@ -4,7 +4,7 @@ import socket from './socket';
export const transformCard = (card) => ({ export const transformCard = (card) => ({
...card, ...card,
deadline: card.deadline && new Date(card.deadline), dueDate: card.dueDate && new Date(card.dueDate),
timer: card.timer && { timer: card.timer && {
...card.timer, ...card.timer,
startedAt: card.timer.startedAt && new Date(card.timer.startedAt), startedAt: card.timer.startedAt && new Date(card.timer.startedAt),
@ -13,8 +13,8 @@ export const transformCard = (card) => ({
export const transformCardData = (data) => ({ export const transformCardData = (data) => ({
...data, ...data,
...(data.deadline && { ...(data.dueDate && {
deadline: data.deadline.toISOString(), dueDate: data.dueDate.toISOString(),
}), }),
...(data.timer && { ...(data.timer && {
...data.timer, ...data.timer,

View file

@ -8,7 +8,7 @@ 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 EditDeadlineStep from '../EditDeadlineStep'; import EditDueDateStep from '../EditDueDateStep';
import EditTimerStep from '../EditTimerStep'; import EditTimerStep from '../EditTimerStep';
import DeleteStep from '../DeleteStep'; import DeleteStep from '../DeleteStep';
@ -17,7 +17,7 @@ import styles from './ActionsPopup.module.css';
const StepTypes = { const StepTypes = {
USERS: 'USERS', USERS: 'USERS',
LABELS: 'LABELS', LABELS: 'LABELS',
EDIT_DEADLINE: 'EDIT_DEADLINE', EDIT_DUE_DATE: 'EDIT_DUE_DATE',
EDIT_TIMER: 'EDIT_TIMER', EDIT_TIMER: 'EDIT_TIMER',
DELETE: 'DELETE', DELETE: 'DELETE',
}; };
@ -57,8 +57,8 @@ const ActionsStep = React.memo(
openStep(StepTypes.LABELS); openStep(StepTypes.LABELS);
}, [openStep]); }, [openStep]);
const handleEditDeadlineClick = useCallback(() => { const handleEditDueDateClick = useCallback(() => {
openStep(StepTypes.EDIT_DEADLINE); openStep(StepTypes.EDIT_DUE_DATE);
}, [openStep]); }, [openStep]);
const handleEditTimerClick = useCallback(() => { const handleEditTimerClick = useCallback(() => {
@ -69,10 +69,10 @@ const ActionsStep = React.memo(
openStep(StepTypes.DELETE); openStep(StepTypes.DELETE);
}, [openStep]); }, [openStep]);
const handleDeadlineUpdate = useCallback( const handleDueDateUpdate = useCallback(
(deadline) => { (dueDate) => {
onUpdate({ onUpdate({
deadline, dueDate,
}); });
}, },
[onUpdate], [onUpdate],
@ -112,11 +112,11 @@ const ActionsStep = React.memo(
onBack={handleBack} onBack={handleBack}
/> />
); );
case StepTypes.EDIT_DEADLINE: case StepTypes.EDIT_DUE_DATE:
return ( return (
<EditDeadlineStep <EditDueDateStep
defaultValue={card.deadline} defaultValue={card.dueDate}
onUpdate={handleDeadlineUpdate} onUpdate={handleDueDateUpdate}
onBack={handleBack} onBack={handleBack}
onClose={onClose} onClose={onClose}
/> />
@ -170,8 +170,8 @@ const ActionsStep = React.memo(
context: 'title', context: 'title',
})} })}
</Menu.Item> </Menu.Item>
<Menu.Item className={styles.menuItem} onClick={handleEditDeadlineClick}> <Menu.Item className={styles.menuItem} onClick={handleEditDueDateClick}>
{t('action.editDeadline', { {t('action.editDueDate', {
context: 'title', context: 'title',
})} })}
</Menu.Item> </Menu.Item>

View file

@ -11,7 +11,7 @@ import EditName from './EditName';
import ActionsPopup from './ActionsPopup'; import ActionsPopup from './ActionsPopup';
import User from '../User'; import User from '../User';
import Label from '../Label'; import Label from '../Label';
import Deadline from '../Deadline'; import DueDate from '../DueDate';
import Timer from '../Timer'; import Timer from '../Timer';
import styles from './Card.module.css'; import styles from './Card.module.css';
@ -21,7 +21,7 @@ const Card = React.memo(
id, id,
index, index,
name, name,
deadline, dueDate,
timer, timer,
isPersisted, isPersisted,
notificationsTotal, notificationsTotal,
@ -74,7 +74,7 @@ const Card = React.memo(
)} )}
<div className={styles.name}>{name}</div> <div className={styles.name}>{name}</div>
{tasks.length > 0 && <Tasks items={tasks} />} {tasks.length > 0 && <Tasks items={tasks} />}
{(deadline || timer) && ( {(dueDate || timer) && (
<span className={styles.attachments}> <span className={styles.attachments}>
{notificationsTotal > 0 && ( {notificationsTotal > 0 && (
<span <span
@ -87,9 +87,9 @@ const Card = React.memo(
{notificationsTotal} {notificationsTotal}
</span> </span>
)} )}
{deadline && ( {dueDate && (
<span className={classNames(styles.attachment, styles.attachmentLeft)}> <span className={classNames(styles.attachment, styles.attachmentLeft)}>
<Deadline value={deadline} size="tiny" /> <DueDate value={dueDate} size="tiny" />
</span> </span>
)} )}
{timer && ( {timer && (
@ -131,7 +131,7 @@ const Card = React.memo(
card={{ card={{
id, id,
name, name,
deadline, dueDate,
timer, timer,
isPersisted, isPersisted,
}} }}
@ -171,7 +171,7 @@ Card.propTypes = {
id: PropTypes.number.isRequired, id: PropTypes.number.isRequired,
index: PropTypes.number.isRequired, index: PropTypes.number.isRequired,
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
deadline: 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
isPersisted: PropTypes.bool.isRequired, isPersisted: PropTypes.bool.isRequired,
notificationsTotal: PropTypes.number.isRequired, notificationsTotal: PropTypes.number.isRequired,
@ -194,7 +194,7 @@ Card.propTypes = {
}; };
Card.defaultProps = { Card.defaultProps = {
deadline: undefined, dueDate: undefined,
timer: undefined, timer: undefined,
}; };

View file

@ -13,11 +13,11 @@ import Tasks from './Tasks';
import Actions from './Actions'; import Actions from './Actions';
import User from '../User'; import User from '../User';
import Label from '../Label'; import Label from '../Label';
import Deadline from '../Deadline'; 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 EditDeadlinePopup from '../EditDeadlinePopup'; import EditDueDatePopup from '../EditDueDatePopup';
import EditTimerPopup from '../EditTimerPopup'; import EditTimerPopup from '../EditTimerPopup';
import DeletePopup from '../DeletePopup'; import DeletePopup from '../DeletePopup';
@ -27,7 +27,7 @@ const CardModal = React.memo(
({ ({
name, name,
description, description,
deadline, dueDate,
timer, timer,
isSubscribed, isSubscribed,
isActionsFetching, isActionsFetching,
@ -77,10 +77,10 @@ const CardModal = React.memo(
[onUpdate], [onUpdate],
); );
const handleDeadlineUpdate = useCallback( const handleDueDateUpdate = useCallback(
(newDeadline) => { (newDueDate) => {
onUpdate({ onUpdate({
deadline: newDeadline, dueDate: newDueDate,
}); });
}, },
[onUpdate], [onUpdate],
@ -125,7 +125,7 @@ const CardModal = React.memo(
</Grid.Row> </Grid.Row>
<Grid.Row className={styles.modalPadding}> <Grid.Row className={styles.modalPadding}>
<Grid.Column width={12} className={styles.contentPadding}> <Grid.Column width={12} className={styles.contentPadding}>
{(users.length > 0 || labels.length > 0 || deadline || timer) && ( {(users.length > 0 || labels.length > 0 || dueDate || timer) && (
<div className={styles.moduleWrapper}> <div className={styles.moduleWrapper}>
{users.length > 0 && ( {users.length > 0 && (
<div className={styles.attachments}> <div className={styles.attachments}>
@ -154,7 +154,7 @@ const CardModal = React.memo(
> >
<button <button
type="button" type="button"
className={classNames(styles.attachment, styles.deadline)} className={classNames(styles.attachment, styles.dueDate)}
> >
<Icon name="add" size="small" className={styles.addAttachment} /> <Icon name="add" size="small" className={styles.addAttachment} />
</button> </button>
@ -195,24 +195,24 @@ const CardModal = React.memo(
> >
<button <button
type="button" type="button"
className={classNames(styles.attachment, styles.deadline)} className={classNames(styles.attachment, styles.dueDate)}
> >
<Icon name="add" size="small" className={styles.addAttachment} /> <Icon name="add" size="small" className={styles.addAttachment} />
</button> </button>
</LabelsPopup> </LabelsPopup>
</div> </div>
)} )}
{deadline && ( {dueDate && (
<div className={styles.attachments}> <div className={styles.attachments}>
<div className={styles.text}> <div className={styles.text}>
{t('common.deadline', { {t('common.dueDate', {
context: 'title', context: 'title',
})} })}
</div> </div>
<span className={styles.attachment}> <span className={styles.attachment}>
<EditDeadlinePopup defaultValue={deadline} onUpdate={handleDeadlineUpdate}> <EditDueDatePopup defaultValue={dueDate} onUpdate={handleDueDateUpdate}>
<Deadline value={deadline} /> <DueDate value={dueDate} />
</EditDeadlinePopup> </EditDueDatePopup>
</span> </span>
</div> </div>
)} )}
@ -302,12 +302,12 @@ const CardModal = React.memo(
{t('common.labels')} {t('common.labels')}
</Button> </Button>
</LabelsPopup> </LabelsPopup>
<EditDeadlinePopup defaultValue={deadline} onUpdate={handleDeadlineUpdate}> <EditDueDatePopup 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.deadline')} {t('common.dueDate')}
</Button> </Button>
</EditDeadlinePopup> </EditDueDatePopup>
<EditTimerPopup defaultValue={timer} onUpdate={handleTimerUpdate}> <EditTimerPopup 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} />
@ -346,7 +346,7 @@ const CardModal = React.memo(
CardModal.propTypes = { CardModal.propTypes = {
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
description: PropTypes.string, description: PropTypes.string,
deadline: PropTypes.instanceOf(Date), dueDate: PropTypes.instanceOf(Date),
timer: PropTypes.object, // eslint-disable-line react/forbid-prop-types timer: PropTypes.object, // eslint-disable-line react/forbid-prop-types
isSubscribed: PropTypes.bool.isRequired, isSubscribed: PropTypes.bool.isRequired,
isActionsFetching: PropTypes.bool.isRequired, isActionsFetching: PropTypes.bool.isRequired,
@ -381,7 +381,7 @@ CardModal.propTypes = {
CardModal.defaultProps = { CardModal.defaultProps = {
description: undefined, description: undefined,
deadline: undefined, dueDate: undefined,
timer: undefined, timer: undefined,
}; };

View file

@ -64,7 +64,7 @@
padding: 8px 8px 0 16px !important; padding: 8px 8px 0 16px !important;
} }
.deadline { .dueDate {
background: #dce0e4; background: #dce0e4;
border: none; border: none;
border-radius: 3px; border-radius: 3px;
@ -78,7 +78,7 @@
vertical-align: top; vertical-align: top;
} }
.deadline:hover { .dueDate:hover {
background: #d2d8dc; background: #d2d8dc;
color: #17394d; color: #17394d;
} }

View file

@ -1,3 +0,0 @@
import Deadline from './Deadline';
export default Deadline;

View file

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import styles from './Deadline.module.css'; import styles from './DueDate.module.css';
const SIZES = { const SIZES = {
TINY: 'tiny', TINY: 'tiny',
@ -35,7 +35,7 @@ const FORMATS = {
medium: 'longDateTime', medium: 'longDateTime',
}; };
const Deadline = React.memo(({ const DueDate = React.memo(({
value, size, isDisabled, onClick, value, size, isDisabled, onClick,
}) => { }) => {
const [t] = useTranslation(); const [t] = useTranslation();
@ -62,17 +62,17 @@ const Deadline = React.memo(({
); );
}); });
Deadline.propTypes = { DueDate.propTypes = {
value: PropTypes.instanceOf(Date).isRequired, value: PropTypes.instanceOf(Date).isRequired,
size: PropTypes.oneOf(Object.values(SIZES)), size: PropTypes.oneOf(Object.values(SIZES)),
isDisabled: PropTypes.bool, isDisabled: PropTypes.bool,
onClick: PropTypes.func, onClick: PropTypes.func,
}; };
Deadline.defaultProps = { DueDate.defaultProps = {
size: SIZES.MEDIUM, size: SIZES.MEDIUM,
isDisabled: false, isDisabled: false,
onClick: undefined, onClick: undefined,
}; };
export default Deadline; export default DueDate;

View file

@ -0,0 +1,3 @@
import DueDate from './DueDate';
export default DueDate;

View file

@ -1,5 +0,0 @@
import { withPopup } from '../lib/popup';
import EditDeadlineStep from './EditDeadlineStep';
export default withPopup(EditDeadlineStep);

View file

@ -1,3 +0,0 @@
import EditDeadlineStep from './EditDeadlineStep';
export default EditDeadlineStep;

View file

@ -0,0 +1,5 @@
import { withPopup } from '../lib/popup';
import EditDueDateStep from './EditDueDateStep';
export default withPopup(EditDueDateStep);

View file

@ -11,9 +11,9 @@ import {
useDeepCompareCallback, useDidUpdate, useForm, useToggle, useDeepCompareCallback, useDidUpdate, useForm, useToggle,
} from '../../hooks'; } from '../../hooks';
import styles from './EditDeadlineStep.module.css'; import styles from './EditDueDateStep.module.css';
const EditDeadlineStep = React.memo(({ const EditDueDateStep = React.memo(({
defaultValue, onUpdate, onBack, onClose, defaultValue, onUpdate, onBack, onClose,
}) => { }) => {
const [t] = useTranslation(); const [t] = useTranslation();
@ -107,7 +107,7 @@ const EditDeadlineStep = React.memo(({
return ( return (
<> <>
<Popup.Header onBack={onBack}> <Popup.Header onBack={onBack}>
{t('common.editDeadline', { {t('common.editDueDate', {
context: 'title', context: 'title',
})} })}
</Popup.Header> </Popup.Header>
@ -137,16 +137,16 @@ const EditDeadlineStep = React.memo(({
); );
}); });
EditDeadlineStep.propTypes = { EditDueDateStep.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,
}; };
EditDeadlineStep.defaultProps = { EditDueDateStep.defaultProps = {
defaultValue: undefined, defaultValue: undefined,
onBack: undefined, onBack: undefined,
}; };
export default EditDeadlineStep; export default EditDueDateStep;

View file

@ -0,0 +1,3 @@
import EditDueDateStep from './EditDueDateStep';
export default EditDueDateStep;

View file

@ -35,7 +35,7 @@ const makeMapStateToProps = () => {
const allLabels = labelsForCurrentBoardSelector(state); const allLabels = labelsForCurrentBoardSelector(state);
const { const {
name, deadline, timer, isPersisted, name, dueDate, timer, isPersisted,
} = cardByIdSelector(state, id); } = cardByIdSelector(state, id);
const users = usersByCardIdSelector(state, id); const users = usersByCardIdSelector(state, id);
@ -47,7 +47,7 @@ const makeMapStateToProps = () => {
id, id,
index, index,
name, name,
deadline, dueDate,
timer, timer,
isPersisted, isPersisted,
notificationsTotal, notificationsTotal,

View file

@ -42,7 +42,7 @@ const mapStateToProps = (state) => {
const { const {
name, name,
description, description,
deadline, dueDate,
timer, timer,
isSubscribed, isSubscribed,
isActionsFetching, isActionsFetching,
@ -58,7 +58,7 @@ const mapStateToProps = (state) => {
return { return {
name, name,
description, description,
deadline, dueDate,
timer, timer,
isSubscribed, isSubscribed,
isActionsFetching, isActionsFetching,

View file

@ -36,7 +36,7 @@ export default {
createNewOneOrSelectExistingOne: 'Create a new one or select<br />an existing one', createNewOneOrSelectExistingOne: 'Create a new one or select<br />an existing one',
createProject_title: 'Create Project', createProject_title: 'Create Project',
date: 'Date', date: 'Date',
deadline: 'Deadline', dueDate: 'Due date',
deleteBoard_title: 'Delete Board', deleteBoard_title: 'Delete Board',
deleteCard_title: 'Delete Card', deleteCard_title: 'Delete Card',
deleteComment_title: 'Delete Comment', deleteComment_title: 'Delete Comment',
@ -48,7 +48,7 @@ export default {
description: 'Description', description: 'Description',
editAvatar_title: 'Edit Avatar', editAvatar_title: 'Edit Avatar',
editBoard_title: 'Edit Board', editBoard_title: 'Edit Board',
editDeadline_title: 'Edit Deadline', editDueDate_title: 'Edit Due Date',
editLabel_title: 'Edit Label', editLabel_title: 'Edit Label',
editName_title: 'Edit Name', editName_title: 'Edit Name',
editProject_title: 'Edit Project', editProject_title: 'Edit Project',
@ -119,7 +119,7 @@ export default {
deleteUser: 'Delete user', deleteUser: 'Delete user',
edit: 'Edit', edit: 'Edit',
editAvatar_title: 'Edit Avatar', editAvatar_title: 'Edit Avatar',
editDeadline_title: 'Edit Deadline', editDueDate_title: 'Edit Due Date',
editDescription_title: 'Edit Description', editDescription_title: 'Edit Description',
editName_title: 'Edit Name', editName_title: 'Edit Name',
editTask_title: 'Edit Task', editTask_title: 'Edit Task',

View file

@ -40,7 +40,7 @@ export default {
createNewOneOrSelectExistingOne: 'Создайте новую или выберите<br />уже существующую', createNewOneOrSelectExistingOne: 'Создайте новую или выберите<br />уже существующую',
createProject: 'Создание проекта', createProject: 'Создание проекта',
date: 'Дата', date: 'Дата',
deadline: 'Срок', dueDate: 'Срок',
deleteBoard: 'Удаление доски', deleteBoard: 'Удаление доски',
deleteCard: 'Удаление карточки', deleteCard: 'Удаление карточки',
deleteComment: 'Удаление комментария', deleteComment: 'Удаление комментария',
@ -52,7 +52,7 @@ export default {
description: 'Описание', description: 'Описание',
editAvatar: 'Изменение аватара', editAvatar: 'Изменение аватара',
editBoard: 'Изменение доски', editBoard: 'Изменение доски',
editDeadline: 'Изменение срока', editDueDate: 'Изменение срока',
editLabel: 'Изменения метки', editLabel: 'Изменения метки',
editName: 'Изменение имени', editName: 'Изменение имени',
editProject: 'Изменение проекта', editProject: 'Изменение проекта',
@ -119,7 +119,7 @@ export default {
deleteUser: 'Удалить пользователя', deleteUser: 'Удалить пользователя',
edit: 'Изменить', edit: 'Изменить',
editAvatar: 'Изменить аватар', editAvatar: 'Изменить аватар',
editDeadline: 'Изменить срок', editDueDate: 'Изменить срок',
editDescription: 'Изменить описание', editDescription: 'Изменить описание',
editName: 'Изменить имя', editName: 'Изменить имя',
editTask: 'Изменить задачу', editTask: 'Изменить задачу',

View file

@ -13,7 +13,7 @@ export default class extends Model {
position: attr(), position: attr(),
name: attr(), name: attr(),
description: attr(), description: attr(),
deadline: attr(), dueDate: attr(),
timer: attr(), timer: attr(),
isSubscribed: attr({ isSubscribed: attr({
getDefault: () => false, getDefault: () => false,

View file

@ -1,5 +1,5 @@
import { import {
all, call, fork, take, all, apply, call, fork, take,
} from 'redux-saga/effects'; } from 'redux-saga/effects';
import watchers from './watchers'; import watchers from './watchers';
@ -12,11 +12,11 @@ import Paths from '../../constants/Paths';
export default function* () { export default function* () {
yield all(watchers.map((watcher) => fork(watcher))); yield all(watchers.map((watcher) => fork(watcher)));
yield call([socket, socket.connect]); yield apply(socket, socket.connect);
yield call(initializeAppService); yield fork(initializeAppService);
yield take(ActionTypes.LOGOUT); yield take(ActionTypes.LOGOUT);
yield call(removeAccessToken);
yield call(removeAccessToken);
window.location.href = Paths.LOGIN; window.location.href = Paths.LOGIN;
} }

View file

@ -1,4 +1,6 @@
import { call, select, put } from 'redux-saga/effects'; import {
call, put, select, take,
} from 'redux-saga/effects';
import { accessTokenSelector } from '../../../selectors'; import { accessTokenSelector } from '../../../selectors';
import { logout } from '../../../actions'; import { logout } from '../../../actions';
@ -14,6 +16,7 @@ export default function* (method, ...args) {
} catch (error) { } catch (error) {
if (error.code === ErrorCodes.UNAUTHORIZED) { if (error.code === ErrorCodes.UNAUTHORIZED) {
yield put(logout()); // TODO: next url yield put(logout()); // TODO: next url
yield take();
} }
throw error; throw error;

View file

@ -14,13 +14,7 @@ import i18n from '../../../i18n';
import Paths from '../../../constants/Paths'; import Paths from '../../../constants/Paths';
export function* loadLocaleService(language) { export function* loadLocaleService(language) {
try { yield call(i18n.loadAppLocale, language);
yield call(i18n.loadAppLocale, language);
return true;
} catch (error) {
return false;
}
} }
export function* initializeAppService() { export function* initializeAppService() {

View file

@ -5,7 +5,6 @@ import { authenticate, clearAuthenticationError } from '../../../actions';
export function* authenticateService(data) { export function* authenticateService(data) {
yield put(authenticate(data)); yield put(authenticate(data));
yield call(authenticateRequest, data); yield call(authenticateRequest, data);
} }

View file

@ -25,7 +25,7 @@ module.exports = {
isNotEmptyString: true, isNotEmptyString: true,
allowNull: true allowNull: true
}, },
deadline: { dueDate: {
type: 'string', type: 'string',
custom: value => moment(value, moment.ISO_8601, true).isValid() custom: value => moment(value, moment.ISO_8601, true).isValid()
}, },
@ -66,7 +66,7 @@ module.exports = {
'position', 'position',
'name', 'name',
'description', 'description',
'deadline', 'dueDate',
'timer' 'timer'
]); ]);

View file

@ -30,7 +30,7 @@ module.exports = {
isNotEmptyString: true, isNotEmptyString: true,
allowNull: true allowNull: true
}, },
deadline: { dueDate: {
type: 'string', type: 'string',
custom: value => moment(value, moment.ISO_8601, true).isValid(), custom: value => moment(value, moment.ISO_8601, true).isValid(),
allowNull: true allowNull: true
@ -87,7 +87,7 @@ module.exports = {
'position', 'position',
'name', 'name',
'description', 'description',
'deadline', 'dueDate',
'timer', 'timer',
'isSubscribed' 'isSubscribed'
]); ]);

View file

@ -24,8 +24,9 @@ module.exports = {
isNotEmptyString: true, isNotEmptyString: true,
allowNull: true allowNull: true
}, },
deadline: { dueDate: {
type: 'ref' type: 'ref',
columnName: 'due_date'
}, },
timer: { timer: {
type: 'json' type: 'json'

View file

@ -10,7 +10,7 @@ module.exports.up = knex =>
table.specificType('position', 'double precision').notNullable(); table.specificType('position', 'double precision').notNullable();
table.text('name').notNullable(); table.text('name').notNullable();
table.text('description'); table.text('description');
table.timestamp('deadline', true); table.timestamp('dueDate', true);
table.jsonb('timer'); table.jsonb('timer');
table.timestamp('created_at', true); table.timestamp('created_at', true);