@glissandoo/lib 1.104.10 → 1.104.11
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/Group/Player/index.d.ts +1 -0
- package/models/Group/Player/index.js +3 -0
- package/models/Group/Player/types.d.ts +9 -0
- package/models/Group/index.d.ts +3 -1
- package/models/Group/index.js +11 -0
- package/models/Group/types.d.ts +28 -0
- package/models/Group/types.js +11 -1
- package/package.json +1 -1
|
@@ -3,6 +3,14 @@ import { InstrumentId } from '../../../helpers/instruments';
|
|
|
3
3
|
import { Descendant } from '../../../helpers/slate';
|
|
4
4
|
import { UserExtendedData } from '../../User/types';
|
|
5
5
|
import { AdminPermissions } from '../types';
|
|
6
|
+
export interface GroupPlayerCustomFieldValue {
|
|
7
|
+
value: string | number | boolean | Timestamp | null;
|
|
8
|
+
updatedAt: Timestamp;
|
|
9
|
+
updatedBy: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AGroupPlayerCustomFieldValue extends GroupPlayerCustomFieldValue {
|
|
12
|
+
id: string;
|
|
13
|
+
}
|
|
6
14
|
export declare enum GroupPlayerRole {
|
|
7
15
|
Admin = "admin",
|
|
8
16
|
Member = "member",
|
|
@@ -21,6 +29,7 @@ export interface GroupPlayerData extends UserExtendedData {
|
|
|
21
29
|
leavedAt: Timestamp | null;
|
|
22
30
|
leavedBy: string | null;
|
|
23
31
|
additionalInfo: Descendant[];
|
|
32
|
+
customFields: Record<string, GroupPlayerCustomFieldValue>;
|
|
24
33
|
lastEditAdditionalInfoAt: Timestamp | null;
|
|
25
34
|
lastEditAdditionalInfoBy: string | null;
|
|
26
35
|
badgeAccPractices?: BadgeLevels;
|
package/models/Group/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { LanguagesTypes } from '../../lang';
|
|
|
4
4
|
import { EventPlayerStatus } from '../Evento/Player/types';
|
|
5
5
|
import { DocumentModel } from '../Model';
|
|
6
6
|
import GroupBasic from './basic';
|
|
7
|
-
import { AdminPermissions, CustomGroupInstrument, GroupConfigShowAttendanceToMembers, GroupData, GroupStatus, SocialNetwork } from './types';
|
|
7
|
+
import { AGroupCustomField, AdminPermissions, CustomGroupInstrument, GroupConfigShowAttendanceToMembers, GroupData, GroupStatus, SocialNetwork } from './types';
|
|
8
8
|
export default class Group extends GroupBasic<GroupData> {
|
|
9
9
|
constructor(doc: DocumentModel, lang?: LanguagesTypes);
|
|
10
10
|
get owner(): DocumentReference;
|
|
@@ -129,4 +129,6 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
129
129
|
multiselect: boolean;
|
|
130
130
|
id: string;
|
|
131
131
|
} | undefined;
|
|
132
|
+
get customFields(): Record<string, import("./types").GroupCustomField>;
|
|
133
|
+
get customFieldsList(): AGroupCustomField[];
|
|
132
134
|
}
|
package/models/Group/index.js
CHANGED
|
@@ -281,5 +281,16 @@ class Group extends basic_1.default {
|
|
|
281
281
|
getDefaultQuestion(status) {
|
|
282
282
|
return this.questionsList.find((q) => q.isDefault && q.status === status);
|
|
283
283
|
}
|
|
284
|
+
get customFields() {
|
|
285
|
+
return this.data.customFields || {};
|
|
286
|
+
}
|
|
287
|
+
get customFieldsList() {
|
|
288
|
+
return Object.entries(this.customFields)
|
|
289
|
+
.map(([id, field]) => ({
|
|
290
|
+
id,
|
|
291
|
+
...field,
|
|
292
|
+
}))
|
|
293
|
+
.sort((a, b) => a.order - b.order);
|
|
294
|
+
}
|
|
284
295
|
}
|
|
285
296
|
exports.default = Group;
|
package/models/Group/types.d.ts
CHANGED
|
@@ -6,6 +6,33 @@ import { CreatedOn } from '../../helpers/types';
|
|
|
6
6
|
import { EventPlayerStatus } from '../Evento/Player/types';
|
|
7
7
|
import { EventType } from '../Evento/types';
|
|
8
8
|
import { PlayerBasicData } from '../Player/types';
|
|
9
|
+
export declare enum GroupCustomFieldType {
|
|
10
|
+
TEXT = "text",
|
|
11
|
+
NUMBER = "number",
|
|
12
|
+
DATE = "date",
|
|
13
|
+
SELECT = "select",
|
|
14
|
+
EMAIL = "email",
|
|
15
|
+
PHONE = "phone"
|
|
16
|
+
}
|
|
17
|
+
export interface GroupCustomFieldOption {
|
|
18
|
+
id: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GroupCustomField {
|
|
22
|
+
label: string;
|
|
23
|
+
type: GroupCustomFieldType;
|
|
24
|
+
required: boolean;
|
|
25
|
+
placeholder: string | null;
|
|
26
|
+
options: GroupCustomFieldOption[];
|
|
27
|
+
order: number;
|
|
28
|
+
createdAt: Timestamp;
|
|
29
|
+
updatedAt: Timestamp;
|
|
30
|
+
createdBy: string;
|
|
31
|
+
updatedBy: string;
|
|
32
|
+
}
|
|
33
|
+
export interface AGroupCustomField extends GroupCustomField {
|
|
34
|
+
id: string;
|
|
35
|
+
}
|
|
9
36
|
export interface GroupOnboardingMessage {
|
|
10
37
|
type: string;
|
|
11
38
|
createdAt: Timestamp;
|
|
@@ -197,6 +224,7 @@ export interface GroupData extends GroupBasicData {
|
|
|
197
224
|
onboardingMessages: GroupOnboardingMessage[];
|
|
198
225
|
subscriptionId: string | null;
|
|
199
226
|
questions: Record<string, GroupEventQuestion>;
|
|
227
|
+
customFields: Record<string, GroupCustomField>;
|
|
200
228
|
readonly createdOn: CreatedOn;
|
|
201
229
|
readonly owner: DocumentReference;
|
|
202
230
|
readonly createdAt: Timestamp;
|
package/models/Group/types.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GroupRepertoireTagDefault = exports.GroupRepertoireTagReserved = exports.SocialNetwork = exports.GroupStatus = exports.GroupConfigShowAttendanceToMembers = exports.GroupConfigSitesKey = exports.GroupConfigKey = exports.AdminPermissions = void 0;
|
|
3
|
+
exports.GroupRepertoireTagDefault = exports.GroupRepertoireTagReserved = exports.SocialNetwork = exports.GroupStatus = exports.GroupConfigShowAttendanceToMembers = exports.GroupConfigSitesKey = exports.GroupConfigKey = exports.AdminPermissions = exports.GroupCustomFieldType = void 0;
|
|
4
|
+
// types/CustomFields.ts
|
|
5
|
+
var GroupCustomFieldType;
|
|
6
|
+
(function (GroupCustomFieldType) {
|
|
7
|
+
GroupCustomFieldType["TEXT"] = "text";
|
|
8
|
+
GroupCustomFieldType["NUMBER"] = "number";
|
|
9
|
+
GroupCustomFieldType["DATE"] = "date";
|
|
10
|
+
GroupCustomFieldType["SELECT"] = "select";
|
|
11
|
+
GroupCustomFieldType["EMAIL"] = "email";
|
|
12
|
+
GroupCustomFieldType["PHONE"] = "phone";
|
|
13
|
+
})(GroupCustomFieldType = exports.GroupCustomFieldType || (exports.GroupCustomFieldType = {}));
|
|
4
14
|
var AdminPermissions;
|
|
5
15
|
(function (AdminPermissions) {
|
|
6
16
|
AdminPermissions["Owner"] = "owner";
|