fix(scheduler): removes proposals from metadata when removing event

Also add <tbody> tags
This commit is contained in:
Evan Morikawa 2016-04-06 13:56:33 -07:00
parent 5140cf5f07
commit 5311ab6b34
2 changed files with 9 additions and 18 deletions

View file

@ -118,18 +118,6 @@ and an event on a draft at the same time!`);
}
}
_removeDraftEvent() {
this._session.changes.add({events: []});
return this._session.changes.commit();
}
_removePendingEvent() {
const draft = this._session.draft()
const metadata = draft.metadataForPluginId(PLUGIN_ID);
delete metadata.pendingEvent
Actions.setMetadata(draft, PLUGIN_ID, metadata);
}
_onEventChange = (newData) => {
const eventType = this._eventType(this._session.draft());
if (eventType === MEETING_REQUEST) {
@ -140,11 +128,14 @@ and an event on a draft at the same time!`);
}
_onEventRemove = () => {
const eventType = this._eventType(this._session.draft());
if (eventType === MEETING_REQUEST) {
this._removeDraftEvent()
} else if (eventType === PENDING_EVENT) {
this._removePendingEvent()
this._session.changes.add({events: []});
this._session.changes.commit();
const draft = this._session.draft()
const metadata = draft.metadataForPluginId(PLUGIN_ID);
if (metadata) {
delete metadata.pendingEvent
delete metadata.proposals
Actions.setMetadata(draft, PLUGIN_ID, metadata);
}
}

View file

@ -198,7 +198,7 @@ export default class ProposedTimeList extends React.Component {
)
}
return <table style={this._sProposalTable()}>{trs}</table>
return <table style={this._sProposalTable()}><tbody>{trs}</tbody></table>
}
_renderProposalTimeText(proposal) {