@abi-software/map-side-bar 1.3.21 → 1.3.25

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.21",
3
+ "version": "1.3.25",
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>
@@ -34,7 +34,7 @@
34
34
  </div>
35
35
  </span>
36
36
  <div v-bind:key="i+'_4'" v-if="sampleDetails[i]" v-html="sample.description"/>
37
- <a v-bind:key="i+'_5'" v-if="sampleDetails[i]" :href="generateFileLink(sample.path)" target="_blank">View Source</a>
37
+ <a v-bind:key="i+'_5'" v-if="sampleDetails[i] && sample.path" :href="generateFileLink(sample)" target="_blank">View Source</a>
38
38
  <div v-bind:key="i+'_2'" class="padding"/>
39
39
  </template>
40
40
  </template>
@@ -48,7 +48,7 @@
48
48
  <div class="view-description">{{view.description}}<i class="el-icon-warning-outline info"></i> </div>
49
49
  </span>
50
50
  <div v-if="sampleDetails[i]" v-html="samplesMatching(view.id).description" :key="i+'_2'"/>
51
- <a v-bind:key="i+'_5'" v-if="sampleDetails[i]" :href="generateFileLink(samplesMatching(view.id))" target="_blank">View Source</a>
51
+ <a v-bind:key="i+'_5'" v-if="sampleDetails[i] && samplesMatching(view.id).path" :href="generateFileLink(samplesMatching(view.id))" target="_blank">View Source</a>
52
52
  <div :key="i" class="padding"/>
53
53
 
54
54
  <!-- Extra padding if sample details is open -->
@@ -215,7 +215,6 @@ export default {
215
215
  },
216
216
  createScaffoldItems: function () {
217
217
  if (this.entry.scaffolds) {
218
- window.entry = this.entry
219
218
  let index = 0;
220
219
  this.entry.scaffolds.forEach((scaffold, i) => {
221
220
  const filePath = scaffold.dataset.path;
@@ -237,7 +236,6 @@ export default {
237
236
  });
238
237
  mimetype = thumbnail.mimetype.name;
239
238
  }
240
- let contextIndex = this.entry.contextualInformation.length > 0 ? i : 0
241
239
  let action = {
242
240
  label: capitalise(this.label),
243
241
  resource: `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${filePath}`,
@@ -247,7 +245,7 @@ export default {
247
245
  apiLocation: this.envVars.API_LOCATION,
248
246
  version: this.datasetVersion,
249
247
  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,
248
+ contextCardUrl: this.getContextCardUrl(i)
251
249
  };
252
250
  this.items['Scaffolds'].push({
253
251
  id,
@@ -346,6 +344,15 @@ export default {
346
344
  this.maxWidth = this.$el.clientWidth;
347
345
  // this.$emit('resize', this.$el.clientWidth)
348
346
  },
347
+ getContextCardUrl(scaffoldIndex){
348
+ if(!this.entry.contextualInformation || this.entry.contextualInformation.length == 0){
349
+ return undefined
350
+ } else {
351
+ // 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.
352
+ let contextIndex = this.entry['abi-contextual-information'].length == this.entry.scaffolds.length ? scaffoldIndex : 0
353
+ return `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation[contextIndex]}`
354
+ }
355
+ }
349
356
  },
350
357
  computed: {
351
358
  galleryItems() {