• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FAIRsharing / fairsharing.github.io / 24769584990

22 Apr 2026 08:57AM UTC coverage: 95.892% (-4.1%) from 100.0%
24769584990

push

github

web-flow
Merge pull request #2746 from FAIRsharing/dev

Dev

3653 of 3813 branches covered (95.8%)

Branch coverage included in aggregate %.

17344 of 18229 new or added lines in 282 files covered. (95.15%)

766 existing lines in 50 files now uncovered.

38617 of 40268 relevant lines covered (95.9%)

5.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.0
/src/components/Records/Search/Header/Sorting.vue
1
<template>
2
  <v-list>
1✔
3
    <v-list-item
1✔
4
      v-for="(item, index) in getFilters()"
1✔
5
      :key="'sorter_' + index"
1✔
6
      :class="{
1✔
7
        'v-list-item--active': activeFilter === item.name + ',' + item.order,
8
      }"
9
      @click="applySortQuery(item.name, item.order)"
1✔
10
    >
11
      <v-list-item-title>
1✔
12
        {{ item.label }} ({{ item.orderLabel }})
1✔
13
      </v-list-item-title>
1✔
14
    </v-list-item>
1✔
15
  </v-list>
1✔
16
</template>
17

18
<script>
19
export default {
1✔
20
  name: "Sorting",
1✔
21
  data() {
1✔
22
    return {
3✔
23
      sortFilters: [
3✔
24
        { name: "name", label: "name", active: false },
3✔
25
        { name: "abbreviation", label: "abbreviation", active: false },
3✔
26
        { name: "_score", label: "best-match", active: false },
3✔
27
      ],
3✔
28
      activeFilter: null,
3✔
29
    };
3✔
30
  },
1✔
31
  mounted() {
1✔
32
    const _module = this;
3✔
33
    _module.activeFilter = _module.$route.query.orderBy
3✔
34
      ? _module.$route.query.orderBy
3✔
35
      : "_score,asc";
3✔
36
  },
1✔
37
  methods: {
1✔
38
    /**
1✔
39
     * Set the orderBy parameter value to the given input for vueJs router
1✔
40
     * @param {string} activeSortFilterName - sorting under this name
1✔
41
     * @param {string} sortMethod - can be either ASC or DESC
1✔
42
     */
1✔
43
    applySortQuery: async function (activeSortFilterName, sortMethod) {
1✔
44
      let _module = this;
2✔
45
      let inputOrderBy = `${activeSortFilterName},${sortMethod}`;
2✔
46
      let currentQuery = JSON.parse(JSON.stringify(_module.$route.query));
2✔
47
      currentQuery["orderBy"] = inputOrderBy;
2✔
48
      if (inputOrderBy !== _module.activeFilter) {
2✔
49
        await _module.$router.push({
1✔
50
          name: _module.$route.name,
1✔
51
          query: currentQuery,
1✔
52
        });
1✔
53
      }
1✔
54
    },
1✔
55
    getFilters: function () {
1✔
NEW
56
      let filters = [];
×
NEW
57
      this.sortFilters.forEach(function (filter) {
×
NEW
58
        filters.push({
×
NEW
59
          label: filter.label,
×
NEW
60
          name: filter.name,
×
NEW
61
          order: "asc",
×
NEW
62
          orderLabel: "ascending",
×
NEW
63
        });
×
NEW
64
        if (filter.name !== "_score") {
×
NEW
65
          filters.push({
×
NEW
66
            label: filter.label,
×
NEW
67
            name: filter.name,
×
NEW
68
            order: "desc",
×
NEW
69
            orderLabel: "descending",
×
NEW
70
          });
×
UNCOV
71
        }
×
NEW
72
      });
×
NEW
73
      return filters;
×
74
    },
1✔
75
  },
1✔
76
};
1✔
77
</script>
78

79
<style scoped>
80
.highlighted {
81
  color: red !important;
82
}
83
</style>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc