|
|
@ -1,5 +1,7 @@
|
|
|
|
import * as React from 'react';
|
|
|
|
import * as React from 'react';
|
|
|
|
import { List, ListItem } from 'material-ui/List';
|
|
|
|
import { List, ListItem } from 'material-ui/List';
|
|
|
|
|
|
|
|
import Dialog from 'material-ui/Dialog';
|
|
|
|
|
|
|
|
import FlatButton from 'material-ui/FlatButton';
|
|
|
|
import IconAdd from 'material-ui/svg-icons/content/add';
|
|
|
|
import IconAdd from 'material-ui/svg-icons/content/add';
|
|
|
|
import IconDelete from 'material-ui/svg-icons/action/delete';
|
|
|
|
import IconDelete from 'material-ui/svg-icons/action/delete';
|
|
|
|
import IconEdit from 'material-ui/svg-icons/editor/mode-edit';
|
|
|
|
import IconEdit from 'material-ui/svg-icons/editor/mode-edit';
|
|
|
@ -13,11 +15,20 @@ export class JournalViewEntries extends React.Component {
|
|
|
|
prevUid: null,
|
|
|
|
prevUid: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state: {
|
|
|
|
|
|
|
|
dialog?: string;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
journal: EteSync.Journal,
|
|
|
|
journal: EteSync.Journal,
|
|
|
|
entries: Array<EteSync.SyncEntry>,
|
|
|
|
entries: Array<EteSync.SyncEntry>,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(props: any) {
|
|
|
|
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
if (this.props.journal === undefined) {
|
|
|
|
if (this.props.journal === undefined) {
|
|
|
|
return (<div>Loading</div>);
|
|
|
|
return (<div>Loading</div>);
|
|
|
@ -35,41 +46,59 @@ export class JournalViewEntries extends React.Component {
|
|
|
|
icon = (<IconDelete color="#F20C0C" />);
|
|
|
|
icon = (<IconDelete color="#F20C0C" />);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let name;
|
|
|
|
|
|
|
|
let uid;
|
|
|
|
if (comp.name === 'vcalendar') {
|
|
|
|
if (comp.name === 'vcalendar') {
|
|
|
|
const vevent = new ICAL.Event(comp.getFirstSubcomponent('vevent'));
|
|
|
|
const vevent = new ICAL.Event(comp.getFirstSubcomponent('vevent'));
|
|
|
|
return (
|
|
|
|
name = vevent.summary;
|
|
|
|
<ListItem
|
|
|
|
uid = vevent.uid;
|
|
|
|
key={idx}
|
|
|
|
|
|
|
|
leftIcon={icon}
|
|
|
|
|
|
|
|
primaryText={vevent.summary}
|
|
|
|
|
|
|
|
secondaryText={vevent.uid}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (comp.name === 'vcard') {
|
|
|
|
} else if (comp.name === 'vcard') {
|
|
|
|
const vcard = comp;
|
|
|
|
const vcard = comp;
|
|
|
|
const name = vcard.getFirstPropertyValue('fn');
|
|
|
|
name = vcard.getFirstPropertyValue('fn');
|
|
|
|
const uid = vcard.getFirstPropertyValue('uid');
|
|
|
|
uid = vcard.getFirstPropertyValue('uid');
|
|
|
|
return (
|
|
|
|
|
|
|
|
<ListItem
|
|
|
|
|
|
|
|
key={idx}
|
|
|
|
|
|
|
|
leftIcon={icon}
|
|
|
|
|
|
|
|
primaryText={name}
|
|
|
|
|
|
|
|
secondaryText={uid}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return (
|
|
|
|
name = 'Error processing entry';
|
|
|
|
<ListItem
|
|
|
|
uid = '';
|
|
|
|
key={idx}
|
|
|
|
|
|
|
|
leftIcon={icon}
|
|
|
|
|
|
|
|
primaryText="Error processing entry"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<ListItem
|
|
|
|
|
|
|
|
key={idx}
|
|
|
|
|
|
|
|
leftIcon={icon}
|
|
|
|
|
|
|
|
primaryText={name}
|
|
|
|
|
|
|
|
secondaryText={uid}
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
dialog: syncEntry.content
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
);
|
|
|
|
}).reverse();
|
|
|
|
}).reverse();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const actions = [(
|
|
|
|
|
|
|
|
<FlatButton
|
|
|
|
|
|
|
|
label="Close"
|
|
|
|
|
|
|
|
primary={true}
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
this.setState({dialog: undefined});
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
];
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<Dialog
|
|
|
|
|
|
|
|
title="Raw Content"
|
|
|
|
|
|
|
|
actions={actions}
|
|
|
|
|
|
|
|
modal={false}
|
|
|
|
|
|
|
|
autoScrollBodyContent={true}
|
|
|
|
|
|
|
|
open={this.state.dialog !== undefined}
|
|
|
|
|
|
|
|
onRequestClose={() => {
|
|
|
|
|
|
|
|
this.setState({dialog: undefined});
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<pre>{this.state.dialog}</pre>
|
|
|
|
|
|
|
|
</Dialog>
|
|
|
|
<List>
|
|
|
|
<List>
|
|
|
|
{entries}
|
|
|
|
{entries}
|
|
|
|
</List>
|
|
|
|
</List>
|
|
|
|