@dcrackel/hematournamentui 1.0.712 → 1.0.714
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/.prettierignore +7 -7
- package/.storybook/main.js +3 -1
- package/README.md +42 -0
- package/dist/HemaTournamentUI-lib.es.js +6856 -6243
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +79 -9
- package/package.json +96 -96
- package/prettier.config.js +16 -16
- package/src/index.js +43 -42
- package/src/main.js +1 -1
- package/src/mocks/getDEBouts-TableOf128.js +37 -37
- package/src/mocks/getDEBouts-TableOf64.js +35 -35
- package/src/stories/Atoms/Input/BaseInput.test.js +97 -97
- package/src/stories/Atoms/Input/BaseInput.vue +149 -149
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -23
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -35
- package/src/stories/Molecules/Indicators/RegistrationStatus/RegistrationStatus.vue +30 -30
- package/src/stories/Molecules/Menus/HoverActions/HoverActions.test.js +138 -0
- package/src/stories/Molecules/Menus/HoverActions/HoverActions.vue +212 -0
- package/src/stories/Molecules/Modals/BracketDirectorsModal/BracketDirectorsModal.stories.js +49 -0
- package/src/stories/Molecules/Modals/BracketDirectorsModal/BracketDirectorsModal.test.js +129 -0
- package/src/stories/Molecules/Modals/BracketDirectorsModal/BracketDirectorsModal.vue +165 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +6 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -18
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -1
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +5 -1
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +19 -10
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +11 -7
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +42 -33
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +76 -45
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +122 -103
- package/src/stories/Organisms/Cards/Director/DirectorCard.test.js +82 -0
- package/src/stories/Organisms/Cards/Director/DirectorCard.vue +32 -51
- package/src/stories/Organisms/Cards/EditBout/EditBout.test.js +51 -51
- package/src/stories/Organisms/Cards/EventCard/EventCard.test.js +106 -106
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -298
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +77 -60
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +144 -143
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +289 -256
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -69
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -80
- package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +153 -153
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +4 -0
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -31
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -109
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -192
- package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +1 -0
- package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +247 -204
- package/src/stories/Organisms/Containers/Tableau/Tableau.vue +89 -15
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +51 -29
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +63 -46
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -21
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -39
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -145
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -64
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +36 -57
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +101 -65
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +14 -1
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +52 -52
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +10 -3
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -226
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +137 -137
- package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -172
- package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -216
- package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -79
- package/src/stories/Organisms/Wizards/EditEventWizard/RuleSerialization.test.js +29 -29
- package/src/stories/Organisms/Wizards/EditEventWizard/WeaponSelection.test.js +138 -0
- package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +149 -9
- package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +54 -2
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +77 -8
- package/src/stories/Templates/EventManagement/Bracket/BracketDirectorAssignment.test.js +242 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketMobile.test.js +131 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +50 -39
- package/src/stories/Templates/EventManagement/Bracket/BracketStories.test.js +201 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.js +93 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.test.js +152 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -39
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -79
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -93
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -91
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.test.js +121 -121
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +9 -2
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +5 -4
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +81 -81
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -39
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +101 -101
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -71
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.vue +86 -86
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -86
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.vue +247 -247
- package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -170
- package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -156
- package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -329
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -329
- package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -42
- package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -84
- package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +114 -114
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -363
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -116
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +307 -307
- package/src/stories/Util/Validations/PersonManagementValidations.js +45 -45
- package/src/stories/Util/Validations/PriceValidation.js +6 -6
- package/src/stories/Util/boutDirectorAssignment.js +46 -0
- package/src/stories/Util/bracketDirectors.js +86 -0
- package/src/stories/Util/registrationStatus.js +11 -11
- package/src/stories/Util/tabs.js +19 -47
|
@@ -1,65 +1,101 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
addPlannedStrokesToConnectors,
|
|
4
|
-
createPlannedStationByBout,
|
|
5
|
-
isBoutSuggestedForViewer
|
|
6
|
-
} from './plannedAssignments';
|
|
7
|
-
|
|
8
|
-
const stations = [
|
|
9
|
-
{ RingId: 1, Color: '#2563eb', Director: { PersonId: 10 } },
|
|
10
|
-
{ RingId: 2, Color: '#dc2626', Director: { PersonId: 20 } }
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
describe('planned directing presentation helpers', () => {
|
|
14
|
-
it('joins planned bout data to its display station without mutating either input', () => {
|
|
15
|
-
const assignments = [{ DEBoutId: 101, RingId: 1 }];
|
|
16
|
-
|
|
17
|
-
const plannedStationByBout = createPlannedStationByBout({ assignments, stations });
|
|
18
|
-
|
|
19
|
-
expect(plannedStationByBout['101']).toBe(stations[0]);
|
|
20
|
-
expect(assignments).toEqual([{ DEBoutId: 101, RingId: 1 }]);
|
|
21
|
-
expect(stations[0]).toEqual({ RingId: 1, Color: '#2563eb', Director: { PersonId: 10 } });
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('identifies suggestions for the viewer without treating other suggestions as locks', () => {
|
|
25
|
-
const plannedStationByBout = createPlannedStationByBout({
|
|
26
|
-
assignments: [
|
|
27
|
-
{ DEBoutId: 101, RingId: 1 },
|
|
28
|
-
{ DEBoutId: 102, RingId: 2 }
|
|
29
|
-
],
|
|
30
|
-
stations
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
expect(isBoutSuggestedForViewer({ bout: { DEBoutId: 101 }, plannedStationByBout, viewerPersonId: '10' })).toBe(
|
|
34
|
-
true
|
|
35
|
-
);
|
|
36
|
-
expect(isBoutSuggestedForViewer({ bout: { DEBoutId: 102 }, plannedStationByBout, viewerPersonId: '10' })).toBe(
|
|
37
|
-
false
|
|
38
|
-
);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('colors
|
|
42
|
-
const plannedStationByBout = createPlannedStationByBout({
|
|
43
|
-
assignments: [
|
|
44
|
-
{ DEBoutId: 1, RingId: 1 },
|
|
45
|
-
{ DEBoutId: 2, RingId: 2 },
|
|
46
|
-
{ DEBoutId: 3, RingId: 1 }
|
|
47
|
-
],
|
|
48
|
-
stations
|
|
49
|
-
});
|
|
50
|
-
const connectors = [
|
|
51
|
-
{ key: 'child-1', segmentRole: 'child', sourceBoutId: 1 },
|
|
52
|
-
{ key: 'child-2', segmentRole: 'child', sourceBoutId: 2 },
|
|
53
|
-
{ key: 'merge', segmentRole: 'merge', sourceBoutIds: [1, 2] },
|
|
54
|
-
{ key: 'parent', segmentRole: 'parent', targetBoutId: 3 }
|
|
55
|
-
];
|
|
56
|
-
|
|
57
|
-
expect(addPlannedStrokesToConnectors(connectors, plannedStationByBout).map(path => path.stroke)).toEqual([
|
|
58
|
-
'#2563eb',
|
|
59
|
-
'#
|
|
60
|
-
|
|
61
|
-
'#2563eb'
|
|
62
|
-
]);
|
|
63
|
-
expect(connectors.some(connector => Object.hasOwn(connector, 'stroke'))).toBe(false);
|
|
64
|
-
});
|
|
65
|
-
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
addPlannedStrokesToConnectors,
|
|
4
|
+
createPlannedStationByBout,
|
|
5
|
+
isBoutSuggestedForViewer
|
|
6
|
+
} from './plannedAssignments';
|
|
7
|
+
|
|
8
|
+
const stations = [
|
|
9
|
+
{ RingId: 1, Color: '#2563eb', Director: { PersonId: 10 } },
|
|
10
|
+
{ RingId: 2, Color: '#dc2626', Director: { PersonId: 20 } }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
describe('planned directing presentation helpers', () => {
|
|
14
|
+
it('joins planned bout data to its display station without mutating either input', () => {
|
|
15
|
+
const assignments = [{ DEBoutId: 101, RingId: 1 }];
|
|
16
|
+
|
|
17
|
+
const plannedStationByBout = createPlannedStationByBout({ assignments, stations });
|
|
18
|
+
|
|
19
|
+
expect(plannedStationByBout['101']).toBe(stations[0]);
|
|
20
|
+
expect(assignments).toEqual([{ DEBoutId: 101, RingId: 1 }]);
|
|
21
|
+
expect(stations[0]).toEqual({ RingId: 1, Color: '#2563eb', Director: { PersonId: 10 } });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('identifies suggestions for the viewer without treating other suggestions as locks', () => {
|
|
25
|
+
const plannedStationByBout = createPlannedStationByBout({
|
|
26
|
+
assignments: [
|
|
27
|
+
{ DEBoutId: 101, RingId: 1 },
|
|
28
|
+
{ DEBoutId: 102, RingId: 2 }
|
|
29
|
+
],
|
|
30
|
+
stations
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
expect(isBoutSuggestedForViewer({ bout: { DEBoutId: 101 }, plannedStationByBout, viewerPersonId: '10' })).toBe(
|
|
34
|
+
true
|
|
35
|
+
);
|
|
36
|
+
expect(isBoutSuggestedForViewer({ bout: { DEBoutId: 102 }, plannedStationByBout, viewerPersonId: '10' })).toBe(
|
|
37
|
+
false
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('colors every connector segment for the receiving bout even when source directors differ', () => {
|
|
42
|
+
const plannedStationByBout = createPlannedStationByBout({
|
|
43
|
+
assignments: [
|
|
44
|
+
{ DEBoutId: 1, RingId: 1 },
|
|
45
|
+
{ DEBoutId: 2, RingId: 2 },
|
|
46
|
+
{ DEBoutId: 3, RingId: 1 }
|
|
47
|
+
],
|
|
48
|
+
stations
|
|
49
|
+
});
|
|
50
|
+
const connectors = [
|
|
51
|
+
{ key: 'child-1', segmentRole: 'child', sourceBoutId: 1, targetBoutId: 3 },
|
|
52
|
+
{ key: 'child-2', segmentRole: 'child', sourceBoutId: 2, targetBoutId: 3 },
|
|
53
|
+
{ key: 'merge', segmentRole: 'merge', sourceBoutIds: [1, 2], targetBoutId: 3 },
|
|
54
|
+
{ key: 'parent', segmentRole: 'parent', targetBoutId: 3 }
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
expect(addPlannedStrokesToConnectors(connectors, plannedStationByBout).map(path => path.stroke)).toEqual([
|
|
58
|
+
'#2563eb',
|
|
59
|
+
'#2563eb',
|
|
60
|
+
'#2563eb',
|
|
61
|
+
'#2563eb'
|
|
62
|
+
]);
|
|
63
|
+
expect(connectors.some(connector => Object.hasOwn(connector, 'stroke'))).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('colors a single feeder for the receiving director', () => {
|
|
67
|
+
const plannedStationByBout = createPlannedStationByBout({
|
|
68
|
+
assignments: [
|
|
69
|
+
{ DEBoutId: 1, RingId: 1 },
|
|
70
|
+
{ DEBoutId: 2, RingId: 2 }
|
|
71
|
+
],
|
|
72
|
+
stations
|
|
73
|
+
});
|
|
74
|
+
const connectors = [{ key: 'single', segmentRole: 'single', sourceBoutId: 1, targetBoutId: 2 }];
|
|
75
|
+
expect(addPlannedStrokesToConnectors(connectors, plannedStationByBout)[0].stroke).toBe('#dc2626');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('keeps the entire connector neutral when the receiving bout is unassigned', () => {
|
|
79
|
+
const plannedStationByBout = createPlannedStationByBout({
|
|
80
|
+
assignments: [
|
|
81
|
+
{ DEBoutId: 1, RingId: 1 },
|
|
82
|
+
{ DEBoutId: 2, RingId: 1 }
|
|
83
|
+
],
|
|
84
|
+
stations
|
|
85
|
+
});
|
|
86
|
+
const connectors = [
|
|
87
|
+
{ segmentRole: 'child', sourceBoutId: 1, targetBoutId: 3 },
|
|
88
|
+
{ segmentRole: 'child', sourceBoutId: 2, targetBoutId: 3 },
|
|
89
|
+
{ segmentRole: 'merge', sourceBoutIds: [1, 2], targetBoutId: 3 },
|
|
90
|
+
{ segmentRole: 'parent', targetBoutId: 3 },
|
|
91
|
+
{ segmentRole: 'single', sourceBoutId: 1, targetBoutId: 4 }
|
|
92
|
+
];
|
|
93
|
+
expect(addPlannedStrokesToConnectors(connectors, plannedStationByBout).map(path => path.stroke)).toEqual([
|
|
94
|
+
null,
|
|
95
|
+
null,
|
|
96
|
+
null,
|
|
97
|
+
null,
|
|
98
|
+
null
|
|
99
|
+
]);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
:roundName="roundName"
|
|
13
13
|
:bracketSize="bracketSize"
|
|
14
14
|
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore"
|
|
15
|
+
:showBoutDirectorAssignment="showBoutDirectorAssignment"
|
|
16
|
+
:plannedDirectorName="getPlannedDirectorName(bout)"
|
|
17
|
+
:plannedDirectorColor="getPlannedDirectorColor(bout)"
|
|
18
|
+
@request:bout-director="$emit('request:bout-director', $event)"
|
|
15
19
|
@register-node-anchor="registerNodeAnchor"
|
|
16
20
|
@action:editBout="handleEditBout"
|
|
17
21
|
@action:directingBout="handleDirectorBout"
|
|
@@ -24,12 +28,15 @@
|
|
|
24
28
|
<script>
|
|
25
29
|
import TableauBoutCard from '../../Cards/TableauBoutCard/TableauBoutCard.vue';
|
|
26
30
|
import BaseText from '../../../Atoms/Text/BaseText.vue';
|
|
31
|
+
import { getPlannedStationForBout } from '../Tableau/plannedAssignments.js';
|
|
27
32
|
|
|
28
33
|
export default {
|
|
29
34
|
name: 'TableauColumn',
|
|
30
|
-
emits: ['action:directingBout', 'action:editBout', 'register-node-anchor'],
|
|
35
|
+
emits: ['action:directingBout', 'action:editBout', 'register-node-anchor', 'request:bout-director'],
|
|
31
36
|
components: { BaseText, TableauBoutCard },
|
|
32
37
|
props: {
|
|
38
|
+
showBoutDirectorAssignment: { type: Boolean, default: true },
|
|
39
|
+
plannedStationByBout: { type: Object, default: () => ({}) },
|
|
33
40
|
bouts: {
|
|
34
41
|
type: Array,
|
|
35
42
|
required: true
|
|
@@ -61,6 +68,12 @@ export default {
|
|
|
61
68
|
}
|
|
62
69
|
},
|
|
63
70
|
methods: {
|
|
71
|
+
getPlannedDirectorName(bout) {
|
|
72
|
+
return getPlannedStationForBout(this.plannedStationByBout, bout)?.Director?.DisplayName || '';
|
|
73
|
+
},
|
|
74
|
+
getPlannedDirectorColor(bout) {
|
|
75
|
+
return getPlannedStationForBout(this.plannedStationByBout, bout)?.Color || '';
|
|
76
|
+
},
|
|
64
77
|
getBoutStyle(index) {
|
|
65
78
|
return { marginBottom: index < this.bouts.length - 1 ? `${this.layout.gapPx}px` : '0' };
|
|
66
79
|
},
|
package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import BasicEventInfo from './BasicEventInfo.vue';
|
|
2
|
-
import singleEventMock from '../../../../../mocks/singleEventMock.js';
|
|
3
|
-
import getAllWeapons from '../../../../../mocks/getAllWeapons.js';
|
|
4
|
-
|
|
5
|
-
const eventConfig = { ...singleEventMock, EventPrice: 25.5 };
|
|
6
|
-
const validation = {
|
|
7
|
-
EventName: { invalid: false, message: '' },
|
|
8
|
-
EventPrice: { invalid: false, message: '' }
|
|
9
|
-
};
|
|
10
|
-
const steps = [
|
|
11
|
-
{ name: 'Basic Info', icon: 'fa-circle-info' },
|
|
12
|
-
{ name: 'Customization', icon: 'fa-star' },
|
|
13
|
-
{ name: 'Pool Setup', icon: 'fa-table-columns' },
|
|
14
|
-
{ name: 'DE Promotion', icon: 'fa-list' },
|
|
15
|
-
{ name: 'Direct Elimination', icon: 'fa-diagram-sankey' }
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
title: 'Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo',
|
|
20
|
-
component: BasicEventInfo,
|
|
21
|
-
args: { eventConfig, validation, currentStep: 0, steps, weapons: getAllWeapons },
|
|
22
|
-
argTypes: {
|
|
23
|
-
eventConfig: { control: 'object' },
|
|
24
|
-
validation: { control: 'object' },
|
|
25
|
-
weapons: { control: 'object' },
|
|
26
|
-
steps: { control: 'object' },
|
|
27
|
-
currentStep: { control: 'number' }
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const Default = {
|
|
32
|
-
args: { eventConfig, validation, currentStep: 0, steps, weapons: getAllWeapons }
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const FreeEvent = {
|
|
36
|
-
args: { ...Default.args, eventConfig: { ...eventConfig, EventPrice: 0 } }
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const InvalidPrice = {
|
|
40
|
-
args: {
|
|
41
|
-
...Default.args,
|
|
42
|
-
eventConfig: { ...eventConfig, EventPrice: -5 },
|
|
43
|
-
validation: {
|
|
44
|
-
...validation,
|
|
45
|
-
EventPrice: { invalid: true, message: 'Price must be a non-negative number.' }
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const WaitlistDisabled = {
|
|
51
|
-
args: { ...Default.args, eventConfig: { ...eventConfig, CutOffNumber: 32, WaitlistEnabled: false } }
|
|
52
|
-
};
|
|
1
|
+
import BasicEventInfo from './BasicEventInfo.vue';
|
|
2
|
+
import singleEventMock from '../../../../../mocks/singleEventMock.js';
|
|
3
|
+
import getAllWeapons from '../../../../../mocks/getAllWeapons.js';
|
|
4
|
+
|
|
5
|
+
const eventConfig = { ...singleEventMock, EventPrice: 25.5 };
|
|
6
|
+
const validation = {
|
|
7
|
+
EventName: { invalid: false, message: '' },
|
|
8
|
+
EventPrice: { invalid: false, message: '' }
|
|
9
|
+
};
|
|
10
|
+
const steps = [
|
|
11
|
+
{ name: 'Basic Info', icon: 'fa-circle-info' },
|
|
12
|
+
{ name: 'Customization', icon: 'fa-star' },
|
|
13
|
+
{ name: 'Pool Setup', icon: 'fa-table-columns' },
|
|
14
|
+
{ name: 'DE Promotion', icon: 'fa-list' },
|
|
15
|
+
{ name: 'Direct Elimination', icon: 'fa-diagram-sankey' }
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
title: 'Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo',
|
|
20
|
+
component: BasicEventInfo,
|
|
21
|
+
args: { eventConfig, validation, currentStep: 0, steps, weapons: getAllWeapons },
|
|
22
|
+
argTypes: {
|
|
23
|
+
eventConfig: { control: 'object' },
|
|
24
|
+
validation: { control: 'object' },
|
|
25
|
+
weapons: { control: 'object' },
|
|
26
|
+
steps: { control: 'object' },
|
|
27
|
+
currentStep: { control: 'number' }
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Default = {
|
|
32
|
+
args: { eventConfig, validation, currentStep: 0, steps, weapons: getAllWeapons }
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const FreeEvent = {
|
|
36
|
+
args: { ...Default.args, eventConfig: { ...eventConfig, EventPrice: 0 } }
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const InvalidPrice = {
|
|
40
|
+
args: {
|
|
41
|
+
...Default.args,
|
|
42
|
+
eventConfig: { ...eventConfig, EventPrice: -5 },
|
|
43
|
+
validation: {
|
|
44
|
+
...validation,
|
|
45
|
+
EventPrice: { invalid: true, message: 'Price must be a non-negative number.' }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const WaitlistDisabled = {
|
|
51
|
+
args: { ...Default.args, eventConfig: { ...eventConfig, CutOffNumber: 32, WaitlistEnabled: false } }
|
|
52
|
+
};
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
/>
|
|
84
84
|
<DropDownMenu
|
|
85
85
|
:label="''"
|
|
86
|
-
:items="
|
|
86
|
+
:items="weaponOptions"
|
|
87
87
|
:selected-item="selectedWeapon"
|
|
88
88
|
:alignEnd="false"
|
|
89
89
|
width="w-full"
|
|
@@ -208,9 +208,16 @@ export default {
|
|
|
208
208
|
if (!this.priceValidation.invalid) return 'Event Price';
|
|
209
209
|
return `Event Price - ${this.priceValidation.message}`;
|
|
210
210
|
},
|
|
211
|
+
weaponOptions() {
|
|
212
|
+
return this.weapons.map(weapon => ({
|
|
213
|
+
...weapon,
|
|
214
|
+
text: weapon.text ?? weapon.Name,
|
|
215
|
+
link: weapon.link ?? weapon.Id
|
|
216
|
+
}));
|
|
217
|
+
},
|
|
211
218
|
selectedWeapon() {
|
|
212
|
-
const weapon = this.
|
|
213
|
-
return weapon
|
|
219
|
+
const weapon = this.weaponOptions.find(option => String(option.link) === String(this.eventConfig.WeaponId));
|
|
220
|
+
return weapon ?? { text: 'Select a weapon', link: null };
|
|
214
221
|
}
|
|
215
222
|
},
|
|
216
223
|
methods: {
|