@dcrackel/hematournamentui 1.0.696 → 1.0.698
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 +85 -0
- package/README.md +22 -6
- package/dist/HemaTournamentUI-lib.es.js +43127 -44314
- package/dist/HemaTournamentUI-lib.umd.js +34 -38
- package/dist/hematournamentui-tailwind.css +3724 -0
- package/dist/hematournamentui.css +2 -9
- package/package.json +48 -43
- package/src/stories/Atoms/Input/BaseInput.vue +21 -18
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.vue +1 -0
- package/src/stories/Atoms/Tag/BaseTag.vue +17 -31
- package/src/stories/Atoms/Text/BaseText.vue +67 -144
- package/src/stories/Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.vue +1 -0
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +1 -0
- package/src/stories/Molecules/Boxes/CounterBox/CounterBox.vue +1 -0
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.vue +1 -0
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +1 -0
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +1 -0
- package/src/stories/Molecules/Inputs/MultiSelect/MultiSelect.vue +1 -0
- package/src/stories/Molecules/Inputs/Toggle/Toggle.vue +1 -0
- package/src/stories/Molecules/Modals/AddDisplayModal/AddDisplayModal.vue +1 -0
- package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +1 -0
- package/src/stories/Molecules/Modals/EventWizardModal/EventWizardModal.vue +1 -0
- package/src/stories/Molecules/Reorder/ReorderableShell.vue +1 -0
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +3 -0
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +1 -0
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +1 -0
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +1 -0
- package/src/stories/Organisms/Cards/FencerPoolResultsCard/FencerPoolResultsCard.vue +1 -0
- package/src/stories/Organisms/Cards/ImportFencerCard/ImportFencerCard.vue +1 -0
- package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +30 -24
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +29 -39
- package/src/stories/Organisms/Cards/PoolFencerCard/PoolFencerCard.vue +1 -0
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +1 -0
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +1 -0
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +1 -0
- package/src/stories/Organisms/Cards/TournamentAdminCard/TournamentAdminCard.vue +17 -19
- package/src/stories/Organisms/ComplexInputs/AddressAutocomplete/AddressAutocomplete.vue +1 -0
- package/src/stories/Organisms/ComplexInputs/ClubColorPicker/ClubColorPicker.vue +1 -0
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +2 -1
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +1 -0
- package/src/stories/Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue +1 -0
- package/src/stories/Organisms/ComplexInputs/FindPerson/FindPerson.vue +1 -0
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +1 -0
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +1 -0
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +1 -0
- package/src/stories/Organisms/Form/AddDisplay/AddDisplay.vue +1 -0
- package/src/stories/Organisms/Form/AddNewPerson/AddNewPerson.vue +1 -0
- package/src/stories/Organisms/Grids/GridContainer.vue +113 -141
- package/src/stories/Organisms/Headers/EventFinalResultsHeader/EventFinalResultsHeader.vue +1 -0
- package/src/stories/Organisms/Headers/PoolResultsHeader/PoolResultsHeader.vue +1 -0
- package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.vue +1 -0
- package/src/stories/Organisms/Headers/ToggleHeader/ToggleHeader.vue +1 -0
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +1 -0
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +21 -34
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +77 -72
- package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +1 -0
- package/src/stories/Templates/Assignment/Assignment.vue +56 -70
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +1 -0
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +1 -0
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +26 -26
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +1 -0
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +0 -2
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +2 -0
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +1 -0
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +1 -0
- package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +27 -33
- package/src/stories/Templates/TournamentManagement/TouranmentResultsImport/TournamentResultsImport.vue +0 -0
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +1 -0
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TouranmentPageTwo.vue +80 -4
- package/src/stories/Util/tabs.js +1 -0
- package/tailwind/tailwind.css +5 -6
|
@@ -33,10 +33,62 @@ import FencerFinalResultCard from "../../Organisms/Cards/FencerFinalResultCard/F
|
|
|
33
33
|
import ClubCard from "../../Organisms/Cards/ClubCard/ClubCard.vue";
|
|
34
34
|
import FilterAndSortBar from "../../Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue";
|
|
35
35
|
import FilterUpcomingPast from "../../Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue";
|
|
36
|
-
import emptyDesertIcon from '../../../assets/empty_desert_icon.png';
|
|
37
|
-
import TournamentCardSkeleton from "../Skeletons/TournamentCard/TournamentCardSkeleton.vue";
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
import emptyDesertIcon from '../../../assets/empty_desert_icon.png';
|
|
37
|
+
import TournamentCardSkeleton from "../Skeletons/TournamentCard/TournamentCardSkeleton.vue";
|
|
38
|
+
|
|
39
|
+
const componentConfig = {
|
|
40
|
+
TournamentAdminCard: {
|
|
41
|
+
defaultSelectedItem: { text: 'Date', link: 'date' },
|
|
42
|
+
title: 'Tournaments',
|
|
43
|
+
gridClass: 'grid-cols-1',
|
|
44
|
+
noResultsMessage: 'No tournaments found.',
|
|
45
|
+
detailMessage: 'Click the add tournament button and let\'s get started!',
|
|
46
|
+
getSearchText: item => item.Name?.toLowerCase() ?? ''
|
|
47
|
+
},
|
|
48
|
+
FencerFinalResultCard: {
|
|
49
|
+
defaultSelectedItem: { text: 'Name', link: 'name' },
|
|
50
|
+
title: 'Fencers',
|
|
51
|
+
gridClass: 'grid-cols-1',
|
|
52
|
+
noResultsMessage: 'No fencers found.',
|
|
53
|
+
detailMessage: 'Click the add fencer button and let\'s get started!',
|
|
54
|
+
getSearchText: item => item.DisplayName?.toLowerCase() ?? ''
|
|
55
|
+
},
|
|
56
|
+
ClubCard: {
|
|
57
|
+
defaultSelectedItem: { text: 'Club', link: 'club' },
|
|
58
|
+
title: 'Clubs',
|
|
59
|
+
noResultsMessage: 'No clubs found.',
|
|
60
|
+
detailMessage: 'Click the add club button and let\'s get started!',
|
|
61
|
+
getSearchText: item => item.Name?.toLowerCase() ?? ''
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const defaultComponentConfig = {
|
|
66
|
+
defaultSelectedItem: {},
|
|
67
|
+
title: 'Unknown',
|
|
68
|
+
noResultsMessage: 'No results found.',
|
|
69
|
+
detailMessage: 'Click the add button and let\'s get started!',
|
|
70
|
+
getSearchText: () => ''
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const sortOptionsByComponent = {
|
|
74
|
+
FencerFinalResultCard: [
|
|
75
|
+
{ text: 'Name', link: '/sort/name' },
|
|
76
|
+
{ text: 'Club', link: '/sort/club' },
|
|
77
|
+
{ text: 'HR Rating', link: '/sort/hr' }
|
|
78
|
+
],
|
|
79
|
+
ClubCard: [
|
|
80
|
+
{ text: 'Name', link: '/sort/name' },
|
|
81
|
+
{ text: 'Location', link: '/sort/club' }
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const defaultSortOptions = [
|
|
86
|
+
{ text: 'Date', link: '/sort/date' },
|
|
87
|
+
{ text: 'Name', link: '/sort/name' },
|
|
88
|
+
{ text: 'Location', link: '/sort/location' }
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
export default {
|
|
40
92
|
name: 'GridContainer',
|
|
41
93
|
components: {
|
|
42
94
|
TournamentCardSkeleton,
|
|
@@ -91,101 +143,35 @@ export default {
|
|
|
91
143
|
mounted() {
|
|
92
144
|
this.applyFilters();
|
|
93
145
|
},
|
|
94
|
-
computed: {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
getTitle() {
|
|
108
|
-
switch (this.component) {
|
|
109
|
-
case 'TournamentAdminCard':
|
|
110
|
-
return 'Tournaments';
|
|
111
|
-
case 'FencerFinalResultCard':
|
|
112
|
-
return 'Fencers';
|
|
113
|
-
case 'ClubCard':
|
|
114
|
-
return 'Clubs';
|
|
115
|
-
default:
|
|
116
|
-
return 'Unknown';
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
placeholder() {
|
|
120
|
-
switch (this.component) {
|
|
121
|
-
case 'TournamentAdminCard':
|
|
122
|
-
return 'Filter by Name';
|
|
123
|
-
case 'FencerFinalResultCard':
|
|
124
|
-
return 'Filter by Name';
|
|
125
|
-
case 'ClubCard':
|
|
126
|
-
return 'Filter by Name';
|
|
127
|
-
default:
|
|
128
|
-
return 'Filter by Name';
|
|
129
|
-
}
|
|
146
|
+
computed: {
|
|
147
|
+
componentSettings() {
|
|
148
|
+
return componentConfig[this.component] || defaultComponentConfig;
|
|
149
|
+
},
|
|
150
|
+
defaultSelectedItem() {
|
|
151
|
+
return this.componentSettings.defaultSelectedItem;
|
|
152
|
+
},
|
|
153
|
+
getTitle() {
|
|
154
|
+
return this.componentSettings.title;
|
|
155
|
+
},
|
|
156
|
+
placeholder() {
|
|
157
|
+
return 'Filter by Name';
|
|
130
158
|
},
|
|
131
159
|
showButtons() {
|
|
132
160
|
return this.component === 'TournamentAdminCard';
|
|
133
|
-
},
|
|
134
|
-
getGridClass() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return 'No fencers found.';
|
|
148
|
-
case 'ClubCard':
|
|
149
|
-
return 'No clubs found.';
|
|
150
|
-
default:
|
|
151
|
-
return 'No results found.';
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
getDetailMessage(){
|
|
155
|
-
switch (this.component) {
|
|
156
|
-
case 'TournamentAdminCard':
|
|
157
|
-
return 'Click the add tournament button and let\'s get started!';
|
|
158
|
-
case 'FencerFinalResultCard':
|
|
159
|
-
return 'Click the add fencer button and let\'s get started!';
|
|
160
|
-
case 'ClubCard':
|
|
161
|
-
return 'Click the add club button and let\'s get started!';
|
|
162
|
-
default:
|
|
163
|
-
return 'Click the add button and let\'s get started!';
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
sortOptions() {
|
|
167
|
-
if (this.component === 'FencerFinalResultCard') {
|
|
168
|
-
return [
|
|
169
|
-
{ text: 'Name', link: '/sort/name' },
|
|
170
|
-
{ text: 'Club', link: '/sort/club' },
|
|
171
|
-
{ text: 'HR Rating', link: '/sort/hr' }
|
|
172
|
-
];
|
|
173
|
-
}
|
|
174
|
-
if (this.component === 'ClubCard') {
|
|
175
|
-
return [
|
|
176
|
-
{ text: 'Name', link: '/sort/name' },
|
|
177
|
-
{ text: 'Location', link: '/sort/club' },
|
|
178
|
-
];
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return [
|
|
182
|
-
{ text: 'Date', link: '/sort/date' },
|
|
183
|
-
{ text: 'Name', link: '/sort/name' },
|
|
184
|
-
{ text: 'Location', link: '/sort/location' }
|
|
185
|
-
];
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
},
|
|
161
|
+
},
|
|
162
|
+
getGridClass() {
|
|
163
|
+
return this.componentSettings.gridClass;
|
|
164
|
+
},
|
|
165
|
+
getNoResultsMessage() {
|
|
166
|
+
return this.componentSettings.noResultsMessage;
|
|
167
|
+
},
|
|
168
|
+
getDetailMessage(){
|
|
169
|
+
return this.componentSettings.detailMessage;
|
|
170
|
+
},
|
|
171
|
+
sortOptions() {
|
|
172
|
+
return sortOptionsByComponent[this.component] || defaultSortOptions;
|
|
173
|
+
}
|
|
174
|
+
},
|
|
189
175
|
methods: {
|
|
190
176
|
applyFilters() {
|
|
191
177
|
let result = [...this.items];
|
|
@@ -198,25 +184,12 @@ export default {
|
|
|
198
184
|
},
|
|
199
185
|
applySearchFilter(items) {
|
|
200
186
|
if (!this.filterOn.trim()) return items;
|
|
201
|
-
const searchText = this.filterOn.toLowerCase();
|
|
202
|
-
return items.filter(item => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
break;
|
|
208
|
-
case 'FencerFinalResultCard':
|
|
209
|
-
nameToCheck = item.DisplayName?.toLowerCase() ?? '';
|
|
210
|
-
break;
|
|
211
|
-
case 'ClubCard':
|
|
212
|
-
nameToCheck = item.Name?.toLowerCase() ?? '';
|
|
213
|
-
break;
|
|
214
|
-
default:
|
|
215
|
-
nameToCheck = '';
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (!nameToCheck) return false;
|
|
219
|
-
return nameToCheck.includes(searchText);
|
|
187
|
+
const searchText = this.filterOn.toLowerCase();
|
|
188
|
+
return items.filter(item => {
|
|
189
|
+
const nameToCheck = this.componentSettings.getSearchText(item);
|
|
190
|
+
|
|
191
|
+
if (!nameToCheck) return false;
|
|
192
|
+
return nameToCheck.includes(searchText);
|
|
220
193
|
});
|
|
221
194
|
},
|
|
222
195
|
filterByTimeFrame(items) {
|
|
@@ -229,19 +202,20 @@ export default {
|
|
|
229
202
|
const futureLimit = new Date(currentDate);
|
|
230
203
|
futureLimit.setDate(futureLimit.getDate() + 90);
|
|
231
204
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
205
|
+
const timeFrameFilters = {
|
|
206
|
+
Upcoming: () => items.filter(item => new Date(item.EndDate) >= currentDate),
|
|
207
|
+
Past: () => items.filter(item => new Date(item.EndDate) < currentDate),
|
|
208
|
+
Default: () => {
|
|
209
|
+
const filtered = items.filter(item => {
|
|
210
|
+
const endDate = new Date(item.EndDate);
|
|
211
|
+
return endDate >= pastLimit && endDate <= futureLimit;
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
return filtered.slice(0, 20);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
return (timeFrameFilters[this.selectedTimeFrame] || timeFrameFilters.Default)();
|
|
245
219
|
},
|
|
246
220
|
sortTournament(items) {
|
|
247
221
|
if (this.selectedTimeFrame === 'Default') return items;
|
|
@@ -270,19 +244,17 @@ export default {
|
|
|
270
244
|
}[this.sortCriteria];
|
|
271
245
|
|
|
272
246
|
return sortFn ? [...items].sort(sortFn) : items;
|
|
273
|
-
},
|
|
274
|
-
applySorting(items) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
},
|
|
247
|
+
},
|
|
248
|
+
applySorting(items) {
|
|
249
|
+
const sortByComponent = {
|
|
250
|
+
TournamentAdminCard: this.sortTournament,
|
|
251
|
+
FencerFinalResultCard: this.sortFencers,
|
|
252
|
+
ClubCard: this.sortClubs
|
|
253
|
+
};
|
|
254
|
+
const sortItems = sortByComponent[this.component];
|
|
255
|
+
|
|
256
|
+
return sortItems ? sortItems(items) : items;
|
|
257
|
+
},
|
|
286
258
|
handleFilter(filterText) {
|
|
287
259
|
this.filterOn = filterText;
|
|
288
260
|
this.applyFilters();
|
|
@@ -31,6 +31,7 @@ import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
|
31
31
|
|
|
32
32
|
export default {
|
|
33
33
|
name: 'EventFinalResultsHeader',
|
|
34
|
+
emits: ['export:HemaRatings'],
|
|
34
35
|
components: {BaseButton, BaseIcon, BaseText, CounterBox, EventStatusBox },
|
|
35
36
|
props: {
|
|
36
37
|
event: {
|
|
@@ -67,6 +67,7 @@ import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
|
67
67
|
|
|
68
68
|
export default {
|
|
69
69
|
name: 'PoolResultsHeader',
|
|
70
|
+
emits: ['update:handleChange', 'update:handleDecreaseCount', 'update:handleIncreaseCount'],
|
|
70
71
|
components: {BaseIcon, BaseButton, BaseText, CounterBox, EventStatusBox },
|
|
71
72
|
props: {
|
|
72
73
|
eventName: {
|
|
@@ -67,6 +67,7 @@ import ToggleSwitch from "../../../Molecules/Inputs/Toggle/Toggle.vue";
|
|
|
67
67
|
|
|
68
68
|
export default {
|
|
69
69
|
name: 'PoolSummary',
|
|
70
|
+
emits: ['update:manualEdit', 'update:numberOfRings', 'update:poolSize'],
|
|
70
71
|
components: {ToggleSwitch, BaseIcon, BaseButton, BaseText, CounterBox, EventStatusBox },
|
|
71
72
|
props: {
|
|
72
73
|
event: {
|
|
@@ -84,6 +84,7 @@ import StepIndicator from "../../../../Molecules/StepIndicator/BaseStepIndicator
|
|
|
84
84
|
|
|
85
85
|
export default {
|
|
86
86
|
name: 'BasicEventInfoForm',
|
|
87
|
+
emits: ['update', 'update:back', 'update:next'],
|
|
87
88
|
components: {StepIndicator, BaseText, DropDownMenu, DatePicker, TitledInput, BaseButton},
|
|
88
89
|
props: {
|
|
89
90
|
eventConfig: {
|
|
@@ -67,12 +67,21 @@ import TitledInput from "../../../../Molecules/CombinationInputs/TitledInput/Tit
|
|
|
67
67
|
import MultiSelect from "../../../../Molecules/Inputs/MultiSelect/MultiSelect.vue";
|
|
68
68
|
import BaseText from "../../../../Atoms/Text/BaseText.vue";
|
|
69
69
|
import BaseButton from "../../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
70
|
-
import StepIndicator from "../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue";
|
|
71
|
-
import DropDownMenu from "../../../ComplexInputs/DropDown/DropDownMenu.vue";
|
|
72
|
-
import Toggle from "../../../../Molecules/Inputs/Toggle/Toggle.vue";
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
import StepIndicator from "../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue";
|
|
71
|
+
import DropDownMenu from "../../../ComplexInputs/DropDown/DropDownMenu.vue";
|
|
72
|
+
import Toggle from "../../../../Molecules/Inputs/Toggle/Toggle.vue";
|
|
73
|
+
|
|
74
|
+
const promotionTypeDefaults = {
|
|
75
|
+
'Top Percent': { typeCode: 'Percent', defaultAmount: '100%' },
|
|
76
|
+
'Top Count': { typeCode: 'Count', defaultAmount: '16' },
|
|
77
|
+
'Top Count of Each Pool': { typeCode: 'Top', defaultAmount: '2' }
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const defaultPromotionType = { typeCode: 'Percent', defaultAmount: '100%' };
|
|
81
|
+
|
|
82
|
+
export default {
|
|
75
83
|
name: 'DirectEliminationPromotion',
|
|
84
|
+
emits: ['update', 'update:back', 'update:DEPromotionType', 'update:next'],
|
|
76
85
|
components: {Toggle, DropDownMenu, StepIndicator, BaseButton, BaseText, TitledInput, MultiSelect},
|
|
77
86
|
props: {
|
|
78
87
|
eventConfig: Object,
|
|
@@ -135,35 +144,13 @@ export default {
|
|
|
135
144
|
handleNext() {
|
|
136
145
|
this.$emit('update:next', this.eventConfig);
|
|
137
146
|
},
|
|
138
|
-
handleDEPromotionTypeChange(item) {
|
|
139
|
-
this.selectedItem = item;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
case 'Top Percent':
|
|
146
|
-
typeCode = 'Percent';
|
|
147
|
-
defaultAmount = '100%';
|
|
148
|
-
break;
|
|
149
|
-
|
|
150
|
-
case 'Top Count':
|
|
151
|
-
typeCode = 'Count';
|
|
152
|
-
defaultAmount = '16';
|
|
153
|
-
break;
|
|
154
|
-
|
|
155
|
-
case 'Top Count of Each Pool':
|
|
156
|
-
typeCode = 'Top';
|
|
157
|
-
defaultAmount = '2';
|
|
158
|
-
break;
|
|
159
|
-
|
|
160
|
-
default:
|
|
161
|
-
typeCode = 'Percent';
|
|
162
|
-
defaultAmount = '100%';
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
this.eventConfig.DEPromotionTypes = typeCode;
|
|
166
|
-
this.eventConfig.DEPromotionAmount = defaultAmount;
|
|
147
|
+
handleDEPromotionTypeChange(item) {
|
|
148
|
+
this.selectedItem = item;
|
|
149
|
+
|
|
150
|
+
const { typeCode, defaultAmount } = promotionTypeDefaults[item.text] || defaultPromotionType;
|
|
151
|
+
|
|
152
|
+
this.eventConfig.DEPromotionTypes = typeCode;
|
|
153
|
+
this.eventConfig.DEPromotionAmount = defaultAmount;
|
|
167
154
|
|
|
168
155
|
this.$emit('update:DEPromotionType', typeCode);
|
|
169
156
|
},
|
|
@@ -62,11 +62,76 @@ import BasicEventInfo from './BasicEventInfo/BasicEventInfo.vue';
|
|
|
62
62
|
import PoolConfiguration from './PoolConfiguration/PoolConfiguration.vue';
|
|
63
63
|
import DirectElimination from './DirectElimination/DirectElimination.vue';
|
|
64
64
|
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
65
|
-
import StepIndicator from "../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue";
|
|
66
|
-
import DirectEliminationPromotion from "./DirectEliminationPromotion/DirectEliminationPromotion.vue";
|
|
67
|
-
import EventCustomization from "../../..//Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue";
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
import StepIndicator from "../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue";
|
|
66
|
+
import DirectEliminationPromotion from "./DirectEliminationPromotion/DirectEliminationPromotion.vue";
|
|
67
|
+
import EventCustomization from "../../..//Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue";
|
|
68
|
+
|
|
69
|
+
const ruleValueIsTrue = (rule, fallbackField) => rule.RuleValue === 'true' || rule.RuleValue === true || rule[fallbackField] === true;
|
|
70
|
+
|
|
71
|
+
const ruleAppliers = {
|
|
72
|
+
1: (eventConfig, rule) => {
|
|
73
|
+
eventConfig.poolTime = rule.RuleValue;
|
|
74
|
+
eventConfig.poolTimer = true;
|
|
75
|
+
},
|
|
76
|
+
2: (eventConfig, rule) => {
|
|
77
|
+
eventConfig.poolMaxPoints = rule.RuleValue;
|
|
78
|
+
eventConfig.poolMax = true;
|
|
79
|
+
},
|
|
80
|
+
3: (eventConfig, rule) => {
|
|
81
|
+
eventConfig.DETime = rule.RuleValue;
|
|
82
|
+
eventConfig.DETimer = true;
|
|
83
|
+
},
|
|
84
|
+
4: (eventConfig, rule) => {
|
|
85
|
+
eventConfig.DEMaxPoints = rule.RuleValue;
|
|
86
|
+
eventConfig.DEMax = true;
|
|
87
|
+
},
|
|
88
|
+
5: (eventConfig, rule) => {
|
|
89
|
+
eventConfig.thirdPlaceBout = ruleValueIsTrue(rule, 'thirdPlaceBout');
|
|
90
|
+
},
|
|
91
|
+
6: (eventConfig, rule) => {
|
|
92
|
+
eventConfig.boutCount = rule.RuleValue;
|
|
93
|
+
eventConfig.boutCounter = true;
|
|
94
|
+
},
|
|
95
|
+
7: (eventConfig, rule) => {
|
|
96
|
+
eventConfig.DEBoutCount = rule.RuleValue;
|
|
97
|
+
eventConfig.DEBoutCounter = true;
|
|
98
|
+
},
|
|
99
|
+
9: (eventConfig, rule) => {
|
|
100
|
+
eventConfig.DEPromotionOrder = rule.RuleValue.split(',');
|
|
101
|
+
},
|
|
102
|
+
10: (eventConfig, rule) => {
|
|
103
|
+
eventConfig.DEPromotionAmount = rule.RuleValue;
|
|
104
|
+
},
|
|
105
|
+
11: (eventConfig, rule) => {
|
|
106
|
+
eventConfig.seedWith = rule.RuleValue;
|
|
107
|
+
},
|
|
108
|
+
14: (eventConfig, rule) => {
|
|
109
|
+
eventConfig.CutOffNumber = rule.RuleValue;
|
|
110
|
+
},
|
|
111
|
+
15: (eventConfig, rule) => {
|
|
112
|
+
eventConfig.DEType = rule.RuleValue;
|
|
113
|
+
},
|
|
114
|
+
16: (eventConfig, rule) => {
|
|
115
|
+
eventConfig.PoolScoreDirection = ruleValueIsTrue(rule, 'PoolScoreDirection');
|
|
116
|
+
},
|
|
117
|
+
17: (eventConfig, rule) => {
|
|
118
|
+
eventConfig.DEPromoteBy = rule.RuleValue;
|
|
119
|
+
},
|
|
120
|
+
19: (eventConfig, rule) => {
|
|
121
|
+
eventConfig.CountHandshots = ruleValueIsTrue(rule, 'CountHandshots');
|
|
122
|
+
},
|
|
123
|
+
20: (eventConfig, rule) => {
|
|
124
|
+
eventConfig.CountDoubles = ruleValueIsTrue(rule, 'CountDoubles');
|
|
125
|
+
},
|
|
126
|
+
21: (eventConfig, rule) => {
|
|
127
|
+
eventConfig.PenaltiesReset = ruleValueIsTrue(rule, 'PenaltiesReset');
|
|
128
|
+
},
|
|
129
|
+
22: (eventConfig, rule) => {
|
|
130
|
+
eventConfig.IncludeInRatings = ruleValueIsTrue(rule, 'IncludeInRatings');
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export default {
|
|
70
135
|
name: 'EditEventWizard',
|
|
71
136
|
components: {
|
|
72
137
|
EventCustomization,
|
|
@@ -161,73 +226,13 @@ export default {
|
|
|
161
226
|
}
|
|
162
227
|
},
|
|
163
228
|
methods: {
|
|
164
|
-
setInitialValues() {
|
|
165
|
-
if (!this.event.rules) return;
|
|
166
|
-
this.event.rules.forEach(rule => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
break;
|
|
172
|
-
case 2:
|
|
173
|
-
this.eventConfig.poolMaxPoints = rule.RuleValue;
|
|
174
|
-
this.eventConfig.poolMax = true;
|
|
175
|
-
break;
|
|
176
|
-
case 3:
|
|
177
|
-
this.eventConfig.DETime = rule.RuleValue;
|
|
178
|
-
this.eventConfig.DETimer = true;
|
|
179
|
-
break;
|
|
180
|
-
case 4:
|
|
181
|
-
this.eventConfig.DEMaxPoints = rule.RuleValue;
|
|
182
|
-
this.eventConfig.DEMax = true;
|
|
183
|
-
break;
|
|
184
|
-
case 5:
|
|
185
|
-
this.eventConfig.thirdPlaceBout = rule.thirdPlaceBout === 'true' || rule.thirdPlaceBout === true;
|
|
186
|
-
break;
|
|
187
|
-
case 6:
|
|
188
|
-
this.eventConfig.boutCount = rule.RuleValue;
|
|
189
|
-
this.eventConfig.boutCounter = true;
|
|
190
|
-
break;
|
|
191
|
-
case 7:
|
|
192
|
-
this.eventConfig.DEBoutCount = rule.RuleValue;
|
|
193
|
-
this.eventConfig.DEBoutCounter = true;
|
|
194
|
-
break;
|
|
195
|
-
case 9:
|
|
196
|
-
this.eventConfig.DEPromotionOrder = rule.RuleValue.split(',');
|
|
197
|
-
break;
|
|
198
|
-
case 10:
|
|
199
|
-
this.eventConfig.DEPromotionAmount = rule.RuleValue;
|
|
200
|
-
break;
|
|
201
|
-
case 11:
|
|
202
|
-
this.eventConfig.seedWith = rule.RuleValue;
|
|
203
|
-
break;
|
|
204
|
-
case 14:
|
|
205
|
-
this.eventConfig.CutOffNumber = rule.RuleValue;
|
|
206
|
-
break;
|
|
207
|
-
case 15:
|
|
208
|
-
this.eventConfig.DEType = rule.RuleValue;
|
|
209
|
-
break;
|
|
210
|
-
case 16:
|
|
211
|
-
this.eventConfig.PoolScoreDirection = rule.RuleValue === 'true' || rule.RuleValue === true;
|
|
212
|
-
break;
|
|
213
|
-
case 17:
|
|
214
|
-
this.eventConfig.DEPromoteBy = rule.RuleValue;
|
|
215
|
-
break;
|
|
216
|
-
case 19:
|
|
217
|
-
this.eventConfig.CountHandshots = rule.RuleValue === 'true' || rule.CountHandshots === true;
|
|
218
|
-
break;
|
|
219
|
-
case 20:
|
|
220
|
-
this.eventConfig.CountDoubles = rule.RuleValue === 'true' || rule.CountDoubles === true;
|
|
221
|
-
break;
|
|
222
|
-
case 21:
|
|
223
|
-
this.eventConfig.PenaltiesReset = rule.RuleValue === 'true' || rule.PenaltiesReset === true;
|
|
224
|
-
break;
|
|
225
|
-
case 22:
|
|
226
|
-
this.eventConfig.IncludeInRatings = rule.RuleValue === 'true' || rule.IncludeInRatings === true;
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
},
|
|
229
|
+
setInitialValues() {
|
|
230
|
+
if (!this.event.rules) return;
|
|
231
|
+
this.event.rules.forEach(rule => {
|
|
232
|
+
const applyRule = ruleAppliers[rule.RuleId];
|
|
233
|
+
if (applyRule) applyRule(this.eventConfig, rule);
|
|
234
|
+
});
|
|
235
|
+
},
|
|
231
236
|
handleValueChange(change) {
|
|
232
237
|
const [key, value] = Object.entries(change)[0];
|
|
233
238
|
|
package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue
CHANGED
|
@@ -95,6 +95,7 @@ import BaseButton from "../../../../Molecules/Buttons/BaseButton/BaseButton.vue"
|
|
|
95
95
|
|
|
96
96
|
export default {
|
|
97
97
|
name: 'PoolConfiguration',
|
|
98
|
+
emits: ['update', 'update:back', 'update:next'],
|
|
98
99
|
components: {BaseButton, StepIndicator, BaseText, DropDownMenu, TitledInput, Toggle},
|
|
99
100
|
props: {
|
|
100
101
|
eventConfig: {
|