@dcrackel/hematournamentui 1.0.712 → 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 (99) hide show
  1. package/.prettierignore +7 -7
  2. package/.storybook/main.js +3 -1
  3. package/README.md +30 -0
  4. package/package.json +96 -96
  5. package/prettier.config.js +16 -16
  6. package/src/main.js +1 -1
  7. package/src/mocks/getDEBouts-TableOf128.js +37 -37
  8. package/src/mocks/getDEBouts-TableOf64.js +35 -35
  9. package/src/stories/Atoms/Input/BaseInput.test.js +97 -97
  10. package/src/stories/Atoms/Input/BaseInput.vue +149 -149
  11. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -23
  12. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -35
  13. package/src/stories/Molecules/Indicators/RegistrationStatus/RegistrationStatus.vue +30 -30
  14. package/src/stories/Molecules/Menus/HoverActions/HoverActions.test.js +138 -0
  15. package/src/stories/Molecules/Menus/HoverActions/HoverActions.vue +212 -0
  16. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +6 -0
  17. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -18
  18. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -1
  19. package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +5 -1
  20. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +19 -10
  21. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +11 -7
  22. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -33
  23. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -45
  24. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -103
  25. package/src/stories/Organisms/Cards/Director/DirectorCard.test.js +82 -0
  26. package/src/stories/Organisms/Cards/Director/DirectorCard.vue +32 -51
  27. package/src/stories/Organisms/Cards/EditBout/EditBout.test.js +51 -51
  28. package/src/stories/Organisms/Cards/EventCard/EventCard.test.js +106 -106
  29. package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -298
  30. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +77 -60
  31. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +144 -143
  32. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +289 -256
  33. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -69
  34. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -80
  35. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +153 -153
  36. package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +4 -0
  37. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -31
  38. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -109
  39. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -192
  40. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +1 -0
  41. package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +247 -204
  42. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +89 -15
  43. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -29
  44. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -46
  45. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -21
  46. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -39
  47. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -145
  48. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -64
  49. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +36 -57
  50. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +101 -65
  51. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +14 -1
  52. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +52 -52
  53. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +10 -3
  54. package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -226
  55. package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
  56. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +137 -137
  57. package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -172
  58. package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -216
  59. package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -79
  60. package/src/stories/Organisms/Wizards/EditEventWizard/RuleSerialization.test.js +29 -29
  61. package/src/stories/Organisms/Wizards/EditEventWizard/WeaponSelection.test.js +138 -0
  62. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +123 -12
  63. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +178 -166
  64. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +35 -7
  65. package/src/stories/Templates/EventManagement/Bracket/BracketDirectorAssignment.test.js +242 -0
  66. package/src/stories/Templates/EventManagement/Bracket/BracketMobile.test.js +131 -0
  67. package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +42 -39
  68. package/src/stories/Templates/EventManagement/Bracket/BracketStories.test.js +80 -0
  69. package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.js +93 -0
  70. package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.test.js +152 -0
  71. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -39
  72. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -79
  73. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -93
  74. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -91
  75. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.test.js +121 -121
  76. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +9 -2
  77. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +5 -4
  78. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +81 -81
  79. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -39
  80. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +101 -101
  81. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -71
  82. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.vue +86 -86
  83. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -86
  84. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.vue +247 -247
  85. package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -170
  86. package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -156
  87. package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -329
  88. package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -329
  89. package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -42
  90. package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -84
  91. package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +114 -114
  92. package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -363
  93. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -116
  94. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +307 -307
  95. package/src/stories/Util/Validations/PersonManagementValidations.js +45 -45
  96. package/src/stories/Util/Validations/PriceValidation.js +6 -6
  97. package/src/stories/Util/boutDirectorAssignment.js +46 -0
  98. package/src/stories/Util/registrationStatus.js +11 -11
  99. package/src/stories/Util/tabs.js +19 -47
@@ -1,170 +1,170 @@
1
- <template>
2
- <section class="mt-2 min-h-80">
3
- <div>
4
- <div class="flex flex-col mb-4">
5
- <TitledInput
6
- :inputValue="person.DisplayName || ''"
7
- placeholder="Enter Display Name"
8
- :invalid="validation.DisplayName.invalid"
9
- :title="
10
- validation.DisplayName.invalid ? `DisplayName Name - ${validation.DisplayName.message}` : 'Display Name'
11
- "
12
- @update:value="emitUpdate('DisplayName', $event)"
13
- />
14
- </div>
15
-
16
- <div class="flex flex-col mb-4">
17
- <TitledInput
18
- :inputValue="getLegalName"
19
- placeholder="Enter Your Legal Name"
20
- :invalid="validation.LegalName.invalid"
21
- :title="
22
- validation.LegalName.invalid
23
- ? `Legal Name - ${validation.LegalName.message}`
24
- : 'Legal Name (not shown on site)'
25
- "
26
- @update:value="emitUpdate('LegalName', $event)"
27
- />
28
- </div>
29
-
30
- <div class="flex flex-col mb-4">
31
- <BaseText text="Club Name" size="sm" color="quaternary" />
32
- <DropDownMenu
33
- :label="formattedClubs.length < 2 ? 'Select Club' : ''"
34
- :items="formattedClubs"
35
- :selectedItem="getClubName"
36
- class="pb-2"
37
- @update:selectedItem="emitUpdate('Club', { Name: $event.text, ClubId: $event.link })"
38
- width="w-full"
39
- dropDownWidth="w-full"
40
- />
41
- </div>
42
-
43
- <div class="flex flex-col mb-4">
44
- <BaseText text="Preferred Pronouns" size="sm" color="quaternary" />
45
- <DropDownMenu
46
- :label="getPronounLabel"
47
- :items="pronouns"
48
- class="pb-2"
49
- :selectedItem="getSelectedPronouns"
50
- @update:selectedItem="emitUpdate('Pronouns', $event.text)"
51
- width="w-full"
52
- dropDownWidth="w-full"
53
- />
54
- </div>
55
-
56
- <div class="flex flex-col mb-4">
57
- <TitledInput
58
- :inputValue="getEmail || ''"
59
- inputType="email"
60
- placeholder="Enter Your Email"
61
- :invalid="validation.EmailAddress.invalid"
62
- :title="
63
- validation.EmailAddress.invalid ? `Email Address - ${validation.EmailAddress.message}` : 'Email Address'
64
- "
65
- @update:value="emitUpdate('EmailAddress', $event)"
66
- />
67
- </div>
68
-
69
- <div class="border-b border-dropdownSelect mt-6">
70
- <BaseText color="quinary" size="sm" text="PROFILE USE" weight="normal" data-testid="text-registration" />
71
- </div>
72
-
73
- <div class="my-4 w-full">
74
- <BaseText
75
- color="quinary"
76
- size="sm"
77
- text="Your information belongs to you..."
78
- weight="normal"
79
- data-testid="text-registration"
80
- class="mb-4"
81
- />
82
-
83
- <Toggle
84
- :checked="person.ShowData"
85
- label="Allow your name and profile image to be displayed on M² Website?"
86
- :labelLeft="false"
87
- @update:checked="emitUpdate('ShowData', $event)"
88
- />
89
-
90
- <Toggle
91
- :checked="person.ShareData"
92
- label="Share information with 3rd Parties? (like: Hema Ratings)"
93
- :labelLeft="false"
94
- @update:checked="emitUpdate('ShareData', $event)"
95
- />
96
- </div>
97
- </div>
98
- </section>
99
- </template>
100
-
101
- <script>
102
- import TitledInput from '../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
103
- import BaseText from '../../../Atoms/Text/BaseText.vue';
104
- import DropDownMenu from '../../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue';
105
- import Toggle from '../../../Molecules/Inputs/Toggle/Toggle.vue';
106
- import { getDraftEmailAddress, getDraftLegalName } from '../PersonManagementDraft.js';
107
-
108
- export default {
109
- name: 'BasicEdit',
110
- emits: ['update:person'], // Generic emit event
111
- components: { Toggle, DropDownMenu, BaseText, TitledInput },
112
- props: {
113
- person: {
114
- type: Object,
115
- required: true
116
- },
117
- fencingClubs: {
118
- type: Array,
119
- default: () => []
120
- },
121
- validation: {
122
- type: Object,
123
- required: true
124
- }
125
- },
126
- data() {
127
- return {
128
- pronouns: [
129
- { text: 'He/Him', link: 'He/Him' },
130
- { text: 'She/Her', link: 'She/Her' },
131
- { text: 'They/Them', link: 'They/Them' },
132
- { text: 'Other', link: 'Other' }
133
- ]
134
- };
135
- },
136
- computed: {
137
- formattedClubs() {
138
- return this.fencingClubs.map(club => ({
139
- text: club.Name,
140
- link: club.ClubId.toString()
141
- }));
142
- },
143
- getLegalName() {
144
- return getDraftLegalName(this.person);
145
- },
146
- getClubName() {
147
- return this.person?.Club
148
- ? { text: this.person.Club.Name, link: this.person.Club.ClubId }
149
- : { text: 'No Club', link: null };
150
- },
151
- getSelectedPronouns() {
152
- if (!this.person.Pronouns) {
153
- return { text: 'He/Him', link: 'He/Him' };
154
- }
155
- return { text: this.person.Pronouns, link: this.person.Pronouns };
156
- },
157
- getEmail() {
158
- return getDraftEmailAddress(this.person);
159
- },
160
- getPronounLabel() {
161
- return this.person.Pronouns ? '' : 'Please select your preferred pronouns';
162
- }
163
- },
164
- methods: {
165
- emitUpdate(field, value) {
166
- this.$emit('update:person', { field, value });
167
- }
168
- }
169
- };
170
- </script>
1
+ <template>
2
+ <section class="mt-2 min-h-80">
3
+ <div>
4
+ <div class="flex flex-col mb-4">
5
+ <TitledInput
6
+ :inputValue="person.DisplayName || ''"
7
+ placeholder="Enter Display Name"
8
+ :invalid="validation.DisplayName.invalid"
9
+ :title="
10
+ validation.DisplayName.invalid ? `DisplayName Name - ${validation.DisplayName.message}` : 'Display Name'
11
+ "
12
+ @update:value="emitUpdate('DisplayName', $event)"
13
+ />
14
+ </div>
15
+
16
+ <div class="flex flex-col mb-4">
17
+ <TitledInput
18
+ :inputValue="getLegalName"
19
+ placeholder="Enter Your Legal Name"
20
+ :invalid="validation.LegalName.invalid"
21
+ :title="
22
+ validation.LegalName.invalid
23
+ ? `Legal Name - ${validation.LegalName.message}`
24
+ : 'Legal Name (not shown on site)'
25
+ "
26
+ @update:value="emitUpdate('LegalName', $event)"
27
+ />
28
+ </div>
29
+
30
+ <div class="flex flex-col mb-4">
31
+ <BaseText text="Club Name" size="sm" color="quaternary" />
32
+ <DropDownMenu
33
+ :label="formattedClubs.length < 2 ? 'Select Club' : ''"
34
+ :items="formattedClubs"
35
+ :selectedItem="getClubName"
36
+ class="pb-2"
37
+ @update:selectedItem="emitUpdate('Club', { Name: $event.text, ClubId: $event.link })"
38
+ width="w-full"
39
+ dropDownWidth="w-full"
40
+ />
41
+ </div>
42
+
43
+ <div class="flex flex-col mb-4">
44
+ <BaseText text="Preferred Pronouns" size="sm" color="quaternary" />
45
+ <DropDownMenu
46
+ :label="getPronounLabel"
47
+ :items="pronouns"
48
+ class="pb-2"
49
+ :selectedItem="getSelectedPronouns"
50
+ @update:selectedItem="emitUpdate('Pronouns', $event.text)"
51
+ width="w-full"
52
+ dropDownWidth="w-full"
53
+ />
54
+ </div>
55
+
56
+ <div class="flex flex-col mb-4">
57
+ <TitledInput
58
+ :inputValue="getEmail || ''"
59
+ inputType="email"
60
+ placeholder="Enter Your Email"
61
+ :invalid="validation.EmailAddress.invalid"
62
+ :title="
63
+ validation.EmailAddress.invalid ? `Email Address - ${validation.EmailAddress.message}` : 'Email Address'
64
+ "
65
+ @update:value="emitUpdate('EmailAddress', $event)"
66
+ />
67
+ </div>
68
+
69
+ <div class="border-b border-dropdownSelect mt-6">
70
+ <BaseText color="quinary" size="sm" text="PROFILE USE" weight="normal" data-testid="text-registration" />
71
+ </div>
72
+
73
+ <div class="my-4 w-full">
74
+ <BaseText
75
+ color="quinary"
76
+ size="sm"
77
+ text="Your information belongs to you..."
78
+ weight="normal"
79
+ data-testid="text-registration"
80
+ class="mb-4"
81
+ />
82
+
83
+ <Toggle
84
+ :checked="person.ShowData"
85
+ label="Allow your name and profile image to be displayed on M² Website?"
86
+ :labelLeft="false"
87
+ @update:checked="emitUpdate('ShowData', $event)"
88
+ />
89
+
90
+ <Toggle
91
+ :checked="person.ShareData"
92
+ label="Share information with 3rd Parties? (like: Hema Ratings)"
93
+ :labelLeft="false"
94
+ @update:checked="emitUpdate('ShareData', $event)"
95
+ />
96
+ </div>
97
+ </div>
98
+ </section>
99
+ </template>
100
+
101
+ <script>
102
+ import TitledInput from '../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
103
+ import BaseText from '../../../Atoms/Text/BaseText.vue';
104
+ import DropDownMenu from '../../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue';
105
+ import Toggle from '../../../Molecules/Inputs/Toggle/Toggle.vue';
106
+ import { getDraftEmailAddress, getDraftLegalName } from '../PersonManagementDraft.js';
107
+
108
+ export default {
109
+ name: 'BasicEdit',
110
+ emits: ['update:person'], // Generic emit event
111
+ components: { Toggle, DropDownMenu, BaseText, TitledInput },
112
+ props: {
113
+ person: {
114
+ type: Object,
115
+ required: true
116
+ },
117
+ fencingClubs: {
118
+ type: Array,
119
+ default: () => []
120
+ },
121
+ validation: {
122
+ type: Object,
123
+ required: true
124
+ }
125
+ },
126
+ data() {
127
+ return {
128
+ pronouns: [
129
+ { text: 'He/Him', link: 'He/Him' },
130
+ { text: 'She/Her', link: 'She/Her' },
131
+ { text: 'They/Them', link: 'They/Them' },
132
+ { text: 'Other', link: 'Other' }
133
+ ]
134
+ };
135
+ },
136
+ computed: {
137
+ formattedClubs() {
138
+ return this.fencingClubs.map(club => ({
139
+ text: club.Name,
140
+ link: club.ClubId.toString()
141
+ }));
142
+ },
143
+ getLegalName() {
144
+ return getDraftLegalName(this.person);
145
+ },
146
+ getClubName() {
147
+ return this.person?.Club
148
+ ? { text: this.person.Club.Name, link: this.person.Club.ClubId }
149
+ : { text: 'No Club', link: null };
150
+ },
151
+ getSelectedPronouns() {
152
+ if (!this.person.Pronouns) {
153
+ return { text: 'He/Him', link: 'He/Him' };
154
+ }
155
+ return { text: this.person.Pronouns, link: this.person.Pronouns };
156
+ },
157
+ getEmail() {
158
+ return getDraftEmailAddress(this.person);
159
+ },
160
+ getPronounLabel() {
161
+ return this.person.Pronouns ? '' : 'Please select your preferred pronouns';
162
+ }
163
+ },
164
+ methods: {
165
+ emitUpdate(field, value) {
166
+ this.$emit('update:person', { field, value });
167
+ }
168
+ }
169
+ };
170
+ </script>
@@ -1,156 +1,156 @@
1
- import { ref } from 'vue';
2
- import PersonManagement from './PersonManagement.vue';
3
- import clubGetAllMock from '../../../mocks/clubGetAllMock.js';
4
- import personsMock from '../../../mocks/personsMock.js';
5
- import attendance from '../../../mocks/getAttendance.js';
6
- import allPersonsMock from '../../../mocks/personGetAllMock.js';
7
-
8
- export default {
9
- title: 'Templates/PersonManagement/PersonManagement',
10
- component: PersonManagement,
11
- tags: ['autodocs'],
12
- args: {
13
- personProfile: personsMock[1],
14
- fencingClubs: clubGetAllMock,
15
- attendance: attendance,
16
- uploadImageName: 'profile-test',
17
- uploadServer: 'http://localhost:3000/api/upload/',
18
- imageServer: 'https://meyersquaredimages.com/uploads/',
19
- userLevel: 'User',
20
- saving: false,
21
- disabled: false,
22
- draftResetKey: 0
23
- },
24
- argTypes: {
25
- personProfile: { control: { type: 'object' } },
26
- fencingClubs: { control: { type: 'object' } },
27
- attendance: { control: { type: 'object' } },
28
- uploadImageName: { control: { type: 'text' } },
29
- uploadServer: { control: { type: 'text' } },
30
- imageServer: { control: { type: 'text' } },
31
- userLevel: { control: { type: 'select' }, options: ['User', 'Club', 'Admin'] },
32
- saving: { control: 'boolean', description: 'Disables editing and actions while the parent saves.' },
33
- disabled: { control: 'boolean', description: 'Disables the entire profile form.' },
34
- draftResetKey: { control: 'number', description: 'Change after a confirmed reload to replace the draft.' },
35
- 'submit:person': { action: 'submit:person' },
36
- 'update:image': { action: 'update:image' },
37
- 'error:image': { action: 'error:image' }
38
- }
39
- };
40
-
41
- export const Default = {
42
- args: {
43
- personProfile: personsMock[1],
44
- fencingClubs: clubGetAllMock,
45
- attendance: attendance,
46
- uploadImageName: 'profile-test',
47
- uploadServer: 'http://localhost:3000/api/upload/',
48
- imageServer: 'http://localhost:3000/uploads/',
49
- userLevel: 'User'
50
- }
51
- };
52
-
53
- export const admin = {
54
- args: {
55
- personProfile: personsMock[1],
56
- fencingClubs: clubGetAllMock,
57
- attendance: attendance,
58
- people: allPersonsMock,
59
- uploadImageName: 'profile-test',
60
- uploadServer: 'http://localhost:3000/api/upload/',
61
- imageServer: 'http://localhost:3000/uploads/',
62
- userLevel: 'Admin'
63
- }
64
- };
65
-
66
- export const clubAdmin = {
67
- args: {
68
- personProfile: personsMock[1],
69
- fencingClubs: clubGetAllMock,
70
- people: allPersonsMock,
71
- attendance: attendance,
72
- uploadImageName: 'profile-test',
73
- uploadServer: 'http://localhost:3000/api/upload/',
74
- imageServer: 'http://localhost:3000/uploads/',
75
- userLevel: 'Club'
76
- }
77
- };
78
-
79
- export const adminWithLoading = {
80
- args: {
81
- personProfile: personsMock[1],
82
- fencingClubs: clubGetAllMock,
83
- attendance: attendance,
84
- people: allPersonsMock,
85
- uploadImageName: 'profile-test',
86
- uploadServer: 'http://localhost:3000/api/upload/',
87
- imageServer: 'http://localhost:3000/uploads/',
88
- userLevel: 'Admin',
89
- loading: true
90
- }
91
- };
92
-
93
- export const Saving = {
94
- args: { ...admin.args, saving: true }
95
- };
96
-
97
- export const Disabled = {
98
- args: { ...Default.args, disabled: true }
99
- };
100
-
101
- export const CurrentDraft = {
102
- args: {
103
- ...admin.args,
104
- personProfile: {
105
- ...personsMock[1],
106
- LegalName: 'Updated Legal Name',
107
- EmailAddress: 'draft@example.com',
108
- HemaRatingsId: null,
109
- Images: []
110
- }
111
- }
112
- };
113
-
114
- export const ResetDraft = {
115
- args: { ...admin.args },
116
- render: args => ({
117
- components: { PersonManagement },
118
- setup() {
119
- const revision = ref(0);
120
- const resetDraft = () => {
121
- revision.value += 1;
122
- };
123
- return { args, revision, resetDraft };
124
- },
125
- template: `
126
- <div>
127
- <button type="button" class="mb-4 rounded border border-dropdownSelect p-2 text-quinary" @click="resetDraft">
128
- Reset unsaved changes to supplied profile
129
- </button>
130
- <PersonManagement v-bind="args" :draftResetKey="revision" />
131
- </div>
132
- `
133
- })
134
- };
135
-
136
- export const emptyProfile = {
137
- args: {
138
- personProfile: {
139
- DisplayName: '',
140
- LegalName: '',
141
- EmailAddress: '',
142
- Club: { Name: 'No Club Affiliation ', ClubId: '17' },
143
- AccessLevel: 'User',
144
- ShareData: true,
145
- ShowData: true
146
- },
147
- fencingClubs: clubGetAllMock,
148
- attendance: attendance,
149
- people: allPersonsMock,
150
- uploadImageName: 'profile-test',
151
- uploadServer: 'http://localhost:3000/api/upload/',
152
- imageServer: 'http://localhost:3000/uploads/',
153
- userLevel: 'Admin',
154
- loading: false
155
- }
156
- };
1
+ import { ref } from 'vue';
2
+ import PersonManagement from './PersonManagement.vue';
3
+ import clubGetAllMock from '../../../mocks/clubGetAllMock.js';
4
+ import personsMock from '../../../mocks/personsMock.js';
5
+ import attendance from '../../../mocks/getAttendance.js';
6
+ import allPersonsMock from '../../../mocks/personGetAllMock.js';
7
+
8
+ export default {
9
+ title: 'Templates/PersonManagement/PersonManagement',
10
+ component: PersonManagement,
11
+ tags: ['autodocs'],
12
+ args: {
13
+ personProfile: personsMock[1],
14
+ fencingClubs: clubGetAllMock,
15
+ attendance: attendance,
16
+ uploadImageName: 'profile-test',
17
+ uploadServer: 'http://localhost:3000/api/upload/',
18
+ imageServer: 'https://meyersquaredimages.com/uploads/',
19
+ userLevel: 'User',
20
+ saving: false,
21
+ disabled: false,
22
+ draftResetKey: 0
23
+ },
24
+ argTypes: {
25
+ personProfile: { control: { type: 'object' } },
26
+ fencingClubs: { control: { type: 'object' } },
27
+ attendance: { control: { type: 'object' } },
28
+ uploadImageName: { control: { type: 'text' } },
29
+ uploadServer: { control: { type: 'text' } },
30
+ imageServer: { control: { type: 'text' } },
31
+ userLevel: { control: { type: 'select' }, options: ['User', 'Club', 'Admin'] },
32
+ saving: { control: 'boolean', description: 'Disables editing and actions while the parent saves.' },
33
+ disabled: { control: 'boolean', description: 'Disables the entire profile form.' },
34
+ draftResetKey: { control: 'number', description: 'Change after a confirmed reload to replace the draft.' },
35
+ 'submit:person': { action: 'submit:person' },
36
+ 'update:image': { action: 'update:image' },
37
+ 'error:image': { action: 'error:image' }
38
+ }
39
+ };
40
+
41
+ export const Default = {
42
+ args: {
43
+ personProfile: personsMock[1],
44
+ fencingClubs: clubGetAllMock,
45
+ attendance: attendance,
46
+ uploadImageName: 'profile-test',
47
+ uploadServer: 'http://localhost:3000/api/upload/',
48
+ imageServer: 'http://localhost:3000/uploads/',
49
+ userLevel: 'User'
50
+ }
51
+ };
52
+
53
+ export const admin = {
54
+ args: {
55
+ personProfile: personsMock[1],
56
+ fencingClubs: clubGetAllMock,
57
+ attendance: attendance,
58
+ people: allPersonsMock,
59
+ uploadImageName: 'profile-test',
60
+ uploadServer: 'http://localhost:3000/api/upload/',
61
+ imageServer: 'http://localhost:3000/uploads/',
62
+ userLevel: 'Admin'
63
+ }
64
+ };
65
+
66
+ export const clubAdmin = {
67
+ args: {
68
+ personProfile: personsMock[1],
69
+ fencingClubs: clubGetAllMock,
70
+ people: allPersonsMock,
71
+ attendance: attendance,
72
+ uploadImageName: 'profile-test',
73
+ uploadServer: 'http://localhost:3000/api/upload/',
74
+ imageServer: 'http://localhost:3000/uploads/',
75
+ userLevel: 'Club'
76
+ }
77
+ };
78
+
79
+ export const adminWithLoading = {
80
+ args: {
81
+ personProfile: personsMock[1],
82
+ fencingClubs: clubGetAllMock,
83
+ attendance: attendance,
84
+ people: allPersonsMock,
85
+ uploadImageName: 'profile-test',
86
+ uploadServer: 'http://localhost:3000/api/upload/',
87
+ imageServer: 'http://localhost:3000/uploads/',
88
+ userLevel: 'Admin',
89
+ loading: true
90
+ }
91
+ };
92
+
93
+ export const Saving = {
94
+ args: { ...admin.args, saving: true }
95
+ };
96
+
97
+ export const Disabled = {
98
+ args: { ...Default.args, disabled: true }
99
+ };
100
+
101
+ export const CurrentDraft = {
102
+ args: {
103
+ ...admin.args,
104
+ personProfile: {
105
+ ...personsMock[1],
106
+ LegalName: 'Updated Legal Name',
107
+ EmailAddress: 'draft@example.com',
108
+ HemaRatingsId: null,
109
+ Images: []
110
+ }
111
+ }
112
+ };
113
+
114
+ export const ResetDraft = {
115
+ args: { ...admin.args },
116
+ render: args => ({
117
+ components: { PersonManagement },
118
+ setup() {
119
+ const revision = ref(0);
120
+ const resetDraft = () => {
121
+ revision.value += 1;
122
+ };
123
+ return { args, revision, resetDraft };
124
+ },
125
+ template: `
126
+ <div>
127
+ <button type="button" class="mb-4 rounded border border-dropdownSelect p-2 text-quinary" @click="resetDraft">
128
+ Reset unsaved changes to supplied profile
129
+ </button>
130
+ <PersonManagement v-bind="args" :draftResetKey="revision" />
131
+ </div>
132
+ `
133
+ })
134
+ };
135
+
136
+ export const emptyProfile = {
137
+ args: {
138
+ personProfile: {
139
+ DisplayName: '',
140
+ LegalName: '',
141
+ EmailAddress: '',
142
+ Club: { Name: 'No Club Affiliation ', ClubId: '17' },
143
+ AccessLevel: 'User',
144
+ ShareData: true,
145
+ ShowData: true
146
+ },
147
+ fencingClubs: clubGetAllMock,
148
+ attendance: attendance,
149
+ people: allPersonsMock,
150
+ uploadImageName: 'profile-test',
151
+ uploadServer: 'http://localhost:3000/api/upload/',
152
+ imageServer: 'http://localhost:3000/uploads/',
153
+ userLevel: 'Admin',
154
+ loading: false
155
+ }
156
+ };