@glissandoo/lib 1.51.0 → 1.51.2
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/models/Evento/Player/index.d.ts +1 -0
- package/models/Evento/Player/index.js +3 -0
- package/models/Evento/Player/types.d.ts +1 -7
- package/models/Evento/basic.d.ts +3 -0
- package/models/Evento/basic.js +12 -1
- package/models/Evento/index.d.ts +6 -10
- package/models/Evento/index.js +9 -26
- package/models/Evento/types.d.ts +2 -3
- package/models/Group/Event/types.d.ts +2 -3
- package/models/User/index.js +1 -1
- package/package.json +1 -1
|
@@ -56,5 +56,8 @@ class EventoPlayer extends basic_1.default {
|
|
|
56
56
|
get selected() {
|
|
57
57
|
return !(0, lodash_1.isUndefined)(this.data.selected) ? this.data.selected : null;
|
|
58
58
|
}
|
|
59
|
+
get isActive() {
|
|
60
|
+
return this.exists && this.selected !== false;
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
exports.default = EventoPlayer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { EmptyObject } from 'type-fest';
|
|
1
2
|
import { Timestamp } from '../../../types/firestore';
|
|
2
3
|
import { EventPlayerBasicData, EventRollcallHistory } from '../../Evento/types';
|
|
3
|
-
import { EmptyObject } from 'type-fest';
|
|
4
4
|
export declare enum EventPlayerStatus {
|
|
5
5
|
Confirmed = "confirmed",
|
|
6
6
|
Declined = "declined"
|
|
@@ -45,12 +45,6 @@ export interface EventPlayerData extends EventPlayerBasicData {
|
|
|
45
45
|
joinedAt: Timestamp;
|
|
46
46
|
rollCalledAt: Timestamp | null;
|
|
47
47
|
history: EventPlayerHistory[];
|
|
48
|
-
/** @deprecated use rollcall */
|
|
49
|
-
statusHistory: EventPlayerStatusHistory[];
|
|
50
|
-
/** @deprecated use rollcall */
|
|
51
|
-
rollcallHistory: EventPlayerRollcallHistory[];
|
|
52
|
-
/** @deprecated use rollcall */
|
|
53
|
-
rollCallStatus?: EventPlayerStatus;
|
|
54
48
|
}
|
|
55
49
|
export interface AEventPlayerData extends EventPlayerData {
|
|
56
50
|
id: string;
|
package/models/Evento/basic.d.ts
CHANGED
|
@@ -19,4 +19,7 @@ export default class EventoBasic<D> extends ModelWithLang<EventBasicData & D> {
|
|
|
19
19
|
get isOutDate(): boolean;
|
|
20
20
|
get isHappening(): boolean;
|
|
21
21
|
get timezone(): string;
|
|
22
|
+
get responseDeadlineAt(): import("../../types/firestore").Timestamp;
|
|
23
|
+
get isResponseAllowed(): boolean;
|
|
24
|
+
get selectionMode(): import("./types").EventSelectionMode | null;
|
|
22
25
|
}
|
package/models/Evento/basic.js
CHANGED
|
@@ -27,7 +27,9 @@ class EventoBasic extends lang_2.default {
|
|
|
27
27
|
datetime: this.datetime,
|
|
28
28
|
datetimeEnd: this.datetimeEnd,
|
|
29
29
|
type: this.type,
|
|
30
|
-
timezone: this.
|
|
30
|
+
timezone: this.timezone,
|
|
31
|
+
responseDeadlineAt: this.responseDeadlineAt,
|
|
32
|
+
selectionMode: this.selectionMode,
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
get displayName() {
|
|
@@ -72,5 +74,14 @@ class EventoBasic extends lang_2.default {
|
|
|
72
74
|
get timezone() {
|
|
73
75
|
return this.data.timezone || 'Europe/Madrid';
|
|
74
76
|
}
|
|
77
|
+
get responseDeadlineAt() {
|
|
78
|
+
return this.data.responseDeadlineAt || this.datetime;
|
|
79
|
+
}
|
|
80
|
+
get isResponseAllowed() {
|
|
81
|
+
return (0, date_fns_1.isFuture)(this.responseDeadlineAt.toDate());
|
|
82
|
+
}
|
|
83
|
+
get selectionMode() {
|
|
84
|
+
return this.data.selectionMode || null;
|
|
85
|
+
}
|
|
75
86
|
}
|
|
76
87
|
exports.default = EventoBasic;
|
package/models/Evento/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { InstrumentId } from '../../helpers/instruments';
|
|
1
2
|
import { LanguagesTypes } from '../../lang';
|
|
2
3
|
import { DocumentReference, DocumentSnapshot } from '../../types/firestore';
|
|
3
4
|
import { EventPlayerStatus } from './Player/types';
|
|
4
5
|
import EventoPromoter from './promoter';
|
|
5
|
-
import { EventData, EventPlayerBasicData, EventResponseDeadlineOptions,
|
|
6
|
+
import { EventData, EventPlayerBasicData, EventResponseDeadlineOptions, EventStatusByTime } from './types';
|
|
6
7
|
export default class Evento extends EventoPromoter<EventData> {
|
|
7
8
|
constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
|
|
8
9
|
get maxAttendance(): number | null;
|
|
@@ -45,10 +46,9 @@ export default class Evento extends EventoPromoter<EventData> {
|
|
|
45
46
|
tags: string[];
|
|
46
47
|
media: import("../Repertory/types").ThemeMediaType | null;
|
|
47
48
|
}[];
|
|
48
|
-
|
|
49
|
-
playersList({ showAll, order }: {
|
|
49
|
+
playersList({ showAll, order }?: {
|
|
50
50
|
showAll?: boolean;
|
|
51
|
-
order?:
|
|
51
|
+
order?: InstrumentId[];
|
|
52
52
|
}): {
|
|
53
53
|
note?: string | null | undefined;
|
|
54
54
|
reason?: import("./Player/types").EventPlayerReason | null | undefined;
|
|
@@ -56,7 +56,7 @@ export default class Evento extends EventoPromoter<EventData> {
|
|
|
56
56
|
rollcall: EventPlayerStatus | null;
|
|
57
57
|
interested: true | null;
|
|
58
58
|
selected: boolean | null;
|
|
59
|
-
mainInstrument:
|
|
59
|
+
mainInstrument: InstrumentId;
|
|
60
60
|
username: string;
|
|
61
61
|
displayName: string;
|
|
62
62
|
photoURL: string;
|
|
@@ -72,7 +72,7 @@ export default class Evento extends EventoPromoter<EventData> {
|
|
|
72
72
|
get templateId(): string | null;
|
|
73
73
|
get repeat(): import("./types").EventRepeatType | null;
|
|
74
74
|
isPlayer: (userId: string) => boolean;
|
|
75
|
-
isPlayerActive: (userId: string) => boolean;
|
|
75
|
+
isPlayerActive: (userId: string) => boolean | null;
|
|
76
76
|
getPlayer: (userId: string) => EventPlayerBasicData | null;
|
|
77
77
|
isPlayerConfirmed(player: EventPlayerBasicData): boolean;
|
|
78
78
|
isPlayerDeclined(player: EventPlayerBasicData): boolean;
|
|
@@ -82,10 +82,6 @@ export default class Evento extends EventoPromoter<EventData> {
|
|
|
82
82
|
option: EventResponseDeadlineOptions;
|
|
83
83
|
customAt: import("../../types/firestore").Timestamp | null;
|
|
84
84
|
};
|
|
85
|
-
get responseDeadlineAt(): import("../../types/firestore").Timestamp;
|
|
86
|
-
get isResponseAllowed(): boolean;
|
|
87
|
-
get selectionMode(): EventSelectionMode | null;
|
|
88
85
|
get selectionModeClosedAt(): import("../../types/firestore").Timestamp | null;
|
|
89
86
|
get isSelectionModeClose(): boolean;
|
|
90
|
-
get isSelectionModeOpen(): boolean;
|
|
91
87
|
}
|
package/models/Evento/index.js
CHANGED
|
@@ -15,13 +15,11 @@ class Evento extends promoter_1.default {
|
|
|
15
15
|
constructor(doc, lang = lang_1.defaultLocale) {
|
|
16
16
|
super(doc, lang);
|
|
17
17
|
this.isPlayer = (userId) => {
|
|
18
|
-
return this.
|
|
18
|
+
return this.playerIds.includes(userId);
|
|
19
19
|
};
|
|
20
20
|
this.isPlayerActive = (userId) => {
|
|
21
21
|
const player = this.getPlayer(userId);
|
|
22
|
-
|
|
23
|
-
return false;
|
|
24
|
-
return this.isSelectionModeClose ? !!player.selected : true;
|
|
22
|
+
return player && player.selected !== false;
|
|
25
23
|
};
|
|
26
24
|
this.getPlayer = (userId) => {
|
|
27
25
|
return userId in this.players ? this.players[userId] : null;
|
|
@@ -137,11 +135,8 @@ class Evento extends promoter_1.default {
|
|
|
137
135
|
}));
|
|
138
136
|
return (0, lodash_1.orderBy)(repertory, 'order', 'asc');
|
|
139
137
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
playersList({ showAll, order }) {
|
|
144
|
-
const players = this.activePlayers.map((playerId) => ({
|
|
138
|
+
playersList({ showAll, order } = {}) {
|
|
139
|
+
const players = this.playerIds.map((playerId) => ({
|
|
145
140
|
id: playerId,
|
|
146
141
|
...this.players[playerId],
|
|
147
142
|
}));
|
|
@@ -153,19 +148,19 @@ class Evento extends promoter_1.default {
|
|
|
153
148
|
return orderedPlayers.filter((player) => this.isPlayerActive(player.id));
|
|
154
149
|
}
|
|
155
150
|
get confirmedPlayers() {
|
|
156
|
-
return this.
|
|
151
|
+
return this.playerIds.filter((playerId) => this.isPlayerConfirmed(this.players[playerId]));
|
|
157
152
|
}
|
|
158
153
|
get declinedPlayers() {
|
|
159
|
-
return this.
|
|
154
|
+
return this.playerIds.filter((playerId) => this.isPlayerDeclined(this.players[playerId]));
|
|
160
155
|
}
|
|
161
156
|
get pendingPlayers() {
|
|
162
|
-
return this.
|
|
157
|
+
return this.playerIds.filter((playerId) => !this.players[playerId].status);
|
|
163
158
|
}
|
|
164
159
|
get confirmedRollCallPlayers() {
|
|
165
|
-
return this.
|
|
160
|
+
return this.playerIds.filter((playerId) => this.isPlayerRollCallConfirmed(this.players[playerId]));
|
|
166
161
|
}
|
|
167
162
|
get declinedRollCallPlayers() {
|
|
168
|
-
return this.
|
|
163
|
+
return this.playerIds.filter((playerId) => this.isPlayerRollCallDeclined(this.players[playerId]));
|
|
169
164
|
}
|
|
170
165
|
get isRollCalled() {
|
|
171
166
|
return this.rollCalledAt !== null;
|
|
@@ -197,23 +192,11 @@ class Evento extends promoter_1.default {
|
|
|
197
192
|
customAt: null,
|
|
198
193
|
});
|
|
199
194
|
}
|
|
200
|
-
get responseDeadlineAt() {
|
|
201
|
-
return this.data.responseDeadlineAt || this.datetime;
|
|
202
|
-
}
|
|
203
|
-
get isResponseAllowed() {
|
|
204
|
-
return (0, date_fns_1.isFuture)(this.responseDeadlineAt.toDate());
|
|
205
|
-
}
|
|
206
|
-
get selectionMode() {
|
|
207
|
-
return this.data.selectionMode || null;
|
|
208
|
-
}
|
|
209
195
|
get selectionModeClosedAt() {
|
|
210
196
|
return this.data.selectionModeClosedAt || null;
|
|
211
197
|
}
|
|
212
198
|
get isSelectionModeClose() {
|
|
213
199
|
return (this.selectionModeClosedAt !== null && this.selectionMode === types_2.EventSelectionMode.Closed);
|
|
214
200
|
}
|
|
215
|
-
get isSelectionModeOpen() {
|
|
216
|
-
return (this.selectionModeClosedAt === null && this.selectionMode === types_2.EventSelectionMode.Open);
|
|
217
|
-
}
|
|
218
201
|
}
|
|
219
202
|
exports.default = Evento;
|
package/models/Evento/types.d.ts
CHANGED
|
@@ -82,6 +82,8 @@ export interface EventBasicData extends EventTinyData {
|
|
|
82
82
|
locality: string | null;
|
|
83
83
|
online: boolean;
|
|
84
84
|
datetimeEnd: Timestamp;
|
|
85
|
+
responseDeadlineAt: Timestamp;
|
|
86
|
+
selectionMode: EventSelectionMode | null;
|
|
85
87
|
}
|
|
86
88
|
export interface EventPromoterData extends EventBasicData {
|
|
87
89
|
readonly promoter: DocumentReference;
|
|
@@ -116,9 +118,6 @@ export interface EventData extends EventPromoterData {
|
|
|
116
118
|
option: EventResponseDeadlineOptions;
|
|
117
119
|
customAt: Timestamp | null;
|
|
118
120
|
};
|
|
119
|
-
responseDeadlineAt: Timestamp;
|
|
120
|
-
mode: EventSelectionMode;
|
|
121
|
-
selectionMode: EventSelectionMode | null;
|
|
122
121
|
selectionModeClosedAt: Timestamp | null;
|
|
123
122
|
readonly owner: DocumentReference;
|
|
124
123
|
readonly createdAt: Timestamp;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Timestamp } from '../../../types/firestore';
|
|
2
|
-
import { EventBasicData
|
|
2
|
+
import { EventBasicData } from '../../Evento/types';
|
|
3
3
|
export interface GroupEventData extends EventBasicData {
|
|
4
4
|
players_count: number;
|
|
5
5
|
players_confirmed_count: number;
|
|
@@ -7,9 +7,8 @@ export interface GroupEventData extends EventBasicData {
|
|
|
7
7
|
players_interested_count: number;
|
|
8
8
|
players_selected_count: number;
|
|
9
9
|
players_deselected_count: number;
|
|
10
|
-
rollCalledAt: Timestamp | null;
|
|
11
|
-
selectionMode: EventSelectionMode | null;
|
|
12
10
|
players_confirmed_rollcall_count: number;
|
|
13
11
|
players_declined_rollcall_count: number;
|
|
14
12
|
repertory_count: number;
|
|
13
|
+
rollCalledAt: Timestamp | null;
|
|
15
14
|
}
|
package/models/User/index.js
CHANGED
|
@@ -105,7 +105,7 @@ class User extends basic_1.default {
|
|
|
105
105
|
return this.data.appConfig[value];
|
|
106
106
|
}
|
|
107
107
|
getNotificationSetting(key) {
|
|
108
|
-
return this.data.notificationSettings[key]
|
|
108
|
+
return this.data.notificationSettings[key];
|
|
109
109
|
}
|
|
110
110
|
get registerVia() {
|
|
111
111
|
return this.data.registerVia || null;
|