@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.
- package/AGENTS.md +118 -118
- package/dist/HemaTournamentUI-lib.es.js +4483 -4618
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +185 -406
- package/package.json +10 -10
- package/src/index.js +2 -0
- package/src/mocks/getDEBouts-42Fencers.js +4 -4
- package/src/mocks/getDEBouts-TableOf128.js +37 -0
- package/src/mocks/getDEBouts-TableOf64.js +35 -0
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -0
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +3 -2
- package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +1 -1
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -0
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -0
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -0
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -278
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +60 -98
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +103 -4
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +256 -215
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -92
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -128
- package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +14 -4
- package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +2 -2
- package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +131 -3
- package/src/stories/Organisms/Containers/Tableau/Tableau.vue +287 -89
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -0
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -0
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -0
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -0
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -0
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -0
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +57 -0
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +65 -0
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +31 -29
- package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +146 -18
- package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +52 -2
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +53 -17
- package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +39 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -0
- package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +0 -111
- package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +0 -162
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +0 -21
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +0 -78
|
@@ -1,98 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
bout: {
|
|
18
|
-
control: 'object',
|
|
19
|
-
description: 'Bout
|
|
20
|
-
},
|
|
21
|
-
hostingClubColors: {
|
|
22
|
-
control: 'object',
|
|
23
|
-
description: '
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
control: '
|
|
27
|
-
description: '
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
control: 'text',
|
|
31
|
-
description: 'Name of the round'
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export const
|
|
57
|
-
args: {
|
|
58
|
-
bout:
|
|
59
|
-
|
|
60
|
-
|
|
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('
|
|
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('
|
|
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
|
});
|