@dcrackel/hematournamentui 1.0.113 → 1.0.114

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.113",
4
+ "version": "1.0.114",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -217,7 +217,8 @@ const eventPersonGetInitialPoolAssignments2 =
217
217
  }
218
218
  ],
219
219
  "poolStrength": 10,
220
- "poolStrengthInd": 0
220
+ "poolStrengthInd": 0,
221
+ "BoutsLeft": 10
221
222
  },
222
223
  {
223
224
  "PoolId": 138,
@@ -409,7 +410,8 @@ const eventPersonGetInitialPoolAssignments2 =
409
410
 
410
411
  ],
411
412
  "poolStrength": 10,
412
- "poolStrengthInd": 0
413
+ "poolStrengthInd": 0,
414
+ "BoutsLeft": 5
413
415
  },
414
416
  ]
415
417
 
@@ -14,7 +14,7 @@ const eventPersonGetPoolAssignmentEvent =
14
14
  "Status": "preparation",
15
15
  "Present": 0,
16
16
  "Absent": 10,
17
- "Removed": 0
17
+ "Removed": 0,
18
18
  }
19
19
 
20
20
  export default eventPersonGetPoolAssignmentEvent;
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  <div v-if="mode === 'live'" class="bg-eventBoxBlue w-40 h-9 rounded-lg my-1 pt-1.5 flex flex-row justify-between border border-dropdownSelect">
13
13
  <BaseText text="BOUTS LEFT" size="sm" color="quinary" weight="bold" class="w-2/3 text-right"/>
14
- <BaseText text="10" size="sm" color="primaryHighlight" weight="bold" class="w-1/3 text-left pl-2"/>
14
+ <BaseText :text="boutsLeft" size="sm" color="primaryHighlight" weight="bold" class="w-1/3 text-left pl-2"/>
15
15
  </div>
16
16
  </div>
17
17
 
@@ -73,6 +73,10 @@ export default {
73
73
  type: [String, Number],
74
74
  required: true
75
75
  },
76
+ boutsLeft: {
77
+ type: Number,
78
+ default: 0
79
+ },
76
80
  pool: {
77
81
  type: Array,
78
82
  required: true
@@ -8,7 +8,8 @@ export default {
8
8
  args: {
9
9
  bouts: getPoolsWithBoutsByPoolId.pools[0].Bouts,
10
10
  eventRules: getPoolsWithBoutsByPoolId.eventRules,
11
- hostingClubColors: getPoolsWithBoutsByPoolId.hostingClubColors
11
+ hostingClubColors: getPoolsWithBoutsByPoolId.hostingClubColors,
12
+ connectedToServer: true
12
13
  },
13
14
  argTypes: {
14
15
  bouts: {
@@ -19,6 +20,9 @@ export default {
19
20
  },
20
21
  hostingClubColors: {
21
22
  control: Object
23
+ },
24
+ connectedToServer: {
25
+ control: Boolean
22
26
  }
23
27
  },
24
28
  };
@@ -27,6 +31,20 @@ export const Default = {
27
31
  args: {
28
32
  bouts: getPoolsWithBoutsByPoolId.pools[0].Bouts,
29
33
  eventRules: getPoolsWithBoutsByPoolId.eventRules,
30
- hostingClubColors: getPoolsWithBoutsByPoolId.hostingClubColors
34
+ hostingClubColors: getPoolsWithBoutsByPoolId.hostingClubColors,
35
+ connectedToServer: true
36
+ }
37
+ };
38
+
39
+ const modifiedBouts = getPoolsWithBoutsByPoolId.pools[0].Bouts.map(bout => ({
40
+ ...bout,
41
+ Status: 'Completed'
42
+ }));
43
+ export const allBoutsComplete = {
44
+ args: {
45
+ bouts: modifiedBouts,
46
+ eventRules: getPoolsWithBoutsByPoolId.eventRules,
47
+ hostingClubColors: getPoolsWithBoutsByPoolId.hostingClubColors,
48
+ connectedToServer: false
31
49
  }
32
50
  };
@@ -1,60 +1,68 @@
1
1
  <template>
2
2
  <section>
3
3
  <EditEventsTopMenu :currentTab="'Pools'" :tabs="tabs" @tabMenuClick="handleTabMenuClick"/>
4
- <ToggleHeader :currentSelection="viewName" @update:selection="handleViewChange" firstButtonLabel="List View"
5
- secondButtonLabel="Pool Grid"/>
4
+ <ToggleHeader :currentSelection="viewName" firstButtonLabel="List View" secondButtonLabel="Pool Grid"
5
+ @update:selection="handleViewChange"/>
6
6
 
7
7
  <!-- active bout -->
8
- <section class="flex flex-row">
9
- <div class="w-5 h-5 rounded-full border-2 mt-5 mr-2">
10
- <div class="w-3 h-3 rounded-full mt-0.5 ml-0.5" :class="hasActiveBout ? 'bg-green' : 'bg-red'"></div>
8
+ <section v-if="remainingBoutsCount > 0">
9
+ <div class="flex flex-row">
10
+ <div class="w-5 h-5 rounded-full border-2 mt-5 mr-2">
11
+ <div :class="connectedToServer ? 'bg-green' : 'bg-red'" class="w-3 h-3 rounded-full mt-0.5 ml-0.5"></div>
12
+ </div>
13
+ <BaseText class="mt-5" color="primaryHighlight" size="md" text="Connected" weight="bold"/>
11
14
  </div>
12
- <BaseText text="Active bout" size="md" color="primaryHighlight" class="mt-5" weight="bold"/>
13
- </section>
14
- <div class="border-b border-dropdownSelect mb-8"></div>
15
+ <div class="border-b border-dropdownSelect mb-8"></div>
15
16
 
16
- <section class="w-full flex flex-col items-center">
17
- <div v-if="!hasActiveBout" class="w-3/4 my-4">
18
- <BoutCard :hostingClubColors="hostingClubColors" :bout="{}" :isWaiting="true"/>
19
- </div>
20
- <div v-for="bout in activeBouts" :key="bout.BoutId" class="w-3/4 my-4">
21
- <BoutCard :hostingClubColors="hostingClubColors" :bout="bout"/>
17
+ <div class="w-full flex flex-col items-center">
18
+ <div v-if="!hasActiveBout" class="w-3/4 my-4">
19
+ <BoutCard :bout="{}" :hostingClubColors="hostingClubColors" :isWaiting="true"/>
20
+ </div>
21
+ <div v-for="bout in activeBouts" :key="bout.BoutId" class="w-3/4 my-4">
22
+ <BoutCard :bout="bout" :hostingClubColors="hostingClubColors"/>
23
+ </div>
22
24
  </div>
23
25
  </section>
24
26
 
25
27
  <!-- Upcoming -->
26
- <section class="flex flex-row justify-between">
27
- <BaseText text="Upcoming" size="md" color="primaryHighlight" class="mt-5" weight="bold"/>
28
- <div class="flex mr-1">
29
- <BaseText text="Remaining bouts:" size="md" color="primaryHighlight" class="mt-5 ml-5"/>
30
- <BaseText :text="remainingBoutsCount" size="md" color="primaryHighlight" weight="bold" class="mt-5 ml-2"/>
28
+ <section v-if="remainingBoutsCount > 0">
29
+ <div class="flex flex-row justify-between">
30
+ <BaseText class="mt-5" color="primaryHighlight" size="md" text="Upcoming" weight="bold"/>
31
+ <div class="flex mr-1">
32
+ <BaseText class="mt-5 ml-5" color="primaryHighlight" size="md" text="Remaining bouts:"/>
33
+ <BaseText :text="remainingBoutsCount" class="mt-5 ml-2" color="primaryHighlight" size="md" weight="bold"/>
34
+ </div>
31
35
  </div>
32
- </section>
33
- <div class="border-b border-dropdownSelect mb-5"></div>
34
- <section class="w-full flex flex-col items-center">
35
- <div v-for="bout in markedUpcomingBouts" :key="bout.BoutId" class="w-3/4 my-4">
36
- <BoutCard :hostingClubColors="hostingClubColors" :bout="bout" @action:startBout="directBout"/>
36
+ <div class="border-b border-dropdownSelect mb-5"></div>
37
+ <div class="w-full flex flex-col items-center">
38
+ <div v-for="bout in markedUpcomingBouts" :key="bout.BoutId" class="w-3/4 my-4">
39
+ <BoutCard :bout="bout" :hostingClubColors="hostingClubColors" @action:startBout="directBout"/>
40
+ </div>
37
41
  </div>
38
42
  </section>
39
43
 
40
44
  <!-- Completed -->
41
- <section class="flex flex-row">
42
- <BaseText text="Completed" size="md" color="primaryHighlight" class="mt-5" weight="bold"/>
43
- </section>
44
- <div class="border-b border-dropdownSelect mb-5"></div>
45
- <section class="w-full flex flex-col items-center">
46
- <div v-for="bout in completedBouts" :key="bout.BoutId" class="w-3/4 my-4">
47
- <BoutCard :hostingClubColors="hostingClubColors" :bout="bout" @action:editBout="editBout" />
45
+ <section v-if="hasCompletedBout > 0">
46
+ <div class="flex flex-row">
47
+ <BaseText v-if="remainingBoutsCount === 0" class="mt-8" color="primaryHighlight" size="md" text="All Bouts Are Complete" weight="bold" />
48
+ <BaseText v-if="remainingBoutsCount > 0" class="mt-5" color="primaryHighlight" size="md" text="Completed" weight="bold"/>
49
+ </div>
50
+ <div class="border-b border-dropdownSelect mb-5"></div>
51
+ <div class="w-full flex flex-col items-center">
52
+ <div v-for="bout in completedBouts" :key="bout.BoutId" class="w-3/4 my-4">
53
+ <BoutCard :bout="bout" :hostingClubColors="hostingClubColors" @action:editBout="editBout"/>
54
+ </div>
48
55
  </div>
49
56
  </section>
50
57
 
51
- <DirectorModal ringName="RingName" :hostingClubColors="hostingClubColors" :eventRules="eventRules"
52
- :bout="selectedBout" :show="showDirectorModal"
58
+ <DirectorModal :bout="selectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
59
+ :show="showDirectorModal" ringName="RingName"
53
60
  @update:closeModal="handleCloseModal"
54
61
  @update:bout="handleUpdateBout"
55
62
  @submit:bout="handleSubmitBout"/>
56
63
 
57
- <EditBoutModal :hostingClubColors="hostingClubColors" :eventRules="eventRules" :bout="selectedBout" :show="showEditBoutModal"
64
+ <EditBoutModal :bout="selectedBout" :eventRules="eventRules" :hostingClubColors="hostingClubColors"
65
+ :show="showEditBoutModal"
58
66
  @update:closeModal="handleCloseModal"
59
67
  @submit:bout="handleSubmitBout"/>
60
68
 
@@ -90,6 +98,10 @@ export default {
90
98
  hostingClubColors: {
91
99
  type: Object,
92
100
  required: true
101
+ },
102
+ connectedToServer: {
103
+ type: Boolean,
104
+ required: true
93
105
  }
94
106
  },
95
107
  computed: {
@@ -105,6 +117,9 @@ export default {
105
117
  hasActiveBout() {
106
118
  return this.activeBouts.length > 0;
107
119
  },
120
+ hasCompletedBout() {
121
+ return this.completedBouts.length > 0;
122
+ },
108
123
  remainingBoutsCount() {
109
124
  return this.upcomingBouts.length;
110
125
  },
@@ -139,7 +154,7 @@ export default {
139
154
  },
140
155
  watch: {
141
156
  bouts: {
142
- handler(newBouts) {
157
+ handler() { //newBouts
143
158
  this.$forceUpdate();
144
159
  },
145
160
  deep: true,
@@ -11,6 +11,7 @@
11
11
  :poolName="pool.Name"
12
12
  :ringName="pool.RingName"
13
13
  :poolInd="pool.poolStrengthInd"
14
+ :boutsLeft="pool.BoutsLeft ?? 0"
14
15
  :directorName="getDirectorName(pool.Staff)"
15
16
  :pool="pool.participants"
16
17
  :staff="staff"