@dcrackel/hematournamentui 1.0.183 → 1.0.185
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/HemaTournamentUI-lib.es.js +11 -4
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/package.json +1 -1
- package/src/mocks/getClubDisplayByClubId.js +107 -0
- package/src/mocks/getEventByTournamentId.js +50 -0
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +2 -2
- package/src/stories/Molecules/Modals/AddDisplayModal/AddDisplay.stories.js +47 -0
- package/src/stories/Molecules/Modals/AddDisplayModal/AddDisplayModal.vue +56 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -2
- package/src/stories/Organisms/Cards/DisplayCard/DisplayCard.stories.js +47 -0
- package/src/stories/Organisms/Cards/DisplayCard/DisplayCard.vue +97 -0
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +1 -1
- package/src/stories/Organisms/Containers/ClubDisplayContainer/ClubDisplayContainer.stories.js +30 -0
- package/src/stories/Organisms/Containers/ClubDisplayContainer/ClubDisplayContainer.vue +106 -0
- package/src/stories/Organisms/Form/AddDisplay/AddDisplay.stories.js +36 -0
- package/src/stories/Organisms/Form/AddDisplay/AddDisplay.vue +132 -0
- package/src/stories/Organisms/ScoreBoardParts/FencerNameBar/FencerNameBar.vue +1 -1
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +1 -0
- package/src/stories/Templates/EventManagement/ClubDisplay/ClubDisplay.stories.js +44 -0
- package/src/stories/Templates/EventManagement/ClubDisplay/ClubDisplay.vue +88 -0
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +1 -0
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +1 -0
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +1 -0
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +1 -0
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +1 -0
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +1 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="p-4 bg-neutral">
|
|
3
|
+
|
|
4
|
+
<div class="w-full flex flex-row justify-center mb-8">
|
|
5
|
+
<p :class="['bg-' + iconBackgroundColor, 'flex flex-row justify-center h-20 w-20 rounded-full', 'border border-' + iconBorderColor]">
|
|
6
|
+
<BaseIcon :icon-name="selectedDisplayType.text === 'ScoreBoard' ? 'fa-screencast' : 'fa-screen-users'" iconStyle="fa-solid" size="4xl" :color="iconColor" class="mb-3 mt-5" data-testid="base-icon" />
|
|
7
|
+
</p>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="w-full flex flex-row justify-center my-4">
|
|
11
|
+
<BaseText :color="'primaryHighlight'" :size="'2xl'" :text="'Add New Display'" :weight="'normal'" />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<!-- Display Name Input -->
|
|
15
|
+
<div class="mb-4">
|
|
16
|
+
<TitledInput :inputValue="localDisplay.displayName" :invalid="validation.displayName" placeholder="Enter Display Name"
|
|
17
|
+
title="Display Name" @update:value="handleDisplayNameChange" />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<!-- Display Type Dropdown/Toggle -->
|
|
21
|
+
<div class="mb-4">
|
|
22
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Display Type'" :weight="'normal'" class="mb-1"/>
|
|
23
|
+
<DropDownMenu :label="selectedDisplayType" :items="displayTypes" :selected-item="selectedDisplayType" :alignEnd="false" :width="'w-full'" @update:selectedItem="handleDisplayTypeChange" />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<!-- Club Dropdown -->
|
|
27
|
+
<div class="mb-4" v-if="isAdmin">
|
|
28
|
+
<BaseText :color="'quinary'" :size="'sm'" :text="'Club'" :weight="'normal'" class="mb-1"/>
|
|
29
|
+
<DropDownMenu :label="selectedClub" :items="clubs" :selected-item="selectedClub" :alignEnd="false" :width="'w-full'" @update:selectedItem="handleClubChange" />
|
|
30
|
+
</div>
|
|
31
|
+
<div class="mb-4" v-else>
|
|
32
|
+
<TitledInput :inputValue="selectedClub.text" :disabled="true" title="Club" />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<!-- Submit and Cancel Buttons -->
|
|
36
|
+
<div class="flex flex-row justify-center mt-10">
|
|
37
|
+
<div class="w-1/2 ml-1">
|
|
38
|
+
<BaseButton class="w-full" color="neutral" label="Cancel" size="sm" type="primary" @click="handleCancel"/>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="w-1/2 ml-1">
|
|
41
|
+
<BaseButton class="w-full transition-all duration-300 ease-in-out" color="neutral" label="Save" size="sm" type="primary" :selected="true" @click="handleSubmit"/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import TitledInput from "../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue";
|
|
49
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
50
|
+
import DropDownMenu from "../../ComplexInputs/DropDown/DropDownMenu.vue";
|
|
51
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
52
|
+
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
name: 'AddDisplay',
|
|
56
|
+
components: {BaseIcon, TitledInput, BaseText, DropDownMenu, BaseButton },
|
|
57
|
+
props: {
|
|
58
|
+
clubs: {
|
|
59
|
+
type: Array,
|
|
60
|
+
required: true
|
|
61
|
+
},
|
|
62
|
+
userClub: {
|
|
63
|
+
type: Object,
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
isAdmin: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
required: true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
iconName: 'fa-check-circle',
|
|
74
|
+
iconColor: 'accepted',
|
|
75
|
+
iconBackgroundColor: 'acceptedHighlight',
|
|
76
|
+
localDisplay: {
|
|
77
|
+
displayName: '',
|
|
78
|
+
displayType: '',
|
|
79
|
+
clubId: ''
|
|
80
|
+
},
|
|
81
|
+
selectedDisplayType: { text: 'ScoreBoard', link: 'ScoreBoard' },
|
|
82
|
+
selectedClub: this.userClub || (this.clubs.length === 1 ? this.clubs[0] : { text: '', link: '' }),
|
|
83
|
+
validation: {
|
|
84
|
+
displayName: false,
|
|
85
|
+
displayType: false,
|
|
86
|
+
club: false
|
|
87
|
+
},
|
|
88
|
+
displayTypes: [
|
|
89
|
+
{ text: 'ScoreBoard', link: 'ScoreBoard' },
|
|
90
|
+
{ text: 'FlightBoard', link: 'FlightBoard' }
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
methods: {
|
|
95
|
+
handleDisplayNameChange(value) {
|
|
96
|
+
this.localDisplay.displayName = value;
|
|
97
|
+
},
|
|
98
|
+
handleDisplayTypeChange(value) {
|
|
99
|
+
this.selectedDisplayType = value;
|
|
100
|
+
this.localDisplay.displayType = value.link;
|
|
101
|
+
},
|
|
102
|
+
handleClubChange(value) {
|
|
103
|
+
this.selectedClub = value;
|
|
104
|
+
this.localDisplay.clubId = value.link;
|
|
105
|
+
},
|
|
106
|
+
handleSubmit() {
|
|
107
|
+
this.validateForm();
|
|
108
|
+
if (!this.hasValidationErrors()) {
|
|
109
|
+
console.log(this.localDisplay);
|
|
110
|
+
this.$emit('update:submit', this.localDisplay);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
handleCancel() {
|
|
114
|
+
this.$emit('update:cancel');
|
|
115
|
+
},
|
|
116
|
+
validateForm() {
|
|
117
|
+
this.validation.displayName = !this.localDisplay.displayName;
|
|
118
|
+
this.validation.displayType = !this.localDisplay.displayType;
|
|
119
|
+
this.validation.club = !this.localDisplay.clubId;
|
|
120
|
+
},
|
|
121
|
+
hasValidationErrors() {
|
|
122
|
+
return this.validation.displayName || this.validation.displayType || this.validation.club;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
mounted() {
|
|
126
|
+
if (this.userClub || this.clubs.length === 1) {
|
|
127
|
+
this.localDisplay.clubId = this.selectedClub.link;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
</script>
|
|
132
|
+
|
|
@@ -111,6 +111,7 @@ export default {
|
|
|
111
111
|
selectedBout: {},
|
|
112
112
|
tabs: [
|
|
113
113
|
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
114
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
114
115
|
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
115
116
|
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
116
117
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import ClubDisplay from './ClubDisplay.vue';
|
|
2
|
+
import getCLubDisplayByClubId from "../../../../mocks/getClubDisplayByClubId.js";
|
|
3
|
+
import getAllStaffByTournamentId from "../../../../mocks/getAllStaffByTournamentId.js";
|
|
4
|
+
import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js"
|
|
5
|
+
|
|
6
|
+
// isAdmin: {
|
|
7
|
+
// userClub: {
|
|
8
|
+
// clubs: {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Templates/EventManagement/ClubDisplay',
|
|
13
|
+
component: ClubDisplay,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
args: {
|
|
16
|
+
displays: getCLubDisplayByClubId,
|
|
17
|
+
staffDropDown: getAllStaffByTournamentId,
|
|
18
|
+
eventDropDown: getEventByTournamentId,
|
|
19
|
+
isAdmin: false,
|
|
20
|
+
userClub: {text: 'Cats Club', link: '1'},
|
|
21
|
+
clubs: []
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
displays: { control: 'object' },
|
|
25
|
+
staffDropDown: { control: 'object' },
|
|
26
|
+
eventDropDown: { control: 'object' },
|
|
27
|
+
isAdmin: { control: 'boolean' },
|
|
28
|
+
userClub: { control: 'object' },
|
|
29
|
+
clubs: { control: 'array '},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const Default = {
|
|
35
|
+
args: {
|
|
36
|
+
displays: getCLubDisplayByClubId,
|
|
37
|
+
staffDropDown: getAllStaffByTournamentId,
|
|
38
|
+
eventDropDown: getEventByTournamentId,
|
|
39
|
+
isAdmin: false,
|
|
40
|
+
userClub: {text: 'Cats Club', link: '1'},
|
|
41
|
+
clubs: []
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section>
|
|
3
|
+
<EditEventsTopMenu :currentTab="'Displays'" :tabs="tabs" @tabMenuClick="handleTabMenuClick"/>
|
|
4
|
+
<ClubDisplayContainer :displays="displays" :eventDropDown="eventDropDown" :staffDropDown="staffDropDown" />
|
|
5
|
+
<div class="w-full flex justify-end mt-4">
|
|
6
|
+
<BaseButton iconName="fa-circle-plus" label="Add Display" icon-class="fa-regular" size="xs" type="primary" @click="openModal" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<AddDisplayModal :show="showModal" :isAdmin="isAdmin" :userClub="userClub" :clubs="clubs" @close:closeModal="closeModal" @submit:display="handleAddDisplay" />
|
|
10
|
+
</section>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import emptyDesertIcon from '../../../../assets/empty_desert_icon.png';
|
|
15
|
+
import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
|
|
16
|
+
import ClubDisplayContainer from "../../../Organisms/Containers/ClubDisplayContainer/ClubDisplayContainer.vue";
|
|
17
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
18
|
+
import AddDisplayModal from "../../../Molecules/Modals/AddDisplayModal/AddDisplayModal.vue";
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
components: {
|
|
23
|
+
AddDisplayModal,
|
|
24
|
+
BaseButton,
|
|
25
|
+
ClubDisplayContainer,
|
|
26
|
+
EditEventsTopMenu
|
|
27
|
+
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
displays: {
|
|
31
|
+
type: Array,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
eventDropDown: {
|
|
35
|
+
type: Array,
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
staffDropDown: {
|
|
39
|
+
type: Array,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
isAdmin: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
userClub: {
|
|
47
|
+
type: Object,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
clubs: {
|
|
51
|
+
type: Array,
|
|
52
|
+
required: true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
emptyDesertIcon,
|
|
58
|
+
showModal: false,
|
|
59
|
+
tabs: [
|
|
60
|
+
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
61
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
62
|
+
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
63
|
+
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
64
|
+
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
65
|
+
{id: 'Bracket', label: 'Bracket', color: 'primaryHighlight'},
|
|
66
|
+
{id: 'Final', label: 'Final Results', color: 'primaryHighlight'}
|
|
67
|
+
],
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
},
|
|
72
|
+
methods: {
|
|
73
|
+
openModal() {
|
|
74
|
+
console.log("open modal")
|
|
75
|
+
this.showModal = true;
|
|
76
|
+
},
|
|
77
|
+
closeModal() {
|
|
78
|
+
this.showModal = false;
|
|
79
|
+
},
|
|
80
|
+
handleAddDisplay(display) {
|
|
81
|
+
this.$emit('add:display', display);
|
|
82
|
+
},
|
|
83
|
+
handleTabMenuClick(value) {
|
|
84
|
+
this.$emit('tab:menu-click', value);
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
@@ -81,6 +81,7 @@ export default {
|
|
|
81
81
|
emptyDesertIcon,
|
|
82
82
|
tabs: [
|
|
83
83
|
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
84
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
84
85
|
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
85
86
|
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
86
87
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
@@ -30,6 +30,7 @@ export default {
|
|
|
30
30
|
return {
|
|
31
31
|
tabs: [
|
|
32
32
|
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
33
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
33
34
|
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
34
35
|
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
35
36
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
@@ -139,6 +139,7 @@ export default {
|
|
|
139
139
|
selectedBout: {},
|
|
140
140
|
tabs: [
|
|
141
141
|
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
142
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
142
143
|
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
143
144
|
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
144
145
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
@@ -70,6 +70,7 @@ export default {
|
|
|
70
70
|
emptyDesertIcon,
|
|
71
71
|
tabs: [
|
|
72
72
|
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
73
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
73
74
|
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
74
75
|
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
75
76
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
return {
|
|
63
63
|
tabs: [
|
|
64
64
|
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
65
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
65
66
|
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
66
67
|
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
67
68
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|
|
@@ -83,6 +83,7 @@ export default {
|
|
|
83
83
|
emptyDesertIcon,
|
|
84
84
|
tabs: [
|
|
85
85
|
{id: 'Staff', label: 'Staff', color: 'primaryHighlight'},
|
|
86
|
+
{id: 'Displays', label: 'Displays', color: 'primaryHighlight'},
|
|
86
87
|
{id: 'Checkin', label: 'Seeding & Checkin', color: 'primaryHighlight'},
|
|
87
88
|
{id: 'Pools', label: 'Pools', color: 'primaryHighlight'},
|
|
88
89
|
{id: 'Pool Results', label: 'Pool Results', color: 'primaryHighlight'},
|