volleyballsimtypes 0.0.444 → 0.0.445
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.
|
@@ -105,6 +105,16 @@ function transformToObject(model, roster) {
|
|
|
105
105
|
const secondLibero = (hasStartingLibero && model.second_libero != null && !inLineupIds.has(model.second_libero))
|
|
106
106
|
? roster.find((p) => p.id === model.second_libero)
|
|
107
107
|
: undefined;
|
|
108
|
+
// A persisted `libero_replacement_sets` whose entries are ALL empty (a stale [[],[],[],[],[]] left by an
|
|
109
|
+
// older "configure each set independently" session that a later "apply to all sets" save could not clear --
|
|
110
|
+
// the pre-fix write omitted the column instead of nulling it) silently benches the libero: the sim picks
|
|
111
|
+
// `sets?.[i] ?? liberoReplacements`, and an empty array is not nullish, so every set gets an empty target
|
|
112
|
+
// list and the libero never enters the court. Treat an all-empty per-set list as absent so the sim falls
|
|
113
|
+
// back to the flat `liberoReplacements`; the next tactics save rewrites the column cleanly.
|
|
114
|
+
const mappedLiberoReplacementSets = model.libero_replacement_sets?.map(set => set.map((id) => findPlayer(id, roster)));
|
|
115
|
+
const liberoReplacementSets = mappedLiberoReplacementSets?.some(set => set.length > 0) === true
|
|
116
|
+
? mappedLiberoReplacementSets
|
|
117
|
+
: undefined;
|
|
108
118
|
return service_1.Tactics.create({
|
|
109
119
|
receiveRotationOffset: model.receive_rotation_offset,
|
|
110
120
|
lineup,
|
|
@@ -112,7 +122,7 @@ function transformToObject(model, roster) {
|
|
|
112
122
|
substitutionBand: model.substitution_band,
|
|
113
123
|
secondLibero,
|
|
114
124
|
liberoSub: secondLibero != null ? (model.libero_sub ?? undefined) : undefined,
|
|
115
|
-
liberoReplacementSets
|
|
125
|
+
liberoReplacementSets,
|
|
116
126
|
designatedSubs: (model.designated_subs ?? []).map(d => ({
|
|
117
127
|
starter: findPlayer(d.starterId, roster),
|
|
118
128
|
bench: d.benchId != null ? findPlayer(d.benchId, roster) : undefined,
|
|
@@ -160,6 +170,12 @@ function tacticsColumnsToApiDto(model) {
|
|
|
160
170
|
const validSecondLibero = (model.second_libero != null && model.lineup[service_1.CourtPosition.LIBERO_ZONE] != null && !lineupIds.has(model.second_libero))
|
|
161
171
|
? model.second_libero
|
|
162
172
|
: undefined;
|
|
173
|
+
// Same all-empty heal as transformToObject: an all-empty per-set `libero_replacement_sets` is a stale
|
|
174
|
+
// artifact that shadows the flat `liberoReplacements` in the sim, so don't surface it to the API/preset
|
|
175
|
+
// shape -- otherwise the UI would reload it as "configure each set independently" (all blank) and re-emit it.
|
|
176
|
+
const validLiberoReplacementSets = model.libero_replacement_sets?.some(set => set.length > 0) === true
|
|
177
|
+
? model.libero_replacement_sets
|
|
178
|
+
: undefined;
|
|
163
179
|
return {
|
|
164
180
|
lineup: model.lineup,
|
|
165
181
|
liberoReplacements: model.libero_replacements,
|
|
@@ -167,7 +183,7 @@ function tacticsColumnsToApiDto(model) {
|
|
|
167
183
|
substitutionBand: model.substitution_band,
|
|
168
184
|
secondLibero: validSecondLibero,
|
|
169
185
|
liberoSub: validSecondLibero != null ? model.libero_sub : undefined,
|
|
170
|
-
liberoReplacementSets:
|
|
186
|
+
liberoReplacementSets: validLiberoReplacementSets,
|
|
171
187
|
designatedSubs: (model.designated_subs ?? []).map(d => ({
|
|
172
188
|
starterId: d.starterId,
|
|
173
189
|
benchId: d.benchId,
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
"chance": 0.25,
|
|
6
6
|
"roles": [
|
|
7
7
|
"SETTER",
|
|
8
|
-
"LIBERO"
|
|
8
|
+
"LIBERO",
|
|
9
|
+
"OUTSIDE_HITTER"
|
|
9
10
|
]
|
|
10
11
|
},
|
|
11
12
|
{
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
"roles": [
|
|
26
27
|
"MIDDLE_BLOCKER",
|
|
27
28
|
"OPPOSITE_HITTER",
|
|
28
|
-
"SETTER"
|
|
29
|
+
"SETTER",
|
|
30
|
+
"OUTSIDE_HITTER"
|
|
29
31
|
]
|
|
30
32
|
},
|
|
31
33
|
{
|
|
@@ -35,8 +37,7 @@
|
|
|
35
37
|
"roles": [
|
|
36
38
|
"SETTER",
|
|
37
39
|
"OPPOSITE_HITTER",
|
|
38
|
-
"OUTSIDE_HITTER"
|
|
39
|
-
"MIDDLE_BLOCKER"
|
|
40
|
+
"OUTSIDE_HITTER"
|
|
40
41
|
]
|
|
41
42
|
},
|
|
42
43
|
{
|
|
@@ -100,6 +100,16 @@ function transformToObject(model, roster) {
|
|
|
100
100
|
const secondLibero = (hasStartingLibero && model.second_libero != null && !inLineupIds.has(model.second_libero))
|
|
101
101
|
? roster.find((p) => p.id === model.second_libero)
|
|
102
102
|
: undefined;
|
|
103
|
+
// A persisted `libero_replacement_sets` whose entries are ALL empty (a stale [[],[],[],[],[]] left by an
|
|
104
|
+
// older "configure each set independently" session that a later "apply to all sets" save could not clear --
|
|
105
|
+
// the pre-fix write omitted the column instead of nulling it) silently benches the libero: the sim picks
|
|
106
|
+
// `sets?.[i] ?? liberoReplacements`, and an empty array is not nullish, so every set gets an empty target
|
|
107
|
+
// list and the libero never enters the court. Treat an all-empty per-set list as absent so the sim falls
|
|
108
|
+
// back to the flat `liberoReplacements`; the next tactics save rewrites the column cleanly.
|
|
109
|
+
const mappedLiberoReplacementSets = model.libero_replacement_sets?.map(set => set.map((id) => findPlayer(id, roster)));
|
|
110
|
+
const liberoReplacementSets = mappedLiberoReplacementSets?.some(set => set.length > 0) === true
|
|
111
|
+
? mappedLiberoReplacementSets
|
|
112
|
+
: undefined;
|
|
103
113
|
return Tactics.create({
|
|
104
114
|
receiveRotationOffset: model.receive_rotation_offset,
|
|
105
115
|
lineup,
|
|
@@ -107,7 +117,7 @@ function transformToObject(model, roster) {
|
|
|
107
117
|
substitutionBand: model.substitution_band,
|
|
108
118
|
secondLibero,
|
|
109
119
|
liberoSub: secondLibero != null ? (model.libero_sub ?? undefined) : undefined,
|
|
110
|
-
liberoReplacementSets
|
|
120
|
+
liberoReplacementSets,
|
|
111
121
|
designatedSubs: (model.designated_subs ?? []).map(d => ({
|
|
112
122
|
starter: findPlayer(d.starterId, roster),
|
|
113
123
|
bench: d.benchId != null ? findPlayer(d.benchId, roster) : undefined,
|
|
@@ -155,6 +165,12 @@ function tacticsColumnsToApiDto(model) {
|
|
|
155
165
|
const validSecondLibero = (model.second_libero != null && model.lineup[CourtPosition.LIBERO_ZONE] != null && !lineupIds.has(model.second_libero))
|
|
156
166
|
? model.second_libero
|
|
157
167
|
: undefined;
|
|
168
|
+
// Same all-empty heal as transformToObject: an all-empty per-set `libero_replacement_sets` is a stale
|
|
169
|
+
// artifact that shadows the flat `liberoReplacements` in the sim, so don't surface it to the API/preset
|
|
170
|
+
// shape -- otherwise the UI would reload it as "configure each set independently" (all blank) and re-emit it.
|
|
171
|
+
const validLiberoReplacementSets = model.libero_replacement_sets?.some(set => set.length > 0) === true
|
|
172
|
+
? model.libero_replacement_sets
|
|
173
|
+
: undefined;
|
|
158
174
|
return {
|
|
159
175
|
lineup: model.lineup,
|
|
160
176
|
liberoReplacements: model.libero_replacements,
|
|
@@ -162,7 +178,7 @@ function tacticsColumnsToApiDto(model) {
|
|
|
162
178
|
substitutionBand: model.substitution_band,
|
|
163
179
|
secondLibero: validSecondLibero,
|
|
164
180
|
liberoSub: validSecondLibero != null ? model.libero_sub : undefined,
|
|
165
|
-
liberoReplacementSets:
|
|
181
|
+
liberoReplacementSets: validLiberoReplacementSets,
|
|
166
182
|
designatedSubs: (model.designated_subs ?? []).map(d => ({
|
|
167
183
|
starterId: d.starterId,
|
|
168
184
|
benchId: d.benchId,
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
"chance": 0.25,
|
|
6
6
|
"roles": [
|
|
7
7
|
"SETTER",
|
|
8
|
-
"LIBERO"
|
|
8
|
+
"LIBERO",
|
|
9
|
+
"OUTSIDE_HITTER"
|
|
9
10
|
]
|
|
10
11
|
},
|
|
11
12
|
{
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
"roles": [
|
|
26
27
|
"MIDDLE_BLOCKER",
|
|
27
28
|
"OPPOSITE_HITTER",
|
|
28
|
-
"SETTER"
|
|
29
|
+
"SETTER",
|
|
30
|
+
"OUTSIDE_HITTER"
|
|
29
31
|
]
|
|
30
32
|
},
|
|
31
33
|
{
|
|
@@ -35,8 +37,7 @@
|
|
|
35
37
|
"roles": [
|
|
36
38
|
"SETTER",
|
|
37
39
|
"OPPOSITE_HITTER",
|
|
38
|
-
"OUTSIDE_HITTER"
|
|
39
|
-
"MIDDLE_BLOCKER"
|
|
40
|
+
"OUTSIDE_HITTER"
|
|
40
41
|
]
|
|
41
42
|
},
|
|
42
43
|
{
|