@dcrackel/hematournamentui 1.0.185 → 1.0.187

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/hematournamentui",
3
3
  "private": false,
4
- "version": "1.0.185",
4
+ "version": "1.0.187",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
package/src/index.js CHANGED
@@ -39,4 +39,5 @@ export { default as PoolLive } from './stories/Templates/EventManagement/PoolLiv
39
39
  export { default as PoolResults } from './stories/Templates/EventManagement/PoolResults/PoolResults.vue';
40
40
  export { default as Bracket } from './stories/Templates/EventManagement/Bracket/Bracket.vue';
41
41
  export { default as EventFinalResults } from './stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue';
42
- export { default as ScoreBoard } from './stories/Templates/ScoreBoard/ScoreBoard.vue';
42
+ export { default as ScoreBoard } from './stories/Templates/ScoreBoard/ScoreBoard.vue';
43
+ export { default as ClubDisplay } from './stories/Templates/EventManagement/ClubDisplay/ClubDisplay.vue';
@@ -1,22 +1,21 @@
1
1
  import DisplayCard from './DisplayCard.vue';
2
2
  import getAllStaffByTournamentId from "../../../../mocks/getAllStaffByTournamentId.js";
3
3
  import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js";
4
+ import getCLubDisplayByClubId from "../../../../mocks/getClubDisplayByClubId.js";
4
5
 
5
6
  export default {
6
7
  title: 'Organisms/Cards/DisplayCard',
7
8
  component: DisplayCard,
8
9
  tags: ['autodocs'],
9
10
  args: {
10
- displayType: "ScoreBoard",
11
- displayName: "Ring 1",
11
+ displayObject: getCLubDisplayByClubId[0],
12
12
  assignedTo: { text: "Dave Smith", link: "1" },
13
13
  assignedToEvent: { text: "Cats and things", link: "1" },
14
14
  staffDropDown: getAllStaffByTournamentId,
15
15
  eventDropDown: getEventByTournamentId
16
16
  },
17
17
  argTypes: {
18
- displayType: { control: { type: 'text' } },
19
- displayName: { control: { type: 'text' } },
18
+ displayObject: { control: { type: 'object' } },
20
19
  assignedTo: { control: { type: 'object' } },
21
20
  assignedToEvent: { control: { type: 'object' } },
22
21
  staffDropDown: { control: { type: 'array' } },
@@ -26,8 +25,7 @@ export default {
26
25
 
27
26
  export const Default = {
28
27
  args: {
29
- displayType: "ScoreBoard",
30
- displayName: "Ring 1",
28
+ displayObject: getCLubDisplayByClubId[1],
31
29
  assignedTo: { text: "Dave Smith", link: "1" },
32
30
  assignedToEvent: { text: "Cats and things", link: "1" },
33
31
  staffDropDown: getAllStaffByTournamentId,
@@ -37,8 +35,7 @@ export const Default = {
37
35
 
38
36
  export const WithInitialCount = {
39
37
  args: {
40
- displayType: "FlightBoard",
41
- displayName: "FlightBoard 1",
38
+ displayObject: getCLubDisplayByClubId[4],
42
39
  assignedTo: { text: "Jenny Jones", link: "2" },
43
40
  assignedToEvent: { text: "Cats and things", link: "1" },
44
41
  staffDropDown: getAllStaffByTournamentId,
@@ -1,21 +1,21 @@
1
1
  <template>
2
2
  <div class="flex items-center border border-dropdownSelect rounded-lg shadow-md bg-poolBox hover:border-bright">
3
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" />
4
+ <base-icon v-if="displayObject.Type === 'ScoreBoard'" icon-name="fa-screencast" size="2xl" color="quaternary" />
5
+ <base-icon v-if="displayObject.Type === 'FlightBoard'" icon-name="fa-screen-users" size="2xl" color="quaternary" />
6
6
  </div>
7
7
  <div class="flex flex-col w-full justify-start">
8
8
  <div class="w-full flex justify-start">
9
- <BaseText :text="displayName" size="lg" color="quaternary" class="w-40 mt-1"/>
9
+ <BaseText :text="displayObject.DisplayName" size="lg" color="quaternary" class="w-40 mt-1"/>
10
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" />
11
+ <DropDownMenu v-if="displayObject.Type === 'ScoreBoard'" :label="'Assigned: '" :items="formattedStaff" :selectedItem="localSelectedStaff" :alignEnd="false" width="w-52" @update:selectedItem="handleAssignmentStaff" />
12
+ <DropDownMenu v-if="displayObject.Type === 'FlightBoard'" :label="'Event: '" :items="formattedEvents" :selectedItem="localSelectedEvent" :alignEnd="false" width="w-52" @update:selectedItem="handleAssignmentEvent" />
13
13
  </div>
14
14
  </div>
15
15
  </div>
16
16
 
17
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"/>
18
+ <BaseIcon iconName="fa-circle-xmark" size="2xl" color="quinary" class="pt-3" hover="alarm" @click="handleRemove"/>
19
19
  </div>
20
20
  </div>
21
21
 
@@ -31,14 +31,10 @@ export default {
31
31
  name: 'DisplayCard',
32
32
  components: { DropDownMenu, BaseText, BaseIcon },
33
33
  props: {
34
- displayType: {
35
- type: String,
34
+ displayObject: {
35
+ type: Object,
36
36
  required: true
37
37
  },
38
- displayName: {
39
- type: String,
40
- required: false
41
- },
42
38
  assignedTo: {
43
39
  type: Object,
44
40
  required: false,
@@ -81,16 +77,23 @@ export default {
81
77
  },
82
78
  },
83
79
  methods: {
84
- handlePopModal() {
85
- this.$emit('pop:modal');
80
+ handleRemove() {
81
+ this.$emit('update:remove', this.displayObject);
86
82
  },
87
83
  handleAssignmentStaff(item) {
88
- this.localSelectedStaff = item;
89
- this.$emit('update:selectedStaff', item);
84
+ const retObject = {
85
+ DisplayId: this.displayObject.DisplayId,
86
+ AssignedToId: item.link,
87
+ }
88
+
89
+ this.$emit('update:selectedStaff', retObject);
90
90
  },
91
91
  handleAssignmentEvent(item) {
92
- this.localSelectedEvent = item;
93
- this.$emit('update:selectedEvent', item);
92
+ const retObject = {
93
+ DisplayId: this.displayObject.DisplayId,
94
+ AssignedToId: item.link,
95
+ }
96
+ this.$emit('update:selectedEvent', retObject);
94
97
  }
95
98
  }
96
99
  };
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="mt-3">
3
3
  <div class="flex flex-col w-full relative">
4
- <section v-if="!displays">
4
+ <section v-if="!localDisplays.length">
5
5
  <img alt="Small desert scene with wind blowing." class="w-96 mx-auto" :src="emptyDesertIcon"/>
6
6
  <div class="w-full flex justify-center">
7
7
  <div class="w-96">
@@ -16,26 +16,30 @@
16
16
  <section v-if="scoreboards.length > 0" class="flex flex-col">
17
17
  <div>
18
18
  <BaseText text="Scoreboards" size="lg" color="primaryHighlight" weight="bold" class="w-full text-left"/>
19
- <div class="border-b border-dropdownSelect mb-4" />
19
+ <div class="border-b border-dropdownSelect mb-4" />
20
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"
21
+ <DisplayCard :displayObject="scoreboard"
22
+ :assignedTo="transformAssignedTo(scoreboard)"
24
23
  :eventDropDown="eventDropDown"
25
24
  :staffDropDown="staffDropDown"
25
+ @update:selectedStaff="handleAssignmentStaff"
26
+ @update:selectedEvent="handleAssignmentEvent"
27
+ @update:remove="handleRemove"
26
28
  />
27
29
  </div>
28
30
  </div>
29
31
 
30
32
  <div v-if="flightBoards.length > 0" class="mt-10">
31
33
  <BaseText text="Flight Boards" size="lg" color="primaryHighlight" weight="bold" class="w-full text-left"/>
32
- <div class="border-b border-dropdownSelect mb-4" />
34
+ <div class="border-b border-dropdownSelect mb-4" />
33
35
  <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"
36
+ <DisplayCard :displayObject="flightBoard"
37
+ :assignedToEvent="transformAssignedTo(flightBoard)"
37
38
  :eventDropDown="eventDropDown"
38
39
  :staffDropDown="staffDropDown"
40
+ @update:selectedStaff="handleAssignmentStaff"
41
+ @update:selectedEvent="handleAssignmentEvent"
42
+ @update:remove="handleRemove"
39
43
  />
40
44
  </div>
41
45
  </div>
@@ -49,7 +53,6 @@ import emptyDesertIcon from '../../../../assets/empty_desert_icon.png';
49
53
  import BaseText from "../../../Atoms/Text/BaseText.vue";
50
54
  import DisplayCard from "../../Cards/DisplayCard/DisplayCard.vue";
51
55
 
52
-
53
56
  export default {
54
57
  components: {
55
58
  DisplayCard,
@@ -72,35 +75,43 @@ export default {
72
75
  },
73
76
  data() {
74
77
  return {
78
+ localDisplays: [],
75
79
  emptyDesertIcon
76
80
  }
77
81
  },
82
+ created() {
83
+ this.localDisplays = [...this.displays];
84
+ },
78
85
  computed: {
79
86
  scoreboards() {
80
- return this.displays.filter(display => display.Type === 'ScoreBoard');
87
+ return this.localDisplays.filter(display => display.Type === 'ScoreBoard');
81
88
  },
82
89
  flightBoards() {
83
- return this.displays.filter(display => display.Type === 'FlightBoard');
90
+ return this.localDisplays.filter(display => display.Type === 'FlightBoard');
84
91
  }
85
92
  },
86
93
  methods: {
87
- transformAssignedTo(scoreboard) {
88
- if (scoreboard.Person) {
89
- return { text: scoreboard.Person.DisplayName, link: scoreboard.Person.DisplayName };
94
+ transformAssignedTo(display) {
95
+ if (display.Person) {
96
+ return { text: display.Person.DisplayName, link: display.Person.DisplayName };
90
97
  }
91
98
 
92
- if (scoreboard.Event) {
93
- console.log("EVENT")
94
- console.log(scoreboard.Event.EventName)
95
- return { text: scoreboard.Event.EventName, link: scoreboard.Event.EventName };
99
+ if (display.Event) {
100
+ return { text: display.Event.EventName, link: display.Event.EventName };
96
101
  }
97
102
 
98
103
  return { text: '', link: '' }
104
+ },
105
+ handleRemove(item) {
106
+ this.localDisplays = this.localDisplays.filter(display => display.DisplayId !== item.DisplayId);
107
+ this.$emit('update:remove', item);
108
+ },
109
+ handleAssignmentStaff(item) {
110
+ this.$emit('update:selectedStaff', item);
111
+ },
112
+ handleAssignmentEvent(item) {
113
+ this.$emit('update:selectedEvent', item);
99
114
  }
100
115
  }
101
116
  }
102
117
  </script>
103
-
104
-
105
-
106
-
@@ -20,7 +20,7 @@
20
20
  <!-- Display Type Dropdown/Toggle -->
21
21
  <div class="mb-4">
22
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" />
23
+ <DropDownMenu label="" :items="displayTypes" :selected-item="selectedDisplayType" :alignEnd="false" :width="'w-full'" @update:selectedItem="handleDisplayTypeChange" />
24
24
  </div>
25
25
 
26
26
  <!-- Club Dropdown -->
@@ -29,7 +29,7 @@
29
29
  <DropDownMenu :label="selectedClub" :items="clubs" :selected-item="selectedClub" :alignEnd="false" :width="'w-full'" @update:selectedItem="handleClubChange" />
30
30
  </div>
31
31
  <div class="mb-4" v-else>
32
- <TitledInput :inputValue="selectedClub.text" :disabled="true" title="Club" />
32
+ <TitledInput :inputValue="selectedClub.text" :disabled="isAdmin" title="Club" />
33
33
  </div>
34
34
 
35
35
  <!-- Submit and Cancel Buttons -->
@@ -66,7 +66,11 @@ export default {
66
66
  isAdmin: {
67
67
  type: Boolean,
68
68
  required: true
69
- }
69
+ },
70
+ iconBorderColor: {
71
+ type: String,
72
+ default: 'acceptedBorder'
73
+ },
70
74
  },
71
75
  data() {
72
76
  return {
@@ -78,7 +82,7 @@ export default {
78
82
  displayType: '',
79
83
  clubId: ''
80
84
  },
81
- selectedDisplayType: { text: 'ScoreBoard', link: 'ScoreBoard' },
85
+ selectedDisplayType: { text: 'Select Type', link: 'ScoreBoard' },
82
86
  selectedClub: this.userClub || (this.clubs.length === 1 ? this.clubs[0] : { text: '', link: '' }),
83
87
  validation: {
84
88
  displayName: false,
@@ -3,11 +3,6 @@ import getCLubDisplayByClubId from "../../../../mocks/getClubDisplayByClubId.js"
3
3
  import getAllStaffByTournamentId from "../../../../mocks/getAllStaffByTournamentId.js";
4
4
  import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js"
5
5
 
6
- // isAdmin: {
7
- // userClub: {
8
- // clubs: {
9
-
10
-
11
6
  export default {
12
7
  title: 'Templates/EventManagement/ClubDisplay',
13
8
  component: ClubDisplay,
@@ -17,7 +12,7 @@ export default {
17
12
  staffDropDown: getAllStaffByTournamentId,
18
13
  eventDropDown: getEventByTournamentId,
19
14
  isAdmin: false,
20
- userClub: {text: 'Cats Club', link: '1'},
15
+ userClub: {text: 'Cats Club', link: '2'},
21
16
  clubs: []
22
17
  },
23
18
  argTypes: {
@@ -3,10 +3,19 @@
3
3
  <EditEventsTopMenu :currentTab="'Displays'" :tabs="tabs" @tabMenuClick="handleTabMenuClick"/>
4
4
  <ClubDisplayContainer :displays="displays" :eventDropDown="eventDropDown" :staffDropDown="staffDropDown" />
5
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" />
6
+ <BaseButton iconName="fa-circle-plus" label="Add Display" icon-class="fa-regular" size="xs" type="primary" @click="openModal"/>
7
7
  </div>
8
8
 
9
- <AddDisplayModal :show="showModal" :isAdmin="isAdmin" :userClub="userClub" :clubs="clubs" @close:closeModal="closeModal" @submit:display="handleAddDisplay" />
9
+ <AddDisplayModal :show="showModal"
10
+ :isAdmin="isAdmin"
11
+ :userClub="userClub"
12
+ :clubs="clubs"
13
+ @close:closeModal="closeModal"
14
+ @submit:display="handleAddDisplay"
15
+ @update:remove="handleRemove"
16
+ @update:selectedStaff="handleAssignmentStaff"
17
+ @update:selectedEvent="handleAssignmentEvent"
18
+ />
10
19
  </section>
11
20
  </template>
12
21
 
@@ -16,10 +25,12 @@ import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.v
16
25
  import ClubDisplayContainer from "../../../Organisms/Containers/ClubDisplayContainer/ClubDisplayContainer.vue";
17
26
  import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
18
27
  import AddDisplayModal from "../../../Molecules/Modals/AddDisplayModal/AddDisplayModal.vue";
28
+ import DisplayCard from "../../../Organisms/Cards/DisplayCard/DisplayCard.vue";
19
29
 
20
30
 
21
31
  export default {
22
32
  components: {
33
+ DisplayCard,
23
34
  AddDisplayModal,
24
35
  BaseButton,
25
36
  ClubDisplayContainer,
@@ -83,6 +94,15 @@ export default {
83
94
  handleTabMenuClick(value) {
84
95
  this.$emit('tab:menu-click', value);
85
96
  },
97
+ handleRemove(item) {
98
+ this.$emit('update:remove',item);
99
+ },
100
+ handleAssignmentStaff(item) {
101
+ this.$emit('update:selectedStaff', item);
102
+ },
103
+ handleAssignmentEvent(item) {
104
+ this.$emit('update:selectedEvent', item);
105
+ }
86
106
  }
87
107
  }
88
108
  </script>