@dev-crew-berlin/enter-js-utils 0.40.1 → 0.40.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/api-schema.d.ts +16 -3
- package/dist/models/attendee.js +1 -1
- package/dist/models/checkin.d.ts +0 -1
- package/dist/models/checkin.js +1 -2
- package/dist/models/checkins.d.ts +1 -3
- package/dist/models/checkins.js +2 -11
- package/dist/ui/guest-card.js +1 -1
- package/package.json +1 -1
|
@@ -346,8 +346,12 @@ export declare type components = {
|
|
|
346
346
|
* Format: date-time
|
|
347
347
|
*/
|
|
348
348
|
time: string;
|
|
349
|
-
/**
|
|
350
|
-
|
|
349
|
+
/**
|
|
350
|
+
* Main
|
|
351
|
+
* @default false
|
|
352
|
+
* @enum {boolean}
|
|
353
|
+
*/
|
|
354
|
+
main: false;
|
|
351
355
|
};
|
|
352
356
|
/** CheckinCount */
|
|
353
357
|
CheckinCount: {
|
|
@@ -627,6 +631,11 @@ export declare type components = {
|
|
|
627
631
|
};
|
|
628
632
|
/** EventList */
|
|
629
633
|
EventList: (components["schemas"]["AttendeeCreatedEvent"] | components["schemas"]["AttendeeUpdatedEvent"] | components["schemas"]["AttendeeRespondedEvent"] | components["schemas"]["EmailUnsubscribedEvent"] | components["schemas"]["AttendeeDeletedEvent"] | components["schemas"]["CheckinCreatedEvent"] | components["schemas"]["CheckinDeletedEvent"] | components["schemas"]["PaymentPaidEvent"])[];
|
|
634
|
+
/** EventResponse */
|
|
635
|
+
EventResponse: {
|
|
636
|
+
/** Created */
|
|
637
|
+
created: number;
|
|
638
|
+
};
|
|
630
639
|
/** FieldGroup */
|
|
631
640
|
FieldGroup: {
|
|
632
641
|
/** Questions */
|
|
@@ -1362,7 +1371,11 @@ export declare type operations = {
|
|
|
1362
1371
|
create_events_events_post: {
|
|
1363
1372
|
responses: {
|
|
1364
1373
|
/** Successful Response */
|
|
1365
|
-
|
|
1374
|
+
201: {
|
|
1375
|
+
content: {
|
|
1376
|
+
"application/json": components["schemas"]["EventResponse"];
|
|
1377
|
+
};
|
|
1378
|
+
};
|
|
1366
1379
|
/** Validation Error */
|
|
1367
1380
|
422: {
|
|
1368
1381
|
content: {
|
package/dist/models/attendee.js
CHANGED
|
@@ -72,7 +72,7 @@ export class Attendee {
|
|
|
72
72
|
getCheckinCountForTag(checkinTag) {
|
|
73
73
|
const checkins = this.checkin[checkinTag];
|
|
74
74
|
if (!checkins) return 0;
|
|
75
|
-
return checkins.
|
|
75
|
+
return checkins.getActiveCheckins().length;
|
|
76
76
|
}
|
|
77
77
|
addCheckinForTag(args) {
|
|
78
78
|
const exsitingCheckins = this.getCheckinsForTag(args.checkinTag);
|
package/dist/models/checkin.d.ts
CHANGED
package/dist/models/checkin.js
CHANGED
|
@@ -2,13 +2,12 @@ export class Checkin {
|
|
|
2
2
|
constructor(json) {
|
|
3
3
|
this.id = json.id;
|
|
4
4
|
this.time = new Date(json.time);
|
|
5
|
-
this.main = json.main;
|
|
6
5
|
}
|
|
7
6
|
toJSON() {
|
|
8
7
|
return {
|
|
9
8
|
id: this.id,
|
|
10
9
|
time: this.time.toISOString(),
|
|
11
|
-
main:
|
|
10
|
+
main: false
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
}
|
|
@@ -6,8 +6,6 @@ export declare class Checkins {
|
|
|
6
6
|
deleted: string[];
|
|
7
7
|
constructor(json?: CheckinsJSON);
|
|
8
8
|
toJSON(): CheckinsJSON;
|
|
9
|
-
|
|
10
|
-
getOtherCheckins(): Checkin[];
|
|
11
|
-
getMainCheckin(): Checkin | undefined;
|
|
9
|
+
getActiveCheckins(): Checkin[];
|
|
12
10
|
merge(otherCheckin: Checkins): Checkins;
|
|
13
11
|
}
|
package/dist/models/checkins.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { notUndefined } from '../lib';
|
|
2
1
|
import { Checkin } from './checkin';
|
|
3
2
|
export class Checkins {
|
|
4
3
|
checkins = [];
|
|
@@ -15,16 +14,8 @@ export class Checkins {
|
|
|
15
14
|
deleted: this.deleted
|
|
16
15
|
};
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return mainAndOthers.filter(notUndefined);
|
|
21
|
-
}
|
|
22
|
-
getOtherCheckins() {
|
|
23
|
-
return this.checkins.filter(c => c.main === false && !this.deleted.includes(c.id));
|
|
24
|
-
}
|
|
25
|
-
getMainCheckin() {
|
|
26
|
-
const nonDeletedCheckins = this.checkins.filter(checkin => checkin.main === true && !this.deleted.includes(checkin.id)).sort((a, b) => a.time.getTime() - b.time.getTime());
|
|
27
|
-
return nonDeletedCheckins[0];
|
|
17
|
+
getActiveCheckins() {
|
|
18
|
+
return this.checkins.filter(c => !this.deleted.includes(c.id));
|
|
28
19
|
}
|
|
29
20
|
merge(otherCheckin) {
|
|
30
21
|
const checkins = new Map([...this.checkins, ...otherCheckin.checkins].map(checkin => [checkin.id, checkin])).values();
|
package/dist/ui/guest-card.js
CHANGED
|
@@ -40,7 +40,7 @@ export const GuestCard = props => {
|
|
|
40
40
|
findMainGuest: props.findMainGuest,
|
|
41
41
|
formatName: props.formatName
|
|
42
42
|
}), /*#__PURE__*/React.createElement(CheckinCountIndicator, {
|
|
43
|
-
checkins: props.attendee.getCheckinsForTag(props.checkinTag).
|
|
43
|
+
checkins: props.attendee.getCheckinsForTag(props.checkinTag).getActiveCheckins(),
|
|
44
44
|
response: props.attendee.getResponseForTag(props.checkinTag),
|
|
45
45
|
rsvpCount: props.attendee.getRsvpCountForTag(props.checkinTag)
|
|
46
46
|
})), /*#__PURE__*/React.createElement("div", {
|