@dcrackel/hematournamentui 1.0.694 → 1.0.696

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.694",
4
+ "version": "1.0.696",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -2,9 +2,9 @@ const mockTournaments = [
2
2
  {
3
3
  "TournamentId": 93,
4
4
  "Name": "CombatCon 2021",
5
- "StartDate": "2021-07-22",
6
- "EndDate": "2021-01-31",
7
- "RegistrationCutOff": "2021-07-22",
5
+ "StartDate": "2026-07-01",
6
+ "EndDate": "2026-01-31",
7
+ "RegistrationCutOff": "2026-07-01",
8
8
  "Description": "<p>Combat Con 2021</p><p><br>Longsword </p>",
9
9
  "HostedOnM2": true,
10
10
  "Visibility": "Open",
@@ -18,7 +18,8 @@
18
18
  <BaseText :text="fencer1 ? bout.Person1.DisplayName : bout.Person2.DisplayName" size="xl" weight="bold"
19
19
  color="primaryHighlight"/>
20
20
  </div>
21
- <div class="text-quaternary text-sm pr-3 pt-0.5" @click="$emit('open-report')">
21
+ <div class="text-quaternary text-sm pr-3 pt-0.5 flex" @click="$emit('open-report')">
22
+ <i class="fa-solid fa-cards-blank pr-2" @click="openPenaltyModal"></i>
22
23
  <i class="fa-solid fa-chevron-right" @click="openPenaltyModal"></i>
23
24
  </div>
24
25
  </div>
@@ -12,7 +12,8 @@
12
12
  <div class="flex w-full justify-end mt-1">
13
13
  <BaseIcon icon-name="fa-circle-xmark" size="lg" color="quaternary" hover="alarm" @click="close"/>
14
14
  </div>
15
- <DirectorCard :eventRules="eventRules"
15
+ <DirectorCard :key="bout.BoutId"
16
+ :eventRules="eventRules"
16
17
  :bout="bout"
17
18
  :hostingClubColors="hostingClubColors"
18
19
  @penalty:add="handleUpdatePenalty"
@@ -33,6 +34,7 @@ import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
33
34
  export default {
34
35
  name: "DirectorModal",
35
36
  components: {BaseIcon, DirectorCard},
37
+ emits: ['update:closeModal','update:bout','submit:bout','penalty:update','penalty:add','penalty:remove'],
36
38
  props: {
37
39
  show: {
38
40
  type: Boolean,
@@ -81,6 +81,9 @@ export default {
81
81
  this.determineCountingDirection();
82
82
  this.emitBout()
83
83
  },
84
+ beforeUnmount() {
85
+ clearInterval(this.timerInterval);
86
+ },
84
87
  computed: {
85
88
  RingName() {
86
89
  return this.localBout.Pool?.RingName || 'Ring';
@@ -194,10 +197,12 @@ export default {
194
197
  updateHandShot1(value) {
195
198
  this.localBout.HandShot1 = value;
196
199
  if (this.localBout.HandShot2 === undefined) this.localBout.HandShot2 = 0;
200
+ this.emitBout();
197
201
  },
198
202
  updateHandShot2(value) {
199
203
  this.localBout.HandShot2 = value;
200
204
  if (this.localBout.HandShot1 === undefined) this.localBout.HandShot1 = 0;
205
+ this.emitBout();
201
206
  },
202
207
  updatePasses(currentPass) {
203
208
  this.localBout.CurrentPass = currentPass;
@@ -205,7 +210,7 @@ export default {
205
210
  },
206
211
  emitBout() {
207
212
  this.localBout.TimeLeft = this.timeLeft;
208
- if (this.localBout.Started === null) this.localBout.Started = new Date().toISOString();
213
+ if (!this.localBout.Started) this.localBout.Started = new Date().toISOString();
209
214
 
210
215
  const isScoreReached = this.isCountingUp ? (this.localBout.Score1 === this.maxPoints || this.localBout.Score2 === this.maxPoints)
211
216
  : (this.localBout.Score1 === 0 || this.localBout.Score2 === 0);
@@ -35,6 +35,23 @@
35
35
  </div>
36
36
  </div>
37
37
 
38
+ <!-- Quick phrases pills -->
39
+ <div class="mb-3">
40
+ <div class="flex flex-wrap gap-2">
41
+ <button
42
+ v-for="phrase in quickPhrases"
43
+ :key="phrase"
44
+ type="button"
45
+ class="rounded-full border px-3 py-1 text-sm shadow-sm bg-white
46
+ hover:bg-gray-50 active:scale-[0.98] transition
47
+ disabled:opacity-40 disabled:cursor-not-allowed"
48
+ @click="applyQuickPhrase(phrase)"
49
+ >
50
+ {{ phrase }}
51
+ </button>
52
+ </div>
53
+ </div>
54
+
38
55
  <!-- Notes Section -->
39
56
  <div class="mb-4">
40
57
  <textarea v-model="currentNote" class="w-full h-20 border rounded-md p-2" placeholder="Add a note..."/>
@@ -108,7 +125,14 @@ export default {
108
125
  noteToggle: false,
109
126
  medicalCount: 0,
110
127
  medicalToggle: false,
111
- showConfirmModal: false
128
+ showConfirmModal: false,
129
+ quickPhrases: [
130
+ 'Back of Head',
131
+ 'Excessive force',
132
+ 'Gear issue',
133
+ 'Ignoring director',
134
+ 'Unsafe fencing',
135
+ ],
112
136
  };
113
137
  },
114
138
  mounted() {
@@ -134,6 +158,9 @@ export default {
134
158
  },
135
159
  },
136
160
  methods: {
161
+ applyQuickPhrase(phrase) {
162
+ this.currentNote = this.currentNote + phrase;
163
+ },
137
164
  selectPastCard(card) {
138
165
  this.selectPenaltyId = card.PenaltyId;
139
166
  this.currentNote = card.Notes;
@@ -155,7 +155,17 @@ export default {
155
155
  { text: 'Ring 7', link: 'Ring 7' },
156
156
  { text: 'Ring 8', link: 'Ring 8' },
157
157
  { text: 'Ring 9', link: 'Ring 9' },
158
- { text: 'Ring 10', link: 'Ring 10' }
158
+ { text: 'Ring 10', link: 'Ring 10' },
159
+ { text: 'Ring 11', link: 'Ring 11' },
160
+ { text: 'Ring 13', link: 'Ring 12' },
161
+ { text: 'Ring 14', link: 'Ring 13' },
162
+ { text: 'Ring 14', link: 'Ring 14' },
163
+ { text: 'Ring 15', link: 'Ring 15' },
164
+ { text: 'Ring 16', link: 'Ring 16' },
165
+ { text: 'Ring 17', link: 'Ring 17' },
166
+ { text: 'Ring 18', link: 'Ring 18' },
167
+ { text: 'Ring 19', link: 'Ring 19' },
168
+ { text: 'Ring 20', link: 'Ring 20' }
159
169
  ],
160
170
  flightBoardNames: [
161
171
  { text: 'FlightBoard 1', link: 'FlightBoard 1' },
@@ -165,7 +175,19 @@ export default {
165
175
  { text: 'FlightBoard 5', link: 'FlightBoard 5' },
166
176
  { text: 'FlightBoard 6', link: 'FlightBoard 6' },
167
177
  { text: 'FlightBoard 7', link: 'FlightBoard 7' },
168
- { text: 'FlightBoard 8', link: 'FlightBoard 8' }
178
+ { text: 'FlightBoard 8', link: 'FlightBoard 8' },
179
+ { text: 'FlightBoard 9', link: 'FlightBoard 9' },
180
+ { text: 'FlightBoard 10', link: 'FlightBoard 10' },
181
+ { text: 'FlightBoard 11', link: 'FlightBoard 11' },
182
+ { text: 'FlightBoard 12', link: 'FlightBoard 12' },
183
+ { text: 'FlightBoard 13', link: 'FlightBoard 13' },
184
+ { text: 'FlightBoard 14', link: 'FlightBoard 14' },
185
+ { text: 'FlightBoard 15', link: 'FlightBoard 15' },
186
+ { text: 'FlightBoard 16', link: 'FlightBoard 16' },
187
+ { text: 'FlightBoard 17', link: 'FlightBoard 17' },
188
+ { text: 'FlightBoard 18', link: 'FlightBoard 18' },
189
+ { text: 'FlightBoard 19', link: 'FlightBoard 19' },
190
+ { text: 'FlightBoard 20', link: 'FlightBoard 20' },
169
191
  ]
170
192
  };
171
193
  },
@@ -181,8 +181,9 @@
181
181
  </div>
182
182
  </section>
183
183
 
184
-
185
- <DirectorModal :bout="currentSelectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
184
+ <DirectorModal :bout="currentSelectedBout"
185
+ :eventRules="eventRules"
186
+ :hostingClubColors="hostingClubColors"
186
187
  :show="showDirectorModal"
187
188
  @penalty:add="handleUpdatePenalty"
188
189
  @penalty:update="handleAddPenalty"
@@ -432,18 +433,14 @@ export default {
432
433
  this.viewName = value;
433
434
  },
434
435
  handleUpdateBout(bout) {
435
- if (!this.activeBouts || this.activeBouts.length === 0) {
436
- return;
437
- }
438
-
439
- const updatedBout = this.activeBouts.find(b => b.BoutId === bout.BoutId);
436
+ if (!bout?.BoutId) return;
440
437
 
441
- if (!updatedBout) {
442
- return;
443
- }
438
+ const updatedBout = this.localBouts.find(b => b.BoutId === bout.BoutId);
439
+ if (!updatedBout) return;
444
440
 
445
441
  Object.assign(updatedBout, bout);
446
- updatedBout.Status = 'Active';
442
+ updatedBout.Status = 'Active'; // keep it active while directing
443
+
447
444
  this.$emit('update:bout', updatedBout);
448
445
  },
449
446
  handleEditBout(bout) {
@@ -167,9 +167,8 @@ export default {
167
167
  ? Math.max(1, (endDate - startDate) / (1000 * 60 * 60 * 24) + 1)
168
168
  : 1;
169
169
 
170
- this.localTournament = {...this.tournament,
171
- TotalDays,
172
- WaiverScope: this.tournament.WaiverScope ?? "None",};
170
+ this.localTournament = {...this.tournament, TotalDays, WaiverScope: this.tournament.WaiverScope ?? "None",};
171
+ console.log(this.localTournament)
173
172
  this.setEndDate();
174
173
  },
175
174
  handleAddNewAddress(newAddress) {
@@ -220,10 +219,7 @@ export default {
220
219
  setEndDate() {
221
220
  if (!this.localTournament?.StartDate) return;
222
221
  const days = Math.max(1, Number(this.localTournament.TotalDays) || 1);
223
- this.localTournament.EndDate = this.addDaysInclusiveYMD(
224
- this.localTournament.StartDate,
225
- days
226
- );
222
+ this.localTournament.EndDate = this.addDaysInclusiveYMD(this.localTournament.StartDate, days);
227
223
  },
228
224
  handleCancel() {
229
225
  this.$emit('edit:cancel');
@@ -257,6 +253,7 @@ export default {
257
253
  this.transition('BACK');
258
254
  },
259
255
  handleSubmit() {
256
+ console.log(this.tournament)
260
257
  if (this.validateAllFields()) {
261
258
  this.saveButtonLabel = 'Saving...';
262
259
  setTimeout(() => {
@@ -30,7 +30,7 @@ export default {
30
30
 
31
31
  export const Default = {
32
32
  args: {
33
- tournament: mockTournaments,
33
+ tournament: mockTournaments[0],
34
34
  locations: mockLocation,
35
35
  persons: mockPersons,
36
36
  },