@dev-crew-berlin/enter-js-utils 0.38.1 → 0.39.1
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/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();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type FieldValue = string | number | string[] | null;
|
|
1
|
+
export declare type FieldValue = string | number | string[] | boolean | null;
|
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", {
|