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

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.21",
4
4
  "main": "./dist/map-side-bar.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -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(
@@ -236,6 +237,7 @@ export default {
236
237
  });
237
238
  mimetype = thumbnail.mimetype.name;
238
239
  }
240
+ let contextIndex = this.entry.contextualInformation.length > 0 ? i : 0
239
241
  let action = {
240
242
  label: capitalise(this.label),
241
243
  resource: `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${filePath}`,
@@ -245,7 +247,7 @@ export default {
245
247
  apiLocation: this.envVars.API_LOCATION,
246
248
  version: this.datasetVersion,
247
249
  banner: this.datasetThumbnail,
248
- contextCardUrl: this.entry.contextualInformation ? `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation}` : undefined,
250
+ contextCardUrl: this.entry.contextualInformation[contextIndex] ? `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation[contextIndex]}` : undefined,
249
251
  };
250
252
  this.items['Scaffolds'].push({
251
253
  id,