Tasks: reorganizes Tasks components into their own subfolder
parent
680f9698a7
commit
5d54ab4563
|
@ -14,8 +14,8 @@ import SearchableAddressBook from '../components/SearchableAddressBook';
|
|||
import Contact from '../components/Contact';
|
||||
import Calendar from '../components/Calendar';
|
||||
import Event from '../components/Event';
|
||||
import Task from '../components/Task';
|
||||
import TaskList from '../components/TaskList';
|
||||
import Task from '../components/Tasks/Task';
|
||||
import TaskList from '../components/Tasks/TaskList';
|
||||
|
||||
import AppBarOverride from '../widgets/AppBarOverride';
|
||||
import Container from '../widgets/Container';
|
||||
|
|
|
@ -16,7 +16,7 @@ import Container from '../widgets/Container';
|
|||
|
||||
import SearchableAddressBook from '../components/SearchableAddressBook';
|
||||
import Calendar from '../components/Calendar';
|
||||
import TaskList from '../components/TaskList';
|
||||
import TaskList from '../components/Tasks/TaskList';
|
||||
|
||||
import { EventType, ContactType, TaskType } from '../pim-types';
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ import ContactEdit from '../components/ContactEdit';
|
|||
import Contact from '../components/Contact';
|
||||
import EventEdit from '../components/EventEdit';
|
||||
import Event from '../components/Event';
|
||||
import TaskEdit from '../components/TaskEdit';
|
||||
import Task from '../components/Task';
|
||||
import TaskEdit from '../components/Tasks/TaskEdit';
|
||||
import Task from '../components/Tasks/Task';
|
||||
import PimMain from './PimMain';
|
||||
|
||||
import { routeResolver } from '../App';
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
import * as React from 'react';
|
||||
|
||||
import PimItemHeader from './PimItemHeader';
|
||||
import PimItemHeader from '../PimItemHeader';
|
||||
|
||||
import { formatDate, formatOurTimezoneOffset } from '../helpers';
|
||||
import { formatDate, formatOurTimezoneOffset } from '../../helpers';
|
||||
|
||||
import { TaskType } from '../pim-types';
|
||||
import { TaskType } from '../../pim-types';
|
||||
|
||||
class Task extends React.PureComponent {
|
||||
public props: {
|
|
@ -20,10 +20,10 @@ import IconDelete from '@material-ui/icons/Delete';
|
|||
import IconCancel from '@material-ui/icons/Clear';
|
||||
import IconSave from '@material-ui/icons/Save';
|
||||
|
||||
import DateTimePicker from '../widgets/DateTimePicker';
|
||||
import DateTimePicker from '../../widgets/DateTimePicker';
|
||||
|
||||
import ConfirmationDialog from '../widgets/ConfirmationDialog';
|
||||
import TimezonePicker from '../widgets/TimezonePicker';
|
||||
import ConfirmationDialog from '../../widgets/ConfirmationDialog';
|
||||
import TimezonePicker from '../../widgets/TimezonePicker';
|
||||
|
||||
import { Location } from 'history';
|
||||
import { withRouter } from 'react-router';
|
||||
|
@ -33,9 +33,9 @@ import * as ICAL from 'ical.js';
|
|||
|
||||
import * as EteSync from 'etesync';
|
||||
|
||||
import { getCurrentTimezone } from '../helpers';
|
||||
import { getCurrentTimezone } from '../../helpers';
|
||||
|
||||
import { TaskType, TaskStatusType, timezoneLoadFromName } from '../pim-types';
|
||||
import { TaskType, TaskStatusType, timezoneLoadFromName } from '../../pim-types';
|
||||
|
||||
interface PropsType {
|
||||
collections: EteSync.CollectionInfo[];
|
||||
|
@ -177,7 +177,7 @@ class TaskEdit extends React.PureComponent<PropsType> {
|
|||
this.props.item.clone()
|
||||
:
|
||||
new TaskType(null)
|
||||
;
|
||||
;
|
||||
|
||||
event.uid = this.state.uid;
|
||||
event.summary = this.state.title;
|
||||
|
@ -394,7 +394,7 @@ class TaskEdit extends React.PureComponent<PropsType> {
|
|||
onOk={() => this.props.onDelete(this.props.item!, this.props.initialCollection!)}
|
||||
onCancel={() => this.setState({ showDeleteDialog: false })}
|
||||
>
|
||||
Are you sure you would like to delete this event?
|
||||
Are you sure you would like to delete this event?
|
||||
</ConfirmationDialog>
|
||||
</React.Fragment>
|
||||
);
|
|
@ -5,27 +5,14 @@ import * as React from 'react';
|
|||
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import { List, ListItem } from '../widgets/List';
|
||||
import { List } from '../../widgets/List';
|
||||
|
||||
import { TaskType } from '../pim-types';
|
||||
import { TaskType } from '../../pim-types';
|
||||
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
||||
import Checkbox from '@material-ui/core/Checkbox';
|
||||
import Divider from '@material-ui/core/Divider';
|
||||
|
||||
const TaskListItem = React.memo((props: { entry: TaskType, onClick: (entry: TaskType) => void }) => {
|
||||
const {
|
||||
entry,
|
||||
onClick,
|
||||
} = props;
|
||||
const title = entry.title;
|
||||
|
||||
return (
|
||||
<ListItem
|
||||
primaryText={title}
|
||||
onClick={() => onClick(entry)}
|
||||
/>
|
||||
);
|
||||
});
|
||||
import TaskListItem from './TaskListItem';
|
||||
|
||||
const sortSelector = createSelector(
|
||||
(entries: TaskType[]) => entries,
|
|
@ -0,0 +1,21 @@
|
|||
import * as React from 'react';
|
||||
|
||||
import { TaskType } from '../../pim-types';
|
||||
import { ListItem } from '../../widgets/List';
|
||||
|
||||
const TaskListItem = React.memo((props: { entry: TaskType, onClick: (entry: TaskType) => void }) => {
|
||||
const {
|
||||
entry,
|
||||
onClick,
|
||||
} = props;
|
||||
const title = entry.title;
|
||||
|
||||
return (
|
||||
<ListItem
|
||||
primaryText={title}
|
||||
onClick={() => onClick(entry)}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
export default TaskListItem;
|
Loading…
Reference in New Issue