@dcrackel/hematournamentui 1.0.699 → 1.0.701
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/AGENTS.md +3 -0
- package/dist/HemaTournamentUI-lib.es.js +10512 -10219
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +14 -0
- package/dist/hematournamentui.css +1 -1
- package/package.json +92 -92
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +1 -1
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +1 -1
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +2 -2
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +25 -22
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +31 -29
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.vue +2 -4
- package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +31 -31
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.stories.js +6 -6
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +64 -53
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.stories.js +6 -7
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.vue +18 -10
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +4 -4
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +64 -45
- package/src/stories/Organisms/Containers/Pool/Pool.vue +1 -1
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +35 -20
- package/src/stories/Templates/Assignment/Assignment.stories.js +17 -15
- package/src/stories/Templates/Assignment/Assignment.vue +71 -40
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.stories.js +49 -30
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.vue +29 -28
- package/src/stories/Templates/ClubManagement/{ClubMangement.stories.js → ClubManagement.stories.js} +74 -59
- package/src/stories/Templates/ClubManagement/ClubManagement.vue +104 -92
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +92 -97
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +37 -33
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +11 -14
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +34 -37
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.stories.js +11 -10
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +8 -8
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.stories.js +13 -16
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.vue +15 -19
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.stories.js +25 -24
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.vue +28 -34
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +54 -19
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +75 -68
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +55 -45
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +47 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +56 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +71 -73
- package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +18 -16
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +9 -6
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.stories.js +22 -19
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.vue +44 -36
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +30 -23
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +55 -58
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +67 -0
- package/src/stories/Templates/PersonManagement/Admin/{Administration.vue → Administration/Administration.vue} +94 -87
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -0
- package/src/stories/Templates/PersonManagement/Admin/{FencerAdmin.vue → FencerAdmin/FencerAdmin.vue} +90 -77
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -0
- package/src/stories/Templates/PersonManagement/Admin/{MergeAccounts.vue → MergeAccounts/MergeAccounts.vue} +258 -242
- package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +28 -28
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +1 -1
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +45 -28
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.vue +22 -16
- package/src/stories/Templates/TournamentManagement/{TournamentMangement.stories.js → TournamentManagement.stories.js} +68 -39
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +199 -153
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +113 -0
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +123 -106
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js +76 -31
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/{TouranmentPageTwo.vue → TournamentPageTwo.vue} +63 -44
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin.stories.js +0 -48
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TouranmentPageOne.stories.js +0 -63
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
@action:resumeBout="directBout"
|
|
52
52
|
/>
|
|
53
53
|
</div>
|
|
54
|
-
<div v-for="bout in activeBouts" :key="bout.BoutId" class="w-full md:w-3/4 my-4">
|
|
55
|
-
<BoutCard :bout="bout" :hostingClubColors="hostingClubColors" :editMode="editMode"
|
|
56
|
-
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore" :reorderMode="false"
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
<div v-for="bout in activeBouts" :key="bout.BoutId" class="w-full md:w-3/4 my-4">
|
|
55
|
+
<BoutCard :bout="bout" :hostingClubColors="hostingClubColors" :editMode="editMode"
|
|
56
|
+
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore" :reorderMode="false"
|
|
57
|
+
:timerStatus="bout.TimerStatus || 'stopped'"
|
|
58
|
+
@action:startBout="directBout" @action:resumeBout="directBout"/>
|
|
59
|
+
</div>
|
|
59
60
|
|
|
60
61
|
</div>
|
|
61
62
|
</section>
|
|
@@ -73,14 +74,15 @@
|
|
|
73
74
|
<div class="w-full flex flex-col items-center">
|
|
74
75
|
<div v-for="bout in markedUpcomingBouts" :key="bout.BoutId" class="w-full md:w-3/4 my-4 flex items-stretch">
|
|
75
76
|
<div class="flex-1">
|
|
76
|
-
<BoutCard
|
|
77
|
-
:bout="bout"
|
|
78
|
-
:hostingClubColors="hostingClubColors"
|
|
79
|
-
:editMode="editMode"
|
|
80
|
-
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore"
|
|
81
|
-
:reorderMode="false"
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
<BoutCard
|
|
78
|
+
:bout="bout"
|
|
79
|
+
:hostingClubColors="hostingClubColors"
|
|
80
|
+
:editMode="editMode"
|
|
81
|
+
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore"
|
|
82
|
+
:reorderMode="false"
|
|
83
|
+
:timerStatus="bout.TimerStatus || 'stopped'"
|
|
84
|
+
@action:startBout="directBout"
|
|
85
|
+
/>
|
|
84
86
|
</div>
|
|
85
87
|
|
|
86
88
|
</div>
|
|
@@ -181,15 +183,15 @@
|
|
|
181
183
|
</div>
|
|
182
184
|
</section>
|
|
183
185
|
|
|
184
|
-
<DirectorModal :bout="currentSelectedBout"
|
|
185
|
-
:eventRules="eventRules"
|
|
186
|
-
:hostingClubColors="hostingClubColors"
|
|
187
|
-
:show="showDirectorModal"
|
|
188
|
-
@penalty:add="
|
|
189
|
-
@penalty:update="
|
|
190
|
-
@penalty:remove="handleRemovePenalty"
|
|
191
|
-
@update:closeModal="handleCloseModal"
|
|
192
|
-
@update:bout="handleUpdateBout"
|
|
186
|
+
<DirectorModal :bout="currentSelectedBout"
|
|
187
|
+
:eventRules="eventRules"
|
|
188
|
+
:hostingClubColors="hostingClubColors"
|
|
189
|
+
:show="showDirectorModal"
|
|
190
|
+
@penalty:add="handleAddPenalty"
|
|
191
|
+
@penalty:update="handleUpdatePenalty"
|
|
192
|
+
@penalty:remove="handleRemovePenalty"
|
|
193
|
+
@update:closeModal="handleCloseModal"
|
|
194
|
+
@update:bout="handleUpdateBout"
|
|
193
195
|
@submit:bout="handleSubmitBout"/>
|
|
194
196
|
|
|
195
197
|
<EditBoutModal :bout="currentSelectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
|
|
@@ -205,13 +207,11 @@
|
|
|
205
207
|
import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
|
|
206
208
|
import ToggleHeader from "../../../Organisms/Headers/ToggleHeader/ToggleHeader.vue";
|
|
207
209
|
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
208
|
-
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
209
|
-
import BoutCard from "../../../Organisms/Cards/BoutCard/BoutCard.vue";
|
|
210
|
-
import DirectorModal from "../../../Molecules/Modals/DirectorModal/DirectorModal.vue";
|
|
211
|
-
import EditBoutModal from "../../../Molecules/Modals/EditBoutModal/EditBoutModal.vue";
|
|
212
|
-
import
|
|
213
|
-
import PenaltyModal from "../../../Molecules/Modals/PenaltyModal/PenaltyModal.vue";
|
|
214
|
-
import PoolGrid from "../../../Organisms/Containers/PoolGrid/PoolGrid.vue";
|
|
210
|
+
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
211
|
+
import BoutCard from "../../../Organisms/Cards/BoutCard/BoutCard.vue";
|
|
212
|
+
import DirectorModal from "../../../Molecules/Modals/DirectorModal/DirectorModal.vue";
|
|
213
|
+
import EditBoutModal from "../../../Molecules/Modals/EditBoutModal/EditBoutModal.vue";
|
|
214
|
+
import PoolGrid from "../../../Organisms/Containers/PoolGrid/PoolGrid.vue";
|
|
215
215
|
import {tabs} from '../../../Util/tabs.js';
|
|
216
216
|
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
217
217
|
import FencerFinalResultCard from "../../../Organisms/Cards/FencerFinalResultCard/FencerFinalResultCard.vue";
|
|
@@ -225,17 +225,15 @@ export default {
|
|
|
225
225
|
FencerFinalResultCard,
|
|
226
226
|
BaseButton,
|
|
227
227
|
BaseIcon,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
ServerConnected,
|
|
231
|
-
EditBoutModal,
|
|
228
|
+
PoolGrid,
|
|
229
|
+
EditBoutModal,
|
|
232
230
|
DirectorModal,
|
|
233
231
|
BoutCard,
|
|
234
232
|
BaseText,
|
|
235
233
|
ToggleHeader,
|
|
236
234
|
EditEventsTopMenu
|
|
237
235
|
},
|
|
238
|
-
emits: ["update:bout", "tab:menu-click", "submit:bout", "update:directing-bout", "penalty:update", "penalty:add", "penalty:remove", "scoreboard:showFencerList", "scoreboard:
|
|
236
|
+
emits: ["update:bout", "tab:menu-click", "submit:bout", "update:directing-bout", "penalty:update", "penalty:add", "penalty:remove", "scoreboard:showFencerList", "scoreboard:showPoolGrid"],
|
|
239
237
|
props: {
|
|
240
238
|
bouts: {
|
|
241
239
|
type: Array,
|
|
@@ -264,7 +262,7 @@ export default {
|
|
|
264
262
|
},
|
|
265
263
|
data() {
|
|
266
264
|
return {
|
|
267
|
-
localBouts: this.bouts,
|
|
265
|
+
localBouts: this.cloneBouts(this.bouts),
|
|
268
266
|
showDirectorModal: false,
|
|
269
267
|
showEditBoutModal: false,
|
|
270
268
|
selectedBout: {},
|
|
@@ -277,17 +275,17 @@ export default {
|
|
|
277
275
|
};
|
|
278
276
|
},
|
|
279
277
|
watch: {
|
|
280
|
-
bouts: {
|
|
281
|
-
handler(newBouts) {
|
|
282
|
-
this.localBouts = newBouts;
|
|
283
|
-
},
|
|
278
|
+
bouts: {
|
|
279
|
+
handler(newBouts) {
|
|
280
|
+
this.localBouts = this.cloneBouts(newBouts);
|
|
281
|
+
},
|
|
284
282
|
immediate: true,
|
|
285
283
|
deep: true
|
|
286
284
|
}
|
|
287
285
|
},
|
|
288
286
|
mounted() {
|
|
289
287
|
window.addEventListener('resize', this.handleResize);
|
|
290
|
-
this.localBouts
|
|
288
|
+
this.localBouts = this.sortBoutsByOrder(this.localBouts);
|
|
291
289
|
},
|
|
292
290
|
beforeUnmount() {
|
|
293
291
|
window.removeEventListener('resize', this.handleResize);
|
|
@@ -412,18 +410,19 @@ export default {
|
|
|
412
410
|
},
|
|
413
411
|
},
|
|
414
412
|
methods: {
|
|
415
|
-
handleCloseModal(bout) {
|
|
416
|
-
this.showDirectorModal = false;
|
|
417
|
-
this.showEditBoutModal = false;
|
|
418
|
-
|
|
419
|
-
if (bout
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
413
|
+
handleCloseModal(bout) {
|
|
414
|
+
this.showDirectorModal = false;
|
|
415
|
+
this.showEditBoutModal = false;
|
|
416
|
+
|
|
417
|
+
if (!bout?.BoutId) return;
|
|
418
|
+
if (bout.Status !== 'Completed') {
|
|
419
|
+
const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
|
|
420
|
+
if (!updatedBout) return;
|
|
421
|
+
|
|
422
|
+
updatedBout.Status = 'Scheduled';
|
|
423
|
+
this.$emit('update:bout', updatedBout);
|
|
424
|
+
}
|
|
425
|
+
},
|
|
427
426
|
handleTabMenuClick(value) {
|
|
428
427
|
this.$emit('tab:menu-click', value);
|
|
429
428
|
},
|
|
@@ -446,11 +445,12 @@ export default {
|
|
|
446
445
|
this.handleSubmitBout(bout, resetToActive)
|
|
447
446
|
},
|
|
448
447
|
handleSubmitBout(bout, resetToActive = false) {
|
|
449
|
-
this.showEditBoutModal = false;
|
|
450
|
-
this.showDirectorModal = false;
|
|
451
|
-
const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
|
|
452
|
-
|
|
453
|
-
|
|
448
|
+
this.showEditBoutModal = false;
|
|
449
|
+
this.showDirectorModal = false;
|
|
450
|
+
const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
|
|
451
|
+
if (!updatedBout) return;
|
|
452
|
+
|
|
453
|
+
Object.assign(updatedBout, bout);
|
|
454
454
|
if (!resetToActive) updatedBout.Status = 'Completed';
|
|
455
455
|
updatedBout.Ended = new Date().toISOString();
|
|
456
456
|
|
|
@@ -497,10 +497,10 @@ export default {
|
|
|
497
497
|
},
|
|
498
498
|
reorderBouts() {
|
|
499
499
|
this.reorderMode = !this.reorderMode;
|
|
500
|
-
},
|
|
501
|
-
autoSortBouts() {
|
|
502
|
-
const normalizeStatus = s => String(s || '').toLowerCase();
|
|
503
|
-
const idOf = bout => bout.BoutId ?? bout.
|
|
500
|
+
},
|
|
501
|
+
autoSortBouts() {
|
|
502
|
+
const normalizeStatus = s => String(s || '').toLowerCase();
|
|
503
|
+
const idOf = bout => bout.BoutId ?? bout.boutId;
|
|
504
504
|
const matchPair = (bout, [a, b]) => {
|
|
505
505
|
const p1 = Number(bout.Person1Pos);
|
|
506
506
|
const p2 = Number(bout.Person2Pos);
|
|
@@ -580,7 +580,7 @@ export default {
|
|
|
580
580
|
},
|
|
581
581
|
|
|
582
582
|
// --- Tap-to-swap (mobile) from <ReorderableShell> ---
|
|
583
|
-
onReorderTap(payload) {
|
|
583
|
+
onReorderTap(payload) {
|
|
584
584
|
const tappedId = this._idOf(payload);
|
|
585
585
|
if (!tappedId) return;
|
|
586
586
|
|
|
@@ -593,9 +593,16 @@ export default {
|
|
|
593
593
|
this.selectedReorderId = null;
|
|
594
594
|
return;
|
|
595
595
|
}
|
|
596
|
-
this._swapOrderBetweenIds(this.selectedReorderId, tappedId);
|
|
597
|
-
this.selectedReorderId = null;
|
|
598
|
-
},
|
|
599
|
-
|
|
600
|
-
}
|
|
601
|
-
|
|
596
|
+
this._swapOrderBetweenIds(this.selectedReorderId, tappedId);
|
|
597
|
+
this.selectedReorderId = null;
|
|
598
|
+
},
|
|
599
|
+
cloneBouts(bouts) {
|
|
600
|
+
return Array.isArray(bouts) ? bouts.map(bout => ({ ...bout })) : [];
|
|
601
|
+
},
|
|
602
|
+
sortBoutsByOrder(bouts) {
|
|
603
|
+
return this.cloneBouts(bouts)
|
|
604
|
+
.sort((a, b) => Number(a.OrderIndex ?? 0) - Number(b.OrderIndex ?? 0));
|
|
605
|
+
},
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
</script>
|
|
@@ -19,10 +19,24 @@ export default {
|
|
|
19
19
|
table: {
|
|
20
20
|
type: {summary: 'Object'},
|
|
21
21
|
defaultValue: {summary: '{}'}
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
poolAssignments: {
|
|
25
|
+
control: {type: 'array'},
|
|
26
|
+
description: 'Pool assignment data'
|
|
27
|
+
},
|
|
28
|
+
staff: {
|
|
29
|
+
control: {type: 'array'},
|
|
30
|
+
description: 'Assignable event staff'
|
|
31
|
+
},
|
|
32
|
+
loading: {
|
|
33
|
+
control: {type: 'boolean'}
|
|
34
|
+
},
|
|
35
|
+
role: {
|
|
36
|
+
control: {type: 'text'}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
26
40
|
|
|
27
41
|
export const Default = {
|
|
28
42
|
args: {
|
|
@@ -32,30 +46,27 @@ export const Default = {
|
|
|
32
46
|
}
|
|
33
47
|
};
|
|
34
48
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
event:modifiedEvent,
|
|
57
|
-
poolAssignments: [],
|
|
58
|
-
staff: [],
|
|
49
|
+
export const liveMode = {
|
|
50
|
+
args: {
|
|
51
|
+
event: { ...eventPersonGetPoolAssignmentEvent, Status: 'live' },
|
|
52
|
+
poolAssignments: eventPersonGetInitialPoolAssignments.pools,
|
|
53
|
+
staff: eventPersonGetInitialStaff,
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const singleFlightPlanningMode = {
|
|
58
|
+
args: {
|
|
59
|
+
event: { ...eventPersonGetPoolAssignmentEvent, Status: 'planning' },
|
|
60
|
+
poolAssignments: eventPersonGetInitialPoolAssignments.pools,
|
|
61
|
+
staff: eventPersonGetInitialStaff,
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const NoPoolsYetInPlanning = {
|
|
66
|
+
args: {
|
|
67
|
+
event: { ...eventPersonGetPoolAssignmentEvent, Status: 'planning' },
|
|
68
|
+
poolAssignments: [],
|
|
69
|
+
staff: [],
|
|
59
70
|
}
|
|
60
71
|
};
|
|
61
72
|
|
|
@@ -93,27 +104,26 @@ export const preparationMode = {
|
|
|
93
104
|
}
|
|
94
105
|
};
|
|
95
106
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
staff: eventPersonGetInitialStaff,
|
|
107
|
+
export const singleFlightResultsMode = {
|
|
108
|
+
args: {
|
|
109
|
+
event: { ...eventPersonGetPoolAssignmentEvent, Status: 'results' },
|
|
110
|
+
poolAssignments: eventPersonGetInitialPoolAssignments.pools,
|
|
111
|
+
staff: eventPersonGetInitialStaff,
|
|
102
112
|
}
|
|
103
113
|
};
|
|
104
114
|
|
|
105
|
-
export const singleFlightDEMode = {
|
|
106
|
-
args: {
|
|
107
|
-
event:
|
|
108
|
-
poolAssignments: eventPersonGetInitialPoolAssignments.pools,
|
|
109
|
-
staff: eventPersonGetInitialStaff,
|
|
115
|
+
export const singleFlightDEMode = {
|
|
116
|
+
args: {
|
|
117
|
+
event: { ...eventPersonGetPoolAssignmentEvent, Status: 'de' },
|
|
118
|
+
poolAssignments: eventPersonGetInitialPoolAssignments.pools,
|
|
119
|
+
staff: eventPersonGetInitialStaff,
|
|
110
120
|
}
|
|
111
121
|
};
|
|
112
122
|
|
|
113
|
-
export const singleFlightCompletedMode = {
|
|
114
|
-
args: {
|
|
115
|
-
event:
|
|
116
|
-
poolAssignments: eventPersonGetInitialPoolAssignments.pools,
|
|
117
|
-
staff: eventPersonGetInitialStaff,
|
|
123
|
+
export const singleFlightCompletedMode = {
|
|
124
|
+
args: {
|
|
125
|
+
event: { ...eventPersonGetPoolAssignmentEvent, Status: 'completed' },
|
|
126
|
+
poolAssignments: eventPersonGetInitialPoolAssignments.pools,
|
|
127
|
+
staff: eventPersonGetInitialStaff,
|
|
118
128
|
}
|
|
119
|
-
};
|
|
129
|
+
};
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
@update:manualEdit="handleManualEdit"
|
|
9
9
|
class="hidden md:flex"
|
|
10
10
|
/>
|
|
11
|
-
<EditEventsTopMenu v-if="
|
|
12
|
-
<div class="w-full flex flex-row flex-wrap justify-center" :class="
|
|
13
|
-
<div v-for="pool in filteredPools" :key="pool.
|
|
11
|
+
<EditEventsTopMenu v-if="event.Flights > 1" :currentTab="selectedFlight" :tabs="flights" @tabMenuClick="handleFlightChange" class="mt-3"/>
|
|
12
|
+
<div class="w-full flex flex-row flex-wrap justify-center" :class="event.Flights > 1 ? 'mt-0' : 'mt-4'">
|
|
13
|
+
<div v-for="pool in filteredPools" :key="pool.PoolId">
|
|
14
14
|
<Pool v-if="pool"
|
|
15
15
|
:poolId="pool.PoolId"
|
|
16
16
|
:poolName="pool.Name"
|
|
@@ -67,7 +67,11 @@ export default {
|
|
|
67
67
|
Pool
|
|
68
68
|
},
|
|
69
69
|
props: {
|
|
70
|
-
event:
|
|
70
|
+
event: {
|
|
71
|
+
type: Object,
|
|
72
|
+
required: true,
|
|
73
|
+
default: () => ({})
|
|
74
|
+
},
|
|
71
75
|
poolAssignments: {
|
|
72
76
|
type: Array,
|
|
73
77
|
default: () => []
|
|
@@ -126,10 +130,9 @@ export default {
|
|
|
126
130
|
filteredPools() {
|
|
127
131
|
if (this.loading) {
|
|
128
132
|
return Array.from({ length: 2 }).map((_, index) => ({
|
|
129
|
-
PoolId: `skeleton-${index}`,
|
|
130
|
-
Name: 'Loading...',
|
|
131
|
-
|
|
132
|
-
RingName: 'Loading...',
|
|
133
|
+
PoolId: `skeleton-${index}`,
|
|
134
|
+
Name: 'Loading...',
|
|
135
|
+
RingName: 'Loading...',
|
|
133
136
|
poolStrengthInd: 0,
|
|
134
137
|
BoutsLeft: 0,
|
|
135
138
|
Staff: [],
|
|
@@ -191,51 +194,40 @@ export default {
|
|
|
191
194
|
},
|
|
192
195
|
handleResize() {
|
|
193
196
|
this.windowWidth = window.innerWidth;
|
|
194
|
-
},
|
|
195
|
-
handleAddFencerToPool(payload) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
fencerToMove.PoolPosition = targetPool.participants.length + 1;
|
|
231
|
-
targetPool.participants.push(fencerToMove);
|
|
232
|
-
|
|
233
|
-
this.$emit('fencer:poolChanged', {
|
|
234
|
-
fencer: fencerToMove,
|
|
235
|
-
fromPoolId: sourcePoolId,
|
|
236
|
-
toPoolId: payload.addToPool
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
197
|
+
},
|
|
198
|
+
handleAddFencerToPool(payload) {
|
|
199
|
+
const sourcePool = this.poolAssignments.find(pool => {
|
|
200
|
+
return pool.participants?.some(participant => this.isMatchingFencer(participant, payload));
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
const fencerToMove = sourcePool?.participants.find(participant => this.isMatchingFencer(participant, payload));
|
|
204
|
+
if (!fencerToMove) {
|
|
205
|
+
console.error("Fencer not found in any pool:", payload);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const targetPool = this.poolAssignments.find(pool => pool.PoolId === payload.addToPool);
|
|
210
|
+
if (!targetPool) {
|
|
211
|
+
console.error("Target pool not found:", payload.addToPool);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
this.$emit('fencer:poolChanged', {
|
|
216
|
+
fencer: {
|
|
217
|
+
...fencerToMove,
|
|
218
|
+
PoolId: payload.addToPool,
|
|
219
|
+
PoolPosition: targetPool.participants.length + 1
|
|
220
|
+
},
|
|
221
|
+
fromPoolId: sourcePool.PoolId,
|
|
222
|
+
toPoolId: payload.addToPool
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
isMatchingFencer(participant, payload) {
|
|
226
|
+
return (
|
|
227
|
+
participant.Person.DisplayName === payload.name &&
|
|
228
|
+
participant.Person.Club.Name === payload.club
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
241
233
|
</script>
|
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import EditEvents from './PoolResults.vue';
|
|
2
|
-
import getPoolResults from '../../../../mocks/getPoolResults.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
event:
|
|
15
|
-
poolResults:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import EditEvents from './PoolResults.vue';
|
|
2
|
+
import getPoolResults from '../../../../mocks/getPoolResults.js';
|
|
3
|
+
|
|
4
|
+
const makeEventWithStatus = (status) => ({
|
|
5
|
+
...getPoolResults.event,
|
|
6
|
+
Status: status
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Templates/EventManagement/PoolResults',
|
|
11
|
+
component: EditEvents,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
args: {
|
|
14
|
+
event: getPoolResults.event,
|
|
15
|
+
poolResults: getPoolResults.report,
|
|
16
|
+
role: 'admin'
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
event: { control: {type: 'object'} },
|
|
20
|
+
poolResults: {
|
|
21
|
+
control: {type: 'array'}
|
|
22
|
+
},
|
|
23
|
+
role: { control: {type: 'text'} }
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Default = {
|
|
28
|
+
args: {
|
|
29
|
+
event: makeEventWithStatus("results"),
|
|
30
|
+
poolResults: getPoolResults.report,
|
|
31
|
+
role: 'admin'
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const EventIsInDE = {
|
|
36
|
+
args: {
|
|
37
|
+
event: makeEventWithStatus("de"),
|
|
38
|
+
poolResults: getPoolResults.report,
|
|
39
|
+
role: 'admin'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export const EventIsInPlanning = {
|
|
45
|
+
args: {
|
|
46
|
+
event: makeEventWithStatus("planning"),
|
|
47
|
+
poolResults: getPoolResults.report,
|
|
48
|
+
role: 'admin'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const noResults = {
|
|
53
|
+
args: {
|
|
54
|
+
event: makeEventWithStatus("planning"),
|
|
55
|
+
poolResults: [],
|
|
56
|
+
role: 'admin'
|
|
56
57
|
}
|
|
57
58
|
};
|