@dcrackel/hematournamentui 1.0.698 → 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.
Files changed (67) hide show
  1. package/AGENTS.md +3 -0
  2. package/dist/HemaTournamentUI-lib.es.js +10512 -10219
  3. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  4. package/dist/hematournamentui-tailwind.css +14 -0
  5. package/dist/hematournamentui.css +1 -1
  6. package/package.json +92 -92
  7. package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +1 -1
  8. package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +1 -1
  9. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +2 -2
  10. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +25 -22
  11. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +31 -29
  12. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.vue +2 -4
  13. package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +31 -31
  14. package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.stories.js +6 -6
  15. package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +64 -53
  16. package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.stories.js +6 -7
  17. package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.vue +18 -10
  18. package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +4 -4
  19. package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +64 -45
  20. package/src/stories/Organisms/Containers/Pool/Pool.vue +1 -1
  21. package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +35 -20
  22. package/src/stories/Templates/Assignment/Assignment.stories.js +17 -15
  23. package/src/stories/Templates/Assignment/Assignment.vue +71 -40
  24. package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.stories.js +49 -30
  25. package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.vue +29 -28
  26. package/src/stories/Templates/ClubManagement/{ClubMangement.stories.js → ClubManagement.stories.js} +74 -59
  27. package/src/stories/Templates/ClubManagement/ClubManagement.vue +104 -92
  28. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +92 -97
  29. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +37 -33
  30. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +11 -14
  31. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +34 -37
  32. package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.stories.js +11 -10
  33. package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +8 -8
  34. package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.stories.js +13 -16
  35. package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.vue +15 -19
  36. package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.stories.js +25 -24
  37. package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.vue +28 -34
  38. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +54 -19
  39. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +75 -68
  40. package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +55 -45
  41. package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +47 -55
  42. package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +56 -55
  43. package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +71 -73
  44. package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +18 -16
  45. package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +9 -6
  46. package/src/stories/Templates/Menus/Admin/AdminLeftMenu.stories.js +22 -19
  47. package/src/stories/Templates/Menus/Admin/AdminLeftMenu.vue +44 -36
  48. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +30 -23
  49. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +55 -58
  50. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +67 -0
  51. package/src/stories/Templates/PersonManagement/Admin/{Administration.vue → Administration/Administration.vue} +94 -87
  52. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -0
  53. package/src/stories/Templates/PersonManagement/Admin/{FencerAdmin.vue → FencerAdmin/FencerAdmin.vue} +90 -77
  54. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -0
  55. package/src/stories/Templates/PersonManagement/Admin/{MergeAccounts.vue → MergeAccounts/MergeAccounts.vue} +258 -242
  56. package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +28 -28
  57. package/src/stories/Templates/PersonManagement/PersonManagement.vue +1 -1
  58. package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +45 -28
  59. package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.vue +22 -16
  60. package/src/stories/Templates/TournamentManagement/{TournamentMangement.stories.js → TournamentManagement.stories.js} +68 -39
  61. package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +199 -153
  62. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +113 -0
  63. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +123 -106
  64. package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js +76 -31
  65. package/src/stories/Templates/TournamentManagement/TournamentPageTwo/{TouranmentPageTwo.vue → TournamentPageTwo.vue} +63 -44
  66. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin.stories.js +0 -48
  67. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TouranmentPageOne.stories.js +0 -63
@@ -36,35 +36,28 @@
36
36
  </template>
37
37
 
38
38
  <script>
39
- import BaseText from "../../../stories/Atoms/Text/BaseText.vue";
40
- import ImageCropper from "../../../stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue";
41
- import TitledInput from "../../../stories/Molecules/CombinationInputs/TitledInput/TitledInput.vue";
42
- import DropDownMenu from "../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue";
43
- import BaseButton from "../../../stories/Molecules/Buttons/BaseButton/BaseButton.vue";
44
- import FindLocation from "../../Organisms/ComplexInputs/FindLocation/FindLocation.vue";
45
- import TextBoxEditor from "../../Organisms/ComplexInputs/TextBoxEditor/TextBoxEditor.vue";
46
- import ClubManagementSkeleton from "../../Organisms/Skeletons/ClubManagement/ClubMangementSkeleton.vue";
47
- import ClubBasic from "../../Templates/ClubManagement/ClubBasic/ClubBasic.vue";
48
- import { validateField } from "../../Util/Validations/ClubManagementValidations.js";
39
+ import BaseText from "../../../stories/Atoms/Text/BaseText.vue";
40
+ import ImageCropper from "../../../stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue";
41
+ import BaseButton from "../../../stories/Molecules/Buttons/BaseButton/BaseButton.vue";
42
+ import ClubManagementSkeleton from "../../Organisms/Skeletons/ClubManagement/ClubMangementSkeleton.vue";
43
+ import ClubBasic from "../../Templates/ClubManagement/ClubBasic/ClubBasic.vue";
44
+ import { validateField } from "../../Util/Validations/ClubManagementValidations.js";
49
45
 
50
- export default {
51
- name: 'ClubManagement',
52
- emits: ['submit:club', 'add:newAddress', 'delete:club', 'update:selectedClub'],
53
- components: {
54
- ClubBasic,
55
- ClubManagementSkeleton,
56
- BaseText,
57
- ImageCropper,
58
- TitledInput,
59
- DropDownMenu,
60
- BaseButton,
61
- FindLocation,
62
- TextBoxEditor
63
- },
64
- props: {
65
- clubProfile: {
66
- type: Object
67
- },
46
+ export default {
47
+ name: 'ClubManagement',
48
+ emits: ['submit:club', 'add:newAddress', 'delete:club', 'update:image'],
49
+ components: {
50
+ ClubBasic,
51
+ ClubManagementSkeleton,
52
+ BaseText,
53
+ ImageCropper,
54
+ BaseButton
55
+ },
56
+ props: {
57
+ clubProfile: {
58
+ type: Object,
59
+ default: () => ({})
60
+ },
68
61
  locations: {
69
62
  type: Array,
70
63
  default: () => []
@@ -94,9 +87,9 @@ export default {
94
87
  default: 'Save'
95
88
  }
96
89
  },
97
- data() {
98
- return {
99
- club: {...this.clubProfile},
90
+ data() {
91
+ return {
92
+ club: this.cloneClub(this.clubProfile),
100
93
  validation: {
101
94
  Name: { invalid: false, message: "" },
102
95
  ShortName: { invalid: false, message: "" },
@@ -106,67 +99,82 @@ export default {
106
99
  };
107
100
  },
108
101
  watch: {
109
- clubProfile: {
110
- immediate: true,
111
- handler(newProfile) {
112
- this.club = {...newProfile};
113
- },
114
- },
102
+ clubProfile: {
103
+ immediate: true,
104
+ handler(newProfile) {
105
+ this.club = this.cloneClub(newProfile);
106
+ },
107
+ },
115
108
  },
116
109
  computed: {
117
- getHeaderText() {
118
- return this.club.Name ? this.club.Name : 'Club Profile';
119
- },
120
- getImageURL() {
121
- return Array.isArray(this.club.Images) && this.club.Images.length > 0
110
+ getHeaderText() {
111
+ return this.club?.Name ? this.club.Name : 'Club Profile';
112
+ },
113
+ getImageURL() {
114
+ return Array.isArray(this.club.Images) && this.club.Images.length > 0
122
115
  ? this.club.Images[0].URL
123
116
  : "";
124
117
  },
125
118
  getClass() {
126
119
  return 'border-2 border-dashed rounded-full w-32 h-32';
127
120
  }
128
- },
129
- methods: {
130
- handleProfilePicUpdate(url) {
131
- if (this.club.Images[0]) {
132
- this.club.Images[0].URL = url;
133
- }
134
-
135
- if (!this.club.Images[0]) {
136
- const image = {
137
- "URL": url,
138
- "AltText": "ClubImage",
121
+ },
122
+ methods: {
123
+ cloneClub(club) {
124
+ return {
125
+ ...(club || {}),
126
+ Address: club?.Address ? { ...club.Address } : undefined,
127
+ Images: Array.isArray(club?.Images) ? club.Images.map((image) => ({ ...image })) : []
128
+ };
129
+ },
130
+ handleProfilePicUpdate(url) {
131
+ const images = Array.isArray(this.club.Images)
132
+ ? this.club.Images.map((image) => ({ ...image }))
133
+ : [];
134
+
135
+ if (images[0]) {
136
+ images[0].URL = url;
137
+ }
138
+
139
+ if (!images[0]) {
140
+ const image = {
141
+ "URL": url,
142
+ "AltText": "ClubImage",
139
143
  "Type": "Club",
140
- "EntityId": this.club.ClubId,
141
- "EntityType": "Club"
142
- }
143
- this.club.Images.push(image)
144
- }
145
-
146
- this.$emit('update:image', url);
147
- },
144
+ "EntityId": this.club.ClubId,
145
+ "EntityType": "Club"
146
+ }
147
+ images.push(image)
148
+ }
149
+
150
+ this.club = {
151
+ ...this.club,
152
+ Images: images
153
+ };
154
+ this.$emit('update:image', url);
155
+ },
148
156
  handleAddNewAddress(value) {
149
157
  this.$emit('add:newAddress', value);
150
158
  },
151
- handleSubmit() {
152
- this.pushedSave = true;
153
- if (this.validateAllFields()) {
154
- this.$emit('submit:club', this.club);
155
- }
156
- },
157
- handleDelete() {
158
- this.$emit('delete:club', this.club);
159
- },
160
- updateClub({ field, value }) {
161
- this.club = { ...this.club, [field]: value };
162
-
163
- if (field === 'Color1') {
164
- this.club.Color1 = value.value;
165
- }
166
-
167
- if (field === 'Color2') {
168
- this.club.Color2 = value.value;
169
- }
159
+ handleSubmit() {
160
+ this.pushedSave = true;
161
+ if (this.validateAllFields()) {
162
+ this.$emit('submit:club', this.cloneClub(this.club));
163
+ }
164
+ },
165
+ handleDelete() {
166
+ this.$emit('delete:club', this.cloneClub(this.club));
167
+ },
168
+ updateClub({ field, value }) {
169
+ this.club = { ...this.club, [field]: value };
170
+
171
+ if (field === 'Color1') {
172
+ this.club.Color1 = value;
173
+ }
174
+
175
+ if (field === 'Color2') {
176
+ this.club.Color2 = value;
177
+ }
170
178
 
171
179
  if (field === 'add:newAddress' && value) {
172
180
  this.club = {
@@ -180,18 +188,22 @@ export default {
180
188
  };
181
189
  }
182
190
 
183
- if (field === 'Location' && value) {
184
- this.club = {
185
- ...this.club,
186
- AddressId: value?.AddressId || 0,
187
- Address: { ...value }
188
- };
189
- }
190
-
191
- if (this.validation[field] && this.pushedSave) {
192
- this.validation[field] = validateField(field, value);
193
- }
194
- },
191
+ if (field === 'Location' && value) {
192
+ this.club = {
193
+ ...this.club,
194
+ AddressId: value?.AddressId || 0,
195
+ Address: { ...value }
196
+ };
197
+ }
198
+
199
+ if (this.validation[field] && this.pushedSave) {
200
+ this.validation[field] = validateField(field, value);
201
+ }
202
+
203
+ if (field === 'Location' && this.pushedSave) {
204
+ this.validation.Address = validateField('Address', this.club.Address);
205
+ }
206
+ },
195
207
  validateAllFields() {
196
208
  const fieldsToValidate = ["Name", "ShortName", "Address"];
197
209
 
@@ -40,8 +40,8 @@
40
40
  :hostingClubColors="hostingClubColors"
41
41
  :show="showDirectorModal"
42
42
  ringName="RingName"
43
- @penalty:add="handleUpdatePenalty"
44
- @penalty:update="handleAddPenalty"
43
+ @penalty:add="handleAddPenalty"
44
+ @penalty:update="handleUpdatePenalty"
45
45
  @penalty:remove="handleRemovePenalty"
46
46
  @update:closeModal="handleCloseModal"
47
47
  @update:bout="handleUpdateBout"
@@ -70,27 +70,21 @@
70
70
  import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
71
71
  import ToggleHeader from "../../../Organisms/Headers/ToggleHeader/ToggleHeader.vue";
72
72
  import BaseText from "../../../Atoms/Text/BaseText.vue";
73
- import BoutCard from "../../../Organisms/Cards/BoutCard/BoutCard.vue";
74
- import DirectorModal from "../../../Molecules/Modals/DirectorModal/DirectorModal.vue";
75
- import EditBoutModal from "../../../Molecules/Modals/EditBoutModal/EditBoutModal.vue";
76
- import Tableau from "../../../Organisms/Containers/Tableau/Tableau.vue";
77
- import TableauColumn from "../../../Organisms/Containers/TableauColumn/TableauColumn.vue";
78
- import ServerConnected from "../../../Molecules/Indicators/ServerConnected/ServerConnected.vue";
79
- import emptyDesertIcon from "../../../../assets/empty_desert_icon.png";
73
+ import DirectorModal from "../../../Molecules/Modals/DirectorModal/DirectorModal.vue";
74
+ import EditBoutModal from "../../../Molecules/Modals/EditBoutModal/EditBoutModal.vue";
75
+ import Tableau from "../../../Organisms/Containers/Tableau/Tableau.vue";
76
+ import emptyDesertIcon from "../../../../assets/empty_desert_icon.png";
80
77
  import { tabs } from '../../../Util/tabs.js';
81
78
  import AssignDirectorModal from "../../../Molecules/Modals/AssignDirectorModal/AssignDirectorModal.vue";
82
79
 
83
80
  export default {
84
81
  emits: ['penalty:add', 'penalty:remove', 'penalty:update', 'submit:bout', 'tab:menu-click', 'update:bout', 'update:directing-bout'],
85
- components: {
86
- AssignDirectorModal,
87
- ServerConnected,
88
- TableauColumn,
89
- Tableau,
90
- EditBoutModal,
91
- DirectorModal,
92
- BoutCard,
93
- BaseText,
82
+ components: {
83
+ AssignDirectorModal,
84
+ Tableau,
85
+ EditBoutModal,
86
+ DirectorModal,
87
+ BaseText,
94
88
  ToggleHeader,
95
89
  EditEventsTopMenu
96
90
  },
@@ -98,10 +92,10 @@ export default {
98
92
  bouts: {
99
93
  type: Array,
100
94
  required: true
101
- },
102
- eventRules: {
103
- type: Object,
104
- required: true
95
+ },
96
+ eventRules: {
97
+ type: Array,
98
+ required: true
105
99
  },
106
100
  hostingClubColors: {
107
101
  type: Object,
@@ -138,7 +132,7 @@ export default {
138
132
  tabs,
139
133
  viewName: "Tableau",
140
134
  largeCards: true,
141
- boutsData: [...this.bouts],
135
+ boutsData: this.cloneBouts(this.bouts),
142
136
  isListView: false,
143
137
  showAssignDirectorModal: false,
144
138
  assigningBout: null,
@@ -167,11 +161,11 @@ export default {
167
161
  bracketSize() {
168
162
  return this.boutsData && this.boutsData.length > 0 && this.boutsData[0].RoundLabel ? this.boutsData[0].RoundLabel : "";
169
163
  },
170
- activeBouts() {
171
- return this.boutsData.filter(bout => bout.Status === 'Active');
172
- },
173
- sortedBouts() {
174
- return this.boutsData.sort((a, b) => {
164
+ activeBouts() {
165
+ return this.boutsData.filter(bout => String(bout.Status || '').toLowerCase() === 'active');
166
+ },
167
+ sortedBouts() {
168
+ return this.boutsData.slice().sort((a, b) => {
175
169
  if (a.DEBoutId < b.DEBoutId) {
176
170
  return -1;
177
171
  }
@@ -183,10 +177,10 @@ export default {
183
177
  }
184
178
  },
185
179
  watch: {
186
- bouts: {
187
- handler(newBouts) {
188
- this.boutsData = [...newBouts];
189
- },
180
+ bouts: {
181
+ handler(newBouts) {
182
+ this.boutsData = this.cloneBouts(newBouts);
183
+ },
190
184
  deep: true,
191
185
  immediate: true
192
186
  }
@@ -226,19 +220,20 @@ export default {
226
220
  this.showAssignDirectorModal = false;
227
221
  this.assigningBout = null;
228
222
  },
229
- handleCloseModal(bout) {
230
- this.showDirectorModal = false;
231
- this.showEditBoutModal = false;
232
-
233
- if (bout.Status !== 'Completed') {
234
- const updatedBout = this.boutsData.find(b => b.BoutId === bout.BoutId);
235
- if (updatedBout) {
236
- updatedBout.Status = 'Scheduled';
237
- updatedBout.Score1 = 0;
238
- updatedBout.Score2 = 0;
239
- }
240
- this.$emit('update:bout', updatedBout);
241
- }
223
+ handleCloseModal(bout) {
224
+ this.showDirectorModal = false;
225
+ this.showEditBoutModal = false;
226
+
227
+ if (!bout?.BoutId) return;
228
+ if (bout.Status !== 'Completed') {
229
+ const updatedBout = this.boutsData.find(b => b.BoutId === bout.BoutId);
230
+ if (!updatedBout) return;
231
+
232
+ updatedBout.Status = 'Scheduled';
233
+ updatedBout.Score1 = 0;
234
+ updatedBout.Score2 = 0;
235
+ this.$emit('update:bout', updatedBout);
236
+ }
242
237
  },
243
238
  handleTabMenuClick(value) {
244
239
  this.$emit('tab:menu-click', value);
@@ -251,56 +246,47 @@ export default {
251
246
  return
252
247
  }
253
248
  this.isListView = false;
254
- },
255
- handleUpdateBout(bout) {
256
- if (!this.activeBouts || this.activeBouts.length === 0) {
257
- return;
258
- }
259
-
260
- let updatedBout = this.activeBouts.find(b => b.BoutId === bout.BoutId);
261
-
262
- if (!updatedBout) {
263
- updatedBout = {}
264
- }
265
-
266
- Object.assign(updatedBout, bout);
267
- updatedBout.Status = 'Active';
268
- this.$emit('update:bout', updatedBout);
269
- },
270
- handleSubmitBout(bout) {
271
- this.showEditBoutModal = false;
272
- this.showDirectorModal = false;
273
-
274
- // Find the bout in activeBouts, or create a default copy if not found
275
- let updatedBout = this.activeBouts.find(b => b.BoutId === bout.BoutId) || { ...bout, score1: bout.score1 ?? 0, score2: bout.score2 ?? 0 };
276
-
277
- // Ensure values for score1 and score2 if they are missing
278
- updatedBout.score1 = bout.score1 ?? updatedBout.score1;
279
- updatedBout.score2 = bout.score2 ?? updatedBout.score2;
280
-
281
- // Merge the new data and update status
282
- Object.assign(updatedBout, bout);
283
- updatedBout.Status = 'Completed';
284
- updatedBout.Ended = new Date().toISOString();
249
+ },
250
+ handleUpdateBout(bout) {
251
+ if (!bout?.BoutId) return;
252
+
253
+ const updatedBout = this.boutsData.find(b => b.BoutId === bout.BoutId);
254
+ if (!updatedBout) return;
255
+ Object.assign(updatedBout, bout);
256
+ updatedBout.Status = 'Active';
257
+ this.$emit('update:bout', updatedBout);
258
+ },
259
+ handleSubmitBout(bout) {
260
+ this.showEditBoutModal = false;
261
+ this.showDirectorModal = false;
262
+ if (!bout?.BoutId) return;
263
+
264
+ const updatedBout = this.boutsData.find(b => b.BoutId === bout.BoutId);
265
+ if (!updatedBout) return;
266
+
267
+ Object.assign(updatedBout, bout);
268
+ updatedBout.Status = 'Completed';
269
+ updatedBout.Ended = new Date().toISOString();
285
270
 
286
271
  this.$emit('submit:bout', updatedBout);
287
- },
288
- directBout(bout) {
289
- if (bout.Person1.PersonId === 0 || bout.Person2.PersonId === 0) {
290
- return;
291
- }
292
-
293
- bout.Status = 'Active';
294
- this.showDirectorModal = true;
295
- this.selectedBout = bout;
296
- this.$emit('update:directing-bout', bout)
297
- },
298
- editBout(bout) {
299
- const updatedBout = this.bouts.find(b => b.BoutId === bout.BoutId);
300
- if (updatedBout) {
301
- this.showEditBoutModal = true;
302
- this.selectedBout = bout;
303
- }
272
+ },
273
+ directBout(bout) {
274
+ if (!this.canDirectBout(bout)) return;
275
+
276
+ const updatedBout = this.boutsData.find(b => b.BoutId === bout.BoutId);
277
+ if (!updatedBout) return;
278
+
279
+ updatedBout.Status = 'Active';
280
+ this.showDirectorModal = true;
281
+ this.selectedBout = updatedBout;
282
+ this.$emit('update:directing-bout', updatedBout)
283
+ },
284
+ editBout(bout) {
285
+ const updatedBout = this.boutsData.find(b => b.BoutId === bout.BoutId);
286
+ if (!updatedBout) return;
287
+
288
+ this.showEditBoutModal = true;
289
+ this.selectedBout = updatedBout;
304
290
  },
305
291
  handleCardSizeToggle(value){
306
292
  this.largeCards = value
@@ -315,9 +301,18 @@ export default {
315
301
 
316
302
  this.$emit('penalty:add', penalty);
317
303
  },
318
- handleRemovePenalty(penalty) {
319
- this.$emit('penalty:remove', penalty);
320
- }
304
+ handleRemovePenalty(penalty) {
305
+ this.$emit('penalty:remove', penalty);
306
+ },
307
+ canDirectBout(bout) {
308
+ if (!bout?.BoutId) return false;
309
+ if (bout.Person1?.PersonId === 0) return false;
310
+ if (bout.Person2?.PersonId === 0) return false;
311
+ return true;
312
+ },
313
+ cloneBouts(bouts) {
314
+ return Array.isArray(bouts) ? bouts.map(bout => ({ ...bout })) : [];
315
+ }
321
316
  }
322
317
  }
323
- </script>
318
+ </script>
@@ -8,42 +8,46 @@ export default {
8
8
  component: editConfig,
9
9
  tags: ['autodocs'],
10
10
  args: {
11
- event: singleEventMock,
12
- weapons: getAllWeapons,
13
- rules: eventRules,
14
- role: 'admin'
15
- },
16
- argTypes: {
17
- event: { control: 'object' },
18
- weapons: { control: 'object' },
19
- rules: { control: 'object' },
20
- role: { control: 'text' }
21
- },
22
-
23
- };
24
-
25
- export const Default = {
26
- event: singleEventMock,
27
- weapons: getAllWeapons,
28
- rules: eventRules,
29
- role: 'admin'
30
- };
31
-
32
- export const NewEvent = {
33
- event: {
34
- Absent: 0,
35
- Date: new Date().toISOString().split('T')[0],
36
- EventName: '',
11
+ event: singleEventMock,
12
+ weapons: getAllWeapons,
13
+ rules: eventRules,
14
+ userLevel: 'admin'
15
+ },
16
+ argTypes: {
17
+ event: { control: 'object' },
18
+ weapons: { control: 'object' },
19
+ rules: { control: 'object' },
20
+ userLevel: { control: 'text' }
21
+ },
22
+
23
+ };
24
+
25
+ export const Default = {
26
+ args: {
27
+ event: singleEventMock,
28
+ weapons: getAllWeapons,
29
+ rules: eventRules,
30
+ userLevel: 'admin'
31
+ }
32
+ };
33
+
34
+ export const NewEvent = {
35
+ args: {
36
+ event: {
37
+ Absent: 0,
38
+ Date: new Date().toISOString().split('T')[0],
39
+ EventName: '',
37
40
  Flights: 1,
38
41
  NumberOfPools: 2,
39
42
  NumberOfRings: 2,
40
43
  PoolSize: 0,
41
44
  Present: 0,
42
45
  StartTime: '12:00:00',
43
- Status: 'planning',
44
- TournamentId: 10,
45
- },
46
- weapons: getAllWeapons,
47
- rules: [],
48
- role: 'admin'
49
- }
46
+ Status: 'planning',
47
+ TournamentId: 10,
48
+ },
49
+ weapons: getAllWeapons,
50
+ rules: [],
51
+ userLevel: 'admin'
52
+ }
53
+ }
@@ -15,17 +15,15 @@
15
15
  </template>
16
16
 
17
17
  <script>
18
- import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
19
- import ToggleHeader from "../../../Organisms/Headers/ToggleHeader/ToggleHeader.vue";
20
- import EditEventWizard from "../../../Organisms/Wizards/EditEventWizard/EditEventWizard.vue";
21
- import { tabs } from '../../../Util/tabs.js';
18
+ import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
19
+ import EditEventWizard from "../../../Organisms/Wizards/EditEventWizard/EditEventWizard.vue";
20
+ import { tabs } from '../../../Util/tabs.js';
22
21
 
23
22
  export default {
24
23
  emits: ['tab:menu-click', 'update:submit'],
25
- components: {
26
- EditEventWizard,
27
- ToggleHeader,
28
- EditEventsTopMenu
24
+ components: {
25
+ EditEventWizard,
26
+ EditEventsTopMenu
29
27
  },
30
28
  props: {
31
29
  event: {
@@ -46,12 +44,11 @@ export default {
46
44
  }
47
45
  },
48
46
  data() {
49
- return {
50
- tabs,
51
- windowWidth: window.innerWidth,
52
- viewName: "Edit"
53
- };
54
- },
47
+ return {
48
+ tabs,
49
+ windowWidth: window.innerWidth
50
+ };
51
+ },
55
52
  mounted() {
56
53
  window.addEventListener('resize', this.handleResize);
57
54
  },