@abi-software/map-side-bar 2.5.3-beta.1 → 2.5.3-beta.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.5.3-beta.1",
3
+ "version": "2.5.3-beta.11",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@abi-software/gallery": "^1.1.2",
42
- "@abi-software/map-utilities": "^1.2.1",
42
+ "@abi-software/map-utilities": "^1.2.2-beta.4",
43
43
  "@abi-software/svg-sprite": "^1.0.1",
44
44
  "@element-plus/icons-vue": "^2.3.1",
45
45
  "algoliasearch": "^4.10.5",
@@ -2,7 +2,7 @@
2
2
  <div v-if="entry" class="main" v-loading="loading">
3
3
  <!-- Connectivity Info Title -->
4
4
  <div class="connectivity-info-title">
5
- <div>
5
+ <div class="title-content">
6
6
  <div class="block" v-if="entry.title">
7
7
  <div class="title">
8
8
  {{ capitalise(entry.title) }}
@@ -35,9 +35,6 @@
35
35
  <div class="block" v-else>
36
36
  <div class="title">{{ entry.featureId }}</div>
37
37
  </div>
38
- <div class="block" v-if="resources.length">
39
- <external-resource-card :resources="resources"></external-resource-card>
40
- </div>
41
38
  </div>
42
39
  <div class="title-buttons">
43
40
  <el-popover
@@ -81,7 +78,7 @@
81
78
  </div>
82
79
  </div>
83
80
 
84
- <div class="content-container content-container-connectivity" v-if="activeView === 'listView'">
81
+ <div class="content-container content-container-connectivity" v-show="activeView === 'listView'">
85
82
  {{ entry.paths }}
86
83
  <div v-if="entry.origins && entry.origins.length > 0" class="block">
87
84
  <div class="attribute-title-container">
@@ -209,13 +206,19 @@
209
206
  </div>
210
207
  </div>
211
208
 
212
- <div class="content-container" v-if="activeView === 'graphView'">
213
- <connectivity-graph
214
- :entry="entry.featureId[0]"
215
- :mapServer="envVars.FLATMAPAPI_LOCATION"
216
- @tap-node="onTapNode"
217
- ref="connectivityGraphRef"
218
- />
209
+ <div class="content-container" v-show="activeView === 'graphView'">
210
+ <template v-if="graphViewLoaded">
211
+ <connectivity-graph
212
+ :entry="entry.featureId[0]"
213
+ :mapServer="envVars.FLATMAPAPI_LOCATION"
214
+ @tap-node="onTapNode"
215
+ ref="connectivityGraphRef"
216
+ />
217
+ </template>
218
+ </div>
219
+
220
+ <div class="content-container" v-if="resources.length">
221
+ <external-resource-card :resources="resources"></external-resource-card>
219
222
  </div>
220
223
  </div>
221
224
  </template>
@@ -232,9 +235,13 @@ import {
232
235
  ElContainer as Container,
233
236
  ElIcon as Icon,
234
237
  } from 'element-plus'
235
- import ExternalResourceCard from './ExternalResourceCard.vue'
238
+
236
239
  import EventBus from './EventBus.js'
237
- import { CopyToClipboard, ConnectivityGraph } from '@abi-software/map-utilities';
240
+ import {
241
+ CopyToClipboard,
242
+ ConnectivityGraph,
243
+ ExternalResourceCard,
244
+ } from '@abi-software/map-utilities';
238
245
  import '@abi-software/map-utilities/dist/style.css';
239
246
 
240
247
  const titleCase = (str) => {
@@ -304,6 +311,7 @@ export default {
304
311
  uberons: [{ id: undefined, name: undefined }],
305
312
  connectivityError: null,
306
313
  timeoutID: undefined,
314
+ graphViewLoaded: false,
307
315
  }
308
316
  },
309
317
  watch: {
@@ -406,13 +414,11 @@ export default {
406
414
  switchConnectivityView: function (val) {
407
415
  this.activeView = val;
408
416
 
409
- if (val === 'graphView') {
410
- const connectivityGraphRef = this.$refs.connectivityGraphRef;
411
- if (connectivityGraphRef && connectivityGraphRef.$el) {
412
- connectivityGraphRef.$el.scrollIntoView({
413
- behavior: 'smooth',
414
- });
415
- }
417
+ if (val === 'graphView' && !this.graphViewLoaded) {
418
+ // to load the connectivity graph only after the container is in view
419
+ this.$nextTick(() => {
420
+ this.graphViewLoaded = true;
421
+ });
416
422
  }
417
423
  },
418
424
  onTapNode: function (data) {
@@ -442,21 +448,6 @@ export default {
442
448
  contentArray.push(`<div>${this.provSpeciesDescription}</div>`);
443
449
  }
444
450
 
445
- // PubMed URL
446
- if (this.resources?.length) {
447
- const pubmedContents = [];
448
- this.resources.forEach((resource) => {
449
- let pubmedContent = '';
450
- if (resource.id === 'pubmed') {
451
- pubmedContent += `<div><strong>PubMed URL:</strong></div>`;
452
- pubmedContent += '\n';
453
- pubmedContent += `<div><a href="${resource.url}">${resource.url}</a></div>`;
454
- }
455
- pubmedContents.push(pubmedContent);
456
- });
457
- contentArray.push(pubmedContents.join('\n\n<br>'));
458
- }
459
-
460
451
  // entry.paths
461
452
  if (this.entry.paths) {
462
453
  contentArray.push(`<div>${this.entry.paths}</div>`);
@@ -512,6 +503,14 @@ export default {
512
503
  contentArray.push(transformedDestinations);
513
504
  }
514
505
 
506
+ // References
507
+ if (this.resources?.length) {
508
+ const referenceContents = [];
509
+ referenceContents.push(`<div><strong>References</strong></div>`);
510
+ // TODO: to get references after contents are loaded.
511
+ contentArray.push(referenceContents.join('\n\n<br>'));
512
+ }
513
+
515
514
  return contentArray.join('\n\n<br>');
516
515
  },
517
516
  toggleConnectivityTooltip: function (name, option) {
@@ -616,6 +615,11 @@ export default {
616
615
  flex-direction: row;
617
616
  justify-content: space-between;
618
617
  gap: 1rem;
618
+
619
+ .title-content {
620
+ flex: 1 0 0%;
621
+ max-width: 85%;
622
+ }
619
623
  }
620
624
 
621
625
  .title {
@@ -921,7 +925,10 @@ export default {
921
925
 
922
926
  .title-buttons {
923
927
  display: flex;
928
+ flex: 1 0 0%;
929
+ max-width: 15%;
924
930
  flex-direction: row;
931
+ justify-content: end;
925
932
  gap: 0.5rem;
926
933
 
927
934
  :deep(.copy-clipboard-button) {
@@ -469,14 +469,7 @@ export default {
469
469
  facetSubPropPath: facetSubPropPath, // will be used for filters if we are at the third level of the cascader
470
470
  }
471
471
  })
472
-
473
- // if all checkboxes are checked
474
- // there has no filter values
475
- const filtersLength = filters.filter((item) => item.facet !== 'Show all');
476
- if (!filtersLength.length) {
477
- filters = [];
478
- }
479
-
472
+
480
473
  this.$emit('loading', true) // let sidebarcontent wait for the requests
481
474
  this.$emit('filterResults', filters) // emit filters for apps above sidebar
482
475
  this.setCascader(filterKeys) //update our cascader v-model if we modified the event
@@ -638,7 +631,7 @@ export default {
638
631
  let filters = createFilter(e)
639
632
  return filters
640
633
  })
641
-
634
+
642
635
  // Unforttunately the cascader is very particular about it's v-model
643
636
  // to get around this we create a clone of it and use this clone for adding our boolean information
644
637
  this.cascadeSelectedWithBoolean = filterFacets.map((e) => {