@dcrackel/hematournamentui 1.0.711 → 1.0.713

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.
Files changed (109) hide show
  1. package/.prettierignore +7 -7
  2. package/.storybook/main.js +3 -1
  3. package/README.md +182 -148
  4. package/dist/HemaTournamentUI-lib.es.js +4150 -4039
  5. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  6. package/dist/hematournamentui-tailwind.css +11 -0
  7. package/package.json +96 -96
  8. package/prettier.config.js +16 -16
  9. package/src/main.js +1 -1
  10. package/src/mocks/getDEBouts-TableOf128.js +37 -37
  11. package/src/mocks/getDEBouts-TableOf64.js +35 -35
  12. package/src/stories/Atoms/Input/BaseInput.test.js +97 -97
  13. package/src/stories/Atoms/Input/BaseInput.vue +149 -149
  14. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -23
  15. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -35
  16. package/src/stories/Molecules/Indicators/RegistrationStatus/RegistrationStatus.vue +30 -0
  17. package/src/stories/Molecules/Menus/HoverActions/HoverActions.test.js +138 -0
  18. package/src/stories/Molecules/Menus/HoverActions/HoverActions.vue +212 -0
  19. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +6 -0
  20. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -18
  21. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -1
  22. package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +5 -1
  23. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +19 -10
  24. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +11 -7
  25. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -33
  26. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -45
  27. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -103
  28. package/src/stories/Organisms/Cards/Director/DirectorCard.test.js +82 -0
  29. package/src/stories/Organisms/Cards/Director/DirectorCard.vue +32 -51
  30. package/src/stories/Organisms/Cards/EditBout/EditBout.test.js +51 -51
  31. package/src/stories/Organisms/Cards/EventCard/EventCard.stories.js +41 -1
  32. package/src/stories/Organisms/Cards/EventCard/EventCard.test.js +106 -0
  33. package/src/stories/Organisms/Cards/EventCard/EventCard.vue +62 -30
  34. package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -298
  35. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +77 -60
  36. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +144 -143
  37. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +289 -256
  38. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -69
  39. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -80
  40. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +153 -153
  41. package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +4 -0
  42. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -31
  43. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -109
  44. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -192
  45. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +1 -0
  46. package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +247 -204
  47. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +89 -15
  48. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -29
  49. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -46
  50. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -21
  51. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -39
  52. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -145
  53. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -64
  54. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +36 -57
  55. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +101 -65
  56. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +14 -1
  57. package/src/stories/Organisms/Headers/AttendanceSummary/AttendanceSummary.vue +12 -5
  58. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +52 -48
  59. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +256 -227
  60. package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -226
  61. package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
  62. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +137 -133
  63. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.test.js +221 -191
  64. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +372 -366
  65. package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -172
  66. package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -216
  67. package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -79
  68. package/src/stories/Organisms/Wizards/EditEventWizard/RuleSerialization.test.js +29 -0
  69. package/src/stories/Organisms/Wizards/EditEventWizard/WeaponSelection.test.js +138 -0
  70. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +123 -12
  71. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +178 -166
  72. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +35 -7
  73. package/src/stories/Templates/EventManagement/Bracket/BracketDirectorAssignment.test.js +242 -0
  74. package/src/stories/Templates/EventManagement/Bracket/BracketMobile.test.js +131 -0
  75. package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +42 -39
  76. package/src/stories/Templates/EventManagement/Bracket/BracketStories.test.js +80 -0
  77. package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.js +93 -0
  78. package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.test.js +152 -0
  79. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -39
  80. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -79
  81. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -93
  82. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -91
  83. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.stories.js +31 -1
  84. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.test.js +121 -121
  85. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +9 -2
  86. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +5 -4
  87. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +81 -81
  88. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -39
  89. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +101 -101
  90. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -71
  91. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.vue +86 -86
  92. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -86
  93. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.vue +247 -247
  94. package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -170
  95. package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -156
  96. package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -329
  97. package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -329
  98. package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -42
  99. package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +58 -45
  100. package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -84
  101. package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +114 -114
  102. package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -363
  103. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -116
  104. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +307 -307
  105. package/src/stories/Util/Validations/PersonManagementValidations.js +45 -45
  106. package/src/stories/Util/Validations/PriceValidation.js +6 -6
  107. package/src/stories/Util/boutDirectorAssignment.js +46 -0
  108. package/src/stories/Util/registrationStatus.js +11 -0
  109. package/src/stories/Util/tabs.js +19 -47
@@ -1,216 +1,216 @@
1
- <template>
2
- <div class="flex flex-col h-full pb-4">
3
- <div class="w-full flex justify-center grow">
4
- <StepIndicator :steps="steps" :selected="currentStep" />
5
- </div>
6
- <div class="w-full flex flex-row justify-center my-4 grow">
7
- <BaseText
8
- :color="'primaryHighlight'"
9
- :size="'2xl'"
10
- :text="'POOL CONFIGURATION'"
11
- :weight="'normal'"
12
- data-testid="text-add-tournament"
13
- />
14
- </div>
15
- <div class="w-full flex flex-col mb-3 ml-1 grow">
16
- <BaseText
17
- :color="'quinary'"
18
- :size="'sm'"
19
- :text="'Configure the pool stage settings for your event. These options determine the elements displayed on the director\'s screen and influence how fencers advance to the Direct Elimination (DE) stage. You can choose to use a Timer, Pass Counter, or both.'"
20
- :weight="'normal'"
21
- data-testid="text-registration"
22
- />
23
- </div>
24
-
25
- <div class="grow">
26
- <div class="mb-4 mt-8">
27
- <BaseText :color="'quaternary'" :size="'sm'" :text="'POOL SEEDING'" class="border-b mb-5" />
28
- </div>
29
- <div class="mb-4">
30
- <BaseText
31
- :color="'quinary'"
32
- :invalid="validation.StartDate"
33
- :size="'sm'"
34
- :text="'Seed Pools Using Which Method?'"
35
- :weight="'normal'"
36
- class="mb-1"
37
- data-testid="text-start-date"
38
- />
39
- <DropDownMenu
40
- :label="localEventConfig.seedWith || 'Select Method'"
41
- :items="seedWithOptions"
42
- :selected-item="localEventConfig.seedWith"
43
- :alignEnd="false"
44
- :width="'w-full'"
45
- @update:selectedItem="handleSeedWithChange"
46
- />
47
- </div>
48
- </div>
49
-
50
- <div class="grow">
51
- <div class="mb-4 mt-8">
52
- <BaseText :color="'quaternary'" :size="'sm'" :text="'POOL CONFIGURATION'" class="border-b mt-5" />
53
- <BaseText
54
- :color="'quaternary'"
55
- :size="'sm'"
56
- :text="'Timer duration is in seconds.'"
57
- :weight="'normal'"
58
- class="mt-1"
59
- />
60
- </div>
61
- <div class="mb-2 flex">
62
- <div class="mt-1 h-10 w-52">
63
- <Toggle
64
- :checked="localEventConfig.poolTimer"
65
- label="Using a Timer"
66
- :labelLeft="false"
67
- @update:checked="handlePoolTimerToggle"
68
- />
69
- </div>
70
- <TitledInput
71
- v-if="localEventConfig.poolTimer"
72
- :inputValue="localEventConfig.poolTime"
73
- :invalid="validation.poolTime"
74
- inputType="number"
75
- placeholder="Enter Time in Seconds"
76
- title=""
77
- @update:value="handlePoolTimeChange"
78
- />
79
- </div>
80
- <div class="mb-2 flex">
81
- <div class="mt-1 h-10 w-52">
82
- <Toggle
83
- :checked="localEventConfig.boutCounter"
84
- label="Using Pass Counter"
85
- :labelLeft="false"
86
- inputType="number"
87
- @update:checked="handleBoutCounterToggle"
88
- />
89
- </div>
90
- <TitledInput
91
- v-if="localEventConfig.boutCounter"
92
- :inputValue="localEventConfig.boutCount"
93
- :invalid="validation.boutCount"
94
- inputType="number"
95
- placeholder="Enter Number of Passes"
96
- title=""
97
- @update:value="handleBoutCountChange"
98
- />
99
- </div>
100
- <div class="mb-2 flex">
101
- <div class="mt-1 h-10 w-52">
102
- <Toggle
103
- :checked="localEventConfig.poolMax"
104
- label="Max Points"
105
- :labelLeft="false"
106
- @update:checked="handlePoolMaxToggle"
107
- />
108
- </div>
109
- <TitledInput
110
- v-if="localEventConfig.poolMax"
111
- :inputValue="localEventConfig.poolMaxPoints"
112
- :invalid="validation.poolMaxPoints"
113
- inputType="number"
114
- placeholder="Enter Pool Max Points"
115
- title=""
116
- @update:value="handlePoolMaxPointsChange"
117
- />
118
- </div>
119
- </div>
120
-
121
- <div class="flex flex-row justify-center h-12 mt-10">
122
- <BaseButton class="w-1/2 ml-1" color="neutral" label="Back" size="sm" type="primary" @buttonClick="handleBack" />
123
- <BaseButton
124
- class="w-1/2 mr-1 transition-all duration-300 ease-in-out h-12"
125
- color="neutral"
126
- :label="nextButtonLabel"
127
- selected="selected"
128
- size="sm"
129
- type="primary"
130
- @buttonClick="handleNext"
131
- />
132
- </div>
133
- </div>
134
- </template>
135
-
136
- <script>
137
- import TitledInput from '../../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
138
- import BaseText from '../../../../Atoms/Text/BaseText.vue';
139
- import DropDownMenu from '../../../ComplexInputs/DropDown/DropDownMenu.vue';
140
- import Toggle from '../../../../Molecules/Inputs/Toggle/Toggle.vue';
141
- import StepIndicator from '../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue';
142
- import BaseButton from '../../../../Molecules/Buttons/BaseButton/BaseButton.vue';
143
-
144
- export default {
145
- name: 'PoolConfiguration',
146
- emits: ['update', 'update:back', 'update:next'],
147
- components: { BaseButton, StepIndicator, BaseText, DropDownMenu, TitledInput, Toggle },
148
- props: {
149
- nextButtonLabel: { type: String, default: 'Next' },
150
- eventConfig: {
151
- type: Object,
152
- required: true
153
- },
154
- seedWithOptions: {
155
- type: Array,
156
- required: true
157
- },
158
- validation: Object,
159
- currentStep: Number,
160
- steps: Array
161
- },
162
- data() {
163
- return {
164
- localEventConfig: { ...this.eventConfig },
165
- selectedItem: { text: 'M2 - MeyerSquared', link: 'M2' }
166
- };
167
- },
168
- mounted() {
169
- this.localEventConfig = { ...this.eventConfig };
170
- },
171
- watch: {
172
- eventConfig: {
173
- deep: true,
174
- handler(newConfig) {
175
- this.localEventConfig = { ...newConfig };
176
- }
177
- }
178
- },
179
- methods: {
180
- handleSeedWithChange(value) {
181
- this.localEventConfig.seedWith = value.text;
182
- this.$emit('update', { seedWith: value.text });
183
- },
184
- handlePoolTimerToggle(value) {
185
- this.localEventConfig.poolTimer = value;
186
- this.$emit('update', { poolTimer: value });
187
- },
188
- handlePoolTimeChange(value) {
189
- this.localEventConfig.poolTime = value;
190
- this.$emit('update', { poolTime: value });
191
- },
192
- handleBoutCounterToggle(value) {
193
- this.localEventConfig.boutCounter = value;
194
- this.$emit('update', { boutCounter: value });
195
- },
196
- handleBoutCountChange(value) {
197
- this.localEventConfig.boutCount = value;
198
- this.$emit('update', { boutCount: value });
199
- },
200
- handlePoolMaxToggle(value) {
201
- this.localEventConfig.poolMax = value;
202
- this.$emit('update', { poolMax: value });
203
- },
204
- handlePoolMaxPointsChange(value) {
205
- this.localEventConfig.poolMaxPoints = value;
206
- this.$emit('update', { poolMaxPoints: value });
207
- },
208
- handleNext() {
209
- this.$emit('update:next', this.localEventConfig);
210
- },
211
- handleBack() {
212
- this.$emit('update:back');
213
- }
214
- }
215
- };
216
- </script>
1
+ <template>
2
+ <div class="flex flex-col h-full pb-4">
3
+ <div class="w-full flex justify-center grow">
4
+ <StepIndicator :steps="steps" :selected="currentStep" />
5
+ </div>
6
+ <div class="w-full flex flex-row justify-center my-4 grow">
7
+ <BaseText
8
+ :color="'primaryHighlight'"
9
+ :size="'2xl'"
10
+ :text="'POOL CONFIGURATION'"
11
+ :weight="'normal'"
12
+ data-testid="text-add-tournament"
13
+ />
14
+ </div>
15
+ <div class="w-full flex flex-col mb-3 ml-1 grow">
16
+ <BaseText
17
+ :color="'quinary'"
18
+ :size="'sm'"
19
+ :text="'Configure the pool stage settings for your event. These options determine the elements displayed on the director\'s screen and influence how fencers advance to the Direct Elimination (DE) stage. You can choose to use a Timer, Pass Counter, or both.'"
20
+ :weight="'normal'"
21
+ data-testid="text-registration"
22
+ />
23
+ </div>
24
+
25
+ <div class="grow">
26
+ <div class="mb-4 mt-8">
27
+ <BaseText :color="'quaternary'" :size="'sm'" :text="'POOL SEEDING'" class="border-b mb-5" />
28
+ </div>
29
+ <div class="mb-4">
30
+ <BaseText
31
+ :color="'quinary'"
32
+ :invalid="validation.StartDate"
33
+ :size="'sm'"
34
+ :text="'Seed Pools Using Which Method?'"
35
+ :weight="'normal'"
36
+ class="mb-1"
37
+ data-testid="text-start-date"
38
+ />
39
+ <DropDownMenu
40
+ :label="localEventConfig.seedWith || 'Select Method'"
41
+ :items="seedWithOptions"
42
+ :selected-item="localEventConfig.seedWith"
43
+ :alignEnd="false"
44
+ :width="'w-full'"
45
+ @update:selectedItem="handleSeedWithChange"
46
+ />
47
+ </div>
48
+ </div>
49
+
50
+ <div class="grow">
51
+ <div class="mb-4 mt-8">
52
+ <BaseText :color="'quaternary'" :size="'sm'" :text="'POOL CONFIGURATION'" class="border-b mt-5" />
53
+ <BaseText
54
+ :color="'quaternary'"
55
+ :size="'sm'"
56
+ :text="'Timer duration is in seconds.'"
57
+ :weight="'normal'"
58
+ class="mt-1"
59
+ />
60
+ </div>
61
+ <div class="mb-2 flex">
62
+ <div class="mt-1 h-10 w-52">
63
+ <Toggle
64
+ :checked="localEventConfig.poolTimer"
65
+ label="Using a Timer"
66
+ :labelLeft="false"
67
+ @update:checked="handlePoolTimerToggle"
68
+ />
69
+ </div>
70
+ <TitledInput
71
+ v-if="localEventConfig.poolTimer"
72
+ :inputValue="localEventConfig.poolTime"
73
+ :invalid="validation.poolTime"
74
+ inputType="number"
75
+ placeholder="Enter Time in Seconds"
76
+ title=""
77
+ @update:value="handlePoolTimeChange"
78
+ />
79
+ </div>
80
+ <div class="mb-2 flex">
81
+ <div class="mt-1 h-10 w-52">
82
+ <Toggle
83
+ :checked="localEventConfig.boutCounter"
84
+ label="Using Pass Counter"
85
+ :labelLeft="false"
86
+ inputType="number"
87
+ @update:checked="handleBoutCounterToggle"
88
+ />
89
+ </div>
90
+ <TitledInput
91
+ v-if="localEventConfig.boutCounter"
92
+ :inputValue="localEventConfig.boutCount"
93
+ :invalid="validation.boutCount"
94
+ inputType="number"
95
+ placeholder="Enter Number of Passes"
96
+ title=""
97
+ @update:value="handleBoutCountChange"
98
+ />
99
+ </div>
100
+ <div class="mb-2 flex">
101
+ <div class="mt-1 h-10 w-52">
102
+ <Toggle
103
+ :checked="localEventConfig.poolMax"
104
+ label="Max Points"
105
+ :labelLeft="false"
106
+ @update:checked="handlePoolMaxToggle"
107
+ />
108
+ </div>
109
+ <TitledInput
110
+ v-if="localEventConfig.poolMax"
111
+ :inputValue="localEventConfig.poolMaxPoints"
112
+ :invalid="validation.poolMaxPoints"
113
+ inputType="number"
114
+ placeholder="Enter Pool Max Points"
115
+ title=""
116
+ @update:value="handlePoolMaxPointsChange"
117
+ />
118
+ </div>
119
+ </div>
120
+
121
+ <div class="flex flex-row justify-center h-12 mt-10">
122
+ <BaseButton class="w-1/2 ml-1" color="neutral" label="Back" size="sm" type="primary" @buttonClick="handleBack" />
123
+ <BaseButton
124
+ class="w-1/2 mr-1 transition-all duration-300 ease-in-out h-12"
125
+ color="neutral"
126
+ :label="nextButtonLabel"
127
+ selected="selected"
128
+ size="sm"
129
+ type="primary"
130
+ @buttonClick="handleNext"
131
+ />
132
+ </div>
133
+ </div>
134
+ </template>
135
+
136
+ <script>
137
+ import TitledInput from '../../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
138
+ import BaseText from '../../../../Atoms/Text/BaseText.vue';
139
+ import DropDownMenu from '../../../ComplexInputs/DropDown/DropDownMenu.vue';
140
+ import Toggle from '../../../../Molecules/Inputs/Toggle/Toggle.vue';
141
+ import StepIndicator from '../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue';
142
+ import BaseButton from '../../../../Molecules/Buttons/BaseButton/BaseButton.vue';
143
+
144
+ export default {
145
+ name: 'PoolConfiguration',
146
+ emits: ['update', 'update:back', 'update:next'],
147
+ components: { BaseButton, StepIndicator, BaseText, DropDownMenu, TitledInput, Toggle },
148
+ props: {
149
+ nextButtonLabel: { type: String, default: 'Next' },
150
+ eventConfig: {
151
+ type: Object,
152
+ required: true
153
+ },
154
+ seedWithOptions: {
155
+ type: Array,
156
+ required: true
157
+ },
158
+ validation: Object,
159
+ currentStep: Number,
160
+ steps: Array
161
+ },
162
+ data() {
163
+ return {
164
+ localEventConfig: { ...this.eventConfig },
165
+ selectedItem: { text: 'M2 - MeyerSquared', link: 'M2' }
166
+ };
167
+ },
168
+ mounted() {
169
+ this.localEventConfig = { ...this.eventConfig };
170
+ },
171
+ watch: {
172
+ eventConfig: {
173
+ deep: true,
174
+ handler(newConfig) {
175
+ this.localEventConfig = { ...newConfig };
176
+ }
177
+ }
178
+ },
179
+ methods: {
180
+ handleSeedWithChange(value) {
181
+ this.localEventConfig.seedWith = value.text;
182
+ this.$emit('update', { seedWith: value.text });
183
+ },
184
+ handlePoolTimerToggle(value) {
185
+ this.localEventConfig.poolTimer = value;
186
+ this.$emit('update', { poolTimer: value });
187
+ },
188
+ handlePoolTimeChange(value) {
189
+ this.localEventConfig.poolTime = value;
190
+ this.$emit('update', { poolTime: value });
191
+ },
192
+ handleBoutCounterToggle(value) {
193
+ this.localEventConfig.boutCounter = value;
194
+ this.$emit('update', { boutCounter: value });
195
+ },
196
+ handleBoutCountChange(value) {
197
+ this.localEventConfig.boutCount = value;
198
+ this.$emit('update', { boutCount: value });
199
+ },
200
+ handlePoolMaxToggle(value) {
201
+ this.localEventConfig.poolMax = value;
202
+ this.$emit('update', { poolMax: value });
203
+ },
204
+ handlePoolMaxPointsChange(value) {
205
+ this.localEventConfig.poolMaxPoints = value;
206
+ this.$emit('update', { poolMaxPoints: value });
207
+ },
208
+ handleNext() {
209
+ this.$emit('update:next', this.localEventConfig);
210
+ },
211
+ handleBack() {
212
+ this.$emit('update:back');
213
+ }
214
+ }
215
+ };
216
+ </script>
@@ -1,79 +1,79 @@
1
- import { afterEach, describe, expect, it } from 'vitest';
2
- import { mount } from '@vue/test-utils';
3
- import EditEventWizard from './EditEventWizard.vue';
4
- import TitledInput from '../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
5
-
6
- const wrappers = [];
7
- afterEach(() => wrappers.splice(0).forEach(wrapper => wrapper.unmount()));
8
-
9
- function mountWizard(props = {}) {
10
- const wrapper = mount(EditEventWizard, {
11
- props: { event: { EventName: 'Test Event', EventPrice: 25.5 }, weapons: [], ...props },
12
- global: { stubs: { DatePicker: true, DropDownMenu: true, StepIndicator: true } }
13
- });
14
- wrappers.push(wrapper);
15
- return wrapper;
16
- }
17
-
18
- function priceField(wrapper) {
19
- return wrapper.findAllComponents(TitledInput).find(field => field.props('title').startsWith('Event Price'));
20
- }
21
-
22
- function savedEvent(wrapper, editMode) {
23
- if (editMode) return wrapper.emitted('save:step')[0][0].event;
24
- return wrapper.emitted('update:submit')[0][0];
25
- }
26
-
27
- describe('event price', () => {
28
- it.each([false, true])('includes decimal prices in save payloads with editMode %s', async editMode => {
29
- const event = { EventName: 'Test Event', EventPrice: 25.5 };
30
- const wrapper = mountWizard({ event, editMode });
31
- await wrapper.vm.$nextTick();
32
- expect(priceField(wrapper).find('input').element.value).toBe('25.5');
33
- await priceField(wrapper).find('input').setValue('30.');
34
- expect(priceField(wrapper).find('input').element.value).toBe('30.');
35
- await priceField(wrapper).find('input').setValue('30.75');
36
- await wrapper
37
- .findAll('button')
38
- .find(button => button.text() === (editMode ? 'Save and Continue' : 'Next'))
39
- .trigger('click');
40
- if (!editMode) {
41
- await wrapper.setProps({ step: 5 });
42
- await wrapper
43
- .findAll('button')
44
- .find(button => button.text() === 'Submit')
45
- .trigger('click');
46
- }
47
- const payload = savedEvent(wrapper, editMode);
48
- expect(payload.EventPrice).toBe(30.75);
49
- expect(payload.rules.some(rule => rule.RuleName === 'EventPrice')).toBe(false);
50
- expect(event.EventPrice).toBe(25.5);
51
- await wrapper.setProps({ event: { ...event, EventPrice: 0 }, step: 1 });
52
- expect(priceField(wrapper).find('input').element.value).toBe('0');
53
- });
54
-
55
- it.each([undefined, null, 0])('allows a free event with an initial price of %s', async value => {
56
- const wrapper = mountWizard({ event: { EventName: 'Free Event', EventPrice: value } });
57
- await wrapper.vm.$nextTick();
58
- expect(priceField(wrapper).find('input').element.value).toBe(value == null ? '' : '0');
59
- expect(priceField(wrapper).find('input').attributes('placeholder')).toBe('0.00');
60
- await priceField(wrapper).find('input').setValue('');
61
- wrapper.vm.handleSubmit();
62
- expect(savedEvent(wrapper, false).EventPrice).toBe(0);
63
- });
64
-
65
- it.each(['-5', 'invalid', 'Infinity'])('blocks Next and save for invalid price %s', async value => {
66
- const wrapper = mountWizard();
67
- await wrapper.vm.$nextTick();
68
- await priceField(wrapper).find('input').setValue(value);
69
- wrapper.vm.handleUpdate();
70
- wrapper.vm.handleSubmit();
71
- await wrapper.vm.$nextTick();
72
- expect(wrapper.vm.currentStep).toBe(1);
73
- expect(wrapper.emitted('update:submit')).toBeUndefined();
74
- expect(priceField(wrapper).props('invalid')).toBe(true);
75
- await priceField(wrapper).find('input').setValue('0');
76
- wrapper.vm.handleSubmit();
77
- expect(savedEvent(wrapper, false).EventPrice).toBe(0);
78
- });
79
- });
1
+ import { afterEach, describe, expect, it } from 'vitest';
2
+ import { mount } from '@vue/test-utils';
3
+ import EditEventWizard from './EditEventWizard.vue';
4
+ import TitledInput from '../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
5
+
6
+ const wrappers = [];
7
+ afterEach(() => wrappers.splice(0).forEach(wrapper => wrapper.unmount()));
8
+
9
+ function mountWizard(props = {}) {
10
+ const wrapper = mount(EditEventWizard, {
11
+ props: { event: { EventName: 'Test Event', EventPrice: 25.5 }, weapons: [], ...props },
12
+ global: { stubs: { DatePicker: true, DropDownMenu: true, StepIndicator: true } }
13
+ });
14
+ wrappers.push(wrapper);
15
+ return wrapper;
16
+ }
17
+
18
+ function priceField(wrapper) {
19
+ return wrapper.findAllComponents(TitledInput).find(field => field.props('title').startsWith('Event Price'));
20
+ }
21
+
22
+ function savedEvent(wrapper, editMode) {
23
+ if (editMode) return wrapper.emitted('save:step')[0][0].event;
24
+ return wrapper.emitted('update:submit')[0][0];
25
+ }
26
+
27
+ describe('event price', () => {
28
+ it.each([false, true])('includes decimal prices in save payloads with editMode %s', async editMode => {
29
+ const event = { EventName: 'Test Event', EventPrice: 25.5 };
30
+ const wrapper = mountWizard({ event, editMode });
31
+ await wrapper.vm.$nextTick();
32
+ expect(priceField(wrapper).find('input').element.value).toBe('25.5');
33
+ await priceField(wrapper).find('input').setValue('30.');
34
+ expect(priceField(wrapper).find('input').element.value).toBe('30.');
35
+ await priceField(wrapper).find('input').setValue('30.75');
36
+ await wrapper
37
+ .findAll('button')
38
+ .find(button => button.text() === (editMode ? 'Save and Continue' : 'Next'))
39
+ .trigger('click');
40
+ if (!editMode) {
41
+ await wrapper.setProps({ step: 5 });
42
+ await wrapper
43
+ .findAll('button')
44
+ .find(button => button.text() === 'Submit')
45
+ .trigger('click');
46
+ }
47
+ const payload = savedEvent(wrapper, editMode);
48
+ expect(payload.EventPrice).toBe(30.75);
49
+ expect(payload.rules.some(rule => rule.RuleName === 'EventPrice')).toBe(false);
50
+ expect(event.EventPrice).toBe(25.5);
51
+ await wrapper.setProps({ event: { ...event, EventPrice: 0 }, step: 1 });
52
+ expect(priceField(wrapper).find('input').element.value).toBe('0');
53
+ });
54
+
55
+ it.each([undefined, null, 0])('allows a free event with an initial price of %s', async value => {
56
+ const wrapper = mountWizard({ event: { EventName: 'Free Event', EventPrice: value } });
57
+ await wrapper.vm.$nextTick();
58
+ expect(priceField(wrapper).find('input').element.value).toBe(value == null ? '' : '0');
59
+ expect(priceField(wrapper).find('input').attributes('placeholder')).toBe('0.00');
60
+ await priceField(wrapper).find('input').setValue('');
61
+ wrapper.vm.handleSubmit();
62
+ expect(savedEvent(wrapper, false).EventPrice).toBe(0);
63
+ });
64
+
65
+ it.each(['-5', 'invalid', 'Infinity'])('blocks Next and save for invalid price %s', async value => {
66
+ const wrapper = mountWizard();
67
+ await wrapper.vm.$nextTick();
68
+ await priceField(wrapper).find('input').setValue(value);
69
+ wrapper.vm.handleUpdate();
70
+ wrapper.vm.handleSubmit();
71
+ await wrapper.vm.$nextTick();
72
+ expect(wrapper.vm.currentStep).toBe(1);
73
+ expect(wrapper.emitted('update:submit')).toBeUndefined();
74
+ expect(priceField(wrapper).props('invalid')).toBe(true);
75
+ await priceField(wrapper).find('input').setValue('0');
76
+ wrapper.vm.handleSubmit();
77
+ expect(savedEvent(wrapper, false).EventPrice).toBe(0);
78
+ });
79
+ });
@@ -0,0 +1,29 @@
1
+ import { afterEach, expect, it } from 'vitest';
2
+ import { shallowMount } from '@vue/test-utils';
3
+ import EditEventWizard from './EditEventWizard.vue';
4
+
5
+ const wrappers = [];
6
+ afterEach(() => wrappers.splice(0).forEach(wrapper => wrapper.unmount()));
7
+
8
+ it.each([
9
+ ['CutOffNumber', '32', 14, '32'],
10
+ ['poolTime', '180', 1, '180'],
11
+ ['DEType', 'single', 15, 'single'],
12
+ ['DEType', 'double', 15, 'double'],
13
+ ['DEPromoteBy', 'Percent', 17, 'Percent'],
14
+ ['seedWith', 'HR - Hema Rating', 11, 'HR - Hema Rating'],
15
+ ['CutOffNumber', 0, 14, '0'],
16
+ ['thirdPlaceBout', false, 5, 'false'],
17
+ ['DEPromotionOrder', ['Win Percent', 'Indicator'], 9, 'Win Percent,Indicator'],
18
+ ['seedWith', { text: 'Manual', link: 'MN' }, 11, 'MN']
19
+ ])('serializes %s value %j without accessing inherited string methods', (field, value, ruleId, expected) => {
20
+ const wrapper = shallowMount(EditEventWizard, {
21
+ props: { event: { EventId: 12, EventName: 'Example Event', EventPrice: 0, rules: [] }, weapons: [], editMode: true }
22
+ });
23
+ wrappers.push(wrapper);
24
+ wrapper.vm.handleValueChange({ poolTimer: true, [field]: value });
25
+ wrapper.vm.handleUpdate();
26
+ const payload = wrapper.emitted('save:step')[0][0].event;
27
+ expect(payload.rules.find(rule => rule.RuleId === ruleId).RuleValue).toBe(expected);
28
+ expect(payload.rules.some(rule => rule.RuleValue.includes('[native code]'))).toBe(false);
29
+ });