• 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

92.73
/src/components/Records/Search/Input/SearchInput.vue
1
<template>
2
  <v-card
1✔
3
    id="scrollable-holder"
1✔
4
    :class="[
1✔
5
      'pa-2 overflow-auto',
6
      $vuetify.display.mdAndUp ? responsiveClassObject : 'fullHeight',
7
    ]"
8
    border
1✔
9
    tile
1✔
10
    elevation="3"
1✔
11
    width="100%"
1✔
12
  >
13
    <!-- Search Box -->
1✔
14
    <string-search
1✔
15
      v-if="showSearchBox"
1✔
16
      add-search-terms
1✔
17
      :search-path="searchPath"
1✔
18
      placeholder="Search through current results."
1✔
19
    />
1✔
20

21
    <hr v-if="showSearchBox" class="mb-3 mr-2 ml-2 custom-hr" />
1✔
22

23
    <!-- Filter Buttons     -->
1✔
24
    <FilterButtons />
1✔
25

26
    <!-- expansion Panels    -->
1✔
27
    <v-expansion-panels
1✔
28
      v-if="getFilters.length > 0"
1✔
29
      v-model="panel"
1✔
30
      multiple
1✔
31
      flat
1✔
32
      variant="accordion"
1✔
33
    >
34
      <filter-autocomplete
1✔
35
        v-for="filter in setup"
1✔
36
        :key="filter.filterLabel"
1✔
37
        :filter="filter"
1✔
38
      />
1✔
39
    </v-expansion-panels>
1✔
40
  </v-card>
1✔
41
</template>
42

43
<script>
44
import { mapGetters, mapState } from "vuex";
1✔
45

46
import StringSearch from "@/components/Records/Search/Input/StringSearch";
1✔
47
import filterMapping from "@/data/FiltersLabelMapping.json";
1✔
48

49
import FilterAutocomplete from "./FilterAutocomplete";
1✔
50
import FilterButtons from "./FilterButtons";
1✔
51

52
export default {
1✔
53
  name: "SearchInput",
1✔
54
  components: { StringSearch, FilterButtons, FilterAutocomplete },
1✔
55
  props: {
1✔
56
    showSearchBox: { default: true, type: Boolean },
1✔
57
    searchPath: { default: "/search", type: String },
1✔
58
  },
1✔
59
  data() {
1✔
60
    return {
1✔
61
      panel: [],
1✔
62
      filterSelected: {},
1✔
63
      sortOrder: filterMapping["sort_order"],
1✔
64
    };
1✔
65
  },
1✔
66
  computed: {
1✔
67
    ...mapState("uiController", ["UIGeneralStatus"]),
1✔
68
    ...mapGetters("searchFilters", ["getFilters"]),
1✔
69
    setup() {
1✔
UNCOV
70
      let _module = this;
×
UNCOV
71
      _module.setPanel();
×
UNCOV
72
      _module.createIndexForFilters();
×
UNCOV
73
      return _module.getFilters.sort(_module.compareLabels);
×
74
    },
1✔
75
    responsiveClassObject: function () {
1✔
76
      return {
1✔
77
        "filters-holder-default": this.UIGeneralStatus.headerVisibilityState,
1✔
78
        "filters-holder-after-scroll":
1✔
79
          !this.UIGeneralStatus.headerVisibilityState,
1✔
80
      };
1✔
81
    },
1✔
82
  },
1✔
83
  methods: {
1✔
84
    setPanel() {
1✔
85
      this.panel = [...Array(this.getFilters.length).keys()].map((k, i) => i);
1✔
86
    },
1✔
87
    resetPanel() {
1✔
88
      this.panel = [];
1✔
89
    },
1✔
90
    createIndexForFilters: function () {
1✔
91
      this.getFilters.forEach((item) => {
1✔
92
        this.filterSelected[item.filterName] = [];
1✔
93
      });
1✔
94
    },
1✔
95
    /**
1✔
96
     * This gets the index of the name of the filter from the list above, so that the fields can be sorted on the
1✔
97
     * users' preferences. But, some terms may not be in the list, so they are given the index of 100 to force
1✔
98
     * them to appear later.
1✔
99
     */
1✔
100
    compareLabels: function (a, b) {
1✔
101
      let _module = this;
3✔
102
      const aIndex = _module.sortOrder.indexOf(a["filterName"]);
3✔
103
      const bIndex = _module.sortOrder.indexOf(b["filterName"]);
3✔
104
      const aOrder = aIndex === -1 ? 100 : aIndex;
3!
105
      const bOrder = bIndex === -1 ? 100 : bIndex;
3✔
106
      let comparison = -1;
3✔
107
      if (aOrder > bOrder) {
3!
UNCOV
108
        comparison = 1;
×
UNCOV
109
      }
×
110
      return comparison;
3✔
111
    },
1✔
112
  },
1✔
113
};
1✔
114
</script>
115

116
<style scoped>
117
.filters-holder-default {
118
  border-radius: 0;
119
  -moz-border-radius: 0;
120
  -webkit-border-radius: 0;
121
  overflow-x: hidden;
122
  height: calc(100vh - 355px);
123
  position: sticky;
124
  top: 0;
125
  transition: height ease-in 500ms;
126
  overscroll-behavior: contain;
127
  scrollbar-width: thin;
128
}
129
.filters-holder-after-scroll {
130
  border-radius: 0;
131
  -moz-border-radius: 0;
132
  -webkit-border-radius: 0;
133
  overflow-x: hidden;
134
  height: 100vh;
135
  position: sticky;
136
  top: 0;
137
  transition: height ease-in 500ms;
138
  overscroll-behavior: contain;
139
  scrollbar-width: thin;
140
}
141
.custom-hr {
142
  opacity: 0.5;
143
}
144
.fullHeight {
145
  height: 90vh;
146
  overflow: scroll;
147
}
148
</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