@abi-software/map-side-bar 1.3.20 → 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.20",
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>
@@ -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,8 +215,9 @@ 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
- this.entry.scaffolds.forEach((scaffold) => {
220
+ this.entry.scaffolds.forEach((scaffold, i) => {
220
221
  const filePath = scaffold.dataset.path;
221
222
  const id = scaffold.identifier;
222
223
  const thumbnail = this.getThumbnailForScaffold(
@@ -245,7 +246,7 @@ export default {
245
246
  apiLocation: this.envVars.API_LOCATION,
246
247
  version: this.datasetVersion,
247
248
  banner: this.datasetThumbnail,
248
- contextCardUrl: this.entry.contextualInformation ? `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation}` : undefined,
249
+ contextCardUrl: this.getContextCardUrl(i)
249
250
  };
250
251
  this.items['Scaffolds'].push({
251
252
  id,
@@ -344,6 +345,15 @@ export default {
344
345
  this.maxWidth = this.$el.clientWidth;
345
346
  // this.$emit('resize', this.$el.clientWidth)
346
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
+ }
347
357
  },
348
358
  computed: {
349
359
  galleryItems() {