@abi-software/map-side-bar 1.3.19 → 1.3.20
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/dist/map-side-bar.common.js +126 -108
- package/dist/map-side-bar.common.js.map +1 -1
- package/dist/map-side-bar.css +1 -1
- package/dist/map-side-bar.umd.js +126 -108
- package/dist/map-side-bar.umd.js.map +1 -1
- package/dist/map-side-bar.umd.min.js +1 -1
- package/dist/map-side-bar.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/App.vue +1 -1
- package/src/components/ContextCard.vue +1 -1
- package/src/components/SearchFilters.vue +1 -0
- package/src/components/SidebarContent.vue +41 -27
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
this.$refs.sideBar.addFilter({facet: 'Heart', term:'Anatomical structure', facetPropPath: 'anatomy.organ.name', AND: true})
|
|
115
115
|
},
|
|
116
116
|
addStomach: function(){
|
|
117
|
-
this.$refs.sideBar.addFilter({facet: 'Stomach', term:'Anatomical structure', facetPropPath: 'anatomy.organ.name', AND:
|
|
117
|
+
this.$refs.sideBar.addFilter({facet: 'Stomach', term:'Anatomical structure', facetPropPath: 'anatomy.organ.name', AND: false})
|
|
118
118
|
},
|
|
119
119
|
addInvalidTerm: function(){
|
|
120
120
|
this.$refs.sideBar.addFilter({facet: 'Invalid', term:'Anatomical structure', facetPropPath: 'anatomy.organ.name', AND: true})
|
|
@@ -242,7 +242,7 @@ export default {
|
|
|
242
242
|
return url.split('https://doi.org/').pop()
|
|
243
243
|
},
|
|
244
244
|
generateFileLink(sample){
|
|
245
|
-
return
|
|
245
|
+
return `${this.envVars.ROOT_URL}/file/${sample.discoverId}/${sample.version}?path=${this.processPathForUrl(sample.path)}`
|
|
246
246
|
|
|
247
247
|
},
|
|
248
248
|
openViewFile: function(view){
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
@filterResults="filterUpdate"
|
|
21
21
|
@numberPerPage="numberPerPageUpdate"
|
|
22
22
|
@loading="filtersLoading"
|
|
23
|
+
@cascaderReady="cascaderReady"
|
|
23
24
|
></SearchFilters>
|
|
24
25
|
<div class="content scrollbar" v-loading="loadingCards" ref="content">
|
|
25
26
|
<div
|
|
@@ -125,10 +126,6 @@ export default {
|
|
|
125
126
|
type: Object,
|
|
126
127
|
default: () => {}
|
|
127
128
|
},
|
|
128
|
-
firstSearch: {
|
|
129
|
-
type: String,
|
|
130
|
-
default: ""
|
|
131
|
-
}
|
|
132
129
|
},
|
|
133
130
|
data: function() {
|
|
134
131
|
return {
|
|
@@ -137,7 +134,8 @@ export default {
|
|
|
137
134
|
flex: "1 1 auto",
|
|
138
135
|
"flex-flow": "column",
|
|
139
136
|
display: "flex"
|
|
140
|
-
}
|
|
137
|
+
},
|
|
138
|
+
cascaderIsReady: false,
|
|
141
139
|
};
|
|
142
140
|
},
|
|
143
141
|
computed: {
|
|
@@ -163,26 +161,48 @@ export default {
|
|
|
163
161
|
openSearch: function(filter, search='') {
|
|
164
162
|
this.searchInput = search;
|
|
165
163
|
this.resetPageNavigation();
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
164
|
+
//Proceed normally if cascader is ready
|
|
165
|
+
if (this.cascaderIsReady) {
|
|
166
|
+
this.filter = this.$refs.filtersRef.getValidatedFilters(filter);
|
|
167
|
+
//Facets provided but cannot find at least one valid
|
|
168
|
+
//facet. Tell the users the search is invalid and reset
|
|
169
|
+
//facets check boxes.
|
|
170
|
+
if ((filter && filter.length > 0) &&
|
|
171
|
+
(this.filter && this.filter.length === 0)) {
|
|
172
|
+
this.$refs.filtersRef.checkShowAllBoxes();
|
|
173
|
+
this.resetSearch();
|
|
174
|
+
} else if (this.filter) {
|
|
175
|
+
this.searchAlgolia(this.filter, search);
|
|
176
|
+
this.$refs.filtersRef.setCascader(this.filter);
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
//cascader is not ready, perform search if no filter is set,
|
|
180
|
+
//otherwise waith for cascader to be ready
|
|
181
|
+
this.filter = filter;
|
|
182
|
+
if (!filter || filter.length == 0) {
|
|
183
|
+
this.searchAlgolia(this.filter, search);
|
|
184
|
+
}
|
|
177
185
|
}
|
|
178
186
|
},
|
|
179
187
|
addFilter: function(filter) {
|
|
180
|
-
this.
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
this.$refs.filtersRef.
|
|
188
|
+
if (this.cascaderIsReady) {
|
|
189
|
+
this.resetPageNavigation();
|
|
190
|
+
if (filter) {
|
|
191
|
+
if (this.$refs.filtersRef.addFilter(filter))
|
|
192
|
+
this.$refs.filtersRef.initiateSearch();
|
|
193
|
+
}
|
|
194
|
+
} else {
|
|
195
|
+
if (Array.isArray(this.filter)) {
|
|
196
|
+
this.filter.push(filter);
|
|
197
|
+
} else {
|
|
198
|
+
this.filter = [filter];
|
|
199
|
+
}
|
|
184
200
|
}
|
|
185
201
|
},
|
|
202
|
+
cascaderReady: function() {
|
|
203
|
+
this.cascaderIsReady = true;
|
|
204
|
+
this.openSearch(this.filter, this.searchInput);
|
|
205
|
+
},
|
|
186
206
|
clearSearchClicked: function() {
|
|
187
207
|
this.searchInput = "";
|
|
188
208
|
this.resetPageNavigation();
|
|
@@ -360,13 +380,7 @@ export default {
|
|
|
360
380
|
// initialise algolia
|
|
361
381
|
this.algoliaClient = new AlgoliaClient(this.envVars.ALGOLIA_ID, this.envVars.ALGOLIA_KEY, this.envVars.PENNSIEVE_API_LOCATION);
|
|
362
382
|
this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX);
|
|
363
|
-
|
|
364
|
-
// temporarily disable flatmap search since there are no datasets
|
|
365
|
-
if (this.firstSearch === "Flatmap" || this.firstSearch === "flatmap") {
|
|
366
|
-
this.openSearch(undefined, '')
|
|
367
|
-
} else {
|
|
368
|
-
this.openSearch(undefined, '');
|
|
369
|
-
}
|
|
383
|
+
this.openSearch(undefined, '');
|
|
370
384
|
},
|
|
371
385
|
created: function() {
|
|
372
386
|
//Create non-reactive local variables
|