@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.
Files changed (26) hide show
  1. package/dist/HemaTournamentUI-lib.es.js +11 -4
  2. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  3. package/package.json +1 -1
  4. package/src/mocks/getClubDisplayByClubId.js +107 -0
  5. package/src/mocks/getEventByTournamentId.js +50 -0
  6. package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +2 -2
  7. package/src/stories/Molecules/Modals/AddDisplayModal/AddDisplay.stories.js +47 -0
  8. package/src/stories/Molecules/Modals/AddDisplayModal/AddDisplayModal.vue +56 -0
  9. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -2
  10. package/src/stories/Organisms/Cards/DisplayCard/DisplayCard.stories.js +47 -0
  11. package/src/stories/Organisms/Cards/DisplayCard/DisplayCard.vue +97 -0
  12. package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +1 -1
  13. package/src/stories/Organisms/Containers/ClubDisplayContainer/ClubDisplayContainer.stories.js +30 -0
  14. package/src/stories/Organisms/Containers/ClubDisplayContainer/ClubDisplayContainer.vue +106 -0
  15. package/src/stories/Organisms/Form/AddDisplay/AddDisplay.stories.js +36 -0
  16. package/src/stories/Organisms/Form/AddDisplay/AddDisplay.vue +132 -0
  17. package/src/stories/Organisms/ScoreBoardParts/FencerNameBar/FencerNameBar.vue +1 -1
  18. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +1 -0
  19. package/src/stories/Templates/EventManagement/ClubDisplay/ClubDisplay.stories.js +44 -0
  20. package/src/stories/Templates/EventManagement/ClubDisplay/ClubDisplay.vue +88 -0
  21. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +1 -0
  22. package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +1 -0
  23. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +1 -0
  24. package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +1 -0
  25. package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +1 -0
  26. package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +1 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/hematournamentui",
3
3
  "private": false,
4
- "version": "1.0.183",
4
+ "version": "1.0.185",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -0,0 +1,107 @@
1
+ const getCLubDisplayByClubId =
2
+ [
3
+ {
4
+ "DisplayId": 1,
5
+ "DisplayName": "Ring 1",
6
+ "Type": "ScoreBoard",
7
+ "AssignedToType": "Person",
8
+ "AssignedToId": 1,
9
+ "ClubId": 1,
10
+ "Person": {
11
+ "PersonId": 1,
12
+ "DisplayName": "Dwain Crackel",
13
+ "Pronouns": "He/Him",
14
+ "FirstName": "Dave",
15
+ "LastName": "Smith",
16
+ "Birthday": "1980-07-16",
17
+ "ClubId": 4,
18
+ "ShowData": true,
19
+ "AccessLevel": "User"
20
+ },
21
+ "Event": null
22
+ },
23
+ {
24
+ "DisplayId": 2,
25
+ "DisplayName": "Ring 2",
26
+ "Type": "ScoreBoard",
27
+ "AssignedToType": "Person",
28
+ "AssignedToId": 2,
29
+ "ClubId": 1,
30
+ "Person": {
31
+ "PersonId": 2,
32
+ "DisplayName": "Kyle Edwards",
33
+ "Pronouns": "They/Them",
34
+ "FirstName": "Kyle",
35
+ "LastName": "Edwards",
36
+ "Birthday": null,
37
+ "ClubId": 6,
38
+ "ShowData": true,
39
+ "AccessLevel": "User"
40
+ },
41
+ "Event": null
42
+ },
43
+ {
44
+ "DisplayId": 3,
45
+ "DisplayName": "Ring 3",
46
+ "Type": "ScoreBoard",
47
+ "AssignedToType": "Person",
48
+ "AssignedToId": 3,
49
+ "ClubId": 1,
50
+ "Person": {
51
+ "PersonId": 3,
52
+ "DisplayName": "Dave Larabee",
53
+ "Pronouns": null,
54
+ "FirstName": "Dave",
55
+ "LastName": "Larabee",
56
+ "Birthday": null,
57
+ "ClubId": 3,
58
+ "ShowData": true,
59
+ "AccessLevel": "User"
60
+ },
61
+ "Event": null
62
+ },
63
+ {
64
+ "DisplayId": 4,
65
+ "DisplayName": "Ring 4",
66
+ "Type": "ScoreBoard",
67
+ "AssignedToType": "Person",
68
+ "AssignedToId": 4,
69
+ "ClubId": 1,
70
+ "Person": {
71
+ "PersonId": 4,
72
+ "DisplayName": "Kim Bullock",
73
+ "Pronouns": "He/Him",
74
+ "FirstName": "Kim",
75
+ "LastName": "Bullock",
76
+ "Birthday": "1963-07-09",
77
+ "ClubId": 1,
78
+ "ShowData": true,
79
+ "AccessLevel": "User"
80
+ },
81
+ "Event": null
82
+ },
83
+ {
84
+ "DisplayId": 5,
85
+ "DisplayName": "FlightBoard 1",
86
+ "Type": "FlightBoard",
87
+ "AssignedToType": "Event",
88
+ "AssignedToId": 6,
89
+ "ClubId": 1,
90
+ "Person": null,
91
+ "Event": {
92
+ "EventId": 6,
93
+ "TournamentId": 4,
94
+ "EventName": "Saber Cat Saber",
95
+ "Date": "2024-06-16",
96
+ "StartTime": "23:03:24",
97
+ "NumberOfRings": 2,
98
+ "NumberOfPools": 3,
99
+ "PoolSize": 7,
100
+ "Flights": 1,
101
+ "WeaponId": 2,
102
+ "Status": "live"
103
+ }
104
+ }
105
+ ]
106
+
107
+ export default getCLubDisplayByClubId;
@@ -0,0 +1,50 @@
1
+ const getEventByTournamentId =
2
+ [
3
+ {
4
+ "EventId": 5,
5
+ "TournamentId": 4,
6
+ "EventName": "Feline Longsword",
7
+ "Date": "2024-05-22",
8
+ "StartTime": "17:25:31",
9
+ "NumberOfRings": 2,
10
+ "NumberOfPools": 3,
11
+ "PoolSize": 7,
12
+ "Flights": 1,
13
+ "WeaponId": 1,
14
+ "Status": "completed",
15
+ "Present": 10,
16
+ "Absent": 0
17
+ },
18
+ {
19
+ "EventId": 6,
20
+ "TournamentId": 4,
21
+ "EventName": "Saber Cat Saber",
22
+ "Date": "2024-06-16",
23
+ "StartTime": "23:03:24",
24
+ "NumberOfRings": 2,
25
+ "NumberOfPools": 3,
26
+ "PoolSize": 7,
27
+ "Flights": 1,
28
+ "WeaponId": 2,
29
+ "Status": "live",
30
+ "Present": 6,
31
+ "Absent": 0
32
+ },
33
+ {
34
+ "EventId": 7,
35
+ "TournamentId": 4,
36
+ "EventName": "Paws and Effect",
37
+ "Date": "2024-07-17",
38
+ "StartTime": "11:00:00",
39
+ "NumberOfRings": 3,
40
+ "NumberOfPools": 3,
41
+ "PoolSize": 7,
42
+ "Flights": 1,
43
+ "WeaponId": 3,
44
+ "Status": "planning",
45
+ "Present": 0,
46
+ "Absent": 0
47
+ }
48
+ ];
49
+
50
+ export default getEventByTournamentId;
@@ -63,7 +63,7 @@ export default {
63
63
  }[props.size];
64
64
 
65
65
  const typeClass = {
66
- primary: `mx-1 p-2 items-center gap-2.5 text-center rounded-md shadow border border-dropdownSelect justify-center hover:bg-tertiary ${props.selected ? 'bg-dropdownSelect' : 'bg-neutral'}`,
66
+ primary: `mx-1 p-2 items-center gap-2.5 text-center rounded-md shadow border border-dropdownSelect justify-center hover:bg-tertiary ${props.selected ? 'bg-dropdownSelect shadow-md' : 'bg-neutral'}`,
67
67
  secondary: `px-2.5 items-center gap-2.5 text-center my-1 p-3 w-full rounded-lg flex flex-row justify-center hover:bg-primaryHighlight ${props.selected ? 'bg-secondary' : 'bg-primary'}`,
68
68
  tertiary: `px-2.5 py-0.5 items-center gap-2.5 rounded-md text-center justify-center border border-dropdownSelect hover:bg-dropdownSelect ${props.selected ? 'bg-primary' : 'bg-tertiary'}`,
69
69
  bright: `px-3 py-1 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral ${props.selected ? 'bg-primary' : 'bg-bright'}`,
@@ -86,7 +86,7 @@ export default {
86
86
  return {
87
87
  textColor: computed(() => {
88
88
  const colorMap = {
89
- primary: 'primary',
89
+ primary: 'quinary',
90
90
  secondary: 'neutral',
91
91
  tertiary: 'quinary',
92
92
  bright: 'neutral',
@@ -0,0 +1,47 @@
1
+ import AddDisplayModal from './AddDisplayModal.vue';
2
+ import getAllStaffByTournamentId from "../../../../mocks/getAllStaffByTournamentId.js";
3
+ import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js";
4
+
5
+ export default {
6
+ title: 'Molecules/Modals/AddDisplayModal',
7
+ component: AddDisplayModal,
8
+ tags: ['autodocs'],
9
+ args: {
10
+ displayType: "ScoreBoard",
11
+ displayName: "Ring 1",
12
+ assignedTo: { text: "Dave Smith", link: "1" },
13
+ assignedToEvent: { text: "Cats and things", link: "1" },
14
+ staffDropDown: getAllStaffByTournamentId,
15
+ eventDropDown: getEventByTournamentId
16
+ },
17
+ argTypes: {
18
+ displayType: { control: { type: 'text' } },
19
+ displayName: { control: { type: 'text' } },
20
+ assignedTo: { control: { type: 'object' } },
21
+ assignedToEvent: { control: { type: 'object' } },
22
+ staffDropDown: { control: { type: 'array' } },
23
+ eventDropDown: { control: { type: 'array' } },
24
+ },
25
+ };
26
+
27
+ export const Default = {
28
+ args: {
29
+ displayType: "ScoreBoard",
30
+ displayName: "Ring 1",
31
+ assignedTo: { text: "Dave Smith", link: "1" },
32
+ assignedToEvent: { text: "Cats and things", link: "1" },
33
+ staffDropDown: getAllStaffByTournamentId,
34
+ eventDropDown: getEventByTournamentId
35
+ },
36
+ };
37
+
38
+ export const WithInitialCount = {
39
+ args: {
40
+ displayType: "FlightBoard",
41
+ displayName: "FlightBoard 1",
42
+ assignedTo: { text: "Jenny Jones", link: "2" },
43
+ assignedToEvent: { text: "Cats and things", link: "1" },
44
+ staffDropDown: getAllStaffByTournamentId,
45
+ eventDropDown: getEventByTournamentId
46
+ },
47
+ };
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <transition
3
+ enter-active-class="transition-opacity duration-500"
4
+ enter-class="opacity-0"
5
+ enter-to-class="opacity-100"
6
+ leave-active-class="transition-opacity duration-500"
7
+ leave-class="opacity-100"
8
+ leave-to-class="opacity-0"
9
+ >
10
+ <div v-if="show" class="fixed inset-0 bg-secondary bg-opacity-75 flex items-center justify-center z-50" @click="handleClose">
11
+ <div class="w-1/3 min-w-[30rem] bg-neutral rounded-lg shadow-lg pb-6 px-2" @click.stop>
12
+ <div class="flex w-full justify-end mt-1">
13
+ <BaseIcon icon-name="fa-circle-xmark" size="lg" color="quaternary" hover="alarm" @click="handleClose"/>
14
+ </div>
15
+ <AddDisplay :isAdmin="isAdmin" :clubs="clubs" :userClub="userClub" @update:cancel="handleClose" @update:submit="handleSubmit" />
16
+ </div>
17
+ </div>
18
+ </transition>
19
+ </template>
20
+
21
+ <script>
22
+ import DirectorCard from "../../../Organisms/Cards/Director/DirectorCard.vue";
23
+ import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
24
+ import AddDisplay from "../../../Organisms/Form/AddDisplay/AddDisplay.vue";
25
+
26
+ export default {
27
+ name: "AddDisplayModal",
28
+ components: {AddDisplay, BaseIcon, DirectorCard},
29
+ props: {
30
+ show: {
31
+ type: Boolean,
32
+ default: true
33
+ },
34
+ clubs: {
35
+ type: Array,
36
+ required: true
37
+ },
38
+ userClub: {
39
+ type: Object,
40
+ required: true
41
+ },
42
+ isAdmin: {
43
+ type: Boolean,
44
+ required: true
45
+ }
46
+ },
47
+ methods: {
48
+ handleClose() {
49
+ this.$emit('close:closeModal');
50
+ },
51
+ handleSubmit(display) {
52
+ this.$emit('submit:display', display);
53
+ }
54
+ }
55
+ };
56
+ </script>
@@ -7,8 +7,7 @@
7
7
  leave-class="opacity-100"
8
8
  leave-to-class="opacity-0"
9
9
  >
10
- <div v-if="show" class="fixed inset-0 bg-secondary bg-opacity-75 flex items-center justify-center z-50"
11
- @click="close">
10
+ <div v-if="show" class="fixed inset-0 bg-secondary bg-opacity-75 flex items-center justify-center z-50" @click="close">
12
11
  <div class="w-1/3 min-w-[30rem] bg-neutral rounded-lg shadow-lg pb-6 px-2" @click.stop>
13
12
  <div class="flex w-full justify-end mt-1">
14
13
  <BaseIcon icon-name="fa-circle-xmark" size="lg" color="quaternary" hover="alarm" @click="close"/>
@@ -0,0 +1,47 @@
1
+ import DisplayCard from './DisplayCard.vue';
2
+ import getAllStaffByTournamentId from "../../../../mocks/getAllStaffByTournamentId.js";
3
+ import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js";
4
+
5
+ export default {
6
+ title: 'Organisms/Cards/DisplayCard',
7
+ component: DisplayCard,
8
+ tags: ['autodocs'],
9
+ args: {
10
+ displayType: "ScoreBoard",
11
+ displayName: "Ring 1",
12
+ assignedTo: { text: "Dave Smith", link: "1" },
13
+ assignedToEvent: { text: "Cats and things", link: "1" },
14
+ staffDropDown: getAllStaffByTournamentId,
15
+ eventDropDown: getEventByTournamentId
16
+ },
17
+ argTypes: {
18
+ displayType: { control: { type: 'text' } },
19
+ displayName: { control: { type: 'text' } },
20
+ assignedTo: { control: { type: 'object' } },
21
+ assignedToEvent: { control: { type: 'object' } },
22
+ staffDropDown: { control: { type: 'array' } },
23
+ eventDropDown: { control: { type: 'array' } },
24
+ },
25
+ };
26
+
27
+ export const Default = {
28
+ args: {
29
+ displayType: "ScoreBoard",
30
+ displayName: "Ring 1",
31
+ assignedTo: { text: "Dave Smith", link: "1" },
32
+ assignedToEvent: { text: "Cats and things", link: "1" },
33
+ staffDropDown: getAllStaffByTournamentId,
34
+ eventDropDown: getEventByTournamentId
35
+ },
36
+ };
37
+
38
+ export const WithInitialCount = {
39
+ args: {
40
+ displayType: "FlightBoard",
41
+ displayName: "FlightBoard 1",
42
+ assignedTo: { text: "Jenny Jones", link: "2" },
43
+ assignedToEvent: { text: "Cats and things", link: "1" },
44
+ staffDropDown: getAllStaffByTournamentId,
45
+ eventDropDown: getEventByTournamentId
46
+ },
47
+ };
@@ -0,0 +1,97 @@
1
+ <template>
2
+ <div class="flex items-center border border-dropdownSelect rounded-lg shadow-md bg-poolBox hover:border-bright">
3
+ <div class="mr-4 pl-4 h-14 pt-3">
4
+ <base-icon v-if="displayType === 'ScoreBoard'" icon-name="fa-screencast" size="2xl" color="quaternary" />
5
+ <base-icon v-if="displayType === 'FlightBoard'" icon-name="fa-screen-users" size="2xl" color="quaternary" />
6
+ </div>
7
+ <div class="flex flex-col w-full justify-start">
8
+ <div class="w-full flex justify-start">
9
+ <BaseText :text="displayName" size="lg" color="quaternary" class="w-40 mt-1"/>
10
+ <div class="flex justify-start w-full">
11
+ <DropDownMenu v-if="displayType === 'ScoreBoard'" :label="'Assigned: '" :items="formattedStaff" :selectedItem="localSelectedStaff" :alignEnd="false" width="w-52" @update:selectedItem="handleAssignmentStaff" />
12
+ <DropDownMenu v-if="displayType === 'FlightBoard'" :label="'Event: '" :items="formattedEvents" :selectedItem="localSelectedEvent" :alignEnd="false" width="w-52" @update:selectedItem="handleAssignmentEvent" />
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="border-l h-14 border-dropdownSelect items-center text-center hover:bg-eventBoxRed rounded-tr-lg rounded-br-lg px-2">
18
+ <BaseIcon iconName="fa-circle-xmark" size="2xl" color="quinary" class="pt-3" hover="alarm" @click="handlePopModal"/>
19
+ </div>
20
+ </div>
21
+
22
+
23
+ </template>
24
+
25
+ <script>
26
+ import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
27
+ import BaseText from "../../../Atoms/Text/BaseText.vue";
28
+ import DropDownMenu from "../../ComplexInputs/DropDown/DropDownMenu.vue";
29
+
30
+ export default {
31
+ name: 'DisplayCard',
32
+ components: { DropDownMenu, BaseText, BaseIcon },
33
+ props: {
34
+ displayType: {
35
+ type: String,
36
+ required: true
37
+ },
38
+ displayName: {
39
+ type: String,
40
+ required: false
41
+ },
42
+ assignedTo: {
43
+ type: Object,
44
+ required: false,
45
+ default: () => ({ text: '', link: '' })
46
+ },
47
+ assignedToEvent: {
48
+ type: Object,
49
+ required: false,
50
+ default: () => ({ text: '', link: '' })
51
+ },
52
+ staffDropDown: {
53
+ type: Array,
54
+ required: true,
55
+ default: () => []
56
+ },
57
+ eventDropDown: {
58
+ type: Array,
59
+ required: true,
60
+ default: () => []
61
+ },
62
+ },
63
+ data() {
64
+ return {
65
+ localSelectedStaff: this.assignedTo,
66
+ localSelectedEvent: this.assignedToEvent
67
+ };
68
+ },
69
+ computed: {
70
+ formattedStaff() {
71
+ return this.staffDropDown.map(staff => ({
72
+ text: staff.Person.DisplayName,
73
+ link: staff.PersonId.toString()
74
+ }));
75
+ },
76
+ formattedEvents() {
77
+ return this.eventDropDown.map(event => ({
78
+ text: event.EventName,
79
+ link: event.EventId.toString()
80
+ }));
81
+ },
82
+ },
83
+ methods: {
84
+ handlePopModal() {
85
+ this.$emit('pop:modal');
86
+ },
87
+ handleAssignmentStaff(item) {
88
+ this.localSelectedStaff = item;
89
+ this.$emit('update:selectedStaff', item);
90
+ },
91
+ handleAssignmentEvent(item) {
92
+ this.localSelectedEvent = item;
93
+ this.$emit('update:selectedEvent', item);
94
+ }
95
+ }
96
+ };
97
+ </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="flex flex-row w-full relative" :class="[alignEnd ? 'justify-end' : '']">
3
- <div class="z-10 rounded-lg px-2 py-2 flex flex-row justify-between border border-dropdownSelect" :class="width" @click="handleDropDown()">
3
+ <div class="z-10 rounded-lg px-2 py-2 flex flex-row justify-between border border-dropdownSelect bg-white" :class="width" @click="handleDropDown()">
4
4
  <BaseText v-if="label.length > 1" :text="label" color="quinary" size="sm" weight="normal" />
5
5
  <BaseText :text="selectedItem.text" color="secondary" size="sm" weight="normal" />
6
6
  <i class="fa-solid fa-chevron-down text-xs text-quinary" />
@@ -0,0 +1,30 @@
1
+ import ClubDisplayContainer from './ClubDisplayContainer.vue'
2
+ import getCLubDisplayByClubId from "../../../../mocks/getClubDisplayByClubId.js";
3
+ import getAllStaffByTournamentId from "../../../../mocks/getAllStaffByTournamentId.js";
4
+ import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js"
5
+
6
+ export default {
7
+ title: 'Organisms/Containers/ClubDisplayContainer',
8
+ component: ClubDisplayContainer,
9
+ tags: ['autodocs'],
10
+ args: {
11
+ displays: getCLubDisplayByClubId,
12
+ staffDropDown: getAllStaffByTournamentId,
13
+ eventDropDown: getEventByTournamentId
14
+ },
15
+ argTypes: {
16
+ displays: { control: 'object' },
17
+ staffDropDown: { control: 'object' },
18
+ eventDropDown: { control: 'object' },
19
+ },
20
+ }
21
+
22
+ //let modifiedEvent = {...generateFinalResults, Status: "results"}
23
+ export const Default = {
24
+ args: {
25
+ displays: getCLubDisplayByClubId,
26
+ staffDropDown: getAllStaffByTournamentId,
27
+ eventDropDown: getEventByTournamentId
28
+ }
29
+ }
30
+
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div class="mt-3">
3
+ <div class="flex flex-col w-full relative">
4
+ <section v-if="!displays">
5
+ <img alt="Small desert scene with wind blowing." class="w-96 mx-auto" :src="emptyDesertIcon"/>
6
+ <div class="w-full flex justify-center">
7
+ <div class="w-96">
8
+ <BaseText text="No Results Yet!" size="lg" color="quinary" weight="bold" class="text-center"/>
9
+ <BaseText
10
+ text="Pool results will be displayed here once all bouts have completed and the 'Generate Pool Results' button has been clicked on the Pools Tab."
11
+ size="sm" color="quinary" class="text-center"/>
12
+ </div>
13
+ </div>
14
+ </section>
15
+
16
+ <section v-if="scoreboards.length > 0" class="flex flex-col">
17
+ <div>
18
+ <BaseText text="Scoreboards" size="lg" color="primaryHighlight" weight="bold" class="w-full text-left"/>
19
+ <div class="border-b border-dropdownSelect mb-4" />
20
+ <div v-for="scoreboard in scoreboards" :key="scoreboard.DisplayId" class="flex flex-col py-1">
21
+ <DisplayCard :assignedTo="transformAssignedTo(scoreboard)"
22
+ :displayName="scoreboard.DisplayName"
23
+ :displayType="scoreboard.Type"
24
+ :eventDropDown="eventDropDown"
25
+ :staffDropDown="staffDropDown"
26
+ />
27
+ </div>
28
+ </div>
29
+
30
+ <div v-if="flightBoards.length > 0" class="mt-10">
31
+ <BaseText text="Flight Boards" size="lg" color="primaryHighlight" weight="bold" class="w-full text-left"/>
32
+ <div class="border-b border-dropdownSelect mb-4" />
33
+ <div v-for="flightBoard in flightBoards" :key="flightBoard.DisplayId" class="flex flex-col py-1">
34
+ <DisplayCard :assignedToEvent="transformAssignedTo(flightBoard)"
35
+ :displayName="flightBoard.DisplayName"
36
+ :displayType="flightBoard.Type"
37
+ :eventDropDown="eventDropDown"
38
+ :staffDropDown="staffDropDown"
39
+ />
40
+ </div>
41
+ </div>
42
+ </section>
43
+ </div>
44
+ </div>
45
+ </template>
46
+
47
+ <script>
48
+ import emptyDesertIcon from '../../../../assets/empty_desert_icon.png';
49
+ import BaseText from "../../../Atoms/Text/BaseText.vue";
50
+ import DisplayCard from "../../Cards/DisplayCard/DisplayCard.vue";
51
+
52
+
53
+ export default {
54
+ components: {
55
+ DisplayCard,
56
+ BaseText,
57
+ emptyDesertIcon
58
+ },
59
+ props: {
60
+ displays: {
61
+ type: Array,
62
+ required: true
63
+ },
64
+ eventDropDown: {
65
+ type: Array,
66
+ required: true
67
+ },
68
+ staffDropDown: {
69
+ type: Array,
70
+ required: true
71
+ }
72
+ },
73
+ data() {
74
+ return {
75
+ emptyDesertIcon
76
+ }
77
+ },
78
+ computed: {
79
+ scoreboards() {
80
+ return this.displays.filter(display => display.Type === 'ScoreBoard');
81
+ },
82
+ flightBoards() {
83
+ return this.displays.filter(display => display.Type === 'FlightBoard');
84
+ }
85
+ },
86
+ methods: {
87
+ transformAssignedTo(scoreboard) {
88
+ if (scoreboard.Person) {
89
+ return { text: scoreboard.Person.DisplayName, link: scoreboard.Person.DisplayName };
90
+ }
91
+
92
+ if (scoreboard.Event) {
93
+ console.log("EVENT")
94
+ console.log(scoreboard.Event.EventName)
95
+ return { text: scoreboard.Event.EventName, link: scoreboard.Event.EventName };
96
+ }
97
+
98
+ return { text: '', link: '' }
99
+ }
100
+ }
101
+ }
102
+ </script>
103
+
104
+
105
+
106
+
@@ -0,0 +1,36 @@
1
+ import AddDisplay from './AddDisplay.vue';
2
+ import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js"
3
+
4
+ export default {
5
+ title: 'Organisms/Forms/AddDisplay',
6
+ component: AddDisplay,
7
+ args: {
8
+ clubs: getEventByTournamentId,
9
+ userClub: { text: 'Club A', link: '1' },
10
+ isAdmin: true
11
+ },
12
+ argTypes: {
13
+ clubs: { control: 'object' },
14
+ userClub: { control: 'object' },
15
+ isAdmin: { control: 'boolean' }
16
+ },
17
+ };
18
+
19
+ export const Default = {
20
+ args: {
21
+ clubs: [
22
+ { text: 'Club A', link: '1' },
23
+ { text: 'Club B', link: '2' }
24
+ ],
25
+ userClub: { text: 'Club A', link: '1' },
26
+ isAdmin: true
27
+ }
28
+ };
29
+
30
+ export const ClubLevelUser = {
31
+ args: {
32
+ clubs: getEventByTournamentId,
33
+ userClub: { text: 'Club A', link: '1' },
34
+ isAdmin: false
35
+ }
36
+ };