@glissandoo/lib 1.53.6 → 1.53.8
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/functions/group.d.ts +9 -1
- package/functions/groupRepertory.d.ts +1 -1
- package/functions/index.d.ts +1 -0
- package/functions/index.js +1 -0
- package/functions/regions.js +1 -0
- package/helpers/errors.d.ts +14 -1
- package/helpers/errors.js +2 -0
- package/helpers/fileSections/index.js +1 -1
- package/helpers/instruments/index.d.ts +6 -5
- package/helpers/instruments/index.js +180 -185
- package/helpers/instruments/lists.d.ts +6 -0
- package/helpers/instruments/lists.js +21 -0
- package/helpers/musicStyles/index.d.ts +2 -2
- package/helpers/musicStyles/index.js +11 -11
- package/helpers/musicStyles/orders.d.ts +3 -3
- package/helpers/musicStyles/orders.js +172 -168
- package/helpers/notifications/placeholders.js +14 -7
- package/helpers/objects.d.ts +1 -1
- package/lang/ca.json +18 -16
- package/lang/de.json +22 -20
- package/lang/en.json +18 -16
- package/lang/es.json +17 -15
- package/lang/eu.json +22 -20
- package/lang/gl.json +22 -20
- package/lang/pt.json +22 -20
- package/models/Evento/Player/basic.js +1 -1
- package/models/Group/index.d.ts +7 -2
- package/models/Group/index.js +4 -1
- package/models/Group/types.d.ts +14 -5
- package/models/Instrument/group.d.ts +12 -0
- package/models/Instrument/group.js +30 -0
- package/package.json +1 -1
|
@@ -6,195 +6,199 @@ const utils_1 = require("../utils");
|
|
|
6
6
|
const index_1 = require("./index");
|
|
7
7
|
exports.orders = {
|
|
8
8
|
[index_1.MusicStyleId.Band]: [
|
|
9
|
-
instruments_1.
|
|
10
|
-
instruments_1.
|
|
11
|
-
instruments_1.
|
|
12
|
-
instruments_1.
|
|
13
|
-
instruments_1.
|
|
14
|
-
instruments_1.
|
|
15
|
-
instruments_1.
|
|
16
|
-
instruments_1.
|
|
17
|
-
instruments_1.
|
|
18
|
-
instruments_1.
|
|
19
|
-
instruments_1.
|
|
20
|
-
instruments_1.
|
|
21
|
-
instruments_1.
|
|
22
|
-
instruments_1.
|
|
23
|
-
instruments_1.
|
|
24
|
-
instruments_1.
|
|
25
|
-
instruments_1.
|
|
26
|
-
instruments_1.
|
|
27
|
-
instruments_1.
|
|
28
|
-
instruments_1.
|
|
29
|
-
instruments_1.
|
|
30
|
-
instruments_1.
|
|
31
|
-
instruments_1.
|
|
32
|
-
instruments_1.
|
|
33
|
-
instruments_1.
|
|
34
|
-
instruments_1.
|
|
35
|
-
instruments_1.
|
|
36
|
-
instruments_1.
|
|
37
|
-
instruments_1.
|
|
38
|
-
instruments_1.
|
|
9
|
+
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
10
|
+
instruments_1.DefaultInstrumentId.Piccolo,
|
|
11
|
+
instruments_1.DefaultInstrumentId.Flute,
|
|
12
|
+
instruments_1.DefaultInstrumentId.Oboe,
|
|
13
|
+
instruments_1.DefaultInstrumentId.EnglishHorn,
|
|
14
|
+
instruments_1.DefaultInstrumentId.Bassoon,
|
|
15
|
+
instruments_1.DefaultInstrumentId.BassoonContra,
|
|
16
|
+
instruments_1.DefaultInstrumentId.ClarinetLittle,
|
|
17
|
+
instruments_1.DefaultInstrumentId.Clarinet,
|
|
18
|
+
instruments_1.DefaultInstrumentId.ClarinetBass,
|
|
19
|
+
instruments_1.DefaultInstrumentId.SaxSoprano,
|
|
20
|
+
instruments_1.DefaultInstrumentId.SaxAlto,
|
|
21
|
+
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
22
|
+
instruments_1.DefaultInstrumentId.SaxBaritone,
|
|
23
|
+
instruments_1.DefaultInstrumentId.FrenchHorn,
|
|
24
|
+
instruments_1.DefaultInstrumentId.FlugeHorn,
|
|
25
|
+
instruments_1.DefaultInstrumentId.Trumpet,
|
|
26
|
+
instruments_1.DefaultInstrumentId.Trombone,
|
|
27
|
+
instruments_1.DefaultInstrumentId.TromboneLow,
|
|
28
|
+
instruments_1.DefaultInstrumentId.Euphonium,
|
|
29
|
+
instruments_1.DefaultInstrumentId.Tuba,
|
|
30
|
+
instruments_1.DefaultInstrumentId.Cello,
|
|
31
|
+
instruments_1.DefaultInstrumentId.DoubleBass,
|
|
32
|
+
instruments_1.DefaultInstrumentId.SnareDrum,
|
|
33
|
+
instruments_1.DefaultInstrumentId.Percussion,
|
|
34
|
+
instruments_1.DefaultInstrumentId.BassDrum,
|
|
35
|
+
instruments_1.DefaultInstrumentId.Cymbals,
|
|
36
|
+
instruments_1.DefaultInstrumentId.Timpani,
|
|
37
|
+
instruments_1.DefaultInstrumentId.Mallets,
|
|
38
|
+
instruments_1.DefaultInstrumentId.DrumSet,
|
|
39
39
|
],
|
|
40
40
|
[index_1.MusicStyleId.MarchingBand]: [
|
|
41
|
-
instruments_1.
|
|
42
|
-
instruments_1.
|
|
43
|
-
instruments_1.
|
|
44
|
-
instruments_1.
|
|
45
|
-
instruments_1.
|
|
46
|
-
instruments_1.
|
|
47
|
-
instruments_1.
|
|
48
|
-
instruments_1.
|
|
49
|
-
instruments_1.
|
|
50
|
-
instruments_1.
|
|
51
|
-
instruments_1.
|
|
52
|
-
instruments_1.
|
|
53
|
-
instruments_1.
|
|
54
|
-
instruments_1.
|
|
55
|
-
instruments_1.
|
|
56
|
-
instruments_1.
|
|
57
|
-
instruments_1.
|
|
58
|
-
instruments_1.
|
|
59
|
-
instruments_1.
|
|
60
|
-
instruments_1.
|
|
41
|
+
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
42
|
+
instruments_1.DefaultInstrumentId.Piccolo,
|
|
43
|
+
instruments_1.DefaultInstrumentId.Flute,
|
|
44
|
+
instruments_1.DefaultInstrumentId.Clarinet,
|
|
45
|
+
instruments_1.DefaultInstrumentId.ClarinetBass,
|
|
46
|
+
instruments_1.DefaultInstrumentId.SaxAlto,
|
|
47
|
+
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
48
|
+
instruments_1.DefaultInstrumentId.SaxBaritone,
|
|
49
|
+
instruments_1.DefaultInstrumentId.Trumpet,
|
|
50
|
+
instruments_1.DefaultInstrumentId.Trombone,
|
|
51
|
+
instruments_1.DefaultInstrumentId.TromboneLow,
|
|
52
|
+
instruments_1.DefaultInstrumentId.Euphonium,
|
|
53
|
+
instruments_1.DefaultInstrumentId.Tuba,
|
|
54
|
+
instruments_1.DefaultInstrumentId.SnareDrum,
|
|
55
|
+
instruments_1.DefaultInstrumentId.MarchingToms,
|
|
56
|
+
instruments_1.DefaultInstrumentId.BassDrum,
|
|
57
|
+
instruments_1.DefaultInstrumentId.Cymbals,
|
|
58
|
+
instruments_1.DefaultInstrumentId.Timpani,
|
|
59
|
+
instruments_1.DefaultInstrumentId.Mallets,
|
|
60
|
+
instruments_1.DefaultInstrumentId.DrumSet,
|
|
61
61
|
],
|
|
62
62
|
[index_1.MusicStyleId.Orchestra]: [
|
|
63
|
-
instruments_1.
|
|
64
|
-
instruments_1.
|
|
65
|
-
instruments_1.
|
|
66
|
-
instruments_1.
|
|
67
|
-
instruments_1.
|
|
68
|
-
instruments_1.
|
|
69
|
-
instruments_1.
|
|
70
|
-
instruments_1.
|
|
71
|
-
instruments_1.
|
|
72
|
-
instruments_1.
|
|
73
|
-
instruments_1.
|
|
74
|
-
instruments_1.
|
|
75
|
-
instruments_1.
|
|
76
|
-
instruments_1.
|
|
77
|
-
instruments_1.
|
|
78
|
-
instruments_1.
|
|
79
|
-
instruments_1.
|
|
80
|
-
instruments_1.
|
|
81
|
-
instruments_1.
|
|
82
|
-
instruments_1.
|
|
83
|
-
instruments_1.
|
|
84
|
-
instruments_1.
|
|
85
|
-
instruments_1.
|
|
86
|
-
instruments_1.
|
|
87
|
-
instruments_1.
|
|
88
|
-
instruments_1.
|
|
89
|
-
instruments_1.
|
|
90
|
-
instruments_1.
|
|
91
|
-
instruments_1.
|
|
92
|
-
instruments_1.
|
|
93
|
-
instruments_1.
|
|
94
|
-
instruments_1.
|
|
95
|
-
instruments_1.
|
|
96
|
-
instruments_1.
|
|
97
|
-
instruments_1.
|
|
63
|
+
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
64
|
+
instruments_1.DefaultInstrumentId.Violin,
|
|
65
|
+
instruments_1.DefaultInstrumentId.Viola,
|
|
66
|
+
instruments_1.DefaultInstrumentId.Cello,
|
|
67
|
+
instruments_1.DefaultInstrumentId.DoubleBass,
|
|
68
|
+
instruments_1.DefaultInstrumentId.Piccolo,
|
|
69
|
+
instruments_1.DefaultInstrumentId.Flute,
|
|
70
|
+
instruments_1.DefaultInstrumentId.FluteLow,
|
|
71
|
+
instruments_1.DefaultInstrumentId.Oboe,
|
|
72
|
+
instruments_1.DefaultInstrumentId.EnglishHorn,
|
|
73
|
+
instruments_1.DefaultInstrumentId.Bassoon,
|
|
74
|
+
instruments_1.DefaultInstrumentId.BassoonContra,
|
|
75
|
+
instruments_1.DefaultInstrumentId.ClarinetLittle,
|
|
76
|
+
instruments_1.DefaultInstrumentId.Clarinet,
|
|
77
|
+
instruments_1.DefaultInstrumentId.ClarinetBass,
|
|
78
|
+
instruments_1.DefaultInstrumentId.SaxSoprano,
|
|
79
|
+
instruments_1.DefaultInstrumentId.SaxAlto,
|
|
80
|
+
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
81
|
+
instruments_1.DefaultInstrumentId.SaxBaritone,
|
|
82
|
+
instruments_1.DefaultInstrumentId.FrenchHorn,
|
|
83
|
+
instruments_1.DefaultInstrumentId.FlugeHorn,
|
|
84
|
+
instruments_1.DefaultInstrumentId.Trumpet,
|
|
85
|
+
instruments_1.DefaultInstrumentId.TrumpetLow,
|
|
86
|
+
instruments_1.DefaultInstrumentId.TrumpetPiccolo,
|
|
87
|
+
instruments_1.DefaultInstrumentId.Trombone,
|
|
88
|
+
instruments_1.DefaultInstrumentId.TromboneHigh,
|
|
89
|
+
instruments_1.DefaultInstrumentId.TromboneLow,
|
|
90
|
+
instruments_1.DefaultInstrumentId.Euphonium,
|
|
91
|
+
instruments_1.DefaultInstrumentId.Tuba,
|
|
92
|
+
instruments_1.DefaultInstrumentId.Percussion,
|
|
93
|
+
instruments_1.DefaultInstrumentId.SnareDrum,
|
|
94
|
+
instruments_1.DefaultInstrumentId.BassDrum,
|
|
95
|
+
instruments_1.DefaultInstrumentId.Cymbals,
|
|
96
|
+
instruments_1.DefaultInstrumentId.Timpani,
|
|
97
|
+
instruments_1.DefaultInstrumentId.Mallets,
|
|
98
98
|
],
|
|
99
99
|
[index_1.MusicStyleId.Choir]: [
|
|
100
|
-
instruments_1.
|
|
101
|
-
instruments_1.
|
|
102
|
-
instruments_1.
|
|
103
|
-
instruments_1.
|
|
104
|
-
instruments_1.
|
|
105
|
-
instruments_1.
|
|
106
|
-
instruments_1.
|
|
107
|
-
instruments_1.
|
|
108
|
-
instruments_1.
|
|
100
|
+
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
101
|
+
instruments_1.DefaultInstrumentId.Soprano,
|
|
102
|
+
instruments_1.DefaultInstrumentId.MezzoSoprano,
|
|
103
|
+
instruments_1.DefaultInstrumentId.ContraAlto,
|
|
104
|
+
instruments_1.DefaultInstrumentId.CounterTenor,
|
|
105
|
+
instruments_1.DefaultInstrumentId.BassChoir,
|
|
106
|
+
instruments_1.DefaultInstrumentId.Tenor,
|
|
107
|
+
instruments_1.DefaultInstrumentId.Baritone,
|
|
108
|
+
instruments_1.DefaultInstrumentId.Choir,
|
|
109
109
|
],
|
|
110
110
|
[index_1.MusicStyleId.BigBand]: [
|
|
111
|
-
instruments_1.
|
|
112
|
-
instruments_1.
|
|
113
|
-
instruments_1.
|
|
114
|
-
instruments_1.
|
|
115
|
-
instruments_1.
|
|
116
|
-
instruments_1.
|
|
117
|
-
instruments_1.
|
|
118
|
-
instruments_1.
|
|
119
|
-
instruments_1.
|
|
120
|
-
instruments_1.
|
|
121
|
-
instruments_1.
|
|
122
|
-
instruments_1.
|
|
123
|
-
instruments_1.
|
|
124
|
-
instruments_1.
|
|
125
|
-
instruments_1.
|
|
126
|
-
instruments_1.
|
|
127
|
-
instruments_1.
|
|
128
|
-
instruments_1.
|
|
129
|
-
instruments_1.
|
|
130
|
-
instruments_1.
|
|
131
|
-
instruments_1.
|
|
132
|
-
instruments_1.
|
|
133
|
-
instruments_1.
|
|
134
|
-
instruments_1.
|
|
135
|
-
instruments_1.
|
|
136
|
-
instruments_1.
|
|
111
|
+
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
112
|
+
instruments_1.DefaultInstrumentId.Piccolo,
|
|
113
|
+
instruments_1.DefaultInstrumentId.Flute,
|
|
114
|
+
instruments_1.DefaultInstrumentId.FluteLow,
|
|
115
|
+
instruments_1.DefaultInstrumentId.Oboe,
|
|
116
|
+
instruments_1.DefaultInstrumentId.EnglishHorn,
|
|
117
|
+
instruments_1.DefaultInstrumentId.Bassoon,
|
|
118
|
+
instruments_1.DefaultInstrumentId.BassoonContra,
|
|
119
|
+
instruments_1.DefaultInstrumentId.ClarinetLittle,
|
|
120
|
+
instruments_1.DefaultInstrumentId.Clarinet,
|
|
121
|
+
instruments_1.DefaultInstrumentId.ClarinetBass,
|
|
122
|
+
instruments_1.DefaultInstrumentId.SaxSoprano,
|
|
123
|
+
instruments_1.DefaultInstrumentId.SaxAlto,
|
|
124
|
+
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
125
|
+
instruments_1.DefaultInstrumentId.SaxBaritone,
|
|
126
|
+
instruments_1.DefaultInstrumentId.FrenchHorn,
|
|
127
|
+
instruments_1.DefaultInstrumentId.FlugeHorn,
|
|
128
|
+
instruments_1.DefaultInstrumentId.Trumpet,
|
|
129
|
+
instruments_1.DefaultInstrumentId.Trombone,
|
|
130
|
+
instruments_1.DefaultInstrumentId.TromboneLow,
|
|
131
|
+
instruments_1.DefaultInstrumentId.Euphonium,
|
|
132
|
+
instruments_1.DefaultInstrumentId.Tuba,
|
|
133
|
+
instruments_1.DefaultInstrumentId.Cello,
|
|
134
|
+
instruments_1.DefaultInstrumentId.DoubleBass,
|
|
135
|
+
instruments_1.DefaultInstrumentId.Percussion,
|
|
136
|
+
instruments_1.DefaultInstrumentId.DrumSet,
|
|
137
|
+
],
|
|
138
|
+
[index_1.MusicStyleId.TxistularisBand]: [
|
|
139
|
+
instruments_1.DefaultInstrumentId.Txistu,
|
|
140
|
+
instruments_1.DefaultInstrumentId.Silbote,
|
|
141
|
+
instruments_1.DefaultInstrumentId.Tabal,
|
|
137
142
|
],
|
|
138
|
-
[index_1.MusicStyleId.TxistularisBand]: [instruments_1.InstrumentId.Txistu, instruments_1.InstrumentId.Silbote, instruments_1.InstrumentId.Tabal],
|
|
139
143
|
[index_1.MusicStyleId.Colla]: [
|
|
140
|
-
instruments_1.
|
|
141
|
-
instruments_1.
|
|
142
|
-
instruments_1.
|
|
143
|
-
instruments_1.
|
|
144
|
-
instruments_1.
|
|
145
|
-
instruments_1.
|
|
146
|
-
instruments_1.
|
|
147
|
-
instruments_1.
|
|
148
|
-
instruments_1.
|
|
149
|
-
instruments_1.
|
|
144
|
+
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
145
|
+
instruments_1.DefaultInstrumentId.Dulzaina,
|
|
146
|
+
instruments_1.DefaultInstrumentId.DulzainaFa,
|
|
147
|
+
instruments_1.DefaultInstrumentId.Tarota,
|
|
148
|
+
instruments_1.DefaultInstrumentId.Bagpipes,
|
|
149
|
+
instruments_1.DefaultInstrumentId.Tabal,
|
|
150
|
+
instruments_1.DefaultInstrumentId.Percussion,
|
|
151
|
+
instruments_1.DefaultInstrumentId.BassDrum,
|
|
152
|
+
instruments_1.DefaultInstrumentId.Cymbals,
|
|
153
|
+
instruments_1.DefaultInstrumentId.Timpani,
|
|
150
154
|
],
|
|
151
155
|
[index_1.MusicStyleId.Charanga]: [
|
|
152
|
-
instruments_1.
|
|
153
|
-
instruments_1.
|
|
154
|
-
instruments_1.
|
|
155
|
-
instruments_1.
|
|
156
|
-
instruments_1.
|
|
157
|
-
instruments_1.
|
|
158
|
-
instruments_1.
|
|
159
|
-
instruments_1.
|
|
160
|
-
instruments_1.
|
|
161
|
-
instruments_1.
|
|
162
|
-
instruments_1.
|
|
163
|
-
instruments_1.
|
|
156
|
+
instruments_1.DefaultInstrumentId.Clarinet,
|
|
157
|
+
instruments_1.DefaultInstrumentId.SaxAlto,
|
|
158
|
+
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
159
|
+
instruments_1.DefaultInstrumentId.Trumpet,
|
|
160
|
+
instruments_1.DefaultInstrumentId.Trombone,
|
|
161
|
+
instruments_1.DefaultInstrumentId.Euphonium,
|
|
162
|
+
instruments_1.DefaultInstrumentId.Tuba,
|
|
163
|
+
instruments_1.DefaultInstrumentId.Percussion,
|
|
164
|
+
instruments_1.DefaultInstrumentId.SnareDrum,
|
|
165
|
+
instruments_1.DefaultInstrumentId.BassDrum,
|
|
166
|
+
instruments_1.DefaultInstrumentId.MarchingToms,
|
|
167
|
+
instruments_1.DefaultInstrumentId.Cymbals,
|
|
164
168
|
],
|
|
165
169
|
[index_1.MusicStyleId.BandaCornetasYTambores]: [
|
|
166
|
-
instruments_1.
|
|
167
|
-
instruments_1.
|
|
168
|
-
instruments_1.
|
|
169
|
-
instruments_1.
|
|
170
|
-
instruments_1.
|
|
170
|
+
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
171
|
+
instruments_1.DefaultInstrumentId.Cornet,
|
|
172
|
+
instruments_1.DefaultInstrumentId.Percussion,
|
|
173
|
+
instruments_1.DefaultInstrumentId.SnareDrum,
|
|
174
|
+
instruments_1.DefaultInstrumentId.BassDrum,
|
|
171
175
|
],
|
|
172
176
|
[index_1.MusicStyleId.JazzBand]: [
|
|
173
|
-
instruments_1.
|
|
174
|
-
instruments_1.
|
|
175
|
-
instruments_1.
|
|
176
|
-
instruments_1.
|
|
177
|
-
instruments_1.
|
|
178
|
-
instruments_1.
|
|
179
|
-
instruments_1.
|
|
180
|
-
instruments_1.
|
|
181
|
-
instruments_1.
|
|
182
|
-
instruments_1.
|
|
183
|
-
instruments_1.
|
|
184
|
-
instruments_1.
|
|
177
|
+
instruments_1.DefaultInstrumentId.Flute,
|
|
178
|
+
instruments_1.DefaultInstrumentId.Clarinet,
|
|
179
|
+
instruments_1.DefaultInstrumentId.SaxSoprano,
|
|
180
|
+
instruments_1.DefaultInstrumentId.SaxAlto,
|
|
181
|
+
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
182
|
+
instruments_1.DefaultInstrumentId.SaxBaritone,
|
|
183
|
+
instruments_1.DefaultInstrumentId.Trumpet,
|
|
184
|
+
instruments_1.DefaultInstrumentId.Trombone,
|
|
185
|
+
instruments_1.DefaultInstrumentId.Tuba,
|
|
186
|
+
instruments_1.DefaultInstrumentId.DoubleBass,
|
|
187
|
+
instruments_1.DefaultInstrumentId.Percussion,
|
|
188
|
+
instruments_1.DefaultInstrumentId.DrumSet,
|
|
185
189
|
],
|
|
186
190
|
[index_1.MusicStyleId.Batucada]: [
|
|
187
|
-
instruments_1.
|
|
188
|
-
instruments_1.
|
|
189
|
-
instruments_1.
|
|
190
|
-
instruments_1.
|
|
191
|
-
instruments_1.
|
|
192
|
-
instruments_1.
|
|
193
|
-
instruments_1.
|
|
191
|
+
instruments_1.DefaultInstrumentId.Repique,
|
|
192
|
+
instruments_1.DefaultInstrumentId.TambourineBrazilian,
|
|
193
|
+
instruments_1.DefaultInstrumentId.TimbalBrazilian,
|
|
194
|
+
instruments_1.DefaultInstrumentId.SnareDrum,
|
|
195
|
+
instruments_1.DefaultInstrumentId.Surdo,
|
|
196
|
+
instruments_1.DefaultInstrumentId.Agogo,
|
|
197
|
+
instruments_1.DefaultInstrumentId.Chocalho,
|
|
194
198
|
],
|
|
195
199
|
};
|
|
196
200
|
const getInstrumentsOrderByMusicStyle = (musicStyle) => {
|
|
197
|
-
return musicStyle in exports.orders ? exports.orders[musicStyle] : Object.values(instruments_1.
|
|
201
|
+
return musicStyle in exports.orders ? exports.orders[musicStyle] : Object.values(instruments_1.DefaultInstrumentId);
|
|
198
202
|
};
|
|
199
203
|
exports.getInstrumentsOrderByMusicStyle = getInstrumentsOrderByMusicStyle;
|
|
200
204
|
const orderByMusicStyle = (list, field, musicStyle) => {
|
|
@@ -36,6 +36,11 @@ const getTypeAndPathFromPlaceholder = (placeholder) => {
|
|
|
36
36
|
formatValue: (formatValue || 'shortDate'),
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
+
const getPropsPathsFromArrayPlaceholderInPath = (path) => {
|
|
40
|
+
const placeholder = path.pop();
|
|
41
|
+
const props = placeholder ? placeholder.slice(1, -1).replace(' ', '').split(',') : [];
|
|
42
|
+
return props.map((prop) => [...path, prop]);
|
|
43
|
+
};
|
|
39
44
|
const replaceKeysNotification = (text, values, lang) => {
|
|
40
45
|
const placeholders = text.match(/(\{).+?(\})/g);
|
|
41
46
|
if (!placeholders || placeholders.length === 0) {
|
|
@@ -51,21 +56,23 @@ const replaceKeysNotification = (text, values, lang) => {
|
|
|
51
56
|
const { type, path, formatValue } = getTypeAndPathFromPlaceholder(placeholder);
|
|
52
57
|
switch (type) {
|
|
53
58
|
case PlaceholderType.Instrument: {
|
|
54
|
-
const
|
|
59
|
+
const [instrumentIdPropPath, customInstrumentNamePropPath] = getPropsPathsFromArrayPlaceholderInPath(path);
|
|
60
|
+
const customInstrumentName = (0, lodash_1.get)(newValues, customInstrumentNamePropPath);
|
|
61
|
+
if (customInstrumentName) {
|
|
62
|
+
return text.replace(placeholder, customInstrumentName.toLowerCase());
|
|
63
|
+
}
|
|
64
|
+
const instrumentId = (0, lodash_1.get)(newValues, instrumentIdPropPath);
|
|
55
65
|
const instrument = new Instrument_1.default(instrumentId, lang);
|
|
56
66
|
if (!instrument)
|
|
57
67
|
return text;
|
|
58
68
|
return text.replace(placeholder, instrument.name.toLowerCase());
|
|
59
69
|
}
|
|
60
70
|
case PlaceholderType.Date: {
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
? lastPath.slice(1, -1).replace(' ', '').split(',')
|
|
64
|
-
: [];
|
|
65
|
-
const datetime = (0, lodash_1.get)(newValues, [...path, datetimeProp]);
|
|
71
|
+
const [datetimePropPath, timezonePropPath] = getPropsPathsFromArrayPlaceholderInPath(path);
|
|
72
|
+
const datetime = (0, lodash_1.get)(newValues, datetimePropPath);
|
|
66
73
|
if (!datetime)
|
|
67
74
|
return text.replace(placeholder, '');
|
|
68
|
-
const timezone = (0, lodash_1.get)(newValues,
|
|
75
|
+
const timezone = (0, lodash_1.get)(newValues, timezonePropPath) || 'Europe/Madrid';
|
|
69
76
|
const zonedDatetime = (0, date_fns_tz_1.utcToZonedTime)(datetime.toDate(), timezone);
|
|
70
77
|
const dateLang = (0, lang_1.getDateLang)(lang);
|
|
71
78
|
const dateFormat = (0, date_fns_1.format)(zonedDatetime, (0, lodash_1.get)(dateLang.format, formatValue), {
|
package/helpers/objects.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const mapToArray: <K extends string, V extends object, O extends Record<K, V>>(obj: O) => (O[`${Exclude<keyof O, symbol>}`] & {
|
|
1
|
+
export declare const mapToArray: <K extends string, V extends object, O extends Record<K, V | undefined>>(obj: O) => (O[`${Exclude<keyof O, symbol>}`] & {
|
|
2
2
|
id: keyof O;
|
|
3
3
|
})[];
|
|
4
4
|
export declare const orderedMapToArray: <K extends string, V extends {
|
package/lang/ca.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"instruments.agogo": "Agogó",
|
|
47
47
|
"instruments.altoClarinet": "Clarinet Alt",
|
|
48
48
|
"instruments.altoSaxophone": "Saxòfon alt",
|
|
49
|
+
"instruments.auxiliar": "Auxiliar",
|
|
49
50
|
"instruments.bagpipes": "Sac de gemecs",
|
|
50
51
|
"instruments.bandurria": "Bandúrria",
|
|
51
52
|
"instruments.banjo": "Banjo",
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
"instruments.englishHorn": "Corn anglès",
|
|
78
79
|
"instruments.euphonium": "Bombardí",
|
|
79
80
|
"instruments.flabiol": "Flabiol",
|
|
81
|
+
"instruments.flagBearer": "Abanderat",
|
|
80
82
|
"instruments.flugelhorn": "Fiscorn",
|
|
81
83
|
"instruments.flute": "Flauta",
|
|
82
84
|
"instruments.frenchHorn": "Trompa",
|
|
@@ -168,10 +170,10 @@
|
|
|
168
170
|
"performance.edit.stage.title": "Concert - Mapa de l'escenari modificat",
|
|
169
171
|
"performance.edit.title.text": "S'ha actualitzat el títol de {string:event.0.displayName}",
|
|
170
172
|
"performance.edit.title.title": "Acte - canvi de nom",
|
|
171
|
-
"performance.interest.confirm.text": "{string:user.0.displayName}
|
|
172
|
-
"performance.interest.confirm.title": "
|
|
173
|
-
"performance.interest.lose.text": "{string:user.0.displayName} ja no està
|
|
174
|
-
"performance.interest.lose.title": "
|
|
173
|
+
"performance.interest.confirm.text": "{string:user.0.displayName} s'ha apuntat a {string:event.0.displayName}",
|
|
174
|
+
"performance.interest.confirm.title": "Nova inscripció per al concert",
|
|
175
|
+
"performance.interest.lose.text": "{string:user.0.displayName} ja no està apuntat a {string:event.0.displayName}",
|
|
176
|
+
"performance.interest.lose.title": "Inscripció anulada per al concert",
|
|
175
177
|
"performance.players.add.text": "T'han afegit a {string:event.0.displayName}",
|
|
176
178
|
"performance.players.add.title": "Nou acte",
|
|
177
179
|
"performance.players.remove.text": "Has estat esborrat de {string:event.0.displayName}",
|
|
@@ -188,8 +190,8 @@
|
|
|
188
190
|
"performance.reminderDeadlineSoon.pending.title": "Recordatori data límit acte",
|
|
189
191
|
"performance.rollCallReminder.text": "Ara es el millor moment per a passar llista",
|
|
190
192
|
"performance.rollCallReminder.title": "Pots passar llista a l'assaig",
|
|
191
|
-
"performance.selection.deselect.text": "
|
|
192
|
-
"performance.selection.deselect.title": "
|
|
193
|
+
"performance.selection.deselect.text": "No has estat seleccionat per a participar en {string:event.0.displayName}",
|
|
194
|
+
"performance.selection.deselect.title": "No estàs seleccionat per al concert",
|
|
193
195
|
"performance.selection.select.text": "Has estat seleccionat per a participar en {string:event.0.displayName}",
|
|
194
196
|
"performance.selection.select.title": "Seleccionat per al concert",
|
|
195
197
|
"practice": "Assaig",
|
|
@@ -221,10 +223,10 @@
|
|
|
221
223
|
"practice.edit.stage.title": "Assaig - Mapa actualitzat",
|
|
222
224
|
"practice.edit.title.text": "S'ha actualitzat el títol de l'assaig del {date:event.0.[datetime,timezone]:date}",
|
|
223
225
|
"practice.edit.title.title": "Assaig - canvi de nom",
|
|
224
|
-
"practice.interest.confirm.text": "{string:user.0.displayName}
|
|
225
|
-
"practice.interest.confirm.title": "
|
|
226
|
-
"practice.interest.lose.text": "{string:user.0.displayName} ja
|
|
227
|
-
"practice.interest.lose.title": "
|
|
226
|
+
"practice.interest.confirm.text": "{string:user.0.displayName} s'ha apuntat al assaig de {string:group.0.displayName} el {date:event.0.[datetime,timezone]:date}",
|
|
227
|
+
"practice.interest.confirm.title": "Nova inscripció per a l'assaig",
|
|
228
|
+
"practice.interest.lose.text": "{string:user.0.displayName} ja està apuntat al assaig de {string:group.0.displayName} el {date:event.0.[datetime,timezone]:date}",
|
|
229
|
+
"practice.interest.lose.title": "Inscripció anulada per a l'assaig",
|
|
228
230
|
"practice.players.add.text": "T'han afegit a un assaig de {string:group.0.displayName} programat pel {date:event.0.[datetime,timezone]:datetime}",
|
|
229
231
|
"practice.players.add.title": "Nou assaig",
|
|
230
232
|
"practice.players.remove.text": "Has estat esborrat de l'assaig de {string:group.0.displayName} pel {date:event.0.[datetime,timezone]:date}",
|
|
@@ -241,8 +243,8 @@
|
|
|
241
243
|
"practice.reminderDeadlineSoon.pending.title": "Recordatori data límit assaig",
|
|
242
244
|
"practice.rollCallReminder.text": "Ara es el millor moment per a passar llista",
|
|
243
245
|
"practice.rollCallReminder.title": "Pots passar llista al vostre darrer assaig",
|
|
244
|
-
"practice.selection.deselect.text": "
|
|
245
|
-
"practice.selection.deselect.title": "
|
|
246
|
+
"practice.selection.deselect.text": "No has estat seleccionat per a participar en l'assaig de {string:group.0.displayName} el {date:event.0.[datetime,timezone]:date}",
|
|
247
|
+
"practice.selection.deselect.title": "No estàs seleccionat per a l'assaig",
|
|
246
248
|
"practice.selection.select.text": "Has estat seleccionat per a participar en l'assaig de {string:group.0.displayName} el {date:event.0.[datetime,timezone]:date}",
|
|
247
249
|
"practice.selection.select.title": "Seleccionat per a l'assaig",
|
|
248
250
|
"practices.cancel.text": "S'han cancel·lat {string:extra.num} assajos de {string:group.0.displayName} des del {date:event.0.[datetime,timezone]:shortDate} fins al {date:event.1.[datetime,timezone]:shortDate}",
|
|
@@ -254,7 +256,7 @@
|
|
|
254
256
|
"practices.edit.comments.text": "Una serie d'assajos han actualitzat els seus comentaris",
|
|
255
257
|
"practices.edit.comments.title": "Assajos - comentaris actualitzats",
|
|
256
258
|
"practices.edit.datetime.text": "Una serie d'assajos han actualitzat el seu horari",
|
|
257
|
-
"practices.edit.datetime.title": "Assajos - canvi d
|
|
259
|
+
"practices.edit.datetime.title": "Assajos - canvi d'horari",
|
|
258
260
|
"practices.edit.locality.text": "Una serie d'assajos han actualitzat la seva adreça",
|
|
259
261
|
"practices.edit.locality.title": "Assajos - canvi d'adreça",
|
|
260
262
|
"practices.edit.repertory.text": "Una serie d'assajos han actualitzat el seu repertori",
|
|
@@ -275,8 +277,8 @@
|
|
|
275
277
|
"repertoireTags.4": "4t",
|
|
276
278
|
"repertoireTags.principal": "Principal",
|
|
277
279
|
"sections.all": "Tots",
|
|
278
|
-
"theme.claim.new.text": "{string:user.0.displayName} ha reclamat la partitura de {instrument:extra.instrumentId} de l'obra \"{string:extra.title}\"",
|
|
280
|
+
"theme.claim.new.text": "{string:user.0.displayName} ha reclamat la partitura de {instrument:extra.[instrumentId,customInstrumentName]} de l'obra \"{string:extra.title}\"",
|
|
279
281
|
"theme.claim.new.title": "Han demanat una partitura",
|
|
280
|
-
"theme.claim.update.text": "S'afegit la partitura de {instrument:extra.instrumentId} de l'obra \"{string:extra.title}\"",
|
|
281
|
-
"theme.claim.update.title": "Nova partitura de {instrument:extra.instrumentId}"
|
|
282
|
+
"theme.claim.update.text": "S'afegit la partitura de {instrument:extra.[instrumentId,customInstrumentName]} de l'obra \"{string:extra.title}\"",
|
|
283
|
+
"theme.claim.update.title": "Nova partitura de {instrument:extra.[instrumentId,customInstrumentName]}"
|
|
282
284
|
}
|