@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.
- package/AGENTS.md +3 -0
- package/dist/HemaTournamentUI-lib.es.js +10512 -10219
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +14 -0
- package/dist/hematournamentui.css +1 -1
- package/package.json +92 -92
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +1 -1
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +1 -1
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +2 -2
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +25 -22
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +31 -29
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.vue +2 -4
- package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +31 -31
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.stories.js +6 -6
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +64 -53
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.stories.js +6 -7
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.vue +18 -10
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +4 -4
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +64 -45
- package/src/stories/Organisms/Containers/Pool/Pool.vue +1 -1
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +35 -20
- package/src/stories/Templates/Assignment/Assignment.stories.js +17 -15
- package/src/stories/Templates/Assignment/Assignment.vue +71 -40
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.stories.js +49 -30
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.vue +29 -28
- package/src/stories/Templates/ClubManagement/{ClubMangement.stories.js → ClubManagement.stories.js} +74 -59
- package/src/stories/Templates/ClubManagement/ClubManagement.vue +104 -92
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +92 -97
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +37 -33
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +11 -14
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +34 -37
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.stories.js +11 -10
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +8 -8
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.stories.js +13 -16
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.vue +15 -19
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.stories.js +25 -24
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.vue +28 -34
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +54 -19
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +75 -68
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +55 -45
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +47 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +56 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +71 -73
- package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +18 -16
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +9 -6
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.stories.js +22 -19
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.vue +44 -36
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +30 -23
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +55 -58
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +67 -0
- package/src/stories/Templates/PersonManagement/Admin/{Administration.vue → Administration/Administration.vue} +94 -87
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -0
- package/src/stories/Templates/PersonManagement/Admin/{FencerAdmin.vue → FencerAdmin/FencerAdmin.vue} +90 -77
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -0
- package/src/stories/Templates/PersonManagement/Admin/{MergeAccounts.vue → MergeAccounts/MergeAccounts.vue} +258 -242
- package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +28 -28
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +1 -1
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +45 -28
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.vue +22 -16
- package/src/stories/Templates/TournamentManagement/{TournamentMangement.stories.js → TournamentManagement.stories.js} +68 -39
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +199 -153
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +113 -0
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +123 -106
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js +76 -31
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/{TouranmentPageTwo.vue → TournamentPageTwo.vue} +63 -44
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin.stories.js +0 -48
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TouranmentPageOne.stories.js +0 -63
package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import TournamentForm from "./TournamentPageOne.vue";
|
|
2
|
+
import mockLocation from "../../../../mocks/locationMock.js";
|
|
3
|
+
import mockTournaments from "../../../../mocks/tournamentMock.js";
|
|
4
|
+
import mockPersons from "../../../../mocks/personsMock.js";
|
|
5
|
+
|
|
6
|
+
const validTournamentFields = {
|
|
7
|
+
Name: { invalid: false, message: '' },
|
|
8
|
+
Address: { invalid: false, message: '' },
|
|
9
|
+
StartDate: { invalid: false, message: '' },
|
|
10
|
+
TotalDays: { invalid: false, message: '' },
|
|
11
|
+
RegistrationCutOff: { invalid: false, message: '' },
|
|
12
|
+
Description: { invalid: false, message: '' },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const invalidTournamentFields = {
|
|
16
|
+
Name: { invalid: true, message: 'Tournament name is required' },
|
|
17
|
+
Address: { invalid: true, message: 'Location is required' },
|
|
18
|
+
StartDate: { invalid: true, message: 'Start date is required' },
|
|
19
|
+
TotalDays: { invalid: true, message: 'Must be at least 1 day' },
|
|
20
|
+
RegistrationCutOff: { invalid: true, message: 'Registration cut off is required' },
|
|
21
|
+
Description: { invalid: true, message: 'Description is required' },
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const emptyTournament = {
|
|
25
|
+
Name: '',
|
|
26
|
+
Address: { Name: '' },
|
|
27
|
+
StartDate: new Date().toISOString().slice(0, 10),
|
|
28
|
+
TotalDays: 1,
|
|
29
|
+
RegistrationCutOff: new Date().toISOString().slice(0, 10),
|
|
30
|
+
PrimaryContactId: mockPersons?.[0]?.PersonId ?? 0,
|
|
31
|
+
Images: [{ URL: '' }],
|
|
32
|
+
Description: '',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
title: 'Templates/TournamentManagement/TournamentPageOne',
|
|
37
|
+
component: TournamentForm,
|
|
38
|
+
tags: ["autodocs"],
|
|
39
|
+
args: {
|
|
40
|
+
tournament: mockTournaments[0],
|
|
41
|
+
locations: mockLocation,
|
|
42
|
+
persons: mockPersons,
|
|
43
|
+
validation: validTournamentFields,
|
|
44
|
+
isNewTournament: true,
|
|
45
|
+
userLevel: 'Club',
|
|
46
|
+
},
|
|
47
|
+
argTypes: {
|
|
48
|
+
tournament: {
|
|
49
|
+
control: { type: "object" },
|
|
50
|
+
},
|
|
51
|
+
locations: {
|
|
52
|
+
control: { type: "object" },
|
|
53
|
+
},
|
|
54
|
+
persons: {
|
|
55
|
+
control: { type: "object" },
|
|
56
|
+
},
|
|
57
|
+
validation: {
|
|
58
|
+
control: { type: "object" },
|
|
59
|
+
},
|
|
60
|
+
isNewTournament: {
|
|
61
|
+
control: { type: "boolean" },
|
|
62
|
+
},
|
|
63
|
+
userLevel: {
|
|
64
|
+
control: { type: "text" },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Default = {
|
|
70
|
+
args: {
|
|
71
|
+
tournament: mockTournaments[0],
|
|
72
|
+
locations: mockLocation,
|
|
73
|
+
persons: mockPersons,
|
|
74
|
+
validation: validTournamentFields,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const EmptyTournament = {
|
|
79
|
+
args: {
|
|
80
|
+
tournament: emptyTournament,
|
|
81
|
+
locations: mockLocation,
|
|
82
|
+
persons: mockPersons,
|
|
83
|
+
validation: validTournamentFields,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const EditMode = {
|
|
88
|
+
args: {
|
|
89
|
+
tournament: mockTournaments[0],
|
|
90
|
+
locations: mockLocation,
|
|
91
|
+
persons: mockPersons,
|
|
92
|
+
validation: validTournamentFields,
|
|
93
|
+
isNewTournament: false,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const InvalidFields = {
|
|
98
|
+
args: {
|
|
99
|
+
tournament: emptyTournament,
|
|
100
|
+
locations: mockLocation,
|
|
101
|
+
persons: mockPersons,
|
|
102
|
+
validation: invalidTournamentFields,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const EmptyOptions = {
|
|
107
|
+
args: {
|
|
108
|
+
tournament: emptyTournament,
|
|
109
|
+
locations: [],
|
|
110
|
+
persons: [],
|
|
111
|
+
validation: validTournamentFields,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
@@ -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
|
|
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="
|
|
22
|
-
:title="
|
|
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="
|
|
32
|
-
:text="
|
|
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="
|
|
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="
|
|
55
|
-
:size="'sm'"
|
|
56
|
-
:text="
|
|
57
|
-
:weight="'normal'"
|
|
58
|
-
class="mb-1"
|
|
59
|
-
data-testid="text-start-date"
|
|
60
|
-
/>
|
|
61
|
-
<DatePicker
|
|
62
|
-
: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="
|
|
72
|
-
:placeholder="'Number of Days'"
|
|
73
|
-
:inputType="'number'"
|
|
74
|
-
:title="
|
|
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="
|
|
84
|
-
:size="'sm'"
|
|
85
|
-
:text="
|
|
86
|
-
:weight="'normal'"
|
|
87
|
-
class="mb-1"
|
|
88
|
-
data-testid="text-start-date"
|
|
89
|
-
/>
|
|
90
|
-
<DatePicker
|
|
91
|
-
: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="
|
|
102
|
-
:size="'sm'"
|
|
103
|
-
:text="
|
|
104
|
-
:weight="'normal'"
|
|
105
|
-
class="mb-1"
|
|
106
|
-
data-testid="text-description"
|
|
107
|
-
/>
|
|
108
|
-
<TextBoxEditor
|
|
109
|
-
:invalid="
|
|
110
|
-
:initialContent="
|
|
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
|
|
123
|
-
@person-selected="
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
227
|
-
this.$emit('
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
|
|
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>
|
package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js
CHANGED
|
@@ -1,32 +1,77 @@
|
|
|
1
|
-
import TournamentPageTwo from "./
|
|
2
|
-
import mockTournaments from "../../../../mocks/tournamentMock.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
};
|