@glissandoo/lib 1.79.0 → 1.81.0
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/helpers/appScenes.d.ts +13 -0
- package/helpers/appScenes.js +13 -0
- package/helpers/fileSections/orders.d.ts +4 -7
- package/helpers/fileSections/orders.js +10 -15
- package/helpers/instruments/orders.d.ts +2 -0
- package/helpers/instruments/orders.js +8 -0
- package/models/Evento/index.js +2 -2
- package/models/Group/Repertory/File/Section/index.d.ts +2 -2
- package/models/Group/Repertory/File/Section/index.js +2 -2
- package/models/Group/index.js +2 -2
- package/package.json +1 -1
package/helpers/appScenes.d.ts
CHANGED
|
@@ -56,7 +56,19 @@ export declare enum AppScenes {
|
|
|
56
56
|
Group = "group",
|
|
57
57
|
GroupPlayer = "groupPlayer",
|
|
58
58
|
GroupsNavigation = "GroupsNavigation",
|
|
59
|
+
GroupTab = "GroupTab",
|
|
59
60
|
GroupView = "GroupView",
|
|
61
|
+
GroupPlayerEditInstruments = "GroupPlayerEditInstruments",
|
|
62
|
+
GroupSettings = "GroupSettings",
|
|
63
|
+
GroupSettingsStack = "GroupSettingsStack",
|
|
64
|
+
GroupSettingsDisplayName = "GroupSettingsDisplayName",
|
|
65
|
+
GroupSettingsUsername = "GroupSettingsUsername",
|
|
66
|
+
GroupSettingsMusicStyle = "GroupSettingsMusicStyle",
|
|
67
|
+
GroupSettingsLocality = "GroupSettingsLocality",
|
|
68
|
+
GroupSettingsPhotoURL = "GroupSettingsPhotoURL",
|
|
69
|
+
GroupSettingsDelete = "GroupSettingsDelete",
|
|
70
|
+
GroupSettingsConfigShowAttendance = "GroupSettingsConfigShowAttendance",
|
|
71
|
+
GroupSettingsAddresses = "GroupSettingsAddresses",
|
|
60
72
|
Join = "Join",
|
|
61
73
|
JoinImageProfile = "AddProfileImage",
|
|
62
74
|
JoinInstrument = "SelectGroupInstrument",
|
|
@@ -75,6 +87,7 @@ export declare enum AppScenes {
|
|
|
75
87
|
ThemeView = "ThemeView",
|
|
76
88
|
VisorImage = "visorImage",
|
|
77
89
|
VisorPDF = "visorPDF",
|
|
90
|
+
VisorQR = "VisorQR",
|
|
78
91
|
NewGroup = "NewGroup",
|
|
79
92
|
NewGroupInfo = "NewGroupInfo",
|
|
80
93
|
NewGroupMusicStyle = "NewGroupMusicStyle",
|
package/helpers/appScenes.js
CHANGED
|
@@ -60,7 +60,19 @@ var AppScenes;
|
|
|
60
60
|
AppScenes["Group"] = "group";
|
|
61
61
|
AppScenes["GroupPlayer"] = "groupPlayer";
|
|
62
62
|
AppScenes["GroupsNavigation"] = "GroupsNavigation";
|
|
63
|
+
AppScenes["GroupTab"] = "GroupTab";
|
|
63
64
|
AppScenes["GroupView"] = "GroupView";
|
|
65
|
+
AppScenes["GroupPlayerEditInstruments"] = "GroupPlayerEditInstruments";
|
|
66
|
+
AppScenes["GroupSettings"] = "GroupSettings";
|
|
67
|
+
AppScenes["GroupSettingsStack"] = "GroupSettingsStack";
|
|
68
|
+
AppScenes["GroupSettingsDisplayName"] = "GroupSettingsDisplayName";
|
|
69
|
+
AppScenes["GroupSettingsUsername"] = "GroupSettingsUsername";
|
|
70
|
+
AppScenes["GroupSettingsMusicStyle"] = "GroupSettingsMusicStyle";
|
|
71
|
+
AppScenes["GroupSettingsLocality"] = "GroupSettingsLocality";
|
|
72
|
+
AppScenes["GroupSettingsPhotoURL"] = "GroupSettingsPhotoURL";
|
|
73
|
+
AppScenes["GroupSettingsDelete"] = "GroupSettingsDelete";
|
|
74
|
+
AppScenes["GroupSettingsConfigShowAttendance"] = "GroupSettingsConfigShowAttendance";
|
|
75
|
+
AppScenes["GroupSettingsAddresses"] = "GroupSettingsAddresses";
|
|
64
76
|
AppScenes["Join"] = "Join";
|
|
65
77
|
AppScenes["JoinImageProfile"] = "AddProfileImage";
|
|
66
78
|
AppScenes["JoinInstrument"] = "SelectGroupInstrument";
|
|
@@ -79,6 +91,7 @@ var AppScenes;
|
|
|
79
91
|
AppScenes["ThemeView"] = "ThemeView";
|
|
80
92
|
AppScenes["VisorImage"] = "visorImage";
|
|
81
93
|
AppScenes["VisorPDF"] = "visorPDF";
|
|
94
|
+
AppScenes["VisorQR"] = "VisorQR";
|
|
82
95
|
AppScenes["NewGroup"] = "NewGroup";
|
|
83
96
|
AppScenes["NewGroupInfo"] = "NewGroupInfo";
|
|
84
97
|
AppScenes["NewGroupMusicStyle"] = "NewGroupMusicStyle";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export declare const getOrderByMusicStyle: (musicStyle: MusicStyleType) => FileSectionId[];
|
|
7
|
-
export declare const orderByMusicStyle: <T>(list: T[], field: keyof T, musicStyle: MusicStyleType) => T[];
|
|
1
|
+
import { FileSectionIdReserved } from '../../models/Group/Repertory/File/Section/types';
|
|
2
|
+
import { InstrumentId } from '../instruments';
|
|
3
|
+
export declare const getFileSectionsOrder: (instrumentsOrder: InstrumentId[]) => (InstrumentId | FileSectionIdReserved)[];
|
|
4
|
+
export declare const orderByInstruments: <T>(list: T[], field: keyof T, instrumentsOrder: InstrumentId[]) => T[];
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.orderByInstruments = exports.getFileSectionsOrder = void 0;
|
|
4
4
|
const types_1 = require("../../models/Group/Repertory/File/Section/types");
|
|
5
|
-
const fileSections_1 = require("../fileSections");
|
|
6
|
-
const orders_1 = require("../musicStyles/orders");
|
|
7
5
|
const utils_1 = require("../utils");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const getFileSectionsOrder = (instrumentsOrder) => [
|
|
7
|
+
types_1.FileSectionIdReserved.All,
|
|
8
|
+
...instrumentsOrder,
|
|
9
|
+
];
|
|
10
|
+
exports.getFileSectionsOrder = getFileSectionsOrder;
|
|
11
|
+
const orderByInstruments = (list, field, instrumentsOrder) => {
|
|
12
|
+
const fileSectionsOrder = (0, exports.getFileSectionsOrder)(instrumentsOrder);
|
|
13
|
+
return (0, utils_1.sortByMatch)(list, field, fileSectionsOrder);
|
|
14
14
|
};
|
|
15
|
-
exports.
|
|
16
|
-
const orderByMusicStyle = (list, field, musicStyle) => {
|
|
17
|
-
const order = (0, exports.getOrderByMusicStyle)(musicStyle);
|
|
18
|
-
return (0, utils_1.sortByMatch)(list, field, order);
|
|
19
|
-
};
|
|
20
|
-
exports.orderByMusicStyle = orderByMusicStyle;
|
|
15
|
+
exports.orderByInstruments = orderByInstruments;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orderByInstruments = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const orderByInstruments = (list, field, instrumentsOrder) => {
|
|
6
|
+
return (0, utils_1.sortByMatch)(list, field, instrumentsOrder);
|
|
7
|
+
};
|
|
8
|
+
exports.orderByInstruments = orderByInstruments;
|
package/models/Evento/index.js
CHANGED
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const date_fns_1 = require("date-fns");
|
|
7
7
|
const lodash_1 = require("lodash");
|
|
8
8
|
const orders_1 = require("../../helpers/musicStyles/orders");
|
|
9
|
-
const utils_1 = require("../../helpers/utils");
|
|
10
9
|
const lang_1 = require("../../lang");
|
|
11
10
|
const basic_1 = __importDefault(require("./Player/basic"));
|
|
12
11
|
const promoter_1 = __importDefault(require("./promoter"));
|
|
13
12
|
const types_1 = require("./types");
|
|
13
|
+
const orders_2 = require("../../helpers/instruments/orders");
|
|
14
14
|
class Evento extends promoter_1.default {
|
|
15
15
|
constructor(doc, lang = lang_1.defaultLocale) {
|
|
16
16
|
super(doc, lang);
|
|
@@ -141,7 +141,7 @@ class Evento extends promoter_1.default {
|
|
|
141
141
|
}))
|
|
142
142
|
: Object.entries(this.players).map(([id, player]) => new basic_1.default(this.id, { id, ...player }));
|
|
143
143
|
const orderedPlayers = order
|
|
144
|
-
? (0,
|
|
144
|
+
? (0, orders_2.orderByInstruments)(players, 'mainInstrument', order)
|
|
145
145
|
: (0, orders_1.orderByMusicStyle)(players, 'mainInstrument', this.promoterInfo.musicStyle);
|
|
146
146
|
if (showAll)
|
|
147
147
|
return orderedPlayers;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InstrumentId } from '../../../../../helpers/instruments';
|
|
2
2
|
import { LanguagesTypes } from '../../../../../lang';
|
|
3
3
|
import { FileSectionId } from './types';
|
|
4
4
|
export default class GroupRepertoryFileSection {
|
|
@@ -6,5 +6,5 @@ export default class GroupRepertoryFileSection {
|
|
|
6
6
|
private lang;
|
|
7
7
|
constructor(id: FileSectionId, lang?: LanguagesTypes);
|
|
8
8
|
get name(): string;
|
|
9
|
-
getOrder(
|
|
9
|
+
getOrder(instrumentsIds: InstrumentId[]): number;
|
|
10
10
|
}
|
|
@@ -17,8 +17,8 @@ class GroupRepertoryFileSection {
|
|
|
17
17
|
? (0, lang_1.getTranslation)(`sections.all`, this.lang)
|
|
18
18
|
: new Instrument_1.default(this.id, this.lang).name) || this.id);
|
|
19
19
|
}
|
|
20
|
-
getOrder(
|
|
21
|
-
return (0, orders_1.
|
|
20
|
+
getOrder(instrumentsIds) {
|
|
21
|
+
return (0, orders_1.getFileSectionsOrder)(instrumentsIds).indexOf(this.id) + 1 || Infinity;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
exports.default = GroupRepertoryFileSection;
|
package/models/Group/index.js
CHANGED
|
@@ -7,12 +7,12 @@ const date_fns_1 = require("date-fns");
|
|
|
7
7
|
const lodash_1 = require("lodash");
|
|
8
8
|
const collections_1 = require("../../helpers/collections");
|
|
9
9
|
const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
|
|
10
|
-
const orders_1 = require("../../helpers/musicStyles/orders");
|
|
11
10
|
const objects_1 = require("../../helpers/objects");
|
|
12
11
|
const plans_1 = require("../../helpers/plans");
|
|
13
12
|
const lang_1 = require("../../lang");
|
|
14
13
|
const basic_1 = __importDefault(require("./basic"));
|
|
15
14
|
const types_1 = require("./types");
|
|
15
|
+
const orders_1 = require("../../helpers/instruments/orders");
|
|
16
16
|
class Group extends basic_1.default {
|
|
17
17
|
constructor(doc, lang = lang_1.defaultLocale) {
|
|
18
18
|
super(doc, lang);
|
|
@@ -97,7 +97,7 @@ class Group extends basic_1.default {
|
|
|
97
97
|
...this.players[playerId],
|
|
98
98
|
id: playerId,
|
|
99
99
|
}));
|
|
100
|
-
return (0, orders_1.
|
|
100
|
+
return (0, orders_1.orderByInstruments)(players, 'mainInstrument', this.instrumentsIds);
|
|
101
101
|
}
|
|
102
102
|
get isActive() {
|
|
103
103
|
return this.exists && !this.deletedAt;
|