|
|
@ -42,10 +42,6 @@ import { addJournalEntry } from '../etesync-helpers';
|
|
|
|
|
|
|
|
|
|
|
|
import { syncEntriesToItemMap, syncEntriesToEventItemMap, syncEntriesToTaskItemMap } from '../journal-processors';
|
|
|
|
import { syncEntriesToItemMap, syncEntriesToEventItemMap, syncEntriesToTaskItemMap } from '../journal-processors';
|
|
|
|
|
|
|
|
|
|
|
|
function objValues(obj: any) {
|
|
|
|
|
|
|
|
return Object.keys(obj).map((x) => obj[x]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const itemsSelector = createSelector(
|
|
|
|
const itemsSelector = createSelector(
|
|
|
|
(props: {syncInfo: SyncInfo}) => props.syncInfo,
|
|
|
|
(props: {syncInfo: SyncInfo}) => props.syncInfo,
|
|
|
|
(syncInfo) => {
|
|
|
|
(syncInfo) => {
|
|
|
@ -80,6 +76,11 @@ const itemsSelector = createSelector(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const itemValuesSelector = createSelector(
|
|
|
|
|
|
|
|
itemsSelector,
|
|
|
|
|
|
|
|
({ addressBookItems, calendarItems, taskListItems }) => [addressBookItems, calendarItems, taskListItems].map(Object.values)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const ItemChangeLog = React.memo((props: any) => {
|
|
|
|
const ItemChangeLog = React.memo((props: any) => {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
syncInfo,
|
|
|
|
syncInfo,
|
|
|
@ -313,6 +314,7 @@ class Pim extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
public render() {
|
|
|
|
public render() {
|
|
|
|
const { collectionsAddressBook, collectionsCalendar, collectionsTaskList, addressBookItems, calendarItems, taskListItems } = itemsSelector(this.props);
|
|
|
|
const { collectionsAddressBook, collectionsCalendar, collectionsTaskList, addressBookItems, calendarItems, taskListItems } = itemsSelector(this.props);
|
|
|
|
|
|
|
|
const [contacts, events, tasks] = itemValuesSelector(this.props);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Switch>
|
|
|
|
<Switch>
|
|
|
@ -321,9 +323,9 @@ class Pim extends React.PureComponent {
|
|
|
|
exact
|
|
|
|
exact
|
|
|
|
render={({ history }) => (
|
|
|
|
render={({ history }) => (
|
|
|
|
<PimMain
|
|
|
|
<PimMain
|
|
|
|
contacts={objValues(addressBookItems)}
|
|
|
|
contacts={contacts}
|
|
|
|
events={objValues(calendarItems)}
|
|
|
|
events={events}
|
|
|
|
tasks={objValues(taskListItems)}
|
|
|
|
tasks={tasks}
|
|
|
|
history={history}
|
|
|
|
history={history}
|
|
|
|
onItemSave={this.onItemSave}
|
|
|
|
onItemSave={this.onItemSave}
|
|
|
|
collectionsTaskList={collectionsTaskList}
|
|
|
|
collectionsTaskList={collectionsTaskList}
|
|
|
|