@dcrackel/hematournamentui 1.0.176 → 1.0.178

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.
@@ -9,23 +9,18 @@
9
9
 
10
10
  <div class="w-full flex flex-row justify-around text-center px-4 pt-4">
11
11
  <div class="pt-1 w-1/4" @click="minusPass">
12
- <BaseIcon icon-name="fa-square-minus" size="5xl" color="quaternary" hover="quaternary" class="hover:text-quaternaryHighlight" :disabled="score <= 0" />
12
+ <BaseIcon icon-name="fa-square-minus" size="5xl" color="quaternary" hover="quaternary" class="hover:text-quaternaryHighlight" :disabled="maxPasses <= 0" />
13
13
  </div>
14
14
  <div class="flex flex-row w-1/2 justify-center">
15
15
  <BaseText :text="currentPass + 1" size="5xl" color="primary" weight="bold" />
16
16
  </div>
17
17
  <div class="pt-1 w-1/4" @click="addPass">
18
- <BaseIcon icon-name="fa-square-plus" size="5xl" color="quaternary" hover="quaternary" class="hover:text-quaternaryHighlight" :disabled="score <= 0" />
18
+ <BaseIcon icon-name="fa-square-plus" size="5xl" color="quaternary" hover="quaternary" class="hover:text-quaternaryHighlight" :disabled="maxPasses <= 0" />
19
19
  </div>
20
20
  </div>
21
21
 
22
22
  <div class="flex flex-row justify-center">
23
- <div v-if="showSubmit" class="flex flex-row justify-between m-8 w-9/12">
24
- <button class="w-full rounded-xl p-1 bg-red text-cloud" @click="submit">
25
- Submit Score
26
- </button>
27
- </div>
28
- <div v-if="!showSubmit" class="flex flex-row justify-between m-4 md:m-9 w-9/12">
23
+ <div class="flex flex-row justify-between m-4 md:m-9 w-9/12">
29
24
  <div v-for="(pass, index) in passes" :key="index">
30
25
  <div v-if="currentPass < index" class="w-4 h-4 border border-quaternary rounded-full"></div>
31
26
  <div v-if="currentPass >= index" class="w-4 h-4 bg-blue rounded-full"></div>
@@ -52,20 +47,12 @@ export default {
52
47
  type: Object,
53
48
  required: true,
54
49
  },
55
- hostingClubColors: {
56
- type: Object,
57
- required: true
58
- },
59
- showSubmit: {
60
- type: Boolean,
61
- default: false,
62
- },
63
50
  screenHeight: Number
64
51
  },
65
52
  data() {
66
53
  return {
67
54
  passes: [],
68
- currentPass: this.bout.CurrentPass || 0
55
+ currentPass: this.bout.CurrentPass || 0,
69
56
  }
70
57
  },
71
58
  created() {
@@ -73,21 +60,24 @@ export default {
73
60
  },
74
61
  methods: {
75
62
  addPass() {
76
- if (this.currentPass + 1 >= this.passes.length) {
77
- this.showSubmit = true
63
+ if (this.currentPass+1 >= this.passes.length) {
64
+ this.emitPass();
78
65
  return
79
66
  }
67
+
80
68
  this.currentPass++
81
69
  this.passes[this.currentPass] = 1
70
+ this.emitPass()
82
71
  },
83
72
  minusPass() {
84
73
  if (this.currentPass <= 0) return
85
74
  this.passes[this.currentPass] = 0
86
75
  this.currentPass--
76
+ this.emitPass()
77
+ },
78
+ emitPass(){
79
+ this.$emit('update:passes', this.currentPass)
87
80
  },
88
- submit() {
89
- this.$emit('submit')
90
- }
91
81
  }
92
82
  }
93
83
  </script>
@@ -2,9 +2,10 @@
2
2
  <section>
3
3
  <ScoreBox :fencer1="true" :bout="localBout" :hostingClubColors="hostingClubColors" :maxScore="parseInt(maxPoints)" @update:Score="updateScore1"/>
4
4
  <TimerBox v-if="showTimerBox" :ringName="ringName" :initialTime="parseInt(startTime)" @update:time="handleTimeChange" @update:timeChange="handleTimeStateChange"/>
5
+ <PassesBox v-if="showPassesBox" :bout="localBout" :maxPasses="parseInt(maxPasses)" @update:passes="updatePasses" />
5
6
  <ScoreBox :fencer1="false" :bout="localBout" :hostingClubColors="hostingClubColors" :maxScore="parseInt(maxPoints)" @update:Score="updateScore2"/>
6
7
  <div class="w-11/12 mt-5 mx-6">
7
- <BaseButton label="Submit" type="grayAndBlue" :selected="showSubmit" @click="submitBout"/>
8
+ <BaseButton label="Submit" type="grayAndBlue" :selected="showSubmit" @click="submitBout"/>
8
9
  </div>
9
10
  </section>
10
11
  </template>
@@ -12,6 +13,7 @@
12
13
  <script>
13
14
  import ScoreBox from "../../../Molecules/Boxes/BoutBoxes/ScoreBox/ScoreBox.vue";
14
15
  import TimerBox from "../../../Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue";
16
+ import PassesBox from "../../../Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.vue";
15
17
  import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
16
18
 
17
19
  export default {
@@ -19,6 +21,7 @@ export default {
19
21
  components: {
20
22
  BaseButton,
21
23
  TimerBox,
24
+ PassesBox,
22
25
  ScoreBox
23
26
  },
24
27
  props: {
@@ -50,6 +53,9 @@ export default {
50
53
  this.emitBout();
51
54
  },
52
55
  computed: {
56
+ showPassesBox() {
57
+ return this.eventRules.some(rule => rule.RuleName === "PoolNumOfPasses") || this.eventRules.some(rule => rule.RuleName === "DENumOfPasses");
58
+ },
53
59
  showTimerBox() {
54
60
  return this.eventRules.some(rule => rule.RuleName === "PoolTime") || this.eventRules.some(rule => rule.RuleName === "DETime");
55
61
  },
@@ -68,11 +74,20 @@ export default {
68
74
  }
69
75
  const rule = this.eventRules.find(rule => rule.RuleName === "PoolMaxPoints");
70
76
  return rule ? parseInt(rule.RuleValue) : 7;
77
+ },
78
+ maxPasses() {
79
+ if (this.localBout.DEBoutId) {
80
+ const rule = this.eventRules.find(rule => rule.RuleName === "DENumOfPasses");
81
+ return rule ? parseInt(rule.RuleValue) : 5;
82
+ }
83
+ const rule = this.eventRules.find(rule => rule.RuleName === "PoolNumOfPasses");
84
+ return rule ? parseInt(rule.RuleValue) : 5;
71
85
  }
72
86
  },
73
87
  methods: {
74
- handleTimeChange(time){
88
+ handleTimeChange(time) {
75
89
  this.localBout.TimeLeft = time;
90
+ this.emitBout();
76
91
  },
77
92
  handleTimeStateChange(time) {
78
93
  this.localBout.TimeLeft = time.time;
@@ -87,14 +102,19 @@ export default {
87
102
  this.localBout.Score2 = score;
88
103
  this.emitBout();
89
104
  },
105
+ updatePasses(currentPass) {
106
+ this.localBout.CurrentPass = currentPass;
107
+ this.emitBout();
108
+ },
90
109
  submitBout() {
91
- if (this.showSubmit) this.$emit('submit:bout', this.localBout)
110
+ if (this.showSubmit) this.$emit('submit:bout', this.localBout);
92
111
  },
93
- emitBout(){
112
+ emitBout() {
94
113
  if (this.localBout.Started === null) this.localBout.Started = new Date().toISOString();
95
- this.showSubmit = this.localBout.Score1 === this.maxPoints || this.localBout.Score2 === this.maxPoints || this.localBout.TimeLeft === 0;
96
- this.$emit('update:bout', this.localBout)
114
+ this.showSubmit = this.localBout.Score1 === this.maxPoints || this.localBout.Score2 === this.maxPoints || this.localBout.TimeLeft === 0 || this.localBout.CurrentPass === this.maxPasses-1;
115
+ console.log(this.localBout)
116
+ this.$emit('update:bout', this.localBout);
97
117
  }
98
118
  }
99
119
  };
100
- </script>
120
+ </script>
@@ -1,5 +1,6 @@
1
1
  import PoolLive from './PoolLive.vue';
2
2
  import getPoolsWithBoutsByPoolId from "../../../../mocks/getPoolsWithBoutsByPoolId.js";
3
+ import getPoolsWithBouts6ByPoolId139 from "../../../../mocks/getPoolsWithBouts6PoolId139.js";
3
4
 
4
5
  export default {
5
6
  title: 'Templates/EventManagement/PoolLive',
@@ -48,4 +49,13 @@ export const allBoutsComplete = {
48
49
  hostingClubColors: getPoolsWithBoutsByPoolId.hostingClubColors,
49
50
  connectedToServer: false
50
51
  }
52
+ };
53
+
54
+ export const eventWithPasses = {
55
+ args: {
56
+ bouts: getPoolsWithBouts6ByPoolId139.pools[0].Bouts,
57
+ eventRules: getPoolsWithBouts6ByPoolId139.eventRules,
58
+ hostingClubColors: getPoolsWithBouts6ByPoolId139.hostingClubColors,
59
+ connectedToServer: false
60
+ }
51
61
  };
@@ -182,8 +182,6 @@ export default {
182
182
  return;
183
183
  }
184
184
 
185
- console.log(bout)
186
-
187
185
  const updatedBout = this.activeBouts.find(b => b.BoutId === bout.BoutId);
188
186
 
189
187
  if (!updatedBout) {
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div class="bg-black h-screen">
3
- <FencerNameBar :bout="currentBout" :hostingClubColors="hostingClubColors" />
3
+ <FencerNameBar v-if="currentBout" :bout="currentBout" :hostingClubColors="hostingClubColors" />
4
4
  <div class="py-8"></div>
5
- <FencerScore :bout="currentBout" :hostingClubColors="hostingClubColors" />
5
+ <FencerScore v-if="currentBout" :bout="currentBout" :hostingClubColors="hostingClubColors" />
6
6
  <div class="pt-20"></div>
7
- <FencerPit :nextBouts="nextBouts" :hostingClubColors="hostingClubColors" />
7
+ <FencerPit v-if="nextBouts.length" :nextBouts="nextBouts" :hostingClubColors="hostingClubColors" />
8
8
  </div>
9
9
  </template>
10
10
 
@@ -22,7 +22,7 @@ export default {
22
22
  },
23
23
  props: {
24
24
  bouts: {
25
- type: Object,
25
+ type: Array, // Change to Array since you're using find and filter methods
26
26
  required: true,
27
27
  },
28
28
  eventRules: {
@@ -36,7 +36,7 @@ export default {
36
36
  },
37
37
  computed: {
38
38
  currentBout() {
39
- return this.bouts.find(bout => bout.Status === 'Active') || {};
39
+ return this.bouts.find(bout => bout.Status === 'Active') || null;
40
40
  },
41
41
  nextBouts() {
42
42
  return this.bouts.filter(bout => bout.Status !== 'Completed' && bout.Status !== 'Active').slice(0, 3);