@dcrackel/hematournamentui 1.0.699 → 1.0.702

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 (72) hide show
  1. package/AGENTS.md +3 -0
  2. package/dist/HemaTournamentUI-lib.es.js +10913 -10269
  3. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  4. package/dist/hematournamentui-tailwind.css +23 -0
  5. package/dist/hematournamentui.css +1 -1
  6. package/package.json +8 -8
  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/Buttons/ButtonBar/ButtonBar.vue +1 -1
  10. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +2 -2
  11. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +25 -22
  12. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +31 -29
  13. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.vue +2 -4
  14. package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +54 -35
  15. package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.stories.js +6 -6
  16. package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +64 -53
  17. package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.stories.js +6 -7
  18. package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.vue +18 -10
  19. package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +4 -4
  20. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +129 -0
  21. package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +64 -45
  22. package/src/stories/Organisms/Containers/KioskContainer/KioskContainer.vue +13 -9
  23. package/src/stories/Organisms/Containers/Pool/Pool.vue +1 -1
  24. package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +35 -20
  25. package/src/stories/Organisms/Headers/AttendanceSummary/AttendanceSummary.vue +45 -19
  26. package/src/stories/Templates/Assignment/Assignment.stories.js +17 -15
  27. package/src/stories/Templates/Assignment/Assignment.vue +71 -40
  28. package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.stories.js +49 -30
  29. package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.vue +29 -28
  30. package/src/stories/Templates/ClubManagement/{ClubMangement.stories.js → ClubManagement.stories.js} +74 -59
  31. package/src/stories/Templates/ClubManagement/ClubManagement.vue +104 -92
  32. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +92 -97
  33. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +37 -33
  34. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +11 -14
  35. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.stories.js +49 -14
  36. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +156 -62
  37. package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.stories.js +11 -10
  38. package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +8 -8
  39. package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.stories.js +13 -16
  40. package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.vue +25 -25
  41. package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.stories.js +25 -24
  42. package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.vue +28 -34
  43. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +54 -19
  44. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +75 -68
  45. package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +55 -45
  46. package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +47 -55
  47. package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +56 -55
  48. package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +71 -73
  49. package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +18 -16
  50. package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +9 -6
  51. package/src/stories/Templates/Menus/Admin/AdminLeftMenu.stories.js +22 -19
  52. package/src/stories/Templates/Menus/Admin/AdminLeftMenu.vue +44 -36
  53. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +30 -23
  54. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +55 -58
  55. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +67 -0
  56. package/src/stories/Templates/PersonManagement/Admin/{Administration.vue → Administration/Administration.vue} +94 -87
  57. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -0
  58. package/src/stories/Templates/PersonManagement/Admin/{FencerAdmin.vue → FencerAdmin/FencerAdmin.vue} +90 -77
  59. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -0
  60. package/src/stories/Templates/PersonManagement/Admin/{MergeAccounts.vue → MergeAccounts/MergeAccounts.vue} +258 -242
  61. package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +28 -28
  62. package/src/stories/Templates/PersonManagement/PersonManagement.vue +1 -1
  63. package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +45 -28
  64. package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.vue +22 -16
  65. package/src/stories/Templates/TournamentManagement/{TournamentMangement.stories.js → TournamentManagement.stories.js} +68 -39
  66. package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +199 -153
  67. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +113 -0
  68. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +123 -106
  69. package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js +76 -31
  70. package/src/stories/Templates/TournamentManagement/TournamentPageTwo/{TouranmentPageTwo.vue → TournamentPageTwo.vue} +63 -44
  71. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin.stories.js +0 -48
  72. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TouranmentPageOne.stories.js +0 -63
@@ -3,9 +3,9 @@
3
3
  <div v-if="isNewTournament" class="w-full flex flex-row justify-center">
4
4
  <BaseText :color="'quaternary'" :size="'sm'" :text="'Step 1 out of 2'" :weight="'normal'" data-testid="text-step"/>
5
5
  </div>
6
- <div class="w-full flex flex-row justify-center my-4">
7
- <BaseText v-if="isNewTournament" :color="'primaryHighlight'" :size="'2xl'" :text="'Add New Tournament'" :weight="'normal'" data-testid="text-add-tournament"/>
8
- <BaseText v-if="!isNewTournament" :color="'primaryHighlight'" :size="'2xl'" :text="'Basic Tournament Infomation'" :weight="'normal'" data-testid="text-add-tournament"/>
6
+ <div class="w-full flex flex-row justify-center my-4">
7
+ <BaseText v-if="isNewTournament" :color="'primaryHighlight'" :size="'2xl'" :text="'Add New Tournament'" :weight="'normal'" data-testid="text-add-tournament"/>
8
+ <BaseText v-if="!isNewTournament" :color="'primaryHighlight'" :size="'2xl'" :text="'Basic Tournament Information'" :weight="'normal'" data-testid="text-add-tournament"/>
9
9
  </div>
10
10
  <div class="w-full flex flex-row justify-center my-4">
11
11
 
@@ -16,111 +16,111 @@
16
16
  @update:url="handleNewImageUrl"/>
17
17
  </div>
18
18
 
19
- <TitledInput
20
- :inputValue="tournamentName"
21
- :invalid="validation?.Name?.invalid ?? false"
22
- :title="validation?.Name?.invalid ? `Tournament Name - ${validation?.Name?.message}` : 'Tournament Name'"
23
- placeholder="Enter Tournament Name"
24
- @update:value="emitUpdate('Name', $event)"
25
- class="mb-4"
19
+ <TitledInput
20
+ :inputValue="tournamentName"
21
+ :invalid="isFieldInvalid('Name')"
22
+ :title="getValidationLabel('Name', 'Tournament Name')"
23
+ placeholder="Enter Tournament Name"
24
+ @update:value="emitUpdate('Name', $event)"
25
+ class="mb-4"
26
26
  />
27
27
 
28
28
  <div class="flex flex-col mb-4">
29
- <BaseText
30
- :color="'primaryHighlight'"
31
- :invalid="validation?.Address?.invalid"
32
- :text="validation?.Address?.invalid ? `Location - ${validation?.Address?.message}` : 'Location'"
33
- :size="'sm'"
34
- :weight="'normal'"
35
- class="mb-1"
29
+ <BaseText
30
+ :color="'primaryHighlight'"
31
+ :invalid="isFieldInvalid('Address')"
32
+ :text="getValidationLabel('Address', 'Location')"
33
+ :size="'sm'"
34
+ :weight="'normal'"
35
+ class="mb-1"
36
36
  data-testid="text-address"
37
37
  />
38
38
  <FindLocation
39
- :placeholder="addressName"
40
- :addBorder="true"
41
- :locations="locations"
42
- :invalid="validation.Address.invalid"
43
- addNewText="Add New"
44
- @update:location="handleAddressUpdate"
45
- @submit:location="handleAddressUpdate"
39
+ :placeholder="addressName"
40
+ :addBorder="true"
41
+ :locations="locations"
42
+ :invalid="isFieldInvalid('Address')"
43
+ addNewText="Add New"
44
+ @update:location="handleAddressUpdate"
45
+ @submit:location="handleAddressUpdate"
46
46
  @submit:addNewAddress="handleAddNewAddress"
47
47
  />
48
48
  </div>
49
49
 
50
50
  <div class="flex flex-row mb-4">
51
51
  <div class="w-3/4 mr-1">
52
- <BaseText
53
- :color="'primaryHighlight'"
54
- :invalid="validation.StartDate.invalid"
55
- :size="'sm'"
56
- :text="validation.StartDate.invalid ? `Start Date - ${validation.StartDate.message}` : 'Start Date'"
57
- :weight="'normal'"
58
- class="mb-1"
59
- data-testid="text-start-date"
60
- />
61
- <DatePicker
62
- :invalid="validation.StartDate.invalid"
63
- :setDate="startDate"
64
- :userLevel="userLevel"
65
- @update:selectedDate="emitUpdate('StartDate', $event)"
52
+ <BaseText
53
+ :color="'primaryHighlight'"
54
+ :invalid="isFieldInvalid('StartDate')"
55
+ :size="'sm'"
56
+ :text="getValidationLabel('StartDate', 'Start Date')"
57
+ :weight="'normal'"
58
+ class="mb-1"
59
+ data-testid="text-start-date"
60
+ />
61
+ <DatePicker
62
+ :invalid="isFieldInvalid('StartDate')"
63
+ :setDate="startDate"
64
+ :userLevel="userLevel"
65
+ @update:selectedDate="emitUpdate('StartDate', $event)"
66
66
  />
67
67
  </div>
68
68
  <div>
69
- <TitledInput
70
- :inputValue="totalDays"
71
- :invalid="validation.TotalDays.invalid"
72
- :placeholder="'Number of Days'"
73
- :inputType="'number'"
74
- :title="validation.TotalDays.invalid ? `Number of Days - ${validation.TotalDays.message}` : 'Number of Days'"
75
- @update:value="emitUpdate('TotalDays', $event)"
76
- />
69
+ <TitledInput
70
+ :inputValue="totalDays"
71
+ :invalid="isFieldInvalid('TotalDays')"
72
+ :placeholder="'Number of Days'"
73
+ :inputType="'number'"
74
+ :title="getValidationLabel('TotalDays', 'Number of Days')"
75
+ @update:value="emitUpdate('TotalDays', $event)"
76
+ />
77
77
  </div>
78
78
  </div>
79
79
 
80
80
  <div class="w-full mr-1 mb-4">
81
- <BaseText
82
- :color="'primaryHighlight'"
83
- :invalid="validation.RegistrationCutOff.invalid"
84
- :size="'sm'"
85
- :text="validation.RegistrationCutOff.invalid ? `Registration Cut Off - ${validation.RegistrationCutOff.message}` : 'Registration Cut Off'"
86
- :weight="'normal'"
87
- class="mb-1"
88
- data-testid="text-start-date"
89
- />
90
- <DatePicker
91
- :invalid="validation.RegistrationCutOff.invalid"
92
- :setDate="registrationCutOff"
93
- :userLevel="userLevel"
94
- @update:selectedDate="emitUpdate('RegistrationCutOff', $event)"
81
+ <BaseText
82
+ :color="'primaryHighlight'"
83
+ :invalid="isFieldInvalid('RegistrationCutOff')"
84
+ :size="'sm'"
85
+ :text="getValidationLabel('RegistrationCutOff', 'Registration Cut Off')"
86
+ :weight="'normal'"
87
+ class="mb-1"
88
+ data-testid="text-start-date"
89
+ />
90
+ <DatePicker
91
+ :invalid="isFieldInvalid('RegistrationCutOff')"
92
+ :setDate="registrationCutOff"
93
+ :userLevel="userLevel"
94
+ @update:selectedDate="emitUpdate('RegistrationCutOff', $event)"
95
95
  />
96
96
  </div>
97
97
 
98
98
  <div class="flex flex-col mb-4">
99
- <BaseText
100
- :color="'primaryHighlight'"
101
- :invalid="validation.Description.invalid"
102
- :size="'sm'"
103
- :text="validation.Description.invalid ? `Description - ${validation.Description.message}` : 'Description'"
104
- :weight="'normal'"
105
- class="mb-1"
106
- data-testid="text-description"
107
- />
108
- <TextBoxEditor
109
- :invalid="validation.Description.invalid"
110
- :initialContent="tournament.Description"
111
- @update:editorContent="emitUpdate('Description', $event)"
112
- />
99
+ <BaseText
100
+ :color="'primaryHighlight'"
101
+ :invalid="isFieldInvalid('Description')"
102
+ :size="'sm'"
103
+ :text="getValidationLabel('Description', 'Description')"
104
+ :weight="'normal'"
105
+ class="mb-1"
106
+ data-testid="text-description"
107
+ />
108
+ <TextBoxEditor
109
+ :invalid="isFieldInvalid('Description')"
110
+ :initialContent="description"
111
+ @update:editorContent="emitUpdate('Description', $event)"
112
+ />
113
113
  </div>
114
114
 
115
115
  <div class="flex flex-col pb-4 mr-4">
116
116
  <BaseText :color="'primaryHighlight'" :invalid="false" :size="'sm'" :text="'Primary Contact'"
117
117
  :weight="'normal'" class="mb-1" data-testid="text-primary-contact"/>
118
118
  <FindPerson :addBorder="true"
119
- :persons="persons"
120
- :defaultValue="getDefaultPerson"
121
- addNewText="Add New Person"
122
- @new-person-submitted="handlePersonUpdate('PrimaryContactId', $event)"
123
- @person-selected="handlePersonUpdate('PrimaryContactId', $event)"/>
119
+ :persons="persons"
120
+ :defaultValue="getDefaultPerson"
121
+ addNewText="Add New Person"
122
+ @add-new-person="handleAddNewPerson"
123
+ @person-selected="handlePrimaryContactUpdate"/>
124
124
  </div>
125
125
 
126
126
  </section>
@@ -135,9 +135,9 @@ import TextBoxEditor from "../../../Organisms/ComplexInputs/TextBoxEditor/TextBo
135
135
  import ImageCropper from "../../../Organisms/ComplexInputs/ImageCropper/ImageCropper.vue";
136
136
  import FindPerson from "../../../Organisms/ComplexInputs/FindPerson/FindPerson.vue";
137
137
 
138
- export default {
139
- name: 'TournamentPageOne',
140
- emits: ['update:tournament', 'update:image', 'update:address', 'add:newAddress'],
138
+ export default {
139
+ name: 'TournamentPageOne',
140
+ emits: ['update:tournament', 'update:image', 'update:address', 'add:newAddress', 'add:newPerson'],
141
141
  props: {
142
142
  tournament: {
143
143
  type: Object,
@@ -204,31 +204,48 @@ export default {
204
204
  totalDays() {
205
205
  return this.tournament?.TotalDays || 1;
206
206
  },
207
- registrationCutOff() {
208
- return this.tournament?.RegistrationCutOff || new Date();
209
- },
210
- getDefaultPerson: function () {
211
- const person = this.persons.find(p => p.PersonId === this.tournament.PrimaryContactId);
212
- return person ? person.DisplayName : '';
213
- }
214
- },
215
- methods: {
216
- handleNewImageUrl(url) {
217
- this.tournament.ImageLink = url;
218
- this.$emit('update:image', { 'ImageLink': url });
219
- },
207
+ registrationCutOff() {
208
+ return this.tournament?.RegistrationCutOff || new Date();
209
+ },
210
+ description() {
211
+ return this.tournament?.Description || '';
212
+ },
213
+ getDefaultPerson: function () {
214
+ const person = this.persons.find(p => p.PersonId === this.tournament?.PrimaryContactId);
215
+ return person ? person.DisplayName : '';
216
+ }
217
+ },
218
+ methods: {
219
+ handleNewImageUrl(url) {
220
+ this.$emit('update:image', { 'ImageLink': url });
221
+ },
220
222
  handleAddNewAddress(newAddress) {
221
223
  this.$emit('add:newAddress', newAddress);
222
224
  },
223
- handleAddressUpdate(updatedAddress) {
224
- this.$emit('update:address', updatedAddress);
225
- },
226
- handlePersonUpdate(person, value) {
227
- this.$emit('update:tournament', { 'PrimaryContactId': value.PersonId });
228
- },
229
- emitUpdate(field, value) {
230
- this.$emit('update:tournament', { [field]: value });
231
- }
232
- }
233
- };
225
+ handleAddressUpdate(updatedAddress) {
226
+ this.$emit('update:address', updatedAddress);
227
+ },
228
+ handleAddNewPerson(personName) {
229
+ this.$emit('add:newPerson', personName);
230
+ },
231
+ handlePrimaryContactUpdate(person) {
232
+ if (!person) return;
233
+ this.$emit('update:tournament', { 'PrimaryContactId': person.PersonId });
234
+ },
235
+ emitUpdate(field, value) {
236
+ this.$emit('update:tournament', { [field]: value });
237
+ },
238
+ getFieldValidation(field) {
239
+ return this.validation?.[field] || { invalid: false, message: '' };
240
+ },
241
+ isFieldInvalid(field) {
242
+ return this.getFieldValidation(field).invalid;
243
+ },
244
+ getValidationLabel(field, label) {
245
+ const fieldValidation = this.getFieldValidation(field);
246
+ if (!fieldValidation.invalid) return label;
247
+ return `${label} - ${fieldValidation.message}`;
248
+ }
249
+ }
250
+ };
234
251
  </script>
@@ -1,32 +1,77 @@
1
- import TournamentPageTwo from "./TouranmentPageTwo.vue";
2
- import mockTournaments from "../../../../mocks/tournamentMock.js";
3
-
4
- export default {
5
- title: 'Templates/TournamentManagement/TournamentPageTwo',
6
- component: TournamentPageTwo,
1
+ import TournamentPageTwo from "./TournamentPageTwo.vue";
2
+ import mockTournaments from "../../../../mocks/tournamentMock.js";
3
+
4
+ const hostedTournament = {
5
+ ...mockTournaments[0],
6
+ HostedOnM2: true,
7
+ ResultsEnabled: false,
8
+ Visibility: 'Open',
9
+ WaiverScope: 'None',
10
+ RegistrationLink: 'https://example.com/register',
11
+ RulesLink: 'https://example.com/rules',
12
+ };
13
+
14
+ const nonHostedTournament = {
15
+ ...hostedTournament,
16
+ HostedOnM2: false,
17
+ ResultsEnabled: false,
18
+ };
19
+
20
+ export default {
21
+ title: 'Templates/TournamentManagement/TournamentPageTwo',
22
+ component: TournamentPageTwo,
7
23
  tags: ["autodocs"],
8
- args: {
9
- tournament: mockTournaments[0],
10
- },
11
- argTypes: {
12
- tournament: {
13
- control: { type: "object" },
14
- },
15
- },
16
- };
17
-
18
- export const Default = {
19
- args: {
20
- tournament: mockTournaments[0],
21
- },
22
- };
23
-
24
- export const EmptyTournament = {
25
- args: {
26
- tournament: {
27
- hostedOnM2: false,
28
- registrationLink: "",
29
- rulesLink: "",
30
- },
31
- },
32
- };
24
+ args: {
25
+ tournament: hostedTournament,
26
+ isNewTournament: true,
27
+ },
28
+ argTypes: {
29
+ tournament: {
30
+ control: { type: "object" },
31
+ },
32
+ isNewTournament: {
33
+ control: { type: "boolean" },
34
+ },
35
+ },
36
+ };
37
+
38
+ export const Default = {
39
+ args: {
40
+ tournament: hostedTournament,
41
+ },
42
+ };
43
+
44
+ export const EmptyTournament = {
45
+ args: {
46
+ tournament: {
47
+ HostedOnM2: false,
48
+ ResultsEnabled: false,
49
+ Visibility: 'Open',
50
+ WaiverScope: 'None',
51
+ RegistrationLink: '',
52
+ RulesLink: '',
53
+ },
54
+ },
55
+ };
56
+
57
+ export const NotHosted = {
58
+ args: {
59
+ tournament: nonHostedTournament,
60
+ },
61
+ };
62
+
63
+ export const ResultsUploadEnabled = {
64
+ args: {
65
+ tournament: {
66
+ ...nonHostedTournament,
67
+ ResultsEnabled: true,
68
+ },
69
+ },
70
+ };
71
+
72
+ export const EditMode = {
73
+ args: {
74
+ tournament: hostedTournament,
75
+ isNewTournament: false,
76
+ },
77
+ };
@@ -12,7 +12,7 @@
12
12
  :size="'xl'"
13
13
  :text="'Do you want MeyerSquared to host your tournament?'"
14
14
  :weight="'normal'"
15
- data-testid="text-ferrotas-to-host"
15
+ data-testid="text-meyer-squared-to-host"
16
16
  class="border-b border-dropdownSelect mb-2"
17
17
  />
18
18
  <BaseText
@@ -32,7 +32,7 @@
32
32
  label="Yes"
33
33
  size="sm"
34
34
  type="square"
35
- :selected="!!tournament.HostedOnM2"
35
+ :selected="isHosted"
36
36
  @buttonClick="handleHostedChoice(true)"
37
37
  />
38
38
  <BaseButton
@@ -41,14 +41,13 @@
41
41
  label="No"
42
42
  size="sm"
43
43
  type="square"
44
- :selected="!tournament.HostedOnM2"
44
+ :selected="!isHosted"
45
45
  @buttonClick="handleHostedChoice(false)"
46
46
  />
47
47
  </div>
48
48
  </section>
49
49
 
50
- <!-- Results Import (only when NOT hosted) -->
51
- <div v-if="!tournament.HostedOnM2" class="flex flex-col pb-4 mt-10">
50
+ <div v-if="!isHosted" class="flex flex-col pb-4 mt-10">
52
51
  <BaseText
53
52
  :color="'primaryHighlight'"
54
53
  :size="'xl'"
@@ -73,22 +72,22 @@
73
72
  label="Not now"
74
73
  size="sm"
75
74
  type="square"
76
- :selected="!tournament.ResultsEnabled"
75
+ :selected="!resultsEnabled"
77
76
  @buttonClick="emitUpdate('ResultsEnabled', false)"
78
77
  />
79
78
  <BaseButton
80
79
  class="w-1/2 ml-1"
81
80
  color="neutral"
82
- label="Yes, Ill upload results"
81
+ label="Yes, I'll upload results"
83
82
  size="sm"
84
83
  type="square"
85
- :selected="!!tournament.ResultsEnabled"
84
+ :selected="resultsEnabled"
86
85
  @buttonClick="emitUpdate('ResultsEnabled', true)"
87
86
  />
88
87
  </div>
89
88
  </section>
90
89
 
91
- <div v-if="tournament.ResultsEnabled" class="w-full flex flex-col items-center mt-6">
90
+ <div v-if="resultsEnabled" class="w-full flex flex-col items-center mt-6">
92
91
  <BaseText
93
92
  :color="'quaternary'"
94
93
  :size="'sm'"
@@ -98,9 +97,7 @@
98
97
  data-testid="text-results-anytime"
99
98
  />
100
99
 
101
- <!-- This does not navigate by itself; it just emits an intent.
102
- Parent can switch to a "Results Import" tab/screen. -->
103
- <BaseButton
100
+ <BaseButton
104
101
  class="w-3/4"
105
102
  color="neutral"
106
103
  label="Go to Results Import"
@@ -111,8 +108,7 @@
111
108
  </div>
112
109
  </div>
113
110
 
114
- <!-- Visibility (only when hosted) -->
115
- <div v-if="tournament.HostedOnM2" class="flex flex-col pb-4 mt-10">
111
+ <div v-if="isHosted" class="flex flex-col pb-4 mt-10">
116
112
  <BaseText
117
113
  :color="'primaryHighlight'"
118
114
  :invalid="validation.visibility"
@@ -133,15 +129,14 @@
133
129
  <BaseRadioGroup
134
130
  :invalid="validation.visibility"
135
131
  :items="visibilityItems"
136
- :value="tournament.Visibility"
132
+ :value="visibility"
137
133
  @update:value="value => emitUpdate('Visibility', value)"
138
134
  class="w-3/4"
139
135
  />
140
136
  </div>
141
137
  </div>
142
138
 
143
- <!-- Waiver Required (only when hosted) -->
144
- <div v-if="tournament.HostedOnM2" class="flex flex-col pb-4 mt-10">
139
+ <div v-if="isHosted" class="flex flex-col pb-4 mt-10">
145
140
  <BaseText
146
141
  :color="'primaryHighlight'"
147
142
  :invalid="validation.waiverScope"
@@ -162,7 +157,7 @@
162
157
  <BaseRadioGroup
163
158
  :invalid="validation.waiverScope"
164
159
  :items="waiverItems"
165
- :value="tournament.WaiverScope"
160
+ :value="waiverScope"
166
161
  @update:value="value => emitUpdate('WaiverScope', value)"
167
162
  class="w-3/4"
168
163
  />
@@ -190,7 +185,7 @@
190
185
 
191
186
  <BaseText :color="'quaternary'" :size="'sm'" :text="'Registration (Payment) Link'" :weight="'normal'" class="mb-1" data-testid="text-registration-link"/>
192
187
  <BaseInput
193
- :value="tournament.RegistrationLink"
188
+ :value="registrationLink"
194
189
  :addBorder="true"
195
190
  class="pb-2 w-full mb-4"
196
191
  iconName="fa-dash"
@@ -200,7 +195,7 @@
200
195
 
201
196
  <BaseText :color="'quaternary'" :size="'sm'" :text="'Tournament Rules and Documents'" :weight="'normal'" class="mb-1" data-testid="text-rules-link"/>
202
197
  <BaseInput
203
- :value="tournament.RulesLink"
198
+ :value="rulesLink"
204
199
  :addBorder="true"
205
200
  class="pb-2 w-full"
206
201
  iconName="fa-dash"
@@ -234,19 +229,37 @@ export default {
234
229
  waiverScope: false,
235
230
  },
236
231
  visibilityItems: [
237
- { label: 'Open', value: 'Open', description: 'Viewable To Everyone' },
238
- { label: 'Club', value: 'Club', description: 'Viewable Only to Members of Your Club' },
239
- { label: 'Private', value: 'Private', description: 'Only Viewable by you' },
240
- ],
241
- waiverItems: [
242
- { label: 'No', value: 'none', description: 'No waiver required' },
243
- { label: 'Club Waiver', value: 'club', description: 'Sign once, good forever' },
244
- { label: 'Tournament Waiver', value: 'tournament', description: 'Only for this tournament' },
245
- ],
232
+ { label: 'Open', value: 'Open', description: 'Viewable to everyone' },
233
+ { label: 'Club', value: 'Club', description: 'Viewable only to members of your club' },
234
+ { label: 'Private', value: 'Private', description: 'Only viewable by you' },
235
+ ],
236
+ waiverItems: [
237
+ { label: 'No', value: 'None', description: 'No waiver required' },
238
+ { label: 'Club Waiver', value: 'Club', description: 'Sign once, good forever' },
239
+ { label: 'Tournament Waiver', value: 'Tournament', description: 'Only for this tournament' },
240
+ ],
246
241
  };
247
- },
248
- computed: {
249
- hostingDescription() {
242
+ },
243
+ computed: {
244
+ isHosted() {
245
+ return !!this.tournament?.HostedOnM2;
246
+ },
247
+ resultsEnabled() {
248
+ return !!this.tournament?.ResultsEnabled;
249
+ },
250
+ visibility() {
251
+ return this.tournament?.Visibility || 'Open';
252
+ },
253
+ waiverScope() {
254
+ return this.tournament?.WaiverScope || 'None';
255
+ },
256
+ registrationLink() {
257
+ return this.tournament?.RegistrationLink || '';
258
+ },
259
+ rulesLink() {
260
+ return this.tournament?.RulesLink || '';
261
+ },
262
+ hostingDescription() {
250
263
  return `If you select 'No', your tournament will be featured on our main calendar and you can link out to your registration page.\n\n`
251
264
  + `You can also publish final results on MeyerSquared later (any time) to support ratings and historical records.\n\n`
252
265
  + `By selecting 'Yes', you'll gain access to the full MeyerSquared platform to run pools, brackets, and live scoring.`;
@@ -256,16 +269,22 @@ export default {
256
269
  + `You can upload results now, or come back after the tournament and upload them later.`;
257
270
  }
258
271
  },
259
- methods: {
260
- emitUpdate(field, value) {
261
- this.$emit('update:tournament', { [field]: value });
262
- },
263
- handleHostedChoice(isHosted) {
264
- this.emitUpdate('HostedOnM2', isHosted);
272
+ methods: {
273
+ emitUpdate(field, value) {
274
+ this.$emit('update:tournament', { [field]: value });
275
+ },
276
+ emitTournamentUpdate(updatedTournamentFields) {
277
+ this.$emit('update:tournament', updatedTournamentFields);
278
+ },
279
+ handleHostedChoice(isHosted) {
280
+ if (isHosted) {
281
+ this.emitTournamentUpdate({ HostedOnM2: true, ResultsEnabled: false });
282
+ return;
283
+ }
284
+
285
+ this.emitUpdate('HostedOnM2', false);
286
+ }
287
+ }
288
+ };
289
+ </script>
265
290
 
266
- // If they switch to Hosted, results import doesn't apply. Clear it to avoid confusion.
267
- if (isHosted) this.emitUpdate('ResultsEnabled', false);
268
- }
269
- }
270
- };
271
- </script>
@@ -1,48 +0,0 @@
1
- import FencerAdmin from './FencerAdmin.vue';
2
- import personsMock from "../../../../mocks/personsMock.js";
3
-
4
- export default {
5
- title: 'Templates/PersonManagement/Admin/FencerAdmin',
6
- component: FencerAdmin,
7
- tags: ['autodocs'],
8
- args: {
9
- person: personsMock
10
- },
11
- argTypes: {
12
- person: { control: { type: 'object' } }
13
- }
14
- };
15
-
16
- export const Default = {
17
- args: {
18
- person: personsMock
19
- }
20
- };
21
-
22
- export const WithAdminAccess = {
23
- args: {
24
- person: {
25
- ...personsMock,
26
- AccessLevel: 'Admin',
27
- HemaRatingsId: '12345'
28
- }
29
- }
30
- };
31
-
32
- export const WithoutHemaRating = {
33
- args: {
34
- person: {
35
- ...personsMock[0],
36
- HemaRatingsId: ''
37
- }
38
- }
39
- };
40
-
41
- export const WithClubAccess = {
42
- args: {
43
- person: {
44
- ...personsMock[0],
45
- AccessLevel: 'Club'
46
- }
47
- }
48
- };