Просмотр исходного кода

[192-webreport] Added blurring in Overview with query params, removed some ids in ComparisonView

Evgeni 4 лет назад
Родитель
Сommit
cf847c8653

+ 16 - 12
report-viewer/src/components/ComparisonsTable.vue

@@ -12,11 +12,13 @@
             + comparison.secondSubmissionId
             + comparison.matchPercentage"
       :class="{ 'even-row' : index % 2 === 0, 'odd-row' : index % 2 !== 0 }"
-      @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">
+      class="selectable"
+      @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)"
+      >
     <td>{{ index + 1 }}.</td>
-    <td>{{ comparison.firstSubmissionId }}</td>
+    <td :class="{ blur : !notBlurred.includes(comparison.firstSubmissionId) }">{{ comparison.firstSubmissionId }}</td>
     <td><img src="@/assets/double_arrow_black_18dp.svg" alt=">>"/></td>
-    <td>{{ comparison.secondSubmissionId }}</td>
+    <td :class="{ blur : !notBlurred.includes(comparison.secondSubmissionId) }">{{ comparison.secondSubmissionId }}</td>
     <td>{{ formattedMatchPercentage(comparison.matchPercentage) }}</td>
   </tr>
 </table>
@@ -32,7 +34,10 @@ export default defineComponent({
    topComparisons : {
      type: Array,
      required: true
-   }
+   },
+    notBlurred : {
+     type: Array
+    }
   },
   setup() {
     let formattedMatchPercentage = ( number ) => number.toFixed(2)
@@ -43,9 +48,11 @@ export default defineComponent({
         params: { id1 : id1, id2 : id2 }
       })
     }
+    const clickk = () => console.log('Clicked ')
     return {
       formattedMatchPercentage,
-      navigateToComparisonView
+      navigateToComparisonView,
+      clickk
     }
   }
 })
@@ -56,7 +63,6 @@ table {
   border-collapse: collapse;
   font-size: larger;
   text-align: center;
-  color: var(--on-primary-color-accent);
 }
 
 th {
@@ -71,6 +77,9 @@ td {
   padding-bottom: 3%;
 }
 
+.blur {
+  filter: blur(5px);
+}
 .head-row {
   background: var(--primary-color-light);
 }
@@ -79,16 +88,11 @@ td {
   background: var(--secondary-color);
 }
 
-.even-row:hover {
-  background: var(--primary-color-dark);
-  cursor: pointer;
-}
-
 .odd-row {
   background: var(--primary-color-light);
 }
 
-.odd-row:hover {
+.selectable:hover {
   background: var(--primary-color-dark);
   cursor: pointer;
 }

+ 2 - 2
report-viewer/src/components/MatchTable.vue

@@ -2,8 +2,8 @@
 <div class="match-table-container">
   <table>
     <tr>
-      <th>{{ id1 }}</th>
-      <th>{{ id2 }}</th>
+      <th>Submission 1</th>
+      <th>Submission 2</th>
     </tr>
     <tr>
       <th>File 1</th>

+ 7 - 0
report-viewer/src/router/index.ts

@@ -7,6 +7,13 @@ const routes: Array<RouteRecordRaw> = [
     path: "/",
     name: "Overview",
     component: Overview,
+    props:true
+  },
+    {
+    path: "/:notBlurred",
+    name: "OverviewBlurred",
+    component: Overview,
+    props:true
   },
   {
     path: "/comparison/:id1/:id2",

+ 5 - 2
report-viewer/src/views/ComparisonView.vue

@@ -15,11 +15,11 @@
       <MatchTable :matches="comparison.allMatches" :id1="id1" :id2="id2" @match-selected="showMatch" />
     </div>
     <FilesContainer :matches="comparison.matchesInFirstSubmission" :files="filesOfFirst" container-id="files1"
-                    :files-owner="id1"
+                    files-owner="Submission 1"
                     @toggle-collapse="toggleCollapseFirst"
                     @line-selected="showMatchInSecond"/>
     <FilesContainer :matches="comparison.matchesInSecondSubmissions" :files="filesOfSecond" container-id="files2"
-                    :files-owner="id2"
+                    files-owner="Submission 2"
                     @toggle-collapse="toggleCollapseSecond"
                     @line-selected="showMatchInFirst"/>
   </div>
@@ -44,6 +44,9 @@ export default defineComponent({
     },
     id2: {
       type: String,
+    },
+    notBlurred: {
+      type: Array
     }
   },
   setup(props) {

+ 14 - 3
report-viewer/src/views/Overview.vue

@@ -35,7 +35,7 @@
         <p class="section-title">Top Comparisons:</p>
         <p class="section-subtitle">(Top n comparisons)</p>
         <div id="comparisonsList">
-          <ComparisonsTable :top-comparisons="topComps[selectedMetricIndex]"/>
+          <ComparisonsTable :top-comparisons="topComps[selectedMetricIndex]" :not-blurred="notBlurredArray"/>
         </div>
     </div>
   </div>
@@ -53,8 +53,18 @@ import {OverviewFactory} from "@/model/factories/OverviewFactory";
 export default defineComponent({
   name: "Overview",
   components: {ComparisonsTable, DistributionDiagram, MetricButton, TextInformation },
-  setup() {
+  props: {
+    notBlurred: {
+      type: String,
+      default: "all"
+    }
+  },
+  setup(props) {
     const overview = OverviewFactory.getOverview(Overview)
+    let notBlurredArray = props.notBlurred.split(",")
+    if(notBlurredArray[0].match("all")) {
+      notBlurredArray = overview.submissionIds
+    }
 
     //Metrics
     let selectedMetric = ref(overview.metrics.map( () => false ))
@@ -73,13 +83,14 @@ export default defineComponent({
     //Top Comparisons
     let topComps = ref(overview.metrics.map((m) => m.comparisons ))
 
+
     return {
       overview,
       selectedMetricIndex,
       selectedMetric,
       distributions,
       topComps,
-
+      notBlurredArray,
       selectMetric
     }
   }