@abi-software/map-side-bar 1.1.8 → 1.1.9

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.
@@ -1,440 +1,439 @@
1
- <template>
2
- <el-card :body-style="bodyStyle" class="content-card">
3
- <div slot="header" class="header">
4
- <context-card v-if="contextCardEntry" :entry="contextCardEntry" />
5
- <el-input
6
- class="search-input"
7
- placeholder="Search"
8
- v-model="searchInput"
9
- @keyup.native="searchEvent"
10
- clearable
11
- @clear="clearSearchClicked"
12
- ></el-input>
13
- <el-button class="button" @click="searchEvent">Search</el-button>
14
- </div>
15
- <SearchFilters
16
- class="filters"
17
- ref="filtersRef"
18
- :entry="filterEntry"
19
- :envVars="envVars"
20
- @filterResults="filterUpdate"
21
- @numberPerPage="numberPerPageUpdate"
22
- @loading="filtersLoading"
23
- ></SearchFilters>
24
- <div class="content scrollbar" v-loading="loadingCards" ref="content">
25
- <div
26
- class="error-feedback"
27
- v-if="results.length === 0 && !loadingCards && !sciCrunchError"
28
- >No results found - Please change your search / filter criteria.</div>
29
- <div class="error-feedback" v-if="sciCrunchError">{{sciCrunchError}}</div>
30
- <div v-for="o in results" :key="o.id" class="step-item">
31
- <DatasetCard :entry="o" :envVars="envVars"></DatasetCard>
32
- </div>
33
- <el-pagination
34
- class="pagination"
35
- :current-page.sync="page"
36
- hide-on-single-page
37
- large
38
- layout="prev, pager, next"
39
- :page-size="numberPerPage"
40
- :total="numberOfHits"
41
- @current-change="pageChange"
42
- ></el-pagination>
43
- </div>
44
- </el-card>
45
- </template>
46
-
47
-
48
- <script>
49
- /* eslint-disable no-alert, no-console */
50
- import Vue from "vue";
51
- import {
52
- Button,
53
- Card,
54
- Drawer,
55
- Icon,
56
- Input,
57
- Loading,
58
- Pagination
59
- } from "element-ui";
60
- import lang from "element-ui/lib/locale/lang/en";
61
- import locale from "element-ui/lib/locale";
62
- import SearchFilters from "./SearchFilters";
63
- import DatasetCard from "./DatasetCard";
64
- import ContextCard from "./ContextCard.vue";
65
-
66
- import {AlgoliaClient} from "../algolia/algolia.js";
67
- import {getFilters} from "../algolia/utils.js"
68
-
69
- locale.use(lang);
70
- Vue.use(Button);
71
- Vue.use(Card);
72
- Vue.use(Drawer);
73
- Vue.use(Icon);
74
- Vue.use(Input);
75
- Vue.use(Loading);
76
- Vue.use(Pagination);
77
-
78
- // handleErrors: A custom fetch error handler to recieve messages from the server
79
- // even when an error is found
80
- var handleErrors = async function(response) {
81
- if (!response.ok) {
82
- let parse = await response.json();
83
- if (parse) {
84
- throw new Error(parse.message);
85
- } else {
86
- throw new Error(response);
87
- }
88
- }
89
- return response;
90
- };
91
-
92
- var initial_state = {
93
- searchInput: "",
94
- lastSearch: "",
95
- results: [],
96
- numberOfHits: 0,
97
- filter: [],
98
- loadingCards: false,
99
- numberPerPage: 10,
100
- page: 1,
101
- pageModel: 1,
102
- start: 0,
103
- hasSearched: false,
104
- sciCrunchError: false
105
- };
106
-
107
- export default {
108
- components: { SearchFilters, DatasetCard, ContextCard },
109
- name: "SideBarContent",
110
- props: {
111
- visible: {
112
- type: Boolean,
113
- default: false
114
- },
115
- isDrawer: {
116
- type: Boolean,
117
- default: true
118
- },
119
- entry: {
120
- type: Object,
121
- default: () => initial_state
122
- },
123
- contextCardEntry: {
124
- type: Object,
125
- default: undefined
126
- },
127
- envVars: {
128
- type: Object,
129
- default: () => {}
130
- },
131
- firstSearch: {
132
- type: String,
133
- default: ""
134
- }
135
- },
136
- data: function() {
137
- return {
138
- ...this.entry,
139
- bodyStyle: {
140
- flex: "1 1 auto",
141
- "flex-flow": "column",
142
- display: "flex"
143
- }
144
- };
145
- },
146
- computed: {
147
- // This computed property populates filter data's entry object with $data from this sidebar
148
- filterEntry: function() {
149
- return {
150
- numberOfHits: this.numberOfHits,
151
- filterFacets: this.filter
152
- };
153
- }
154
- },
155
- methods: {
156
- openSearch: function(filter, search='') {
157
- this.searchInput = search;
158
- this.resetPageNavigation();
159
- this.searchAlgolia(filter, search);
160
- if (filter) {
161
- this.filter = [...filter];
162
- this.$refs.filtersRef.setCascader(this.filter);
163
- }
164
- },
165
- addFilter: function(filter) {
166
- this.resetPageNavigation();
167
- if (filter) {
168
- this.$refs.filtersRef.addFilter(filter);
169
- this.$refs.filtersRef.initiateSearch()
170
- }
171
- },
172
- clearSearchClicked: function() {
173
- this.searchInput = "";
174
- this.resetPageNavigation();
175
- this.searchAlgolia(this.filters, this.searchInput);
176
- },
177
- searchEvent: function(event = false) {
178
- if (event.keyCode === 13 || event instanceof MouseEvent) {
179
- this.resetPageNavigation();
180
- this.searchAlgolia(this.filters, this.searchInput);
181
- }
182
- },
183
- filterUpdate: function(filters) {
184
- this.filters = [...filters]
185
- this.resetPageNavigation()
186
- this.searchAlgolia(filters, this.searchInput)
187
- this.$emit("search-changed", {
188
- value: this.filter,
189
- type: "filter-update"
190
- });
191
- },
192
- searchAlgolia(filters, query=''){
193
- // Algolia search
194
- this.algoliaClient.search(getFilters(filters), query, this.numberPerPage, this.page).then(searchData => {
195
- this.numberOfHits = searchData.total
196
- this.discoverIds = searchData.discoverIds
197
- this.results = searchData.items
198
- this.searchSciCrunch({'discoverIds':this.discoverIds})
199
- })
200
- },
201
- filtersLoading: function (val) {
202
- this.loadingCards = val;
203
- },
204
- numberPerPageUpdate: function(val) {
205
- this.numberPerPage = val;
206
- this.pageChange(1);
207
- },
208
- pageChange: function(page) {
209
- this.start = (page - 1) * this.numberPerPage;
210
- this.page = page
211
- this.searchAlgolia(this.filters, this.searchInput, this.numberPerPage, this.page)
212
- },
213
- searchSciCrunch: function(params) {
214
- this.loadingCards = true;
215
- this.results = [];
216
- this.disableCards();
217
- this.$emit("search-changed", { value: this.searchInput, type: "query-update" });
218
- this.callSciCrunch(this.envVars.API_LOCATION, params)
219
- .then(result => {
220
- //Only process if the search term is the same as the last search term.
221
- //This avoid old search being displayed.
222
- this.sciCrunchError = false;
223
- this.resultsProcessing(result);
224
- this.$refs.content.style["overflow-y"] = "scroll";
225
- this.loadingCards = false;
226
- })
227
- .catch(result => {
228
- if (result.name !== 'AbortError') {
229
- this.loadingCards = false;
230
- this.sciCrunchError = result.message;
231
- }
232
- })
233
- },
234
- disableCards: function() {
235
- if (this.$refs.content) {
236
- this.$refs.content.scroll({ top: 0, behavior: "smooth" });
237
- this.$refs.content.style["overflow-y"] = "hidden";
238
- }
239
- },
240
- resetPageNavigation: function() {
241
- this.start = 0;
242
- this.page = 1;
243
- },
244
- resultsProcessing: function(data) {
245
- this.lastSearch = this.searchInput;
246
- this.results = [];
247
- let id = 0;
248
- if (data.results.length === 0) {
249
- return;
250
- }
251
- data.results.forEach(element => {
252
- // this.results.push(element) below should be once backend is ready
253
- this.results.push({
254
- name: element.name,
255
- description: element.description,
256
- contributors: element.contributors,
257
- numberSamples: element.sampleSize
258
- ? parseInt(element.sampleSize)
259
- : 0,
260
- numberSubjects: element.subjectSize
261
- ? parseInt(element.subjectSize)
262
- : 0,
263
- updated: element.updated[0].timestamp.split("T")[0],
264
- url: element.uri[0],
265
- datasetId: element.identifier,
266
- organs: (element.organs && element.organs.length > 0)
267
- ? [...new Set(element.organs.map(v => v.name))]
268
- : undefined,
269
- species: element.organisms
270
- ? element.organisms[0].species
271
- ? [...new Set(element.organisms.map((v) =>v.species ? v.species.name : null))]
272
- : undefined
273
- : undefined, // This processing only includes each gender once into 'sexes'
274
- csvFiles: element.csvFiles,
275
- id: id,
276
- doi: element.doi,
277
- publishDate: element.publishDate,
278
- scaffolds: element['abi-scaffold-metadata-file'] ? element['abi-scaffold-metadata-file'] : undefined,
279
- additionalLinks: element.additionalLinks,
280
- simulation: element.additionalLinks
281
- ? element.additionalLinks[0].description == 'Repository'
282
- : false,
283
- s3uri: element.s3uri
284
- });
285
- id++;
286
- });
287
- },
288
- createfilterParams: function(params) {
289
- let p = new URLSearchParams();
290
- //Check if field is array or value
291
- for (const key in params) {
292
- if (Array.isArray(params[key])) {
293
- params[key].forEach(e => {
294
- p.append(key, e);
295
- });
296
- } else {
297
- p.append(key, params[key]);
298
- }
299
- }
300
- return p.toString();
301
- },
302
- callSciCrunch: function(apiLocation, params = {}) {
303
- return new Promise((resolve, reject) => {
304
- // the following controller will abort current search
305
- // if a new one has been started
306
- if (this._controller) this._controller.abort();
307
- this._controller = new AbortController();
308
- let signal = this._controller.signal;
309
- // Add parameters if we are sent them
310
- let fullEndpoint = this.envVars.API_LOCATION + this.searchEndpoint + "?" + this.createfilterParams(params);
311
- fetch(fullEndpoint, { signal })
312
- .then(handleErrors)
313
- .then(response => response.json())
314
- .then(data => resolve(data))
315
- .catch(data => reject(data));
316
- });
317
- }
318
- },
319
- mounted: function() {
320
- // initialise algolia
321
- this.algoliaClient = new AlgoliaClient(this.envVars.ALGOLIA_ID, this.envVars.ALGOLIA_KEY, this.envVars.PENNSIEVE_API_LOCATION);
322
- this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX);
323
- console.log('Algolia initialised in sidebar')
324
-
325
- // temporarily disable flatmap search since there are no datasets
326
- if (this.firstSearch === "Flatmap" || this.firstSearch === "flatmap") {
327
- this.openSearch(undefined, '')
328
- } else {
329
- this.openSearch(undefined, '');
330
- }
331
- },
332
- created: function() {
333
- //Create non-reactive local variables
334
- this.searchEndpoint = "dataset_info/using_multiple_discoverIds/";
335
- }
336
- };
337
- </script>
338
-
339
- <!-- Add "scoped" attribute to limit CSS to this component only -->
340
- <style scoped>
341
- .content-card {
342
- height: 100%;
343
- flex-flow: column;
344
- display: flex;
345
- }
346
-
347
- .button {
348
- background-color: #8300bf;
349
- border: #8300bf;
350
- color: white;
351
- }
352
-
353
- .step-item {
354
- font-size: 14px;
355
- margin-bottom: 18px;
356
- text-align: left;
357
- }
358
-
359
- .search-input {
360
- width: 298px !important;
361
- height: 40px;
362
- padding-right: 14px;
363
- align-items: left;
364
- }
365
-
366
- .header {
367
- border: solid 1px #292b66;
368
- background-color: #292b66;
369
- text-align: left;
370
- }
371
-
372
- .pagination {
373
- padding-bottom: 16px;
374
- background-color: white;
375
- text-align: center;
376
- }
377
-
378
- .pagination >>> button {
379
- background-color: white !important;
380
- }
381
- .pagination >>> li {
382
- background-color: white !important;
383
- }
384
- .pagination >>> li.active {
385
- color: #8300bf;
386
- }
387
-
388
- .error-feedback {
389
- font-family: Asap;
390
- font-size: 14px;
391
- font-style: italic;
392
- padding-top: 15px;
393
- }
394
-
395
- .content-card >>> .el-card__header {
396
- background-color: #292b66;
397
- border: solid 1px #292b66;
398
- }
399
-
400
- .content-card >>> .el-card__body {
401
- background-color: #f7faff;
402
- overflow-y: hidden;
403
- }
404
-
405
- .content {
406
- width: 518px;
407
- flex: 1 1 auto;
408
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
409
- border: solid 1px #e4e7ed;
410
- background-color: #ffffff;
411
- overflow-y: scroll;
412
- scrollbar-width: thin;
413
- }
414
-
415
- .scrollbar::-webkit-scrollbar-track {
416
- border-radius: 10px;
417
- background-color: #f5f5f5;
418
- }
419
-
420
- .scrollbar::-webkit-scrollbar {
421
- width: 12px;
422
- right: -12px;
423
- background-color: #f5f5f5;
424
- }
425
-
426
- .scrollbar::-webkit-scrollbar-thumb {
427
- border-radius: 4px;
428
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
429
- background-color: #979797;
430
- }
431
-
432
- >>> .el-input__suffix {
433
- padding-right: 10px;
434
- }
435
-
436
- >>> .my-drawer {
437
- background: rgba(0, 0, 0, 0);
438
- box-shadow: none;
439
- }
440
- </style>
1
+ <template>
2
+ <el-card :body-style="bodyStyle" class="content-card">
3
+ <div slot="header" class="header">
4
+ <context-card v-if="contextCardEntry" :entry="contextCardEntry" />
5
+ <el-input
6
+ class="search-input"
7
+ placeholder="Search"
8
+ v-model="searchInput"
9
+ @keyup.native="searchEvent"
10
+ clearable
11
+ @clear="clearSearchClicked"
12
+ ></el-input>
13
+ <el-button class="button" @click="searchEvent">Search</el-button>
14
+ </div>
15
+ <SearchFilters
16
+ class="filters"
17
+ ref="filtersRef"
18
+ :entry="filterEntry"
19
+ :envVars="envVars"
20
+ @filterResults="filterUpdate"
21
+ @numberPerPage="numberPerPageUpdate"
22
+ @loading="filtersLoading"
23
+ ></SearchFilters>
24
+ <div class="content scrollbar" v-loading="loadingCards" ref="content">
25
+ <div
26
+ class="error-feedback"
27
+ v-if="results.length === 0 && !loadingCards && !sciCrunchError"
28
+ >No results found - Please change your search / filter criteria.</div>
29
+ <div class="error-feedback" v-if="sciCrunchError">{{sciCrunchError}}</div>
30
+ <div v-for="o in results" :key="o.id" class="step-item">
31
+ <DatasetCard :entry="o" :envVars="envVars"></DatasetCard>
32
+ </div>
33
+ <el-pagination
34
+ class="pagination"
35
+ :current-page.sync="page"
36
+ hide-on-single-page
37
+ large
38
+ layout="prev, pager, next"
39
+ :page-size="numberPerPage"
40
+ :total="numberOfHits"
41
+ @current-change="pageChange"
42
+ ></el-pagination>
43
+ </div>
44
+ </el-card>
45
+ </template>
46
+
47
+
48
+ <script>
49
+ /* eslint-disable no-alert, no-console */
50
+ import Vue from "vue";
51
+ import {
52
+ Button,
53
+ Card,
54
+ Drawer,
55
+ Icon,
56
+ Input,
57
+ Loading,
58
+ Pagination
59
+ } from "element-ui";
60
+ import lang from "element-ui/lib/locale/lang/en";
61
+ import locale from "element-ui/lib/locale";
62
+ import SearchFilters from "./SearchFilters";
63
+ import DatasetCard from "./DatasetCard";
64
+ import ContextCard from "./ContextCard.vue";
65
+
66
+ import {AlgoliaClient} from "../algolia/algolia.js";
67
+ import {getFilters} from "../algolia/utils.js"
68
+
69
+ locale.use(lang);
70
+ Vue.use(Button);
71
+ Vue.use(Card);
72
+ Vue.use(Drawer);
73
+ Vue.use(Icon);
74
+ Vue.use(Input);
75
+ Vue.use(Loading);
76
+ Vue.use(Pagination);
77
+
78
+ // handleErrors: A custom fetch error handler to recieve messages from the server
79
+ // even when an error is found
80
+ var handleErrors = async function(response) {
81
+ if (!response.ok) {
82
+ let parse = await response.json();
83
+ if (parse) {
84
+ throw new Error(parse.message);
85
+ } else {
86
+ throw new Error(response);
87
+ }
88
+ }
89
+ return response;
90
+ };
91
+
92
+ var initial_state = {
93
+ searchInput: "",
94
+ lastSearch: "",
95
+ results: [],
96
+ numberOfHits: 0,
97
+ filter: [],
98
+ loadingCards: false,
99
+ numberPerPage: 10,
100
+ page: 1,
101
+ pageModel: 1,
102
+ start: 0,
103
+ hasSearched: false,
104
+ sciCrunchError: false
105
+ };
106
+
107
+ export default {
108
+ components: { SearchFilters, DatasetCard, ContextCard },
109
+ name: "SideBarContent",
110
+ props: {
111
+ visible: {
112
+ type: Boolean,
113
+ default: false
114
+ },
115
+ isDrawer: {
116
+ type: Boolean,
117
+ default: true
118
+ },
119
+ entry: {
120
+ type: Object,
121
+ default: () => initial_state
122
+ },
123
+ contextCardEntry: {
124
+ type: Object,
125
+ default: undefined
126
+ },
127
+ envVars: {
128
+ type: Object,
129
+ default: () => {}
130
+ },
131
+ firstSearch: {
132
+ type: String,
133
+ default: ""
134
+ }
135
+ },
136
+ data: function() {
137
+ return {
138
+ ...this.entry,
139
+ bodyStyle: {
140
+ flex: "1 1 auto",
141
+ "flex-flow": "column",
142
+ display: "flex"
143
+ }
144
+ };
145
+ },
146
+ computed: {
147
+ // This computed property populates filter data's entry object with $data from this sidebar
148
+ filterEntry: function() {
149
+ return {
150
+ numberOfHits: this.numberOfHits,
151
+ filterFacets: this.filter
152
+ };
153
+ }
154
+ },
155
+ methods: {
156
+ openSearch: function(filter, search='') {
157
+ this.searchInput = search;
158
+ this.resetPageNavigation();
159
+ this.searchAlgolia(filter, search);
160
+ if (filter) {
161
+ this.filter = [...filter];
162
+ this.$refs.filtersRef.setCascader(this.filter);
163
+ }
164
+ },
165
+ addFilter: function(filter) {
166
+ this.resetPageNavigation();
167
+ if (filter) {
168
+ this.$refs.filtersRef.addFilter(filter);
169
+ this.$refs.filtersRef.initiateSearch()
170
+ }
171
+ },
172
+ clearSearchClicked: function() {
173
+ this.searchInput = "";
174
+ this.resetPageNavigation();
175
+ this.searchAlgolia(this.filters, this.searchInput);
176
+ },
177
+ searchEvent: function(event = false) {
178
+ if (event.keyCode === 13 || event instanceof MouseEvent) {
179
+ this.resetPageNavigation();
180
+ this.searchAlgolia(this.filters, this.searchInput);
181
+ }
182
+ },
183
+ filterUpdate: function(filters) {
184
+ this.filters = [...filters]
185
+ this.resetPageNavigation()
186
+ this.searchAlgolia(filters, this.searchInput)
187
+ this.$emit("search-changed", {
188
+ value: this.filter,
189
+ type: "filter-update"
190
+ });
191
+ },
192
+ searchAlgolia(filters, query=''){
193
+ // Algolia search
194
+ this.algoliaClient.search(getFilters(filters), query, this.numberPerPage, this.page).then(searchData => {
195
+ this.numberOfHits = searchData.total
196
+ this.discoverIds = searchData.discoverIds
197
+ this.searchSciCrunch({'dois':this.dois})
198
+ })
199
+ },
200
+ filtersLoading: function (val) {
201
+ this.loadingCards = val;
202
+ },
203
+ numberPerPageUpdate: function(val) {
204
+ this.numberPerPage = val;
205
+ this.pageChange(1);
206
+ },
207
+ pageChange: function(page) {
208
+ this.start = (page - 1) * this.numberPerPage;
209
+ this.page = page
210
+ this.searchAlgolia(this.filters, this.searchInput, this.numberPerPage, this.page)
211
+ },
212
+ searchSciCrunch: function(params) {
213
+ this.loadingCards = true;
214
+ this.results = [];
215
+ this.disableCards();
216
+ this.$emit("search-changed", { value: this.searchInput, type: "query-update" });
217
+ this.callSciCrunch(this.envVars.API_LOCATION, params)
218
+ .then(result => {
219
+ //Only process if the search term is the same as the last search term.
220
+ //This avoid old search being displayed.
221
+ this.sciCrunchError = false;
222
+ this.resultsProcessing(result);
223
+ this.$refs.content.style["overflow-y"] = "scroll";
224
+ this.loadingCards = false;
225
+ })
226
+ .catch(result => {
227
+ if (result.name !== 'AbortError') {
228
+ this.loadingCards = false;
229
+ this.sciCrunchError = result.message;
230
+ }
231
+ })
232
+ },
233
+ disableCards: function() {
234
+ if (this.$refs.content) {
235
+ this.$refs.content.scroll({ top: 0, behavior: "smooth" });
236
+ this.$refs.content.style["overflow-y"] = "hidden";
237
+ }
238
+ },
239
+ resetPageNavigation: function() {
240
+ this.start = 0;
241
+ this.page = 1;
242
+ },
243
+ resultsProcessing: function(data) {
244
+ this.lastSearch = this.searchInput;
245
+ this.results = [];
246
+ let id = 0;
247
+ if (data.results.length === 0) {
248
+ return;
249
+ }
250
+ data.results.forEach(element => {
251
+ // this.results.push(element) below should be once backend is ready
252
+ this.results.push({
253
+ name: element.name,
254
+ description: element.description,
255
+ contributors: element.contributors,
256
+ numberSamples: element.sampleSize
257
+ ? parseInt(element.sampleSize)
258
+ : 0,
259
+ numberSubjects: element.subjectSize
260
+ ? parseInt(element.subjectSize)
261
+ : 0,
262
+ updated: element.updated[0].timestamp.split("T")[0],
263
+ url: element.uri[0],
264
+ datasetId: element.identifier,
265
+ organs: (element.organs && element.organs.length > 0)
266
+ ? [...new Set(element.organs.map(v => v.name))]
267
+ : undefined,
268
+ species: element.organisms
269
+ ? element.organisms[0].species
270
+ ? [...new Set(element.organisms.map((v) =>v.species ? v.species.name : null))]
271
+ : undefined
272
+ : undefined, // This processing only includes each gender once into 'sexes'
273
+ csvFiles: element.csvFiles,
274
+ id: id,
275
+ doi: element.doi,
276
+ publishDate: element.publishDate,
277
+ scaffolds: element['abi-scaffold-metadata-file'] ? element['abi-scaffold-metadata-file'] : undefined,
278
+ additionalLinks: element.additionalLinks,
279
+ simulation: element.additionalLinks
280
+ ? element.additionalLinks[0].description == 'Repository'
281
+ : false,
282
+ s3uri: element.s3uri
283
+ });
284
+ id++;
285
+ });
286
+ },
287
+ createfilterParams: function(params) {
288
+ let p = new URLSearchParams();
289
+ //Check if field is array or value
290
+ for (const key in params) {
291
+ if (Array.isArray(params[key])) {
292
+ params[key].forEach(e => {
293
+ p.append(key, e);
294
+ });
295
+ } else {
296
+ p.append(key, params[key]);
297
+ }
298
+ }
299
+ return p.toString();
300
+ },
301
+ callSciCrunch: function(apiLocation, params = {}) {
302
+ return new Promise((resolve, reject) => {
303
+ // the following controller will abort current search
304
+ // if a new one has been started
305
+ if (this._controller) this._controller.abort();
306
+ this._controller = new AbortController();
307
+ let signal = this._controller.signal;
308
+ // Add parameters if we are sent them
309
+ let fullEndpoint = this.envVars.API_LOCATION + this.searchEndpoint + "?" + this.createfilterParams(params);
310
+ fetch(fullEndpoint, { signal })
311
+ .then(handleErrors)
312
+ .then(response => response.json())
313
+ .then(data => resolve(data))
314
+ .catch(data => reject(data));
315
+ });
316
+ }
317
+ },
318
+ mounted: function() {
319
+ // initialise algolia
320
+ this.algoliaClient = new AlgoliaClient(this.envVars.ALGOLIA_ID, this.envVars.ALGOLIA_KEY, this.envVars.PENNSIEVE_API_LOCATION);
321
+ this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX);
322
+ console.log('Algolia initialised in sidebar')
323
+
324
+ // temporarily disable flatmap search since there are no datasets
325
+ if (this.firstSearch === "Flatmap" || this.firstSearch === "flatmap") {
326
+ this.openSearch(undefined, '')
327
+ } else {
328
+ this.openSearch(undefined, '');
329
+ }
330
+ },
331
+ created: function() {
332
+ //Create non-reactive local variables
333
+ this.searchEndpoint = "dataset_info/using_multiple_dois/";
334
+ }
335
+ };
336
+ </script>
337
+
338
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
339
+ <style scoped>
340
+ .content-card {
341
+ height: 100%;
342
+ flex-flow: column;
343
+ display: flex;
344
+ }
345
+
346
+ .button {
347
+ background-color: #8300bf;
348
+ border: #8300bf;
349
+ color: white;
350
+ }
351
+
352
+ .step-item {
353
+ font-size: 14px;
354
+ margin-bottom: 18px;
355
+ text-align: left;
356
+ }
357
+
358
+ .search-input {
359
+ width: 298px !important;
360
+ height: 40px;
361
+ padding-right: 14px;
362
+ align-items: left;
363
+ }
364
+
365
+ .header {
366
+ border: solid 1px #292b66;
367
+ background-color: #292b66;
368
+ text-align: left;
369
+ }
370
+
371
+ .pagination {
372
+ padding-bottom: 16px;
373
+ background-color: white;
374
+ text-align: center;
375
+ }
376
+
377
+ .pagination >>> button {
378
+ background-color: white !important;
379
+ }
380
+ .pagination >>> li {
381
+ background-color: white !important;
382
+ }
383
+ .pagination >>> li.active {
384
+ color: #8300bf;
385
+ }
386
+
387
+ .error-feedback {
388
+ font-family: Asap;
389
+ font-size: 14px;
390
+ font-style: italic;
391
+ padding-top: 15px;
392
+ }
393
+
394
+ .content-card >>> .el-card__header {
395
+ background-color: #292b66;
396
+ border: solid 1px #292b66;
397
+ }
398
+
399
+ .content-card >>> .el-card__body {
400
+ background-color: #f7faff;
401
+ overflow-y: hidden;
402
+ }
403
+
404
+ .content {
405
+ width: 518px;
406
+ flex: 1 1 auto;
407
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
408
+ border: solid 1px #e4e7ed;
409
+ background-color: #ffffff;
410
+ overflow-y: scroll;
411
+ scrollbar-width: thin;
412
+ }
413
+
414
+ .scrollbar::-webkit-scrollbar-track {
415
+ border-radius: 10px;
416
+ background-color: #f5f5f5;
417
+ }
418
+
419
+ .scrollbar::-webkit-scrollbar {
420
+ width: 12px;
421
+ right: -12px;
422
+ background-color: #f5f5f5;
423
+ }
424
+
425
+ .scrollbar::-webkit-scrollbar-thumb {
426
+ border-radius: 4px;
427
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
428
+ background-color: #979797;
429
+ }
430
+
431
+ >>> .el-input__suffix {
432
+ padding-right: 10px;
433
+ }
434
+
435
+ >>> .my-drawer {
436
+ background: rgba(0, 0, 0, 0);
437
+ box-shadow: none;
438
+ }
439
+ </style>