@dcrackel/hematournamentui 1.0.320 → 1.0.322

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.320",
4
+ "version": "1.0.322",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -6,7 +6,7 @@
6
6
  <i class="fa-solid fa-chevron-down text-xs text-quinary" />
7
7
  </div>
8
8
  <transition name="fade-in-down">
9
- <div v-if="isDropDownOpen" class="flex flex-col shadow-lg mt-9 z-20 rounded-b-xl absolute bg-neutral border border-dropdownSelect overflow-y-auto max-h-44" :class="dropDownWidth">
9
+ <div v-if="isDropDownOpen" class="w-full flex flex-col shadow-lg mt-9 z-20 rounded-b-xl absolute bg-neutral border border-dropdownSelect overflow-y-auto max-h-44" :class="dropDownWidth">
10
10
  <a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-l border-r border-dropdownSelect">
11
11
  <BaseText :text="item.text" color="quinary" size="sm" weight="normal" class="py-0.5" />
12
12
  </a>
@@ -26,7 +26,7 @@
26
26
  <!-- Club Dropdown -->
27
27
  <div class="mb-4" v-if="isAdmin">
28
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" />
29
+ <DropDownMenu :label="selectedClub" :items="formattedClubs" :selected-item="selectedClub" :alignEnd="false" :width="'w-full'" @update:selectedItem="handleClubChange" />
30
30
  </div>
31
31
  <div class="mb-4" v-else>
32
32
  <TitledInput :inputValue="selectedClub.text" :disabled="isAdmin" title="Club" />
@@ -95,6 +95,14 @@ export default {
95
95
  ]
96
96
  };
97
97
  },
98
+ computed: {
99
+ formattedClubs() {
100
+ return this.clubs.map(club => ({
101
+ text: club.Name,
102
+ link: club.ClubId.toString()
103
+ }));
104
+ },
105
+ },
98
106
  methods: {
99
107
  handleDisplayNameChange(value) {
100
108
  this.localDisplay.displayName = value;
@@ -0,0 +1,17 @@
1
+ import FencerCardSkeleton from './FencerCardSkeleton.vue';
2
+
3
+
4
+ export default {
5
+ title: 'Organisms/Skeletons/FencerCard',
6
+ component: FencerCardSkeleton,
7
+ tags: ['autodocs'],
8
+ args: {
9
+
10
+ },
11
+ argTypes: {
12
+ }
13
+ };
14
+
15
+ export const Default = {
16
+ components: { FencerCardSkeleton },
17
+ };
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div class="flex items-center border border-dropdownSelect rounded-lg shadow-lg bg-white animate-pulse">
3
+ <div class="mr-4 border-r border-dropdownSelect h-20 w-10 items-center text-center">
4
+ <!-- Skeleton placeholder for the up/down icons and position number -->
5
+ <div class="flex flex-col items-center justify-center h-full">
6
+ <div class="h-6 w-6 bg-dropdownSelect rounded-full my-1"></div>
7
+ </div>
8
+ </div>
9
+ <div class="mr-4">
10
+ <!-- Skeleton placeholder for the portrait image -->
11
+ <div class="w-14 h-14 rounded-xl bg-dropdownSelect"></div>
12
+ </div>
13
+ <div class="flex flex-col w-4/12 justify-star">
14
+ <!-- Skeleton placeholders for the display name and club name -->
15
+ <div class="h-6 bg-dropdownSelect rounded w-3/4 mb-2"></div>
16
+ <div class="h-4 bg-dropdownSelect rounded w-1/2"></div>
17
+ </div>
18
+ <div class="grid grid-cols-2 gap-x-4 mr-10">
19
+ <!-- Skeleton placeholders for the ratings -->
20
+ <div class="h-4 bg-dropdownSelect rounded w-3/4 mb-2"></div>
21
+ <div class="h-4 bg-dropdownSelect rounded w-1/2"></div>
22
+ <div class="h-4 bg-dropdownSelect rounded w-3/4 mb-2"></div>
23
+ <div class="h-4 bg-dropdownSelect rounded w-1/2"></div>
24
+ </div>
25
+ <div>
26
+ <div class="h-4 bg-dropdownSelect rounded w-16"></div>
27
+ <div class="h-4 bg-dropdownSelect rounded w-20 mt-2"></div>
28
+ </div>
29
+ <div>
30
+ <div class="h-4 bg-dropdownSelect rounded w-6 ml-2"></div>
31
+ <div class="h-4 bg-dropdownSelect rounded w-6 ml-2 mt-2"></div>
32
+ </div>
33
+ <div class="mr-4 ml-auto">
34
+ <!-- Skeleton placeholder for the button bar -->
35
+ <div class="h-11 bg-dropdownSelect rounded w-36"></div>
36
+ </div>
37
+ <div class="ml-4 border-l border-dropdownSelect h-20 w-10 items-center text-center pt-6">
38
+ <!-- Skeleton placeholder for the delete icon/spinner -->
39
+ <div class="h-6 w-6 ml-2 mt-1 bg-dropdownSelect rounded-full"></div>
40
+ </div>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ export default {
46
+ name: 'FencerCardSkeleton'
47
+ }
48
+ </script>
@@ -2,6 +2,7 @@ import ClubDisplay from './ClubDisplay.vue';
2
2
  import getCLubDisplayByClubId from "../../../../mocks/getClubDisplayByClubId.js";
3
3
  import getAllStaffByTournamentId from "../../../../mocks/getAllStaffByTournamentId.js";
4
4
  import getEventByTournamentId from "../../../../mocks/getEventByTournamentId.js"
5
+ import clubGetAllMock from "../../../../mocks/clubGetAllMock.js";
5
6
 
6
7
  export default {
7
8
  title: 'Templates/EventManagement/ClubDisplay',
@@ -33,7 +34,17 @@ export const Default = {
33
34
  eventDropDown: getEventByTournamentId,
34
35
  isAdmin: false,
35
36
  userClub: {text: 'Cats Club', link: '1'},
36
- clubs: []
37
+ clubs: clubGetAllMock
37
38
  }
38
39
  };
39
40
 
41
+ export const isAdmin = {
42
+ args: {
43
+ displays: getCLubDisplayByClubId,
44
+ staffDropDown: getAllStaffByTournamentId,
45
+ eventDropDown: getEventByTournamentId,
46
+ isAdmin: true,
47
+ userClub: {text: 'Cats Club', link: '1'},
48
+ clubs: clubGetAllMock
49
+ }
50
+ };
@@ -69,3 +69,13 @@ export const NoPeople = {
69
69
  event: eventMock[0]
70
70
  }
71
71
  };
72
+
73
+ export const peopleAndLoading = {
74
+ args: {
75
+ personsInTournament: eventPersonGetEventById,
76
+ personsAll: personsAllMock,
77
+ fencingClubs: clubsMock,
78
+ event: eventMock[0],
79
+ loading: true
80
+ }
81
+ };
@@ -25,18 +25,10 @@
25
25
  </div>
26
26
  </section>
27
27
 
28
- <div v-if="personsInTournament.length === 0" class="mb-10">
29
- <div class="flex items-center border border-dropdownSelect rounded-lg shadow-lg bg-poolBox">
30
- <BaseText text="Remember to assign staff to your event!" size="lg" color="quaternary" weight="bold" class="w-full text-center py-2"/>
31
- </div>
32
- <img alt="Small desert scene with wind blowing." class="w-96 mx-auto" :src="emptyDesertIcon"/>
33
- <BaseText :color="'primaryHighlight'" :size="'lg'" :text="'0 fencers have been added!'"
34
- :weight="'normal'" data-testid="text-num-events"/>
35
- <BaseText :color="'primaryHighlight'" :size="'md'" :text="'Click Add New button to get started.'"
36
- :weight="'normal'" data-testid="text-num-events"/>
37
- </div>
38
-
39
- <section v-for="(person, index) in sortedPersons" class="w-full">
28
+ <section v-if="loading" v-for="index in 6" class="w-full">
29
+ <FencerCardSkeleton class="mb-4"/>
30
+ </section>
31
+ <section v-if="!loading" v-for="(person, index) in sortedPersons" class="w-full">
40
32
  <FencerCard :person="person" class="mb-4"
41
33
  :isLast="index === sortedPersons.length - 1"
42
34
  :isEdit="event.Status === 'planning' || event.Status === 'preparation'"
@@ -45,6 +37,16 @@
45
37
  @update:moveUp="handleMoveUp"
46
38
  @update:moveDown="handleMoveDown"/>
47
39
  </section>
40
+ <div v-if="!loading && personsInTournament.length === 0" class="mb-10">
41
+ <div class="flex items-center border border-dropdownSelect rounded-lg shadow-lg bg-poolBox">
42
+ <BaseText text="Remember to assign staff to your event!" size="lg" color="quaternary" weight="bold" class="w-full text-center py-2 px-8"/>
43
+ </div>
44
+ <img alt="Small desert scene with wind blowing." class="w-60 mt-8 mx-auto" :src="emptyDesertIcon"/>
45
+ <BaseText :color="'primaryHighlight'" :size="'lg'" :text="'0 fencers have been added!'"
46
+ :weight="'normal'" data-testid="text-num-events"/>
47
+ <BaseText :color="'primaryHighlight'" :size="'md'" :text="'Click Add New button to get started.'"
48
+ :weight="'normal'" data-testid="text-num-events"/>
49
+ </div>
48
50
  </div>
49
51
  </section>
50
52
  </div>
@@ -61,9 +63,11 @@ import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.v
61
63
  import DropDownMenu from "../../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue";
62
64
  import FindOrAddPerson from "../../../Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue";
63
65
  import AttendanceSummary from "../../../Organisms/Headers/AttendanceSummary/AttendanceSummary.vue";
66
+ import FencerCardSkeleton from "../../../Organisms/Skeletons/FencerCard/FencerCardSkeleton.vue";
64
67
 
65
68
  export default {
66
69
  components: {
70
+ FencerCardSkeleton,
67
71
  AttendanceSummary,
68
72
  FindOrAddPerson,
69
73
  DropDownMenu,
@@ -83,6 +87,10 @@ export default {
83
87
  personsInTournament: {
84
88
  type: Array,
85
89
  default: () => []
90
+ },
91
+ loading: {
92
+ type: Boolean,
93
+ default: false
86
94
  }
87
95
  },
88
96
  data() {