@dcrackel/hematournamentui 1.0.711 → 1.0.713

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/.prettierignore +7 -7
  2. package/.storybook/main.js +3 -1
  3. package/README.md +182 -148
  4. package/dist/HemaTournamentUI-lib.es.js +4150 -4039
  5. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  6. package/dist/hematournamentui-tailwind.css +11 -0
  7. package/package.json +96 -96
  8. package/prettier.config.js +16 -16
  9. package/src/main.js +1 -1
  10. package/src/mocks/getDEBouts-TableOf128.js +37 -37
  11. package/src/mocks/getDEBouts-TableOf64.js +35 -35
  12. package/src/stories/Atoms/Input/BaseInput.test.js +97 -97
  13. package/src/stories/Atoms/Input/BaseInput.vue +149 -149
  14. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -23
  15. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -35
  16. package/src/stories/Molecules/Indicators/RegistrationStatus/RegistrationStatus.vue +30 -0
  17. package/src/stories/Molecules/Menus/HoverActions/HoverActions.test.js +138 -0
  18. package/src/stories/Molecules/Menus/HoverActions/HoverActions.vue +212 -0
  19. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +6 -0
  20. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -18
  21. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -1
  22. package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +5 -1
  23. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +19 -10
  24. package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +11 -7
  25. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -33
  26. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -45
  27. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -103
  28. package/src/stories/Organisms/Cards/Director/DirectorCard.test.js +82 -0
  29. package/src/stories/Organisms/Cards/Director/DirectorCard.vue +32 -51
  30. package/src/stories/Organisms/Cards/EditBout/EditBout.test.js +51 -51
  31. package/src/stories/Organisms/Cards/EventCard/EventCard.stories.js +41 -1
  32. package/src/stories/Organisms/Cards/EventCard/EventCard.test.js +106 -0
  33. package/src/stories/Organisms/Cards/EventCard/EventCard.vue +62 -30
  34. package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -298
  35. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +77 -60
  36. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +144 -143
  37. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +289 -256
  38. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -69
  39. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -80
  40. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +153 -153
  41. package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +4 -0
  42. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -31
  43. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -109
  44. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -192
  45. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +1 -0
  46. package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +247 -204
  47. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +89 -15
  48. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -29
  49. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -46
  50. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -21
  51. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -39
  52. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -145
  53. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -64
  54. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +36 -57
  55. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +101 -65
  56. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +14 -1
  57. package/src/stories/Organisms/Headers/AttendanceSummary/AttendanceSummary.vue +12 -5
  58. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +52 -48
  59. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +256 -227
  60. package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -226
  61. package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
  62. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +137 -133
  63. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.test.js +221 -191
  64. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +372 -366
  65. package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -172
  66. package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -216
  67. package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -79
  68. package/src/stories/Organisms/Wizards/EditEventWizard/RuleSerialization.test.js +29 -0
  69. package/src/stories/Organisms/Wizards/EditEventWizard/WeaponSelection.test.js +138 -0
  70. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +123 -12
  71. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +178 -166
  72. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +35 -7
  73. package/src/stories/Templates/EventManagement/Bracket/BracketDirectorAssignment.test.js +242 -0
  74. package/src/stories/Templates/EventManagement/Bracket/BracketMobile.test.js +131 -0
  75. package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +42 -39
  76. package/src/stories/Templates/EventManagement/Bracket/BracketStories.test.js +80 -0
  77. package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.js +93 -0
  78. package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.test.js +152 -0
  79. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -39
  80. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -79
  81. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -93
  82. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -91
  83. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.stories.js +31 -1
  84. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.test.js +121 -121
  85. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +9 -2
  86. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +5 -4
  87. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +81 -81
  88. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -39
  89. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +101 -101
  90. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -71
  91. package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.vue +86 -86
  92. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -86
  93. package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.vue +247 -247
  94. package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -170
  95. package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -156
  96. package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -329
  97. package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -329
  98. package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -42
  99. package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +58 -45
  100. package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -84
  101. package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +114 -114
  102. package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -363
  103. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -116
  104. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +307 -307
  105. package/src/stories/Util/Validations/PersonManagementValidations.js +45 -45
  106. package/src/stories/Util/Validations/PriceValidation.js +6 -6
  107. package/src/stories/Util/boutDirectorAssignment.js +46 -0
  108. package/src/stories/Util/registrationStatus.js +11 -0
  109. package/src/stories/Util/tabs.js +19 -47
@@ -1,91 +1,91 @@
1
- <template>
2
- <section>
3
- <EditEventsTopMenu :currentTab="'Edit'" :tabs="tabs(userLevel, isMobile)" @tabMenuClick="handleTabMenuClick" />
4
-
5
- <div class="w-full flex flex-row justify-center mt-3">
6
- <EditEventWizard
7
- :event="event"
8
- :rules="rules"
9
- :weapons="weapons"
10
- :userLevel="userLevel"
11
- :editMode="editMode"
12
- :step="step"
13
- :saving="saving"
14
- :saveError="saveError"
15
- :saveNotice="saveNotice"
16
- @save:step="$emit('save:step', $event)"
17
- @navigate:step="$emit('navigate:step', $event)"
18
- @update:dirty="$emit('update:dirty', $event)"
19
- @update:cancel="$emit('update:cancel')"
20
- @update:submit="handleSubmit"
21
- />
22
- </div>
23
- </section>
24
- </template>
25
-
26
- <script>
27
- import EditEventsTopMenu from '../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue';
28
- import EditEventWizard from '../../../Organisms/Wizards/EditEventWizard/EditEventWizard.vue';
29
- import { tabs } from '../../../Util/tabs.js';
30
-
31
- export default {
32
- emits: ['tab:menu-click', 'update:submit', 'save:step', 'navigate:step', 'update:dirty', 'update:cancel'],
33
- components: {
34
- EditEventWizard,
35
- EditEventsTopMenu
36
- },
37
- props: {
38
- editMode: { type: Boolean, default: false },
39
- step: { type: Number, default: 1 },
40
- saving: { type: Boolean, default: false },
41
- saveError: { type: String, default: '' },
42
- saveNotice: { type: String, default: '' },
43
-
44
- event: {
45
- type: Object,
46
- required: true
47
- },
48
- weapons: {
49
- type: Array,
50
- required: true
51
- },
52
- rules: {
53
- type: Array,
54
- required: true
55
- },
56
- userLevel: {
57
- type: String,
58
- default: 'Club'
59
- }
60
- },
61
- data() {
62
- return {
63
- tabs,
64
- windowWidth: window.innerWidth
65
- };
66
- },
67
- mounted() {
68
- window.addEventListener('resize', this.handleResize);
69
- },
70
- beforeUnmount() {
71
- window.removeEventListener('resize', this.handleResize);
72
- },
73
- computed: {
74
- isMobile() {
75
- return this.windowWidth <= 748;
76
- }
77
- },
78
- methods: {
79
- handleTabMenuClick(value) {
80
- if (this.saving) return;
81
- this.$emit('tab:menu-click', value);
82
- },
83
- handleSubmit(value) {
84
- this.$emit('update:submit', value);
85
- },
86
- handleResize() {
87
- this.windowWidth = window.innerWidth;
88
- }
89
- }
90
- };
91
- </script>
1
+ <template>
2
+ <section>
3
+ <EditEventsTopMenu :currentTab="'Edit'" :tabs="tabs(userLevel, isMobile)" @tabMenuClick="handleTabMenuClick" />
4
+
5
+ <div class="w-full flex flex-row justify-center mt-3">
6
+ <EditEventWizard
7
+ :event="event"
8
+ :rules="rules"
9
+ :weapons="weapons"
10
+ :userLevel="userLevel"
11
+ :editMode="editMode"
12
+ :step="step"
13
+ :saving="saving"
14
+ :saveError="saveError"
15
+ :saveNotice="saveNotice"
16
+ @save:step="$emit('save:step', $event)"
17
+ @navigate:step="$emit('navigate:step', $event)"
18
+ @update:dirty="$emit('update:dirty', $event)"
19
+ @update:cancel="$emit('update:cancel')"
20
+ @update:submit="handleSubmit"
21
+ />
22
+ </div>
23
+ </section>
24
+ </template>
25
+
26
+ <script>
27
+ import EditEventsTopMenu from '../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue';
28
+ import EditEventWizard from '../../../Organisms/Wizards/EditEventWizard/EditEventWizard.vue';
29
+ import { tabs } from '../../../Util/tabs.js';
30
+
31
+ export default {
32
+ emits: ['tab:menu-click', 'update:submit', 'save:step', 'navigate:step', 'update:dirty', 'update:cancel'],
33
+ components: {
34
+ EditEventWizard,
35
+ EditEventsTopMenu
36
+ },
37
+ props: {
38
+ editMode: { type: Boolean, default: false },
39
+ step: { type: Number, default: 1 },
40
+ saving: { type: Boolean, default: false },
41
+ saveError: { type: String, default: '' },
42
+ saveNotice: { type: String, default: '' },
43
+
44
+ event: {
45
+ type: Object,
46
+ required: true
47
+ },
48
+ weapons: {
49
+ type: Array,
50
+ required: true
51
+ },
52
+ rules: {
53
+ type: Array,
54
+ required: true
55
+ },
56
+ userLevel: {
57
+ type: String,
58
+ default: 'Club'
59
+ }
60
+ },
61
+ data() {
62
+ return {
63
+ tabs,
64
+ windowWidth: window.innerWidth
65
+ };
66
+ },
67
+ mounted() {
68
+ window.addEventListener('resize', this.handleResize);
69
+ },
70
+ beforeUnmount() {
71
+ window.removeEventListener('resize', this.handleResize);
72
+ },
73
+ computed: {
74
+ isMobile() {
75
+ return this.windowWidth <= 748;
76
+ }
77
+ },
78
+ methods: {
79
+ handleTabMenuClick(value) {
80
+ if (this.saving) return;
81
+ this.$emit('tab:menu-click', value);
82
+ },
83
+ handleSubmit(value) {
84
+ this.$emit('update:submit', value);
85
+ },
86
+ handleResize() {
87
+ this.windowWidth = window.innerWidth;
88
+ }
89
+ }
90
+ };
91
+ </script>
@@ -110,6 +110,36 @@ export const WithWaitlist = {
110
110
  personsInTournament: [...activeRoster, ...waitlistedPersons],
111
111
  personsAll: personsAllMock,
112
112
  fencingClubs: clubsMock,
113
- event: makeEventWithCapacity(eventPersonGetEventById.event, activeRoster.length)
113
+ event: {
114
+ ...makeEventWithCapacity(eventPersonGetEventById.event, activeRoster.length),
115
+ RegistrationStatus: 'waitlist'
116
+ }
117
+ }
118
+ };
119
+
120
+ export const RegistrationOpen = {
121
+ args: {
122
+ personsInTournament: eventPersonGetEventById.persons,
123
+ personsAll: personsAllMock,
124
+ fencingClubs: clubsMock,
125
+ event: { ...eventPersonGetEventById.event, RegistrationStatus: 'open' }
126
+ }
127
+ };
128
+
129
+ export const RegistrationFull = {
130
+ args: {
131
+ personsInTournament: eventPersonGetEventById.persons,
132
+ personsAll: personsAllMock,
133
+ fencingClubs: clubsMock,
134
+ event: { ...eventPersonGetEventById.event, RegistrationStatus: 'full' }
135
+ }
136
+ };
137
+
138
+ export const RegistrationClosed = {
139
+ args: {
140
+ personsInTournament: eventPersonGetEventById.persons,
141
+ personsAll: personsAllMock,
142
+ fencingClubs: clubsMock,
143
+ event: { ...eventPersonGetEventById.event, RegistrationStatus: 'closed' }
114
144
  }
115
145
  };
@@ -1,121 +1,121 @@
1
- import { shallowMount } from '@vue/test-utils';
2
- import { describe, expect, it } from 'vitest';
3
- import DirectorModal from '../../../Molecules/Modals/DirectorModal/DirectorModal.vue';
4
- import EditBoutModal from '../../../Molecules/Modals/EditBoutModal/EditBoutModal.vue';
5
- import PoolLive from './PoolLive.vue';
6
-
7
- const createBout = (overrides = {}) => ({
8
- BoutId: 42,
9
- DEBoutId: null,
10
- EventId: 8,
11
- PoolId: 3,
12
- OrderIndex: 0,
13
- Status: 'Scheduled',
14
- Score1: 4,
15
- Score2: 3,
16
- Person1: { PersonId: 1, DisplayName: 'Fencer One' },
17
- Person2: { PersonId: 2, DisplayName: 'Fencer Two' },
18
- ...overrides
19
- });
20
-
21
- const mountPoolLive = bouts =>
22
- shallowMount(PoolLive, {
23
- props: {
24
- bouts,
25
- event: { EventRules: [] },
26
- hostingClubColors: {},
27
- connectedToServer: true,
28
- editMode: true
29
- }
30
- });
31
-
32
- describe('PoolLive bout ownership', () => {
33
- it('emits directing intent and waits for authoritative Active props', async () => {
34
- const bout = createBout();
35
- const wrapper = mountPoolLive([bout]);
36
-
37
- wrapper.vm.directBout(bout);
38
- await wrapper.vm.$nextTick();
39
-
40
- expect(wrapper.emitted('update:directing-bout')).toEqual([[bout]]);
41
- expect(wrapper.vm.localBouts[0].Status).toBe('Scheduled');
42
- expect(wrapper.findComponent(DirectorModal).props('show')).toBe(false);
43
-
44
- await wrapper.setProps({ bouts: [{ ...bout, Status: 'Active' }] });
45
-
46
- expect(wrapper.findComponent(DirectorModal).props('show')).toBe(true);
47
- expect(wrapper.findComponent(DirectorModal).props('bout').Status).toBe('Active');
48
- });
49
-
50
- it('resumes an active bout through directing intent', async () => {
51
- const bout = createBout({ Status: 'Active' });
52
- const wrapper = mountPoolLive([bout]);
53
-
54
- wrapper.vm.directBout(bout);
55
- await wrapper.vm.$nextTick();
56
-
57
- expect(wrapper.emitted('update:directing-bout')).toEqual([[bout]]);
58
- expect(wrapper.findComponent(DirectorModal).props('show')).toBe(true);
59
- });
60
-
61
- it('closes scoring without resetting status or scores', async () => {
62
- const bout = createBout({ Status: 'Active', Score1: 6, Score2: 5 });
63
- const wrapper = mountPoolLive([bout]);
64
-
65
- wrapper.vm.directBout(bout);
66
- await wrapper.vm.$nextTick();
67
- wrapper.findComponent(DirectorModal).vm.$emit('update:closeModal', bout);
68
- await wrapper.vm.$nextTick();
69
-
70
- expect(wrapper.vm.localBouts[0]).toMatchObject({ Status: 'Active', Score1: 6, Score2: 5 });
71
- expect(wrapper.emitted('update:bout')).toBeUndefined();
72
- expect(wrapper.findComponent(DirectorModal).props('show')).toBe(false);
73
- });
74
-
75
- it('submits the draft without assigning Completed or Ended', async () => {
76
- const bout = createBout({ Status: 'Active' });
77
- const submittedBout = { ...bout, Score1: 7 };
78
- const wrapper = mountPoolLive([bout]);
79
-
80
- wrapper.findComponent(DirectorModal).vm.$emit('submit:bout', submittedBout);
81
- await wrapper.vm.$nextTick();
82
-
83
- const emittedBout = wrapper.emitted('submit:bout')[0][0];
84
- expect(emittedBout).toEqual(submittedBout);
85
- expect(emittedBout.Status).toBe('Active');
86
- expect(emittedBout.Ended).toBeUndefined();
87
- });
88
-
89
- it('opens completed bouts for editing', async () => {
90
- const bout = createBout({ Status: 'Completed' });
91
- const wrapper = mountPoolLive([bout]);
92
-
93
- wrapper.vm.editBout(bout);
94
- await wrapper.vm.$nextTick();
95
-
96
- expect(wrapper.findComponent(EditBoutModal).props('show')).toBe(true);
97
- expect(wrapper.findComponent(DirectorModal).props('show')).toBe(false);
98
- });
99
-
100
- it('forwards make-active intent without changing the draft status', async () => {
101
- const bout = createBout({ Status: 'Completed' });
102
- const wrapper = mountPoolLive([bout]);
103
-
104
- wrapper.findComponent(EditBoutModal).vm.$emit('request:bout-active', bout);
105
- await wrapper.vm.$nextTick();
106
-
107
- expect(wrapper.emitted('request:bout-active')).toEqual([[bout]]);
108
- expect(wrapper.vm.localBouts[0].Status).toBe('Completed');
109
- });
110
-
111
- it('swaps scheduled bout order without mutating incoming bouts', () => {
112
- const firstBout = createBout({ BoutId: 1, OrderIndex: 0 });
113
- const secondBout = createBout({ BoutId: 2, OrderIndex: 1 });
114
- const wrapper = mountPoolLive([firstBout, secondBout]);
115
-
116
- wrapper.vm._swapOrderBetweenIds(firstBout.BoutId, secondBout.BoutId);
117
-
118
- expect(wrapper.vm.localBouts.map(bout => bout.OrderIndex)).toEqual([1, 0]);
119
- expect([firstBout.OrderIndex, secondBout.OrderIndex]).toEqual([0, 1]);
120
- });
121
- });
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import { describe, expect, it } from 'vitest';
3
+ import DirectorModal from '../../../Molecules/Modals/DirectorModal/DirectorModal.vue';
4
+ import EditBoutModal from '../../../Molecules/Modals/EditBoutModal/EditBoutModal.vue';
5
+ import PoolLive from './PoolLive.vue';
6
+
7
+ const createBout = (overrides = {}) => ({
8
+ BoutId: 42,
9
+ DEBoutId: null,
10
+ EventId: 8,
11
+ PoolId: 3,
12
+ OrderIndex: 0,
13
+ Status: 'Scheduled',
14
+ Score1: 4,
15
+ Score2: 3,
16
+ Person1: { PersonId: 1, DisplayName: 'Fencer One' },
17
+ Person2: { PersonId: 2, DisplayName: 'Fencer Two' },
18
+ ...overrides
19
+ });
20
+
21
+ const mountPoolLive = bouts =>
22
+ shallowMount(PoolLive, {
23
+ props: {
24
+ bouts,
25
+ event: { EventRules: [] },
26
+ hostingClubColors: {},
27
+ connectedToServer: true,
28
+ editMode: true
29
+ }
30
+ });
31
+
32
+ describe('PoolLive bout ownership', () => {
33
+ it('emits directing intent and waits for authoritative Active props', async () => {
34
+ const bout = createBout();
35
+ const wrapper = mountPoolLive([bout]);
36
+
37
+ wrapper.vm.directBout(bout);
38
+ await wrapper.vm.$nextTick();
39
+
40
+ expect(wrapper.emitted('update:directing-bout')).toEqual([[bout]]);
41
+ expect(wrapper.vm.localBouts[0].Status).toBe('Scheduled');
42
+ expect(wrapper.findComponent(DirectorModal).props('show')).toBe(false);
43
+
44
+ await wrapper.setProps({ bouts: [{ ...bout, Status: 'Active' }] });
45
+
46
+ expect(wrapper.findComponent(DirectorModal).props('show')).toBe(true);
47
+ expect(wrapper.findComponent(DirectorModal).props('bout').Status).toBe('Active');
48
+ });
49
+
50
+ it('resumes an active bout through directing intent', async () => {
51
+ const bout = createBout({ Status: 'Active' });
52
+ const wrapper = mountPoolLive([bout]);
53
+
54
+ wrapper.vm.directBout(bout);
55
+ await wrapper.vm.$nextTick();
56
+
57
+ expect(wrapper.emitted('update:directing-bout')).toEqual([[bout]]);
58
+ expect(wrapper.findComponent(DirectorModal).props('show')).toBe(true);
59
+ });
60
+
61
+ it('closes scoring without resetting status or scores', async () => {
62
+ const bout = createBout({ Status: 'Active', Score1: 6, Score2: 5 });
63
+ const wrapper = mountPoolLive([bout]);
64
+
65
+ wrapper.vm.directBout(bout);
66
+ await wrapper.vm.$nextTick();
67
+ wrapper.findComponent(DirectorModal).vm.$emit('update:closeModal', bout);
68
+ await wrapper.vm.$nextTick();
69
+
70
+ expect(wrapper.vm.localBouts[0]).toMatchObject({ Status: 'Active', Score1: 6, Score2: 5 });
71
+ expect(wrapper.emitted('update:bout')).toBeUndefined();
72
+ expect(wrapper.findComponent(DirectorModal).props('show')).toBe(false);
73
+ });
74
+
75
+ it('submits the draft without assigning Completed or Ended', async () => {
76
+ const bout = createBout({ Status: 'Active' });
77
+ const submittedBout = { ...bout, Score1: 7 };
78
+ const wrapper = mountPoolLive([bout]);
79
+
80
+ wrapper.findComponent(DirectorModal).vm.$emit('submit:bout', submittedBout);
81
+ await wrapper.vm.$nextTick();
82
+
83
+ const emittedBout = wrapper.emitted('submit:bout')[0][0];
84
+ expect(emittedBout).toEqual(submittedBout);
85
+ expect(emittedBout.Status).toBe('Active');
86
+ expect(emittedBout.Ended).toBeUndefined();
87
+ });
88
+
89
+ it('opens completed bouts for editing', async () => {
90
+ const bout = createBout({ Status: 'Completed' });
91
+ const wrapper = mountPoolLive([bout]);
92
+
93
+ wrapper.vm.editBout(bout);
94
+ await wrapper.vm.$nextTick();
95
+
96
+ expect(wrapper.findComponent(EditBoutModal).props('show')).toBe(true);
97
+ expect(wrapper.findComponent(DirectorModal).props('show')).toBe(false);
98
+ });
99
+
100
+ it('forwards make-active intent without changing the draft status', async () => {
101
+ const bout = createBout({ Status: 'Completed' });
102
+ const wrapper = mountPoolLive([bout]);
103
+
104
+ wrapper.findComponent(EditBoutModal).vm.$emit('request:bout-active', bout);
105
+ await wrapper.vm.$nextTick();
106
+
107
+ expect(wrapper.emitted('request:bout-active')).toEqual([[bout]]);
108
+ expect(wrapper.vm.localBouts[0].Status).toBe('Completed');
109
+ });
110
+
111
+ it('swaps scheduled bout order without mutating incoming bouts', () => {
112
+ const firstBout = createBout({ BoutId: 1, OrderIndex: 0 });
113
+ const secondBout = createBout({ BoutId: 2, OrderIndex: 1 });
114
+ const wrapper = mountPoolLive([firstBout, secondBout]);
115
+
116
+ wrapper.vm._swapOrderBetweenIds(firstBout.BoutId, secondBout.BoutId);
117
+
118
+ expect(wrapper.vm.localBouts.map(bout => bout.OrderIndex)).toEqual([1, 0]);
119
+ expect([firstBout.OrderIndex, secondBout.OrderIndex]).toEqual([0, 1]);
120
+ });
121
+ });
@@ -11,7 +11,7 @@ export default {
11
11
  },
12
12
  argTypes: {
13
13
  currentTab: { control: { type: 'text' } },
14
- tabs: { control: { type: 'array' } },
14
+ tabs: { control: { type: 'object' } },
15
15
  tabMenuClick: { action: 'tabMenuClick' }
16
16
  }
17
17
  };
@@ -25,7 +25,7 @@ export const Default = {
25
25
 
26
26
  export const DirectorMenu = {
27
27
  args: {
28
- currentTab: 'Checkin',
28
+ currentTab: 'Pools',
29
29
  tabs: tabs('Director')
30
30
  }
31
31
  };
@@ -43,3 +43,10 @@ export const PersonProfileAdmin = {
43
43
  tabs: personProfileTabs('admin')
44
44
  }
45
45
  };
46
+
47
+ export const PhoneDirector = {
48
+ args: {
49
+ currentTab: 'Pools',
50
+ tabs: tabs('Admin', true)
51
+ }
52
+ };
@@ -1,13 +1,14 @@
1
1
  <template>
2
2
  <div>
3
3
  <section class="flex">
4
- <TabBar class="border-b border-dropdownSelect mb-5 overflow-auto w-full flex flex-wrap">
5
- <div class="w-full flex md:flex-nowrap flex-wrap justify-between md:justify-start">
4
+ <TabBar class="border-b border-dropdownSelect mb-5 overflow-x-auto w-full flex">
5
+ <div class="w-full flex md:flex-wrap">
6
6
  <BaseButton
7
7
  v-for="tab in tabs"
8
8
  :key="tab.id"
9
9
  :selected="currentTab === tab.id"
10
- class="mx-2.5 md:mx-3 text-xs md:text-sm"
10
+ class="mx-1 md:mx-3 min-h-11 shrink-0 text-xs md:text-sm"
11
+ :class="{ 'hidden md:inline-block': tab.mobileHidden }"
11
12
  size="sm"
12
13
  :dropDown="!!tab.children"
13
14
  :iconName="getIconName(tab)"
@@ -70,7 +71,7 @@ export default {
70
71
  },
71
72
  computed: {
72
73
  isMobile() {
73
- return this.windowWidth <= 748;
74
+ return this.windowWidth < 768;
74
75
  },
75
76
  selectedDropdownItems() {
76
77
  return this.tabs.find(tab => tab.id === this.activeDropdown)?.children || [];