@abi-software/map-side-bar 1.3.23 → 1.3.24

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": "1.3.23",
3
+ "version": "1.3.24",
4
4
  "main": "./dist/map-side-bar.common.js",
5
5
  "files": [
6
6
  "dist/*",
package/src/App.vue CHANGED
@@ -6,7 +6,7 @@
6
6
  <el-button @click="openSearch">search Uberon from refs</el-button>
7
7
  <el-button @click="singleFacets">Add heart to Filter</el-button>
8
8
  <el-button @click="addStomach">Add stomach to Filter</el-button>
9
- <el-button @click="AddInvalidTerm">Add invalid term to Filter</el-button>
9
+ <el-button @click="addInvalidTerm">Add invalid term to Filter</el-button>
10
10
  <el-button @click="multiFacets">multiple facets</el-button>
11
11
  <el-button @click="neuronSearch">open neuron search</el-button>
12
12
  <el-button @click="keywordSearch">keyword search</el-button>
@@ -215,6 +215,7 @@ export default {
215
215
  },
216
216
  createScaffoldItems: function () {
217
217
  if (this.entry.scaffolds) {
218
+ window.entry = this.entry
218
219
  let index = 0;
219
220
  this.entry.scaffolds.forEach((scaffold, i) => {
220
221
  const filePath = scaffold.dataset.path;
@@ -236,8 +237,6 @@ export default {
236
237
  });
237
238
  mimetype = thumbnail.mimetype.name;
238
239
  }
239
- // The line below checks if there is a context file for each scaffold. If there is not, we use the first context card for each scaffold.
240
- let contextIndex = this.entry.contextualInformation.length == this.entry.scaffolds.length ? i : 0
241
240
  let action = {
242
241
  label: capitalise(this.label),
243
242
  resource: `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${filePath}`,
@@ -247,7 +246,7 @@ export default {
247
246
  apiLocation: this.envVars.API_LOCATION,
248
247
  version: this.datasetVersion,
249
248
  banner: this.datasetThumbnail,
250
- contextCardUrl: this.entry.contextualInformation[contextIndex] ? `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation[contextIndex]}` : undefined,
249
+ contextCardUrl: this.getContextCardUrl(i)
251
250
  };
252
251
  this.items['Scaffolds'].push({
253
252
  id,
@@ -346,6 +345,15 @@ export default {
346
345
  this.maxWidth = this.$el.clientWidth;
347
346
  // this.$emit('resize', this.$el.clientWidth)
348
347
  },
348
+ getContextCardUrl(scaffoldIndex){
349
+ if(!this.entry.contextualInformation || this.entry.contextualInformation.length == 0){
350
+ return undefined
351
+ } else {
352
+ // The line below checks if there is a context file for each scaffold. If there is not, we use the first context card for each scaffold.
353
+ let contextIndex = this.entry['abi-contextual-information'].length == this.entry.scaffolds.length ? scaffoldIndex : 0
354
+ return `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation[contextIndex]}`
355
+ }
356
+ }
349
357
  },
350
358
  computed: {
351
359
  galleryItems() {