EventEdit: don't discard fields we don't handle and add a note about it.

master
Tom Hacohen 7 years ago
parent da935c0836
commit 29ae3005ea

@ -106,7 +106,11 @@ class EventEdit extends React.Component {
return; return;
} }
let event = new EventType(); let event = (this.props.event) ?
this.props.event.clone()
:
new EventType()
;
event.uid = this.state.uid; event.uid = this.state.uid;
event.summary = this.state.title; event.summary = this.state.title;
event.startDate = ICAL.Time.fromString(this.state.start); event.startDate = ICAL.Time.fromString(this.state.start);
@ -204,6 +208,11 @@ class EventEdit extends React.Component {
secondary={true} secondary={true}
/> />
</div> </div>
<div>
Not all types are supported at the moment. If you are editing a contact,
the unsupported types will be copied as is.
</div>
</form> </form>
</React.Fragment> </React.Fragment>
); );

@ -27,6 +27,10 @@ export class EventType extends ICAL.Event {
comp.addSubcomponent(this.component); comp.addSubcomponent(this.component);
return comp.toString(); return comp.toString();
} }
clone() {
return new EventType(new ICAL.Component(this.component.toJSON()));
}
} }
export class ContactType { export class ContactType {

Loading…
Cancel
Save