@dcrackel/hematournamentui 1.0.607 → 1.0.608

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.607",
4
+ "version": "1.0.608",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -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) {