@dcrackel/hematournamentui 1.0.97 → 1.0.99
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/dist/{HemaTouranmentUI-lib.es.js → HemaTournamentUI-lib.es.js} +1582 -1476
- package/dist/{HemaTouranmentUI-lib.umd.js → HemaTournamentUI-lib.umd.js} +4 -4
- package/package.json +3 -1
- package/src/assets/portrait1.png +0 -0
- package/src/config/boutScreenConfigurations.js +54 -0
- package/src/mocks/eventRules.js +31 -0
- package/src/mocks/getPoolsWithBouts.js +405 -0
- package/src/mocks/getPoolsWithBoutsByPoolId.js +921 -0
- package/src/mocks/getPoolsWithBoutsClubColors.js +6 -0
- package/src/mocks/getPoolsWithBoutsComplete.js +926 -0
- package/src/stories/Atoms/Icon/BaseIcon.vue +8 -4
- package/src/stories/Atoms/Text/BaseText.vue +8 -2
- package/src/stories/Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.stories.js +60 -0
- package/src/stories/Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.vue +94 -0
- package/src/stories/Molecules/Boxes/BoutBoxes/ScoreBox/ScoreBox.stories.js +113 -0
- package/src/stories/Molecules/Boxes/BoutBoxes/ScoreBox/ScoreBox.vue +110 -0
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.stories.js +39 -0
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +112 -0
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.test.js +0 -2
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +6 -8
- package/src/stories/Molecules/Modals/BaseModal/BaseModal.vue +0 -5
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +52 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +64 -0
- package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.stories.js +56 -0
- package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +57 -0
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.stories.js +81 -0
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +212 -0
- package/src/stories/Organisms/Cards/Director/DirectorCard.stories.js +34 -0
- package/src/stories/Organisms/Cards/Director/DirectorCard.vue +100 -0
- package/src/stories/Organisms/Cards/EditBout/EditBout.stories.js +53 -0
- package/src/stories/Organisms/Cards/EditBout/EditBout.vue +150 -0
- package/src/stories/Organisms/Cards/PoolBoutMatchCard/PoolBoutMatchCard.stories.js +202 -0
- package/src/stories/Organisms/Cards/PoolBoutMatchCard/PoolBoutMatchCard.vue +59 -0
- package/src/stories/Organisms/Cards/PoolFencerCard/PoolFencerCard.vue +30 -20
- package/src/stories/Organisms/ComplexInputs/FindLocation/FindLocation.vue +0 -2
- package/src/stories/Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue +0 -5
- package/src/stories/Organisms/Containers/Pool/Pool.vue +25 -5
- package/src/stories/Organisms/Containers/PoolGrid/PoolGrid.stories.js +30 -0
- package/src/stories/Organisms/Containers/PoolGrid/PoolGrid.vue +204 -0
- package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.stories.js +42 -1
- package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.vue +15 -4
- package/src/stories/Organisms/Headers/ToggleHeader/ToggleHeader.stories.js +52 -0
- package/src/stories/Organisms/Headers/{StaffSummary/StaffSummary.vue → ToggleHeader/ToggleHeader.vue} +20 -11
- package/src/stories/Templates/EventManagement/ListEvents/ListEvents.vue +0 -3
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +32 -0
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +206 -0
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +1 -1
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +7 -3
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +3 -3
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +0 -5
- package/src/stories/Templates/TournamentManagement/EditTournament/EditPageOne/EditTournamentPageOne.vue +0 -3
- package/tailwind.config.js +46 -3
- package/vite.config.js +9 -8
- package/src/stories/Organisms/Headers/StaffSummary/StaffSummary.stories.js +0 -35
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import EditBout from './EditBout.vue';
|
|
2
|
+
import getPoolsWithBouts from '../../../../mocks/getPoolsWithBouts.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/Cards/EditBout',
|
|
6
|
+
component: EditBout,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
bout: getPoolsWithBouts[0],
|
|
10
|
+
hostingClubColors: {
|
|
11
|
+
Color1: 'red',
|
|
12
|
+
Color2: 'blue'
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
bout: {
|
|
17
|
+
control: 'object'
|
|
18
|
+
},
|
|
19
|
+
hostingClubColors: {
|
|
20
|
+
control: 'object'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Default = {
|
|
26
|
+
args: {
|
|
27
|
+
bout: getPoolsWithBouts[0],
|
|
28
|
+
hostingClubColors: {
|
|
29
|
+
Color1: 'red',
|
|
30
|
+
Color2: 'blue'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Scheduled = {
|
|
36
|
+
args: {
|
|
37
|
+
bout: getPoolsWithBouts[4],
|
|
38
|
+
hostingClubColors: {
|
|
39
|
+
Color1: 'red',
|
|
40
|
+
Color2: 'blue'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Completed = {
|
|
46
|
+
args: {
|
|
47
|
+
bout: getPoolsWithBouts[2],
|
|
48
|
+
hostingClubColors: {
|
|
49
|
+
Color1: 'red',
|
|
50
|
+
Color2: 'blue'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex items-center justify-between rounded-lg">
|
|
3
|
+
<!-- Fencer 1 -->
|
|
4
|
+
<div class="flex justify-between shadow-lg drop-shadow p-2 rounded-xl bg-poolBox w-1/2 mr-4">
|
|
5
|
+
<div class="flex space-x-4 items-center">
|
|
6
|
+
<div>
|
|
7
|
+
<div :class="`w-4 h-4 rounded-full bg-${computedColor(true)} absolute top-10 left-11`"></div>
|
|
8
|
+
<img :src="fencer1.portrait" alt="Portrait" class="w-12 h-12 rounded-full"/>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<BaseText :text="fencer1.name" size="md" color="primary" weight="bold"/>
|
|
12
|
+
<BaseText :text="fencer1.team" size="sm" color="quaternary"/>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flex w-1/4 justify-between">
|
|
16
|
+
<BaseIcon icon-name="fa-square-minus" size="4xl" :color="computedColor(true)" hover="quaternary" :disabled="fencer1Score <= 0" @click="minus(true)" />
|
|
17
|
+
<BaseText :text="fencer1Score" size="3xl" weight="bold" :class="`align-middle pt-0.5`"/>
|
|
18
|
+
<BaseIcon icon-name="fa-square-plus" size="4xl" :color="computedColor(true)" hover="quaternary" :disabled="fencer1Score >= maxPoints" @click="plus(true)" />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!-- Fencer 2 -->
|
|
23
|
+
<div class="flex justify-between shadow-lg drop-shadow p-2 rounded-xl bg-poolBox w-1/2 ml-4">
|
|
24
|
+
<div class="flex space-x-4 justify-between w-full">
|
|
25
|
+
<div class="flex w-1/4 justify-between">
|
|
26
|
+
<BaseIcon icon-name="fa-square-minus" size="4xl" :color="computedColor(false)" hover="quaternary" :disabled="fencer2Score <= 0" @click="minus(false)" />
|
|
27
|
+
<BaseText :text="fencer2Score" size="3xl" weight="bold" :class="`align-middle pt-0.5`"/>
|
|
28
|
+
<BaseIcon icon-name="fa-square-plus" size="4xl" :color="computedColor(false)" hover="quaternary" :disabled="fencer2Score >= maxPoints" @click="plus(false)" />
|
|
29
|
+
</div>
|
|
30
|
+
<div class="flex space-x-4 items-center">
|
|
31
|
+
<div>
|
|
32
|
+
<BaseText :text="fencer2.name" size="md" color="primary" weight="bold" class="text-right"/>
|
|
33
|
+
<BaseText :text="fencer2.team" size="sm" color="quaternary" class="text-right"/>
|
|
34
|
+
</div>
|
|
35
|
+
<div>
|
|
36
|
+
<div :class="`w-4 h-4 rounded-full bg-${computedColor(false)} absolute top-10 right-12`"></div>
|
|
37
|
+
<img :src="fencer2.portrait" alt="Portrait" class="w-12 h-12 rounded-full"/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="w-full flex justify-center mt-5">
|
|
45
|
+
<div class="w-1/2">
|
|
46
|
+
<BaseButton label="Submit" type="grayAndBlue" :selected="true" @click="submitBout"/>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
53
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
54
|
+
import missingPortrait from "../../../../assets/portrait1.png";
|
|
55
|
+
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
56
|
+
import eventRules from "../../../../mocks/eventRules.js";
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
components: {
|
|
60
|
+
BaseIcon,
|
|
61
|
+
BaseButton,
|
|
62
|
+
BaseText
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
bout: {
|
|
66
|
+
type: Object,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
hostingClubColors: {
|
|
70
|
+
type: Object,
|
|
71
|
+
required: true,
|
|
72
|
+
},
|
|
73
|
+
eventRules: {
|
|
74
|
+
type: Object,
|
|
75
|
+
required: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
emits: ['submit:bout', 'update:bout'],
|
|
79
|
+
data(){
|
|
80
|
+
return {
|
|
81
|
+
missingPortrait,
|
|
82
|
+
localBout: { ...this.bout }
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
computed: {
|
|
86
|
+
fencer1() {
|
|
87
|
+
const person1 = this.localBout.Person1 || {};
|
|
88
|
+
return {
|
|
89
|
+
portrait: (person1.Images && person1.Images.length) ? person1.Images[0].URL : this.missingPortrait,
|
|
90
|
+
name: person1.DisplayName || 'Unknown',
|
|
91
|
+
team: (person1.Club && person1.Club.Name) || 'Unknown',
|
|
92
|
+
score: this.localBout.Score1
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
fencer2() {
|
|
96
|
+
const person2 = this.localBout.Person2 || {};
|
|
97
|
+
return {
|
|
98
|
+
portrait: (person2.Images && person2.Images.length) ? person2.Images[0].URL : this.missingPortrait,
|
|
99
|
+
name: person2.DisplayName || 'Unknown',
|
|
100
|
+
team: (person2.Club && person2.Club.Name) || 'Unknown',
|
|
101
|
+
score: this.localBout.Score2
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
fencer1Score() {
|
|
105
|
+
return this.localBout.Status !== 'Scheduled' ? this.fencer1.score : '-';
|
|
106
|
+
},
|
|
107
|
+
fencer2Score() {
|
|
108
|
+
return this.localBout.Status !== 'Scheduled' ? this.fencer2.score : '-';
|
|
109
|
+
},
|
|
110
|
+
maxPoints() {
|
|
111
|
+
if (this.localBout.DEBoutId) {
|
|
112
|
+
const rule = this.eventRules.find(rule => rule.RuleName === "DEMaxPoints");
|
|
113
|
+
return rule ? rule.RuleValue : 7;
|
|
114
|
+
}
|
|
115
|
+
const rule = this.eventRules.find(rule => rule.RuleName === "PoolMaxPoints");
|
|
116
|
+
return rule ? rule.RuleValue : 7;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
methods: {
|
|
120
|
+
minus(isFencer1) {
|
|
121
|
+
if (isFencer1) {
|
|
122
|
+
if (this.localBout.Score1 > 0) {
|
|
123
|
+
this.localBout.Score1--;
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
if (this.localBout.Score2 > 0) {
|
|
127
|
+
this.localBout.Score2--;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
plus(isFencer1) {
|
|
132
|
+
if (isFencer1) {
|
|
133
|
+
if (this.localBout.Score1 < this.maxPoints) {
|
|
134
|
+
this.localBout.Score1++;
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
if (this.localBout.Score2 < this.maxPoints) {
|
|
138
|
+
this.localBout.Score2++;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
computedColor(fencer1) {
|
|
143
|
+
return fencer1 ? (this.hostingClubColors.Color1?.toLowerCase() || 'red') : (this.hostingClubColors.Color2?.toLowerCase() || 'blue');
|
|
144
|
+
},
|
|
145
|
+
submitBout() {
|
|
146
|
+
this.$emit('submit:bout', this.localBout);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</script>
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import PoolBoutMatchCard from './PoolBoutMatchCard.vue';
|
|
2
|
+
import PoolBouts from '../../../../mocks/getPoolsWithBouts';
|
|
3
|
+
import HostingClubColors from '../../../../mocks/getPoolsWithBoutsClubColors.js';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Organisms/Cards/PoolBoutMatchCard',
|
|
7
|
+
component: PoolBoutMatchCard,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
args: {
|
|
10
|
+
bout: {
|
|
11
|
+
BoutId: 1823,
|
|
12
|
+
PoolId: 137,
|
|
13
|
+
EventId: 5,
|
|
14
|
+
Person1Id: 10,
|
|
15
|
+
Person2Id: 1,
|
|
16
|
+
Status: 'Scheduled',
|
|
17
|
+
Score1: 0,
|
|
18
|
+
Score2: 0,
|
|
19
|
+
Started: null,
|
|
20
|
+
TimeLeft: 0,
|
|
21
|
+
RoundLabel: null,
|
|
22
|
+
DEBoutId: null,
|
|
23
|
+
DENextBoutId: null,
|
|
24
|
+
RefereeId: null,
|
|
25
|
+
createdAt: '2024-06-15T06:45:39.000Z',
|
|
26
|
+
updatedAt: '2024-06-15T06:45:39.000Z',
|
|
27
|
+
Person1: {
|
|
28
|
+
PersonId: 10,
|
|
29
|
+
DisplayName: 'Melissa Jones',
|
|
30
|
+
ClubId: 4,
|
|
31
|
+
Images: [],
|
|
32
|
+
Club: {
|
|
33
|
+
Name: 'Guardians of the Guard',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
Person2: {
|
|
37
|
+
PersonId: 1,
|
|
38
|
+
DisplayName: 'Dave Smith',
|
|
39
|
+
ClubId: 4,
|
|
40
|
+
Images: [
|
|
41
|
+
{
|
|
42
|
+
ImageId: 7,
|
|
43
|
+
URL: 'https://randomuser.me/api/portraits/men/22.jpg',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
Club: {
|
|
47
|
+
Name: 'Guardians of the Guard',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
hostingClubColors: HostingClubColors,
|
|
52
|
+
},
|
|
53
|
+
argTypes: {
|
|
54
|
+
bout: {
|
|
55
|
+
control: 'object',
|
|
56
|
+
},
|
|
57
|
+
hostingClubColors: {
|
|
58
|
+
control: 'object',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Default = {
|
|
64
|
+
args: {
|
|
65
|
+
bout: {
|
|
66
|
+
BoutId: 1823,
|
|
67
|
+
PoolId: 137,
|
|
68
|
+
EventId: 5,
|
|
69
|
+
Person1Id: 10,
|
|
70
|
+
Person2Id: 1,
|
|
71
|
+
Status: 'Scheduled',
|
|
72
|
+
Score1: 0,
|
|
73
|
+
Score2: 0,
|
|
74
|
+
Started: null,
|
|
75
|
+
TimeLeft: 0,
|
|
76
|
+
RoundLabel: null,
|
|
77
|
+
DEBoutId: null,
|
|
78
|
+
DENextBoutId: null,
|
|
79
|
+
RefereeId: null,
|
|
80
|
+
createdAt: '2024-06-15T06:45:39.000Z',
|
|
81
|
+
updatedAt: '2024-06-15T06:45:39.000Z',
|
|
82
|
+
Person1: {
|
|
83
|
+
PersonId: 10,
|
|
84
|
+
DisplayName: 'Melissa Jones',
|
|
85
|
+
ClubId: 4,
|
|
86
|
+
Images: [],
|
|
87
|
+
Club: {
|
|
88
|
+
Name: 'Guardians of the Guard',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
Person2: {
|
|
92
|
+
PersonId: 1,
|
|
93
|
+
DisplayName: 'Dave Smith',
|
|
94
|
+
ClubId: 4,
|
|
95
|
+
Images: [
|
|
96
|
+
{
|
|
97
|
+
ImageId: 7,
|
|
98
|
+
URL: 'https://randomuser.me/api/portraits/men/22.jpg',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
Club: {
|
|
102
|
+
Name: 'Fechtastic Fighters',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
hostingClubColors: HostingClubColors,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const ScheduledBout = {
|
|
111
|
+
args: {
|
|
112
|
+
bout: {
|
|
113
|
+
BoutId: 1824,
|
|
114
|
+
PoolId: 138,
|
|
115
|
+
EventId: 6,
|
|
116
|
+
Person1Id: 11,
|
|
117
|
+
Person2Id: 2,
|
|
118
|
+
Status: 'Scheduled',
|
|
119
|
+
Score1: 0,
|
|
120
|
+
Score2: 0,
|
|
121
|
+
Started: null,
|
|
122
|
+
TimeLeft: 0,
|
|
123
|
+
RoundLabel: null,
|
|
124
|
+
DEBoutId: null,
|
|
125
|
+
DENextBoutId: null,
|
|
126
|
+
RefereeId: null,
|
|
127
|
+
createdAt: '2024-06-15T06:45:39.000Z',
|
|
128
|
+
updatedAt: '2024-06-15T06:45:39.000Z',
|
|
129
|
+
Person1: {
|
|
130
|
+
PersonId: 11,
|
|
131
|
+
DisplayName: 'John Doe',
|
|
132
|
+
ClubId: 5,
|
|
133
|
+
Images: [],
|
|
134
|
+
Club: {
|
|
135
|
+
Name: 'Warriors of the West',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
Person2: {
|
|
139
|
+
PersonId: 2,
|
|
140
|
+
DisplayName: 'Jane Doe',
|
|
141
|
+
ClubId: 5,
|
|
142
|
+
Images: [
|
|
143
|
+
{
|
|
144
|
+
ImageId: 8,
|
|
145
|
+
URL: 'https://randomuser.me/api/portraits/women/22.jpg',
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
Club: {
|
|
149
|
+
Name: 'Warriors of the West',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
hostingClubColors: { Color1: 'green', Color2: 'purple'},
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const CompletedBout = {
|
|
158
|
+
args: {
|
|
159
|
+
bout: {
|
|
160
|
+
BoutId: 1825,
|
|
161
|
+
PoolId: 139,
|
|
162
|
+
EventId: 7,
|
|
163
|
+
Person1Id: 12,
|
|
164
|
+
Person2Id: 3,
|
|
165
|
+
Status: 'Completed',
|
|
166
|
+
Score1: 7,
|
|
167
|
+
Score2: 4,
|
|
168
|
+
Started: '2024-06-15T07:00:00.000Z',
|
|
169
|
+
TimeLeft: 0,
|
|
170
|
+
RoundLabel: 'Final',
|
|
171
|
+
DEBoutId: 101,
|
|
172
|
+
DENextBoutId: 102,
|
|
173
|
+
RefereeId: 5,
|
|
174
|
+
createdAt: '2024-06-15T06:45:39.000Z',
|
|
175
|
+
updatedAt: '2024-06-15T07:30:39.000Z',
|
|
176
|
+
Person1: {
|
|
177
|
+
PersonId: 12,
|
|
178
|
+
DisplayName: 'Alice Wonderland',
|
|
179
|
+
ClubId: 6,
|
|
180
|
+
Images: [],
|
|
181
|
+
Club: {
|
|
182
|
+
Name: 'Knights of the Round',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
Person2: {
|
|
186
|
+
PersonId: 3,
|
|
187
|
+
DisplayName: 'Bob Builder',
|
|
188
|
+
ClubId: 6,
|
|
189
|
+
Images: [
|
|
190
|
+
{
|
|
191
|
+
ImageId: 9,
|
|
192
|
+
URL: 'https://randomuser.me/api/portraits/men/23.jpg',
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
Club: {
|
|
196
|
+
Name: 'Fechtastic Fighters',
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
hostingClubColors: { Color1: 'blue', Color2: 'red'},
|
|
201
|
+
},
|
|
202
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="relative flex items-center justify-between bg-white shadow-md rounded-lg p-4 mb-4 border border-dropdownSelect">
|
|
3
|
+
<div :class="`absolute left-0 top-0 bottom-0 w-2 rounded-l-lg bg-${hostingClubColors.Color1}`"></div>
|
|
4
|
+
|
|
5
|
+
<div class="flex items-center space-x-4 w-1/3">
|
|
6
|
+
<img :src="bout.Person1.Images[0]?.URL || missingPortrait" alt="Person 1" class="w-16 h-16 rounded-full object-cover">
|
|
7
|
+
<div class="">
|
|
8
|
+
<BaseText :text="bout.Person1.DisplayName" size="lg" weight="bold" />
|
|
9
|
+
<BaseText :text="bout.Person1.Club.Name" size="sm" color="quaternary" />
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div v-if="bout.Status === 'Scheduled'" class="flex justify-center w-1/3">
|
|
14
|
+
<BaseText text="VS" size="2xl" weight="bold" color="primary" />
|
|
15
|
+
</div>
|
|
16
|
+
<div v-if="bout.Status === 'Completed'" class="flex justify-center w-1/3">
|
|
17
|
+
<div class="flex flex-col justify-center items-center">
|
|
18
|
+
<BaseText :text="`${bout.Score1}-${bout.Score2}`" size="2xl" weight="bold" color="primary" />
|
|
19
|
+
<BaseButton label="Edit Bout" color="primary" size="sm" class="mt-2" />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="flex justify-end space-x-4 w-1/3">
|
|
24
|
+
<div class="">
|
|
25
|
+
<BaseText :text="bout.Person2.DisplayName" size="lg" weight="bold" class="flex justify-end" />
|
|
26
|
+
<BaseText :text="bout.Person2.Club.Name" size="sm" color="quaternary" class="flex justify-end" />
|
|
27
|
+
</div>
|
|
28
|
+
<img :src="bout.Person2.Images[0]?.URL || missingPortrait" alt="Person 2" class="w-16 h-16 rounded-full object-cover">
|
|
29
|
+
</div>
|
|
30
|
+
<div :class="`absolute right-0 top-0 bottom-0 w-2 rounded-r-lg bg-${hostingClubColors.Color2}`"></div>
|
|
31
|
+
</section>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import missingPortrait from '../../../../assets/portrait1.png';
|
|
36
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
37
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
name: 'PoolBoutMatchCard',
|
|
41
|
+
components: {BaseButton, BaseText},
|
|
42
|
+
props: {
|
|
43
|
+
bout: {
|
|
44
|
+
type: Object,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
hostingClubColors: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: () => [],
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
data() {
|
|
53
|
+
return {
|
|
54
|
+
missingPortrait,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="flex items-center p-2 bg-poolSetup shadow rounded-lg"
|
|
4
|
+
:class="mode === 'preparation' || mode === 'planning' ? 'hover:bg-dropdownSelect' : ''"
|
|
5
|
+
:draggable="mode === 'preparation' || mode === 'planning'"
|
|
6
|
+
@dragstart="onDragStart"
|
|
7
|
+
@dragover.prevent
|
|
8
|
+
@dragenter.prevent
|
|
9
|
+
@drop="onDrop"
|
|
10
|
+
>
|
|
8
11
|
<div class="text-center mr-2">
|
|
9
12
|
<BaseText :text="poolPosition" size="md" />
|
|
10
13
|
</div>
|
|
11
14
|
<div class="w-8 h-8 rounded-md overflow-hidden">
|
|
12
15
|
<div v-if="!portrait" class="w-14 h-14 bg-dropdownSelect flex items-center justify-center">
|
|
13
|
-
<BaseText text="" size="sm" color="neutral" weight="bold"/>
|
|
16
|
+
<BaseText text="" size="sm" color="neutral" weight="bold" />
|
|
14
17
|
</div>
|
|
15
18
|
<img :src="portrait" alt="Fencer Portrait" class="w-full h-full object-cover" />
|
|
16
19
|
</div>
|
|
@@ -21,7 +24,7 @@
|
|
|
21
24
|
</p>
|
|
22
25
|
<BaseText :text="club" size="xs" />
|
|
23
26
|
</div>
|
|
24
|
-
<BaseIcon icon-name="fa-grip-dots-vertical" size="2xl" />
|
|
27
|
+
<BaseIcon v-if="mode === 'preparation' || mode === 'planning'" icon-name="fa-grip-dots-vertical" size="2xl" />
|
|
25
28
|
</div>
|
|
26
29
|
</template>
|
|
27
30
|
|
|
@@ -37,23 +40,30 @@ export default {
|
|
|
37
40
|
name: String,
|
|
38
41
|
club: String,
|
|
39
42
|
seed: Number,
|
|
40
|
-
portrait: String
|
|
43
|
+
portrait: String,
|
|
44
|
+
mode: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true,
|
|
47
|
+
validator: value => ['planning','preparation','live','results','de','completed'].includes(value)
|
|
48
|
+
},
|
|
41
49
|
},
|
|
42
50
|
methods: {
|
|
43
51
|
onDragStart(event) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
if (mode === 'preparation' || mode === 'planning') {
|
|
53
|
+
event.dataTransfer.setData('text/plain', JSON.stringify({
|
|
54
|
+
fromPosition: this.poolPosition,
|
|
55
|
+
name: this.name,
|
|
56
|
+
club: this.club,
|
|
57
|
+
seed: this.seed
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
51
60
|
},
|
|
52
61
|
onDrop(event) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
if (mode === 'preparation' || mode === 'planning') {
|
|
63
|
+
const droppedData = JSON.parse(event.dataTransfer.getData('text/plain'));
|
|
64
|
+
droppedData.toPosition = this.poolPosition;
|
|
65
|
+
this.$emit('swap-fencers', {droppedData});
|
|
66
|
+
}
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
}
|
|
@@ -117,8 +117,6 @@ export default {
|
|
|
117
117
|
this.formData.locationName = newName
|
|
118
118
|
},
|
|
119
119
|
handleAddressUpdate(newAddress) {
|
|
120
|
-
console.log("handle address update:")
|
|
121
|
-
console.log(newAddress)
|
|
122
120
|
this.formData.address = newAddress.address
|
|
123
121
|
this.formData.coordinates = newAddress.coordinates
|
|
124
122
|
},
|
|
@@ -93,12 +93,10 @@ export default {
|
|
|
93
93
|
},
|
|
94
94
|
computed: {
|
|
95
95
|
formattedClubs() {
|
|
96
|
-
console.log('Mapping clubs:', this.fencingClubs); // Debug log
|
|
97
96
|
const mappedClubs = this.fencingClubs.map(club => ({
|
|
98
97
|
text: club.Name,
|
|
99
98
|
link: club.ClubId.toString()
|
|
100
99
|
}));
|
|
101
|
-
console.log('Mapped clubs:', mappedClubs); // Debug log
|
|
102
100
|
return mappedClubs;
|
|
103
101
|
}
|
|
104
102
|
},
|
|
@@ -119,8 +117,6 @@ export default {
|
|
|
119
117
|
this.inputValue = event.target.value;
|
|
120
118
|
},
|
|
121
119
|
selectPerson(person) {
|
|
122
|
-
console.log(`------- FindOrAddPerson: selectPerson -------`);
|
|
123
|
-
console.log(person);
|
|
124
120
|
this.showDropdown = false;
|
|
125
121
|
this.inputValue = '';
|
|
126
122
|
this.$emit('person-selected', person);
|
|
@@ -161,7 +157,6 @@ export default {
|
|
|
161
157
|
clubId: this.selectedClub.link
|
|
162
158
|
};
|
|
163
159
|
this.$emit('new-person-submitted', newPerson);
|
|
164
|
-
console.log(newPerson);
|
|
165
160
|
this.showModal = false;
|
|
166
161
|
},
|
|
167
162
|
handleSelectedClub(value) {
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="p-4 mr-4 mt-3 bg-neutral rounded-lg shadow-md border border-dropdownSelect min-w-[22rem]">
|
|
2
|
+
<div class="p-4 mr-4 mt-3 bg-neutral rounded-lg shadow-md border border-dropdownSelect min-w-[22rem]" :class="mode === 'live' ? 'hover:border-bright' : ''" @click="handleSelectPool">
|
|
3
3
|
<div class="flex flex-row justify-between mb-2">
|
|
4
4
|
<h2 class="text-xl font-bold mb-2 flex">
|
|
5
5
|
<BaseText :text="`${poolName} - ${ringName}`" size="lg" color="primary" weight="bold" class="p-2"/>
|
|
6
6
|
</h2>
|
|
7
|
-
<div class="bg-eventBoxBlue w-40 h-9 rounded-lg my-1 flex flex-row justify-between border border-dropdownSelect">
|
|
7
|
+
<div v-if="mode === 'preparation' || mode === 'planning'" class="bg-eventBoxBlue w-40 h-9 rounded-lg my-1 flex flex-row justify-between border border-dropdownSelect">
|
|
8
8
|
<BaseText text="STRENGTH" size="xs" color="quinary" weight="bold" class="pt-2.5 pl-3"/>
|
|
9
9
|
<BaseText :text="poolInd" size="2xl" color="primaryHighlight" weight="bold" class="pt-0.5"/>
|
|
10
10
|
<BaseIcon icon-name="fa-circle-info" size="2xl" color="quinary" class="pt-0.5 pr-2"/>
|
|
11
11
|
</div>
|
|
12
|
+
<div v-if="mode === 'live'" class="bg-eventBoxBlue w-40 h-9 rounded-lg my-1 pt-1.5 flex flex-row justify-between border border-dropdownSelect">
|
|
13
|
+
<BaseText text="BOUTS LEFT" size="sm" color="quinary" weight="bold" class="w-2/3 text-right"/>
|
|
14
|
+
<BaseText text="10" size="sm" color="primaryHighlight" weight="bold" class="w-1/3 text-left pl-2"/>
|
|
15
|
+
</div>
|
|
12
16
|
</div>
|
|
13
17
|
|
|
14
|
-
<div class="text-md mb-4 w-full">
|
|
15
|
-
<DropDownMenu :label="'Director'" :items="directors" :selectedItem="selectedDirector" width="w-full" dropDownWidth="w-full"
|
|
18
|
+
<div v-if="mode === 'preparation' || mode === 'planning'" class="text-md mb-4 w-full">
|
|
19
|
+
<DropDownMenu :label="'Director'" :items="directors" :selectedItem="selectedDirector" width="w-full" dropDownWidth="w-full" :alignEnd="false" @update:selectedItem="handleSelectedItem"/>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="text-md mb-4 w-full flex ">
|
|
22
|
+
<BaseText text="Director: "size="sm" color="quinary" weight="bold" />
|
|
23
|
+
<BaseText :text="selectedDirector.text" size="sm" color="primaryHighlight" weight="bold" class="ml-2" />
|
|
16
24
|
</div>
|
|
17
25
|
<div class="grid grid-cols-1 gap-4">
|
|
18
26
|
<PoolFencerCard v-for="(person, index) in pool" :key="person.id"
|
|
@@ -22,6 +30,7 @@
|
|
|
22
30
|
:club="person.Person.Club.Name"
|
|
23
31
|
:seed="person.Seed"
|
|
24
32
|
:portrait="clubLogoURL(person)"
|
|
33
|
+
:mode="mode"
|
|
25
34
|
@swap-fencers="handleSwap"
|
|
26
35
|
@remove:fencer="handleRemoveFencer"
|
|
27
36
|
/>
|
|
@@ -71,7 +80,12 @@ export default {
|
|
|
71
80
|
staff: {
|
|
72
81
|
type: Array,
|
|
73
82
|
required: true
|
|
74
|
-
}
|
|
83
|
+
},
|
|
84
|
+
mode: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: true,
|
|
87
|
+
validator: value => ['planning','preparation','live','results','de','completed'].includes(value)
|
|
88
|
+
},
|
|
75
89
|
},
|
|
76
90
|
data() {
|
|
77
91
|
return {
|
|
@@ -105,6 +119,12 @@ export default {
|
|
|
105
119
|
},
|
|
106
120
|
handleRemoveFencer(person) {
|
|
107
121
|
this.$emit('remove:fencer', person);
|
|
122
|
+
},
|
|
123
|
+
handleSelectPool(){
|
|
124
|
+
if (this.mode === 'live') {
|
|
125
|
+
this.$emit('select:pool', this.poolId);
|
|
126
|
+
}
|
|
127
|
+
|
|
108
128
|
}
|
|
109
129
|
}
|
|
110
130
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import PoolGrid from './PoolGrid.vue';
|
|
2
|
+
import getPoolsWithBouts from '../../../../mocks/getPoolsWithBouts.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/Containers/PoolGrid',
|
|
6
|
+
component: PoolGrid,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
bouts: getPoolsWithBouts
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
bouts: {
|
|
13
|
+
control: 'object'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Default = {
|
|
20
|
+
args: {
|
|
21
|
+
bouts: getPoolsWithBouts
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export const EmptyPool = {
|
|
27
|
+
args: {
|
|
28
|
+
bouts: []
|
|
29
|
+
}
|
|
30
|
+
};
|