@abi-software/map-side-bar 1.3.34 → 1.3.36

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-lock.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "1.3.34",
3
+ "version": "1.3.36",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
7
7
  "@abi-software/gallery": {
8
- "version": "0.3.1",
9
- "resolved": "https://registry.npmjs.org/@abi-software/gallery/-/gallery-0.3.1.tgz",
10
- "integrity": "sha512-ED5ppMiXfHbobM073SnDiUhomviLH+dSQ6jgk6b9ULBkdTmF6r0cE6WbPHYJHdNgZVJDbYokBieO/URrff8QhQ==",
8
+ "version": "0.3.2",
9
+ "resolved": "https://registry.npmjs.org/@abi-software/gallery/-/gallery-0.3.2.tgz",
10
+ "integrity": "sha512-YvLlBQVQY7mKyytfsYKX838ulpzlHo8THYEiDwBOT4xSdBVzl+t1cNvFC4Fip+QcXw96LLDJLKCiZXtU+7JDTw==",
11
11
  "requires": {
12
12
  "@babel/code-frame": "^7.12.11",
13
13
  "axios": "^0.26.1",
@@ -19,19 +19,19 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@babel/code-frame": {
22
- "version": "7.16.7",
23
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
24
- "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
22
+ "version": "7.18.6",
23
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
24
+ "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
25
25
  "requires": {
26
- "@babel/highlight": "^7.16.7"
26
+ "@babel/highlight": "^7.18.6"
27
27
  }
28
28
  },
29
29
  "@babel/highlight": {
30
- "version": "7.17.12",
31
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz",
32
- "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==",
30
+ "version": "7.18.6",
31
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
32
+ "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
33
33
  "requires": {
34
- "@babel/helper-validator-identifier": "^7.16.7",
34
+ "@babel/helper-validator-identifier": "^7.18.6",
35
35
  "chalk": "^2.0.0",
36
36
  "js-tokens": "^4.0.0"
37
37
  }
@@ -55,14 +55,14 @@
55
55
  }
56
56
  },
57
57
  "core-js": {
58
- "version": "3.22.8",
59
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.22.8.tgz",
60
- "integrity": "sha512-UoGQ/cfzGYIuiq6Z7vWL1HfkE9U9IZ4Ub+0XSiJTCzvbZzgPA69oDF2f+lgJ6dFFLEdjW5O6svvoKzXX23xFkA=="
58
+ "version": "3.29.1",
59
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.29.1.tgz",
60
+ "integrity": "sha512-+jwgnhg6cQxKYIIjGtAHq2nwUOolo9eoFZ4sHfUH09BLXBgxnH4gA0zEd+t+BO2cNB8idaBtZFcFTRjQJRJmAw=="
61
61
  },
62
62
  "element-ui": {
63
- "version": "2.15.9",
64
- "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.9.tgz",
65
- "integrity": "sha512-dx45nQLt4Hn87/Z9eRr3ex6KFZbxlFAwEU3QoW3wA5EsYftvHTyL9Pq7VnXXD7hu1Eiaup2jcs6kp+/VSFmXuA==",
63
+ "version": "2.15.13",
64
+ "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.13.tgz",
65
+ "integrity": "sha512-LJoatEYX6WV74FqXBss8Xfho9fh9rjDSzrDrTyREdGb1h1R3uRvmLh5jqp2JU137aj4/BgqA3K06RQpQBX33Bg==",
66
66
  "requires": {
67
67
  "async-validator": "~1.8.1",
68
68
  "babel-helper-vue-jsx-merge-props": "^2.0.0",
@@ -535,9 +535,9 @@
535
535
  }
536
536
  },
537
537
  "@babel/helper-validator-identifier": {
538
- "version": "7.16.7",
539
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
540
- "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw=="
538
+ "version": "7.19.1",
539
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
540
+ "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w=="
541
541
  },
542
542
  "@babel/helper-wrap-function": {
543
543
  "version": "7.7.4",
@@ -3100,14 +3100,14 @@
3100
3100
  "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
3101
3101
  },
3102
3102
  "json5": {
3103
- "version": "2.2.1",
3104
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
3105
- "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA=="
3103
+ "version": "2.2.3",
3104
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
3105
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="
3106
3106
  },
3107
3107
  "loader-utils": {
3108
- "version": "2.0.2",
3109
- "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
3110
- "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
3108
+ "version": "2.0.4",
3109
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
3110
+ "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
3111
3111
  "requires": {
3112
3112
  "big.js": "^5.2.2",
3113
3113
  "emojis-list": "^3.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "1.3.34",
3
+ "version": "1.3.36",
4
4
  "main": "./dist/map-side-bar.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -17,7 +17,7 @@
17
17
  "start": "vue-cli-service serve"
18
18
  },
19
19
  "dependencies": {
20
- "@abi-software/gallery": "^0.3.1",
20
+ "@abi-software/gallery": "^0.3.2",
21
21
  "@abi-software/svg-sprite": "^0.1.14",
22
22
  "algoliasearch": "^4.10.5",
23
23
  "element-ui": "^2.13.0",
@@ -8,16 +8,16 @@ export const facetPropPathMapping = {
8
8
  'item.modalities.keyword' : 'Experimental Approach',
9
9
  'attributes.subject.sex.value' : 'Sex',
10
10
  'attributes.subject.ageCategory.value' : 'Age Categories',
11
- 'item.keywords.keyword' : 'Keywords'
11
+ 'item.types.name' : 'Data type',
12
12
  }
13
13
 
14
14
  // Same as above, but these show on the sidebar filters
15
15
  export const shownFilters = {
16
16
  'anatomy.organ.name' : 'Anatomical Structure',
17
17
  'organisms.primary.species.name' : 'Species',
18
- 'item.modalities.keyword' : 'Experimental Approach',
19
18
  'attributes.subject.sex.value' : 'Sex',
20
19
  'attributes.subject.ageCategory.value' : 'Age Categories',
20
+ 'item.types.name' : 'Data type',
21
21
  }
22
22
 
23
23
  /* Returns filter for searching algolia. All facets of the same category are joined with OR,
@@ -71,6 +71,9 @@ import locale from "element-ui/lib/locale";
71
71
  import EventBus from "./EventBus"
72
72
  import hardcoded_info from './hardcoded-context-info'
73
73
 
74
+ //provide the s3Bucket related methods and data.
75
+ import S3Bucket from "../mixins/S3Bucket";
76
+
74
77
  import { marked } from 'marked'
75
78
  import xss from 'xss'
76
79
 
@@ -105,6 +108,7 @@ const convertBackslashToForwardSlash = function(path){
105
108
 
106
109
  export default {
107
110
  name: "contextCard",
111
+ mixins: [S3Bucket],
108
112
  props: {
109
113
  /**
110
114
  * Object containing information for
@@ -138,6 +142,12 @@ export default {
138
142
  }
139
143
  },
140
144
  immediate: true
145
+ },
146
+ 'entry.s3uri': {
147
+ handler(val){
148
+ this.updateS3Bucket(val);
149
+ },
150
+ immediate: true
141
151
  }
142
152
  },
143
153
  computed: {
@@ -228,7 +238,7 @@ export default {
228
238
  return path
229
239
  }
230
240
  path = this.removeDoubleFilesPath(path)
231
- return `${this.envVars.API_LOCATION}s3-resource/${this.entry.discoverId}/${this.entry.version}/files/${path}`
241
+ return `${this.envVars.API_LOCATION}s3-resource/${this.entry.discoverId}/${this.entry.version}/files/${path}${this.getS3Args()}`
232
242
  },
233
243
  // This is used later when generateing links to the resource on sparc.science (see generateFileLink)
234
244
  addDiscoverIdsToContextData(){
@@ -263,7 +273,7 @@ export default {
263
273
  },
264
274
  openViewFile: function(view){
265
275
  // note that we assume that the view file is in the same directory as the scaffold (viewUrls take relative paths)
266
- this.entry.viewUrl = `${this.envVars.API_LOCATION}s3-resource/${this.entry.discoverId}/${this.entry.version}/${view.path}`
276
+ this.entry.viewUrl = `${this.envVars.API_LOCATION}s3-resource/${this.entry.discoverId}/${this.entry.version}/${view.path}${this.getS3Args()}`
267
277
  this.entry.type = 'Scaffold View'
268
278
  EventBus.$emit("PopoverActionClick", this.entry)
269
279
  }
@@ -30,12 +30,14 @@ const capitalise = function (string) {
30
30
 
31
31
  import GalleryHelper from "@abi-software/gallery/src/mixins/GalleryHelpers";
32
32
  import Gallery from "@abi-software/gallery";
33
+ //provide the s3Bucket related methods and data.
34
+ import S3Bucket from "../mixins/S3Bucket";
33
35
  import "@abi-software/gallery/dist/gallery.css";
34
36
 
35
37
  export default {
36
38
  name: "ImageGallery",
37
39
  components: { Gallery },
38
- mixins: [GalleryHelper],
40
+ mixins: [GalleryHelper, S3Bucket],
39
41
  props: {
40
42
  datasetBiolucida: {
41
43
  type: Object,
@@ -107,7 +109,7 @@ export default {
107
109
  imageStyle: { maxWidth: '160px', maxHeight: '160px'},
108
110
  shadow: "never",
109
111
  bottomSpacer: { minHeight: '0rem' },
110
- resetIndex: false
112
+ resetIndex: false,
111
113
  };
112
114
  },
113
115
  methods: {
@@ -115,6 +117,7 @@ export default {
115
117
  this.$emit('card-clicked', payload);
116
118
  },
117
119
  createSciCurnchItems: function () {
120
+ this.updateS3Bucket(this.entry.s3uri);
118
121
  this.createDatasetItem();
119
122
  this.createScaffoldItems();
120
123
  this.createSimulationItems();
@@ -170,12 +173,13 @@ export default {
170
173
  datasetId: this.datasetId,
171
174
  datasetVersion: this.datasetVersion,
172
175
  file_path: thumbnail.dataset.path,
176
+ s3Bucket: this.s3Bucket,
173
177
  });
174
178
  mimetype = thumbnail.mimetype.name;
175
179
  }
176
180
  const plotAnnotation = plot.datacite;
177
181
  const filePathPrefix = `${this.envVars.API_LOCATION}/s3-resource/${this.datasetId}/${this.datasetVersion}/files/`;
178
- const sourceUrl = filePathPrefix + plot.dataset.path;
182
+ const sourceUrl = filePathPrefix + plot.dataset.path + this.getS3Args();
179
183
 
180
184
  const metadata = JSON.parse(
181
185
  plotAnnotation.supplemental_json_metadata.description
@@ -197,6 +201,7 @@ export default {
197
201
  let action = {
198
202
  label: capitalise(this.label),
199
203
  resource: resource,
204
+ s3uri: this.entry.s3uri,
200
205
  title: "View plot",
201
206
  type: "Plot",
202
207
  discoverId: this.discoverId,
@@ -234,18 +239,20 @@ export default {
234
239
  datasetId: this.datasetId,
235
240
  datasetVersion: this.datasetVersion,
236
241
  file_path: thumbnail.dataset.path,
242
+ s3Bucket: this.s3Bucket,
237
243
  });
238
244
  mimetype = thumbnail.mimetype.name;
239
245
  }
240
246
  let action = {
241
247
  label: capitalise(this.label),
242
- resource: `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${filePath}`,
248
+ resource: `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${filePath}${this.getS3Args()}`,
243
249
  title: "View 3D scaffold",
244
250
  type: "Scaffold",
245
251
  discoverId: this.datasetId,
246
252
  apiLocation: this.envVars.API_LOCATION,
247
253
  version: this.datasetVersion,
248
254
  banner: this.datasetThumbnail,
255
+ s3uri: this.entry.s3uri,
249
256
  contextCardUrl: this.getContextCardUrl(i)
250
257
  };
251
258
  this.items['Scaffolds'].push({
@@ -275,6 +282,7 @@ export default {
275
282
  label: capitalise(this.label),
276
283
  resource: resource,
277
284
  datasetId: this.datasetId,
285
+ s3uri: this.entry.s3uri,
278
286
  title: "View segmentation",
279
287
  type: "Segmentation",
280
288
  };
@@ -285,6 +293,7 @@ export default {
285
293
  datasetId: this.datasetId,
286
294
  datasetVersion: this.datasetVersion,
287
295
  segmentationFilePath: filePath,
296
+ s3Bucket: this.s3Bucket,
288
297
  }
289
298
  );
290
299
  this.items['Segmentations'].push({
@@ -304,6 +313,7 @@ export default {
304
313
  let action = {
305
314
  label: undefined,
306
315
  apiLocation: this.envVars.API_LOCATION,
316
+ s3uri: this.entry.s3uri,
307
317
  version: this.datasetVersion,
308
318
  title: "View simulation",
309
319
  type: "Simulation",
@@ -351,7 +361,7 @@ export default {
351
361
  } else {
352
362
  // 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
363
  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]}`
364
+ return `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation[contextIndex]}${this.getS3Args()}`
355
365
  }
356
366
  }
357
367
  },
@@ -178,7 +178,6 @@ export default {
178
178
  this.createCascaderItemValue(facet.label, facetItem.label);
179
179
  });
180
180
  });
181
- this.createDataTypeFacet();
182
181
  })
183
182
  .finally(() => {
184
183
  resolve();
@@ -290,28 +289,6 @@ export default {
290
289
  }
291
290
  return event;
292
291
  },
293
- createDataTypeFacet: function(){
294
- let dataFacet = {...this.facets[2]} // copy the 'Experiemental approach' facet
295
- let count = this.facets.at(-1).id // get the last id count
296
-
297
- // Step through the children that are valid data types, switch thier values
298
- let newChildren = dataFacet.children.filter( el=> {
299
- if (el.label === 'Scaffold' || el.label === 'Simulation' || el.label === 'Show all'){
300
- el.key = el.label
301
- el.id = count
302
- el.value = el.value.replace('Experimental approach', 'Data type')
303
- count++
304
- return el
305
- }
306
- })
307
- dataFacet.id = count
308
- dataFacet.key = 'Data type'
309
- // Add 'duplicate' so that the key is unique. This is removed in the cascade event for filtering
310
- dataFacet.value += 'duplicate'
311
- dataFacet.children = newChildren
312
- dataFacet.label = 'Data type'
313
- this.facets.push(dataFacet)
314
- },
315
292
  cascadeExpandChange: function (event) {
316
293
  //work around as the expand item may change on modifying the cascade props
317
294
  this.__expandItem__ = event;
@@ -0,0 +1,31 @@
1
+ <script>
2
+ export default {
3
+ name: "S3Bucket",
4
+ data() {
5
+ return {
6
+ s3Bucket: undefined,
7
+ };
8
+ },
9
+ methods: {
10
+ updateS3Bucket: function(s3uri) {
11
+ this.s3Bucket = undefined;
12
+ if (s3uri) {
13
+ const substring = s3uri.split("//")[1];
14
+ if (substring) {
15
+ this.s3Bucket = substring.split("/")[0];
16
+ return;
17
+ }
18
+ }
19
+ },
20
+ getS3Args: function() {
21
+ if (this.s3Bucket) {
22
+ return `?s3BucketName=${this.s3Bucket}`
23
+ }
24
+ return "";
25
+ },
26
+ },
27
+
28
+ };
29
+ </script>
30
+
31
+