From b7a276d54ae88fde32cd1fba0ec4bb1ac41cab55 Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Mon, 21 May 2018 16:28:24 +0200
Subject: Support talentless modes

---
 src/ReportTable.vue | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

(limited to 'src/ReportTable.vue')

diff --git a/src/ReportTable.vue b/src/ReportTable.vue
index ed099c2..9d3cea1 100644
--- a/src/ReportTable.vue
+++ b/src/ReportTable.vue
@@ -22,7 +22,7 @@
           </div>
         </b-table-column>
 
-        <b-table-column field="Talent" label="Talent">
+        <b-table-column field="Talent" label="Talent" :visible="hasTalents">
           <!-- desktop, table view -->
           <div class="is-hidden-touch">
             <div style="display: flex; align-items: center; justify-content: space-between;">
@@ -39,7 +39,7 @@
           </div>
         </b-table-column>
 
-        <b-table-column field="Level" label="Average Level" sortable numeric>
+        <b-table-column field="Level" label="Average Level" :visible="hasTalents" sortable numeric>
           <template v-if="!!props.row.Level">
             {{ props.row.Level.toFixed(2) }}
           </template>
@@ -49,15 +49,11 @@
         </b-table-column>
 
         <b-table-column field="Winner" label="Win Rate" sortable numeric>
-          <template v-if="!!props.row.Winner">
-            {{ (100 * props.row.Winner).toFixed(2) }}%
-          </template>
+          {{ (100 * props.row.Winner).toFixed(2) }}%
         </b-table-column>
 
         <b-table-column field="Count" label="Pick Rate" sortable numeric>
-          <template v-if="!!props.row.Count">
-            {{ (100 * 6 * props.row.Count / totalPicks).toFixed(2) }}%
-          </template>
+          {{ (100 * playersPerMatch * props.row.Count / totalPicks).toFixed(2) }}%
         </b-table-column>
       </template>
     </b-table>
@@ -87,6 +83,12 @@ export default Vue.component('report-table', {
     totalPicks: function() {
       return this.reportService.getTotalPicks(this.selectedMode);
     },
+    playersPerMatch: function() {
+      return maps.playersPerMatch(this.selectedMode);
+    },
+    hasTalents: function() {
+      return maps.hasTalents(this.selectedMode);
+    },
   },
   components: {
     HeroImage,
-- 
cgit v1.3.1

