@dcrackel/hematournamentui 1.0.707 → 1.0.708

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 (46) hide show
  1. package/AGENTS.md +118 -118
  2. package/dist/HemaTournamentUI-lib.es.js +4483 -4618
  3. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  4. package/dist/hematournamentui-tailwind.css +185 -406
  5. package/package.json +10 -10
  6. package/src/index.js +2 -0
  7. package/src/mocks/getDEBouts-42Fencers.js +4 -4
  8. package/src/mocks/getDEBouts-TableOf128.js +37 -0
  9. package/src/mocks/getDEBouts-TableOf64.js +35 -0
  10. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -0
  11. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -0
  12. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -0
  13. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +3 -2
  14. package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +1 -1
  15. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -0
  16. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -0
  17. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -0
  18. package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -278
  19. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +60 -98
  20. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +103 -4
  21. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +256 -215
  22. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -92
  23. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -128
  24. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +14 -4
  25. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +2 -2
  26. package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +131 -3
  27. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +287 -89
  28. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -0
  29. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -0
  30. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -0
  31. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -0
  32. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -0
  33. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -0
  34. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +57 -0
  35. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +65 -0
  36. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +31 -29
  37. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +146 -18
  38. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +52 -2
  39. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +53 -17
  40. package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +39 -0
  41. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -0
  42. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -0
  43. package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +0 -111
  44. package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +0 -162
  45. package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +0 -21
  46. package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +0 -78
@@ -1,98 +1,60 @@
1
- import TableauBoutCard from './TableauBoutCard.vue';
2
- import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
3
-
4
- export default {
5
- title: 'Organisms/Cards/TableauBoutCard',
6
- component: TableauBoutCard,
7
- tags: ['autodocs'],
8
- args: {
9
- bout: getDEWithBouts.pools[0].Bouts[0],
10
- hostingClubColors: getDEWithBouts.hostingClubColors,
11
- large: true,
12
- roundName: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
13
- bracketSize: 'Table of 8',
14
- highLight: false
15
- },
16
- argTypes: {
17
- bout: {
18
- control: 'object',
19
- description: 'Bout object containing fencers and scores'
20
- },
21
- hostingClubColors: {
22
- control: 'object',
23
- description: 'Colors for hosting club'
24
- },
25
- large: {
26
- control: 'boolean',
27
- description: 'Size of the card'
28
- },
29
- roundName: {
30
- control: 'text',
31
- description: 'Name of the round'
32
- },
33
- bracketSize: {
34
- control: 'text',
35
- description: 'Size of the bracket'
36
- },
37
- highLight: {
38
- control: 'boolean',
39
- description: 'Card is highlighed'
40
- }
41
- }
42
- };
43
-
44
- export const Default = {
45
- args: {
46
- bout: getDEWithBouts.pools[0].Bouts[2],
47
- hostingClubColors: getDEWithBouts.hostingClubColors,
48
- large: true,
49
- roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
50
- bracketSize: 'Table of 8',
51
- highLight: false
52
- }
53
- };
54
-
55
- let modifiedBout = { ...getDEWithBouts.pools[0].Bouts[2], Status: 'Active' };
56
- export const ActiveBout = {
57
- args: {
58
- bout: modifiedBout,
59
- hostingClubColors: getDEWithBouts.hostingClubColors,
60
- large: true,
61
- roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
62
- bracketSize: 'Table of 8',
63
- highLight: false
64
- }
65
- };
66
-
67
- export const smallCardBout = {
68
- args: {
69
- bout: getDEWithBouts.pools[0].Bouts[1],
70
- hostingClubColors: getDEWithBouts.hostingClubColors,
71
- large: false,
72
- roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
73
- bracketSize: 'Table of 8',
74
- highLight: false
75
- }
76
- };
77
-
78
- modifiedBout = { ...getDEWithBouts.pools[0].Bouts[2], Status: 'Completed' };
79
- export const CompletedBout = {
80
- args: {
81
- bout: modifiedBout,
82
- large: true,
83
- roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
84
- highLight: false
85
- }
86
- };
87
-
88
- modifiedBout = { ...getDEWithBouts.pools[0].Bouts[0], Status: 'Completed' };
89
- export const ByeBout = {
90
- args: {
91
- bout: modifiedBout,
92
- hostingClubColors: getDEWithBouts.hostingClubColors,
93
- large: false,
94
- roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
95
- bracketSize: 'Table of 8',
96
- highLight: false
97
- }
98
- };
1
+ import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
2
+ import TableauBoutCard from './TableauBoutCard.vue';
3
+
4
+ const baseBout = getDEWithBouts.pools[0].Bouts[2];
5
+
6
+ export default {
7
+ title: 'Organisms/Cards/TableauBoutCard',
8
+ component: TableauBoutCard,
9
+ tags: ['autodocs'],
10
+ args: {
11
+ bout: baseBout,
12
+ hostingClubColors: getDEWithBouts.hostingClubColors,
13
+ roundName: baseBout.RoundLabel,
14
+ bracketSize: 'Table of 8'
15
+ },
16
+ argTypes: {
17
+ bout: {
18
+ control: 'object',
19
+ description: 'Bout containing both fencers, scores, status, and bracket links'
20
+ },
21
+ hostingClubColors: {
22
+ control: 'object',
23
+ description: 'Hosting-club colors used for the seed strips'
24
+ },
25
+ roundName: {
26
+ control: 'text',
27
+ description: 'Name of the displayed round'
28
+ },
29
+ bracketSize: {
30
+ control: 'text',
31
+ description: 'Name of the opening bracket round'
32
+ }
33
+ }
34
+ };
35
+
36
+ export const Default = {};
37
+
38
+ export const Active = {
39
+ args: {
40
+ bout: {
41
+ ...baseBout,
42
+ Status: 'Active',
43
+ RingName: 'Ring 3',
44
+ TimeLeft: 95,
45
+ TimerStatus: 'running'
46
+ }
47
+ }
48
+ };
49
+
50
+ export const Completed = {
51
+ args: {
52
+ bout: { ...baseBout, Status: 'Completed' }
53
+ }
54
+ };
55
+
56
+ export const Bye = {
57
+ args: {
58
+ bout: getDEWithBouts.pools[0].Bouts[0]
59
+ }
60
+ };
@@ -1,9 +1,11 @@
1
- import { shallowMount } from '@vue/test-utils';
2
- import { describe, expect, it } from 'vitest';
1
+ import { mount, shallowMount } from '@vue/test-utils';
2
+ import { describe, expect, it, vi } from 'vitest';
3
+ import TableauFencerCard from '../TableauFencerCard/TableauFencerCard.vue';
3
4
  import TableauBoutCard from './TableauBoutCard.vue';
4
5
 
5
6
  const createBout = status => ({
6
7
  BoutId: 42,
8
+ DEBoutId: 7,
7
9
  Status: status,
8
10
  Score1: 4,
9
11
  Score2: 3,
@@ -22,23 +24,120 @@ const mountCard = bout =>
22
24
  });
23
25
 
24
26
  describe('TableauBoutCard selection', () => {
27
+ it('keeps the fencer layout outside the native selection button', () => {
28
+ const wrapper = mount(TableauBoutCard, {
29
+ props: {
30
+ bout: createBout('Scheduled'),
31
+ hostingClubColors: {},
32
+ roundName: 'Final',
33
+ bracketSize: 'Final'
34
+ }
35
+ });
36
+ const button = wrapper.find('[data-testid="tableau-bout"]');
37
+
38
+ expect(button.element.tagName).toBe('BUTTON');
39
+ expect(button.attributes('aria-label')).toBe('Fencer One versus Fencer Two');
40
+ expect(button.find('div, section').exists()).toBe(false);
41
+ expect(wrapper.findAllComponents(TableauFencerCard)).toHaveLength(2);
42
+ });
43
+
25
44
  it('emits directing intent for a scheduled bout', async () => {
26
45
  const bout = createBout('Scheduled');
27
46
  const wrapper = mountCard(bout);
28
47
 
29
- await wrapper.find('section section').trigger('click');
48
+ await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
30
49
 
31
50
  expect(wrapper.emitted('action:directingBout')).toEqual([[bout]]);
32
51
  expect(wrapper.emitted('action:editBout')).toBeUndefined();
33
52
  });
34
53
 
54
+ it('does not draw planned-assignment color over the fencer card', () => {
55
+ const wrapper = mountCard(createBout('Scheduled'));
56
+
57
+ expect(wrapper.find('[data-testid="planned-assignment-indicator"]').exists()).toBe(false);
58
+ });
59
+
35
60
  it('emits editing intent for a completed bout', async () => {
36
61
  const bout = createBout('Completed');
37
62
  const wrapper = mountCard(bout);
38
63
 
39
- await wrapper.find('section section').trigger('click');
64
+ await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
40
65
 
41
66
  expect(wrapper.emitted('action:editBout')).toEqual([[bout]]);
42
67
  expect(wrapper.emitted('action:directingBout')).toBeUndefined();
43
68
  });
69
+
70
+ it('emits directing intent for an active bout', async () => {
71
+ const bout = createBout('Active');
72
+ const wrapper = mountCard(bout);
73
+
74
+ await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
75
+
76
+ expect(wrapper.emitted('action:directingBout')).toEqual([[bout]]);
77
+ });
78
+
79
+ it('does not emit directing intent for a BYE bout', async () => {
80
+ const bout = {
81
+ ...createBout('Scheduled'),
82
+ Person2: { PersonId: 0, DisplayName: 'BYE', EventPersons: [] }
83
+ };
84
+ const wrapper = mountCard(bout);
85
+
86
+ await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
87
+
88
+ expect(wrapper.emitted('action:directingBout')).toBeUndefined();
89
+ expect(wrapper.find('[data-testid="tableau-bout"]').attributes('disabled')).toBeDefined();
90
+ });
91
+
92
+ it('rounds the outside corners and highlights the whole bout on hover', () => {
93
+ const wrapper = mountCard(createBout('Scheduled'));
94
+ const fencerRows = wrapper.findAllComponents(TableauFencerCard);
95
+ const boutButton = wrapper.find('[data-testid="tableau-bout"]');
96
+
97
+ expect(fencerRows.map(row => row.props('corners'))).toEqual(['top', 'bottom']);
98
+ expect(boutButton.classes()).toContain('hover:ring-bright');
99
+ expect(boutButton.classes()).toContain('hover:ring-2');
100
+ });
101
+
102
+ it('shows the assigned ring and time for an active bout', () => {
103
+ const wrapper = mountCard({
104
+ ...createBout('Active'),
105
+ RingName: 'Ring 3',
106
+ TimeLeft: 95,
107
+ TimerStatus: 'stopped'
108
+ });
109
+
110
+ expect(wrapper.find('[data-testid="active-ring"]').exists()).toBe(true);
111
+ expect(wrapper.find('[data-testid="active-ring"] base-text-stub').attributes('text')).toBe('Ring 3');
112
+ expect(wrapper.find('[data-testid="active-time"] base-text-stub').attributes('text')).toBe('1:35');
113
+ });
114
+
115
+ it('hides active chrome after its ring and timer display fields are cleared', () => {
116
+ const wrapper = mountCard({
117
+ ...createBout('Active'),
118
+ RingName: '',
119
+ TimeLeft: 0,
120
+ TimerStatus: 'stopped'
121
+ });
122
+
123
+ expect(wrapper.find('[data-testid="active-ring"]').exists()).toBe(false);
124
+ expect(wrapper.find('[data-testid="active-time"]').exists()).toBe(false);
125
+ });
126
+
127
+ it('ticks the presentation timer without mutating the bout prop', async () => {
128
+ vi.useFakeTimers();
129
+ const bout = { ...createBout('Active'), TimeLeft: 90, TimerStatus: 'running' };
130
+ const wrapper = mountCard(bout);
131
+
132
+ try {
133
+ vi.advanceTimersByTime(1000);
134
+ await wrapper.vm.$nextTick();
135
+
136
+ expect(wrapper.vm.displayTime).toBe('1:29');
137
+ expect(bout.TimeLeft).toBe(90);
138
+ } finally {
139
+ wrapper.unmount();
140
+ vi.useRealTimers();
141
+ }
142
+ });
44
143
  });