@dcrackel/hematournamentui 1.0.607 → 1.0.609

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.
@@ -90,6 +90,10 @@ export default {
90
90
  type: Boolean,
91
91
  default: true
92
92
  },
93
+ penaltiesReset: {
94
+ type: Boolean,
95
+ default: false
96
+ },
93
97
  showHandShotCounterBox: {
94
98
  type: Boolean,
95
99
  default: false
@@ -123,6 +127,11 @@ export default {
123
127
  if (!penalties) {
124
128
  return 0;
125
129
  }
130
+ console.log(this.penaltiesReset);
131
+ console.log(penalties);
132
+ if (this.penaltiesReset) {
133
+ return penalties.filter((t3) => t3.PenaltyType === "Yellow").length;
134
+ }
126
135
  return penalties.filter((t3) => t3.PenaltyType === "Yellow" && t3.BoutId === this.bout.BoutId).length;
127
136
  },
128
137
  countRedCards() {
@@ -130,6 +139,9 @@ export default {
130
139
  if (!penalties) {
131
140
  return 0;
132
141
  }
142
+ if (this.penaltiesReset) {
143
+ return penalties.filter((t3) => t3.PenaltyType === "Red").length;
144
+ }
133
145
  return penalties.filter((t3) => t3.PenaltyType === "Red" && t3.BoutId === this.bout.BoutId).length;
134
146
  },
135
147
  getHandShotValue() {
@@ -6,11 +6,11 @@
6
6
  :maxScore="parseInt(maxPoints)"
7
7
  :isCountingUp="isCountingUp"
8
8
  :showHandShotCounterBox="showHandShotCounterBox"
9
+ :penaltiesReset="penaltiesReset"
9
10
  @penalty:open="openPenaltyModal"
10
11
  @update:Score="updateScore1"
11
12
  @update:HandShotValue="updateHandShot1"
12
13
  />
13
-
14
14
  <TimerBox v-if="showTimerBox"
15
15
  :timeLeft="timeLeft"
16
16
  :running="timerRunning"
@@ -20,13 +20,13 @@
20
20
 
21
21
  <PassesBox v-if="showPassesBox" :bout="localBout" :maxPasses="parseInt(maxPasses)" @update:passes="updatePasses" />
22
22
  <PenaltyConfirmationBox v-if="showPenaltyConfirmationBox" />
23
-
24
23
  <ScoreBox :fencer1="false"
25
24
  :bout="localBout"
26
25
  :hostingClubColors="hostingClubColors"
27
26
  :maxScore="parseInt(maxPoints)"
28
27
  :isCountingUp="isCountingUp"
29
28
  :showHandShotCounterBox="showHandShotCounterBox"
29
+ :penaltiesReset="penaltiesReset"
30
30
  @penalty:open="openPenaltyModal"
31
31
  @update:Score="updateScore2"
32
32
  @update:HandShotValue="updateHandShot2"
@@ -103,6 +103,10 @@ export default {
103
103
  return Array.isArray(this.eventRules) &&
104
104
  this.eventRules.some((n2) => n2.Rules.RuleName === "CountHandshots" && n2.RuleValue === "true");
105
105
  },
106
+ penaltiesReset() {
107
+ return Array.isArray(this.eventRules) &&
108
+ this.eventRules.some((n2) => n2.Rules.RuleName === "PenaltiesReset" && n2.RuleValue === "true");
109
+ },
106
110
  maxPoints() {
107
111
  if (this.localBout.DEBoutId) {
108
112
  const e = Array.isArray(this.eventRules) ? this.eventRules.find((t) => t.Rules.RuleName === "DEMaxPoints") : null;
@@ -18,7 +18,7 @@
18
18
  <img v-if="portraitURL" :src="portraitURL" alt="Portrait" class="w-14 h-14 rounded-xl">
19
19
  </div>
20
20
 
21
- <div class="flex flex-col w-1/2 md:w-4/12 justify-star">
21
+ <div class="flex flex-col w-3/4 md:w-4/12 justify-start">
22
22
  <span class="flex justify-start overflow-hidden">
23
23
  <BaseText :text="person.Person.DisplayName" size="md" color="quaternary" weight="bold" class="text-sm md:text-xl"/>
24
24
  </span>
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  </div>
41
41
 
42
- <div class="hidden md:grid grid-col ls-2 gap-x-4 mr-10">
42
+ <div class="hidden md:grid grid-col ls-2 gap-x-4 mr-4 w-36">
43
43
  <div class="flex">
44
44
  <BaseText text="M2Rating:" size="sm" color="quaternary" weight="normal" class="mr-2" />
45
45
  <BaseText :text="M2Rating" size="sm" color="quinary" weight="bold" class="pt-0.5"/>
@@ -50,10 +50,11 @@
50
50
  </div>
51
51
  </div>
52
52
 
53
- <div class="mr-2 md:mr-4 md:ml-auto">
53
+ <div class="mr-2 md:mr-4 md:ml-auto flex flex-row">
54
+ <BaseButton label="Edit" size="xs" color="quinary" class="hidden md:block mr-10 h-9 mt-1" @click="handleForwardToProfile"/>
54
55
  <ButtonBar :buttons="buttons" :selected="computedSelected" @update:selected="handleAttendance" />
55
56
  </div>
56
- <div class="block md:ml-4 border-l border-dropdownSelect h-16 w-7 md:h-20 md:w-10 items-center text-center hover:bg-eventBoxRed rounded-tr-lg rounded-br-lg pt-5 md:pt-6">
57
+ <div class="block md:ml-4 border-l border-dropdownSelect h-16 w-9 md:h-20 md:w-10 items-center text-center hover:bg-eventBoxRed rounded-tr-lg rounded-br-lg pt-5 md:pt-6">
57
58
  <BaseIcon v-if="!showSpinner" icon-name="fa-circle-xmark" size="" color="quinary" hover="alarm" @click="handlerRemoveFencer" class="text-md md:text-2xl" />
58
59
  <BaseIcon v-if="showSpinner" icon-name="fa-spinner-third" size="" color="alarm" class="animate-spin text-md md:text-2xl" hover="alarm" />
59
60
  </div>
@@ -64,10 +65,11 @@
64
65
  import BaseText from "../../../Atoms/Text/BaseText.vue";
65
66
  import ButtonBar from "../../../Molecules/Buttons/ButtonBar/ButtonBar.vue";
66
67
  import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
68
+ import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
67
69
 
68
70
  export default {
69
71
  name: 'FencerCard',
70
- components: {BaseIcon, ButtonBar, BaseText },
72
+ components: {BaseButton, BaseIcon, ButtonBar, BaseText },
71
73
  props: {
72
74
  person: {
73
75
  type: Object,
@@ -132,6 +134,9 @@ export default {
132
134
  handelMoveDown(){
133
135
  if(!this.isLast) this.$emit('update:moveDown', this.person);
134
136
  },
137
+ handleForwardToProfile(){
138
+ this.$emit('forward:toProfile', this.person.PersonId);
139
+ }
135
140
  }
136
141
  };
137
142
  </script>
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="flex items-center border border-dropdownSelect rounded-lg shadow-lg bg-white w-full hover:border-bright"
3
- :class="detail ? 'my-4 ' : ''" @click="handleEditClick">
4
- <div class="md:mr-4 md:border-r border-dropdownSelect h-12 md:h-16 md:w-10 items-center text-center pt-3 md:pt-6">
5
- <BaseText :text="place" size="" color="quaternary" weight="bold" class="text-md md:text-2xl"/>
3
+ :class="detail ? 'my-1 ' : ''" @click="handleEditClick">
4
+ <div class="md:mr-4 md:border-r border-dropdownSelect h-12 md:h-16 md:w-10 items-center text-center pl-1 md:pl-1 pt-3 md:pt-4">
5
+ <BaseText :text="place" size="" color="quaternary" weight="bold" class="text-md md:text-xl"/>
6
6
  </div>
7
7
  <div class="hidden md:flex mr-4 w-16">
8
8
  <div v-if="!portraitURL" class="w-12 h-12 rounded-full bg-dropdownSelect items-center justify-center">
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <section>
2
+ <section class="">
3
3
  <EditEventsTopMenu :currentTab="'Final'" :tabs="tabs(role,isMobile)" @tabMenuClick="handleTabMenuClick"/>
4
4
  <EventFinalResultsHeader :event="event" @export:HemaRatings="handleExportToHemaRatings"/>
5
- <div class="mt-4">
5
+ <div class="md:mt-4">
6
6
  <FinalResultsTable :finalResults="finalResults"/>
7
7
  <div v-if="finalResults.length < 1" class="w-full flex justify-center items-center">
8
8
  <div class="text-center mb-10">
@@ -5,7 +5,7 @@
5
5
  @update:selection="handleViewChange" :connectedToServer="connectedToServer" class="hidden md:block" />
6
6
 
7
7
  <section v-if="viewName === 'Pool Grid'" class="hidden md:block">
8
- <PoolGrid :bouts="bouts"/>
8
+ <PoolGrid :bouts="localBouts"/>
9
9
  </section>
10
10
 
11
11
  <section>
@@ -55,7 +55,7 @@
55
55
  </section>
56
56
  </section>
57
57
 
58
- <DirectorModal :bout="selectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
58
+ <DirectorModal :bout="currentSelectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
59
59
  :show="showDirectorModal"
60
60
  @penalty:add="handleUpdatePenalty"
61
61
  @penalty:update="handleAddPenalty"
@@ -64,7 +64,7 @@
64
64
  @update:bout="handleUpdateBout"
65
65
  @submit:bout="handleSubmitBout"/>
66
66
 
67
- <EditBoutModal :bout="selectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
67
+ <EditBoutModal :bout="currentSelectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
68
68
  :show="showEditBoutModal"
69
69
  @update:closeModal="handleCloseModal"
70
70
  @submit:bout="handleEditBout"/>
@@ -125,6 +125,7 @@ export default {
125
125
  },
126
126
  data() {
127
127
  return {
128
+ localBouts: this.bouts,
128
129
  showDirectorModal: false,
129
130
  showEditBoutModal: false,
130
131
  selectedBout: {},
@@ -135,10 +136,11 @@ export default {
135
136
  },
136
137
  watch: {
137
138
  bouts: {
138
- handler() { //newBouts
139
- this.$forceUpdate();
139
+ handler(newBouts) {
140
+ this.localBouts = newBouts;
140
141
  },
141
- deep: true,
142
+ immediate: true,
143
+ deep: true
142
144
  }
143
145
  },
144
146
  mounted() {
@@ -148,6 +150,9 @@ export default {
148
150
  window.removeEventListener('resize', this.handleResize);
149
151
  },
150
152
  computed: {
153
+ currentSelectedBout() {
154
+ return this.localBouts.find(b => b.BoutId === this.selectedBout.BoutId) || this.selectedBout;
155
+ },
151
156
  isMobile() {
152
157
  return this.windowWidth <= 748;
153
158
  },
@@ -155,13 +160,13 @@ export default {
155
160
  return this.event?.EventRules || {};
156
161
  },
157
162
  upcomingBouts() {
158
- return this.bouts.filter(bout => bout.Status === 'Scheduled');
163
+ return this.localBouts.filter(bout => bout.Status === 'Scheduled');
159
164
  },
160
165
  completedBouts() {
161
- return this.bouts.filter(bout => bout.Status === 'Completed');
166
+ return this.localBouts.filter(bout => bout.Status === 'Completed');
162
167
  },
163
168
  activeBouts() {
164
- return this.bouts.filter(bout => bout.Status === 'Active');
169
+ return this.localBouts.filter(bout => bout.Status === 'Active');
165
170
  },
166
171
  hasActiveBout() {
167
172
  return this.activeBouts.length > 0;
@@ -191,7 +196,7 @@ export default {
191
196
  this.showEditBoutModal = false;
192
197
 
193
198
  if (bout.Status !== 'Completed') {
194
- const updatedBout = this.bouts.find(b => b.BoutId === bout.BoutId);
199
+ const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
195
200
  if (updatedBout) {
196
201
  updatedBout.Status = 'Scheduled';
197
202
  updatedBout.Score1 = 0;
@@ -228,7 +233,7 @@ export default {
228
233
  handleSubmitBout(bout, resetToActive = false) {
229
234
  this.showEditBoutModal = false;
230
235
  this.showDirectorModal = false;
231
- const updatedBout = this.bouts.find(b => b.BoutId === bout.BoutId);
236
+ const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
232
237
 
233
238
  Object.assign(updatedBout, bout);
234
239
  if (!resetToActive) updatedBout.Status = 'Completed';
@@ -237,10 +242,10 @@ export default {
237
242
  this.$emit('submit:bout', updatedBout);
238
243
  },
239
244
  directBout(bout) {
240
- const activeBouts = this.bouts.filter(b => b.Status === 'Active');
245
+ const activeBouts = this.localBouts.filter(b => b.Status === 'Active');
241
246
  activeBouts.forEach(b => b.Status = 'Scheduled');
242
247
 
243
- const updatedBout = this.bouts.find(b => b.BoutId === bout.BoutId);
248
+ const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
244
249
 
245
250
  if (updatedBout) {
246
251
  updatedBout.Status = 'Active';
@@ -250,7 +255,7 @@ export default {
250
255
  this.$emit('update:directing-bout', updatedBout)
251
256
  },
252
257
  editBout(bout) {
253
- const updatedBout = this.bouts.find(b => b.BoutId === bout.BoutId);
258
+ const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
254
259
  if (updatedBout) {
255
260
  this.showEditBoutModal = true;
256
261
  this.selectedBout = bout;
@@ -260,6 +265,7 @@ export default {
260
265
  this.windowWidth = window.innerWidth;
261
266
  },
262
267
  handleUpdatePenalty(penalty) {
268
+
263
269
  this.$emit('penalty:update', penalty);
264
270
  },
265
271
  handleAddPenalty(penalty) {
@@ -1,4 +1,4 @@
1
- <template>
1
+ `<template>
2
2
  <section class="mt-2 min-h-80">
3
3
  <div>
4
4
  <!-- HEMA Rating ID -->
@@ -42,6 +42,10 @@ export default {
42
42
  person: {
43
43
  type: Object,
44
44
  required: true
45
+ },
46
+ userLevel: {
47
+ type: String,
48
+ required: true
45
49
  }
46
50
  },
47
51
  computed: {
@@ -49,11 +53,18 @@ export default {
49
53
  return this.person?.HEMARatings?.[0]?.HemaRatingId ?? '';
50
54
  },
51
55
  accessLevels() {
56
+ if (this.userLevel === 'Admin') {
57
+ return [
58
+ { text: 'User', link: 'User' },
59
+ { text: 'Director', link: 'Director' },
60
+ { text: 'Club', link: 'Club' },
61
+ { text: 'Admin', link: 'Admin' },
62
+ ];
63
+ }
52
64
  return [
53
65
  { text: 'User', link: 'User' },
54
66
  { text: 'Director', link: 'Director' },
55
- { text: 'Club', link: 'Club' },
56
- { text: 'Admin', link: 'Admin' },
67
+ { text: 'Club', link: 'Club' }
57
68
  ];
58
69
  },
59
70
  getSelectedAccessLevel() {
@@ -71,3 +82,4 @@ export default {
71
82
  }
72
83
  };
73
84
  </script>
85
+ `
@@ -51,6 +51,19 @@ export const admin = {
51
51
  }
52
52
  };
53
53
 
54
+ export const clubAdmin = {
55
+ args: {
56
+ personProfile: personsMock[1],
57
+ fencingClubs: clubGetAllMock,
58
+ attendance: attendance,
59
+ uploadImageName: 'profile-test',
60
+ uploadServer: 'http://localhost:3000/api/upload/',
61
+ imageServer: 'http://localhost:3000/uploads/',
62
+ userLevel: 'Club'
63
+ }
64
+ };
65
+
66
+
54
67
  export const adminWithLoading = {
55
68
  args: {
56
69
  personProfile: personsMock,
@@ -27,7 +27,7 @@
27
27
 
28
28
  <EditEventsTopMenu :tabs="personProfileTabs(userLevel)" :currentTab="currentTab" @tabMenuClick="handleTab" />
29
29
  <BasicEdit v-if="currentTab === 'Basic'" :person="person" :fencingClubs="fencingClubs" :validation="validation" @update:person="updatePerson" />
30
- <FencerAdmin v-if="currentTab === 'Admin'" :person="person" @update:person="updatePerson"/>
30
+ <FencerAdmin v-if="currentTab === 'Admin'" :person="person" :userLevel="userLevel" @update:person="updatePerson"/>
31
31
  <Attendance v-if="currentTab === 'Stats'" :attendance="attendance" />
32
32
  <Attendance v-if="currentTab === 'Attendance'" :attendance="attendance" />
33
33
 
@@ -126,8 +126,7 @@ export default {
126
126
  },
127
127
  showButtons() {
128
128
  return (
129
- (this.userLevel === "Admin" && this.currentTab === "Basic") ||
130
- (this.userLevel === "Admin" && this.currentTab === "Admin") ||
129
+ ((this.userLevel === "Admin" || this.userLevel === "Club") && (this.currentTab === "Basic" || this.currentTab === "Admin")) ||
131
130
  (this.userLevel === "User" && this.currentTab === "Basic")
132
131
  );
133
132
  },
@@ -59,6 +59,15 @@ export const personProfileTabs = (role) => {
59
59
  ]
60
60
  }
61
61
 
62
+ if (role.toLocaleLowerCase() === 'club') {
63
+ return [
64
+ {id: 'Basic', label: 'Basic', color: 'primaryHighlight', icon: 'fa-info-circle'},
65
+ {id: 'Admin', label: 'Administration', color: 'primaryHighlight', icon: 'fa-gear'},
66
+ // {id: 'Stats', label: 'Statistics', color: 'primaryHighlight', icon: 'fa-trophy '},
67
+ {id: 'Attendance', label: 'Attendance', color: 'primaryHighlight', icon: 'fa-user-check'},
68
+ ]
69
+ }
70
+
62
71
  return [
63
72
  {id: 'Basic', label: 'Basic', color: 'primaryHighlight', icon: 'fa-info-circle'},
64
73
  // {id: 'Stats', label: 'Statistics', color: 'primaryHighlight', icon: 'fa-trophy'},