@dcrackel/hematournamentui 1.0.87 → 1.0.89
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 +6779 -6288
- package/dist/HemaTouranmentUI-lib.umd.js +28 -28
- package/package.json +1 -1
- package/src/index.js +2 -1
- package/src/mocks/eventPersonGetInitialPoolAssignments.js +148 -136
- package/src/mocks/eventPersonGetInitialPoolAssignments2.js +420 -0
- package/src/mocks/eventPersonGetInitialStaff.js +38 -0
- package/src/mocks/eventPersonGetPoolAssignmentEvent.js +1 -1
- package/src/mocks/getAllStaffByTournamentId.js +80 -0
- package/src/stories/Molecules/Boxes/CounterBox/CounterBox.vue +6 -2
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +43 -50
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.stories.js +73 -0
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +73 -0
- package/src/stories/Organisms/Containers/Pool/Pool.vue +21 -7
- package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.vue +40 -17
- package/src/stories/Organisms/Headers/StaffSummary/StaffSummary.stories.js +35 -0
- package/src/stories/Organisms/Headers/StaffSummary/StaffSummary.vue +55 -0
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +45 -20
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +81 -31
- package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +58 -0
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +135 -0
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +6 -1
- package/tailwind.config.js +2 -0
|
@@ -1,55 +1,68 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section>
|
|
3
3
|
<EditEventsTopMenu :currentTab="'Pools'" :tabs="tabs" @tabMenuClick="handleTabMenuClick"/>
|
|
4
|
-
<PoolSummary :event="event" @update:poolSize="handlePoolSizeChange" @update:numberOfRings="
|
|
4
|
+
<PoolSummary :event="event" @update:poolSize="handlePoolSizeChange" @update:numberOfRings="handleNumberOfRings" @reset:pool="handlePoolReset" :mode="mode"/>
|
|
5
|
+
<EditEventsTopMenu v-if="this.event.Flights > 1" :currentTab="selectedFlight" :tabs="flights" @tabMenuClick="handleFlightChange" class="mt-3"/>
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
<div class="w-full flex flex-row flex-wrap justify-center" :class="this.event.Flights > 1 ? 'mt-0' : 'mt-4'">
|
|
9
|
+
<div v-for="pool in filteredPools" :key="pool.Name">
|
|
8
10
|
<Pool
|
|
9
11
|
:poolName="pool.Name"
|
|
10
12
|
:ringName="pool.RingName"
|
|
11
13
|
:poolInd="pool.poolStrengthInd"
|
|
12
|
-
:directorName="pool.
|
|
14
|
+
:directorName="getDirectorName(pool.Staff)"
|
|
13
15
|
:pool="pool.participants"
|
|
16
|
+
:staff="staff"
|
|
14
17
|
@swap-fencers="swapFencers"
|
|
18
|
+
@update:setDirector="setDirector"
|
|
15
19
|
/>
|
|
16
20
|
</div>
|
|
21
|
+
<div v-if="filteredPools.length < 1" class="w-full flex justify-center items-center">
|
|
22
|
+
<div class="text-center">
|
|
23
|
+
<img alt="Small desert scene with wind blowing." class="w-96 mx-auto" :src="emptyDesertIcon" />
|
|
24
|
+
<BaseText text="0 Fencers are Checked in" size="lg" color="primary" weight="normal" class="center" />
|
|
25
|
+
<BaseText text="Go Back Seeding and Checkin to mark fencers as present." size="sm" color="primary" weight="normal" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
</div>
|
|
17
30
|
|
|
31
|
+
<div v-if="filteredPools.length > 1" class="grid grid-cols-2 gap-4 mx-8 mt-8">
|
|
32
|
+
<BaseButton label="Reset Pools" size="md" icon-name="fa-rotate-right" icon-style="fa-solid" type="graySecondary" :icon-left="true" class="max-w-96 justify-self-end" @click="handleReset" />
|
|
33
|
+
<BaseButton label="Start Pools" size="md" icon-name="fa-caret-right" icon-style="fa-solid" type="secondary" :icon-left="false" class="max-w-96 justify-self-start" @click="handleStart" />
|
|
18
34
|
</div>
|
|
19
35
|
</section>
|
|
20
36
|
</template>
|
|
21
37
|
|
|
22
38
|
<script>
|
|
23
|
-
import EditTournamentMenu from "../../Menus/EditTournamentMenu/EditTournamentMenu.vue";
|
|
24
|
-
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
25
|
-
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
26
|
-
import EventCard from "../../../Organisms/Cards/EventCard/EventCard.vue";
|
|
27
|
-
import emptyDesertIcon from '../../../../assets/empty_desert_icon.png';
|
|
28
|
-
import FencerCard from "../../../Organisms/Cards/FencerCard/FencerCard.vue";
|
|
29
39
|
import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
|
|
30
|
-
import DropDownMenu from "../../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue";
|
|
31
|
-
import FindOrAddPerson from "../../../Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue";
|
|
32
|
-
import AttendanceSummary from "../../../Organisms/Headers/AttendanceSummary/AttendanceSummary.vue";
|
|
33
40
|
import PoolSummary from "../../../Organisms/Headers/PoolSummary/PoolSummary.vue";
|
|
34
41
|
import Pool from "../../../Organisms/Containers/Pool/Pool.vue";
|
|
42
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
43
|
+
import emptyDesertIcon from '../../../../assets/empty_desert_icon.png';
|
|
44
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
35
45
|
|
|
36
46
|
export default {
|
|
37
47
|
components: {
|
|
38
|
-
Pool,
|
|
39
|
-
PoolSummary,
|
|
40
|
-
AttendanceSummary,
|
|
41
|
-
FindOrAddPerson,
|
|
42
|
-
DropDownMenu,
|
|
43
|
-
EditEventsTopMenu,
|
|
44
|
-
FencerCard,
|
|
45
|
-
EventCard,
|
|
46
|
-
EditTournamentMenu,
|
|
47
48
|
BaseText,
|
|
48
49
|
BaseButton,
|
|
50
|
+
EditEventsTopMenu,
|
|
51
|
+
PoolSummary,
|
|
52
|
+
Pool
|
|
49
53
|
},
|
|
50
54
|
props: {
|
|
51
55
|
event: Object,
|
|
52
|
-
poolAssignments: Object
|
|
56
|
+
poolAssignments: Object,
|
|
57
|
+
mode: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: true,
|
|
60
|
+
validator: value => ['Planning', 'Preparation', 'Live', 'Complete'].includes(value)
|
|
61
|
+
},
|
|
62
|
+
staff: {
|
|
63
|
+
type: Array,
|
|
64
|
+
default: () => []
|
|
65
|
+
}
|
|
53
66
|
},
|
|
54
67
|
data() {
|
|
55
68
|
return {
|
|
@@ -61,26 +74,63 @@ export default {
|
|
|
61
74
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
62
75
|
{id: 'Bracket', label: 'Bracket', color: 'primaryHighlight'},
|
|
63
76
|
{id: 'Final', label: 'Final Results', color: 'primaryHighlight'}
|
|
64
|
-
]
|
|
77
|
+
],
|
|
78
|
+
selectedFlight: 'Flight1'
|
|
65
79
|
};
|
|
66
80
|
},
|
|
67
|
-
computed: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
computed: {
|
|
82
|
+
flights() {
|
|
83
|
+
const numberOfFlights = this.event.Flights || 0;
|
|
84
|
+
const flightTabs = Array.from({ length: numberOfFlights }, (_, index) => ({
|
|
85
|
+
id: `Flight${index + 1}`,
|
|
86
|
+
label: `Flight ${index + 1}`,
|
|
87
|
+
color: 'primaryHighlight'
|
|
88
|
+
}));
|
|
89
|
+
return [{ id: 'All', label: 'All', color: 'primaryHighlight' }, ...flightTabs];
|
|
71
90
|
},
|
|
91
|
+
filteredPools() {
|
|
92
|
+
if (this.selectedFlight === 'All') {
|
|
93
|
+
return this.poolAssignments;
|
|
94
|
+
}
|
|
95
|
+
const flightNumber = parseInt(this.selectedFlight.replace('Flight', ''), 10);
|
|
96
|
+
return this.poolAssignments.filter(pool => pool.Flight === flightNumber);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
72
100
|
handleTabMenuClick(value) {
|
|
73
101
|
this.$emit('tab:menu-click', value);
|
|
74
102
|
},
|
|
75
103
|
handlePoolSizeChange(poolSize) {
|
|
76
104
|
this.$emit('update:poolSize', poolSize);
|
|
77
105
|
},
|
|
78
|
-
|
|
106
|
+
handleNumberOfRings(numberOfRings) {
|
|
79
107
|
this.$emit('update:numberOfRings', numberOfRings);
|
|
80
108
|
},
|
|
81
|
-
|
|
109
|
+
handlePoolReset() {
|
|
110
|
+
|
|
82
111
|
this.$emit('reset:pool');
|
|
83
|
-
}
|
|
112
|
+
},
|
|
113
|
+
handleFlightChange(value) {
|
|
114
|
+
this.selectedFlight = value;
|
|
115
|
+
},
|
|
116
|
+
handleReset() {
|
|
117
|
+
this.$emit('reset:pool');
|
|
118
|
+
},
|
|
119
|
+
handleStart() {
|
|
120
|
+
this.$emit('start:pool');
|
|
121
|
+
},
|
|
122
|
+
getDirectorName(staffArray) {
|
|
123
|
+
const director = staffArray.find(staff => staff.Role === 'Director');
|
|
124
|
+
return director ? director.Person.DisplayName : 'Unassigned';
|
|
125
|
+
},
|
|
126
|
+
swapFencers({ draggedPerson }) {
|
|
127
|
+
console.log('swapFencers', draggedPerson);
|
|
128
|
+
this.$emit('update:swapFencers', {draggedPerson});
|
|
129
|
+
},
|
|
130
|
+
setDirector(personId) {
|
|
131
|
+
console.log('setDirector', personId);
|
|
132
|
+
this.$emit('update:director', personId );
|
|
133
|
+
},
|
|
84
134
|
}
|
|
85
135
|
}
|
|
86
136
|
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import StaffList from './StaffList.vue';
|
|
2
|
+
import getAllStaffByTournamentId from '../../../../mocks/getAllStaffByTournamentId.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Templates/EventManagement/StaffList',
|
|
6
|
+
component: StaffList,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
personsAll: [
|
|
10
|
+
{ id: 1, firstName: 'John', lastName: 'Doe' },
|
|
11
|
+
{ id: 2, firstName: 'Jane', lastName: 'Smith' },
|
|
12
|
+
],
|
|
13
|
+
event: {
|
|
14
|
+
EventId: 1,
|
|
15
|
+
EventName: 'Sample Event'
|
|
16
|
+
},
|
|
17
|
+
fencingClubs: [
|
|
18
|
+
{ ClubId: 1, Name: 'Acme Fencing Club' },
|
|
19
|
+
{ ClubId: 2, Name: 'Global Fencing Academy' }
|
|
20
|
+
],
|
|
21
|
+
staffMembers: getAllStaffByTournamentId,
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
personsAll: {
|
|
25
|
+
control: 'object',
|
|
26
|
+
},
|
|
27
|
+
event: {
|
|
28
|
+
control: 'object',
|
|
29
|
+
},
|
|
30
|
+
fencingClubs: {
|
|
31
|
+
control: 'object',
|
|
32
|
+
},
|
|
33
|
+
staffMembers: {
|
|
34
|
+
control: 'object',
|
|
35
|
+
},
|
|
36
|
+
'tab:menu-click': { action: 'tab:menu-click' },
|
|
37
|
+
'update:assignment': { action: 'update:assignment' },
|
|
38
|
+
'add:person': { action: 'add:person' },
|
|
39
|
+
'add:existing-person': { action: 'add:existing-person' },
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export const Default = {
|
|
45
|
+
personsAll: [
|
|
46
|
+
{ id: 1, firstName: 'John', lastName: 'Doe' },
|
|
47
|
+
{ id: 2, firstName: 'Jane', lastName: 'Smith' },
|
|
48
|
+
],
|
|
49
|
+
event: {
|
|
50
|
+
EventId: 1,
|
|
51
|
+
EventName: 'Sample Event'
|
|
52
|
+
},
|
|
53
|
+
fencingClubs: [
|
|
54
|
+
{ ClubId: 1, Name: 'Acme Fencing Club' },
|
|
55
|
+
{ ClubId: 2, Name: 'Global Fencing Academy' }
|
|
56
|
+
],
|
|
57
|
+
staffMembers: getAllStaffByTournamentId,
|
|
58
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section>
|
|
3
|
+
<EditEventsTopMenu :currentTab="'Staff'" :tabs="tabs" @tabMenuClick="handleTabMenuClick"/>
|
|
4
|
+
<StaffSummary :currentSelection="viewName" @update:selection="handleStaffView"/>
|
|
5
|
+
|
|
6
|
+
<div class="w-full flex flex-row justify-center mt-3">
|
|
7
|
+
<section class="w-full">
|
|
8
|
+
<div class="w-full flex flex-col justify-center items-center" style="text-align: center">
|
|
9
|
+
<section class="grid grid-cols-2 w-full py-2">
|
|
10
|
+
<div class="col-start-1 col-end-2 flex justify-start">
|
|
11
|
+
<FindOrAddPerson
|
|
12
|
+
:persons="personsAll"
|
|
13
|
+
:fencingClubs="fencingClubs"
|
|
14
|
+
:addBorder="false"
|
|
15
|
+
:addNewText="'Add Staff'"
|
|
16
|
+
@new-person-submitted="handleNewPerson"
|
|
17
|
+
@person-selected="handleAddExistingPerson" />
|
|
18
|
+
</div>
|
|
19
|
+
<div class="col-start-2 col-end-3 flex justify-end mt-4 mr-2">
|
|
20
|
+
<BaseText :text="staffCountText" size="sm" color="quaternary" weight="normal"/>
|
|
21
|
+
</div>
|
|
22
|
+
</section>
|
|
23
|
+
|
|
24
|
+
<div v-if="staffMembers.length === 0" class="mb-10">
|
|
25
|
+
<img alt="Small desert scene with wind blowing." class="w-96" :src="emptyDesertIcon"/>
|
|
26
|
+
<BaseText :color="'primaryHighlight'" :size="'lg'" :text="'0 staff members added yet.'"
|
|
27
|
+
:weight="'normal'" data-testid="text-num-staff"/>
|
|
28
|
+
<BaseText :color="'primaryHighlight'" :size="'lg'" :text="'Click below to add the first staff member'"
|
|
29
|
+
:weight="'normal'" data-testid="text-num-staff"/>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div v-if="viewName === 'Staff List'" class="mt-4 w-full">
|
|
33
|
+
<div v-for="staff in staffMembers" :key="staff.Id">
|
|
34
|
+
<StaffCard :staff="staff" class="mb-4" @update:assignment="handleAssignment" />
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div v-if="viewName === 'Staff Assignments'" class="mt-4 w-full">
|
|
39
|
+
<div v-for="(pool, poolId) in groupedStaffByPool" :key="poolId">
|
|
40
|
+
<BaseText :text="`${pool.poolName} - ${pool.ringName}`" size="lg" color="quaternary" weight="bold" class="py-2 " />
|
|
41
|
+
<div v-for="staff in pool.staff" :key="staff.Id">
|
|
42
|
+
<StaffCard :staff="staff" class="mb-4" />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
</section>
|
|
49
|
+
</div>
|
|
50
|
+
</section>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
|
|
55
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
56
|
+
import emptyDesertIcon from '../../../../assets/empty_desert_icon.png';
|
|
57
|
+
import FindOrAddPerson from "../../../Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue";
|
|
58
|
+
import StaffCard from "../../../Organisms/Cards/StaffCard/StaffCard.vue";
|
|
59
|
+
import StaffSummary from "../../../Organisms/Headers/StaffSummary/StaffSummary.vue";
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
components: {
|
|
63
|
+
StaffSummary,
|
|
64
|
+
FindOrAddPerson,
|
|
65
|
+
EditEventsTopMenu,
|
|
66
|
+
StaffCard,
|
|
67
|
+
BaseText,
|
|
68
|
+
},
|
|
69
|
+
props: {
|
|
70
|
+
personsAll: Array,
|
|
71
|
+
event: Object,
|
|
72
|
+
fencingClubs: {
|
|
73
|
+
type: Array,
|
|
74
|
+
default: () => []
|
|
75
|
+
},
|
|
76
|
+
staffMembers: {
|
|
77
|
+
type: Array,
|
|
78
|
+
default: () => []
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
return {
|
|
83
|
+
emptyDesertIcon,
|
|
84
|
+
tabs: [
|
|
85
|
+
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
86
|
+
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
87
|
+
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
88
|
+
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
89
|
+
{id: 'Bracket', label: 'Bracket', color: 'primaryHighlight'},
|
|
90
|
+
{id: 'Final', label: 'Final Results', color: 'primaryHighlight'}
|
|
91
|
+
],
|
|
92
|
+
viewName: "Staff List"
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
computed: {
|
|
96
|
+
staffCountText() {
|
|
97
|
+
return `${this.staffMembers.length} staff members`;
|
|
98
|
+
},
|
|
99
|
+
groupedStaffByPool() {
|
|
100
|
+
return this.groupStaffByPool(this.staffMembers);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
methods: {
|
|
104
|
+
groupStaffByPool(staff) {
|
|
105
|
+
return staff.reduce((acc, item) => {
|
|
106
|
+
const poolId = item.Pool ? item.Pool.PoolId : 'Unassigned';
|
|
107
|
+
if (!acc[poolId]) {
|
|
108
|
+
acc[poolId] = {
|
|
109
|
+
poolName: item.Pool ? item.Pool.Name : 'Unassigned',
|
|
110
|
+
ringName: item.Pool ? item.Pool.RingName : '',
|
|
111
|
+
staff: []
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
acc[poolId].staff.push(item);
|
|
115
|
+
return acc;
|
|
116
|
+
}, {})
|
|
117
|
+
},
|
|
118
|
+
handleTabMenuClick(value) {
|
|
119
|
+
this.$emit('tab:menu-click', value);
|
|
120
|
+
},
|
|
121
|
+
handleAssignment(staff) {
|
|
122
|
+
this.$emit('update:assignment', staff);
|
|
123
|
+
},
|
|
124
|
+
handleNewPerson(value) {
|
|
125
|
+
this.$emit('add:person', value);
|
|
126
|
+
},
|
|
127
|
+
handleAddExistingPerson(value) {
|
|
128
|
+
this.$emit('add:existing-person', value);
|
|
129
|
+
},
|
|
130
|
+
handleStaffView(value){
|
|
131
|
+
this.viewName = value;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</script>
|
|
@@ -38,10 +38,15 @@ export default {
|
|
|
38
38
|
default: () => []
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
watch: {
|
|
42
|
+
currentTab(newVal) {
|
|
43
|
+
console.log('currentTab changed to:', newVal);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
41
46
|
methods: {
|
|
42
47
|
handleButtonClick(buttonId) {
|
|
43
48
|
this.$emit('tabMenuClick', buttonId);
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
|
-
</script>
|
|
52
|
+
</script>
|
package/tailwind.config.js
CHANGED
|
@@ -34,11 +34,13 @@ module.exports = {
|
|
|
34
34
|
quaternary: '#8991AC',
|
|
35
35
|
quinary: '#989daa',
|
|
36
36
|
secondary: '#2B324B',
|
|
37
|
+
graySecondary: '#C0C5CA',
|
|
37
38
|
tertiary: '#F6FAFD',
|
|
38
39
|
eventBoxBlue: '#eff4f7',
|
|
39
40
|
eventBoxGreen: '#f3f7ef',
|
|
40
41
|
eventBoxRed: '#f7efef',
|
|
41
42
|
poolSetup: '#F6FAFD',
|
|
43
|
+
poolBox: '#f7f8fb'
|
|
42
44
|
},
|
|
43
45
|
boxShadow: {
|
|
44
46
|
custom: 'var(--tw-shadow)',
|