Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[63848] Add missing fields for recurring events #259

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Unreleased
* Fix minor issues with Neural API implementation
* Add missing fields for recurring events

### 5.6.0 / 2021-07-14
* Fix Jest test cases not respecting async methods
Expand Down
6 changes: 6 additions & 0 deletions __tests__/event-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ describe('Event', () => {
when: { time: 1409594400, object: 'time' },
participants: [{ name: 'foo', email: 'bar', status: 'noreply' }],
ical_uid: 'id-5678',
master_event_id: 'master-1234',
original_start_time: 1409592400,
};
return Promise.resolve(eventJSON);
});
Expand All @@ -425,6 +427,10 @@ describe('Event', () => {
expect(event.when.time).toEqual(1409594400);
expect(event.when.object).toEqual('time');
expect(event.iCalUID).toBe('id-5678');
expect(event.masterEventId).toBe('master-1234');
expect(event.originalStartTime.toString()).toBe(
new Date(1409592400 * 1000).toString()
);
const participant = event.participants[0];
expect(participant.toJSON()).toEqual({
name: 'foo',
Expand Down
12 changes: 12 additions & 0 deletions src/models/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default class Event extends RestfulModel {
rrule: string[];
timezone: string;
};
masterEventId?: string;
originalStartTime?: number;
metadata?: object;

get start() {
Expand Down Expand Up @@ -184,6 +186,16 @@ Event.attributes = {
recurrence: Attributes.Object({
modelKey: 'recurrence',
}),
masterEventId: Attributes.String({
modelKey: 'masterEventId',
jsonKey: 'master_event_id',
readOnly: true,
}),
originalStartTime: Attributes.DateTime({
modelKey: 'originalStartTime',
jsonKey: 'original_start_time',
readOnly: true,
}),
metadata: Attributes.Object({
modelKey: 'metadata',
}),
Expand Down