@abi-software/map-side-bar 2.6.4-beta.1 → 2.6.4-beta.3

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": "2.6.4-beta.1",
3
+ "version": "2.6.4-beta.3",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -39,11 +39,12 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@abi-software/gallery": "^1.1.2",
42
- "@abi-software/map-utilities": "^1.3.3-beta.0",
42
+ "@abi-software/map-utilities": "^1.3.3-beta.1",
43
43
  "@abi-software/svg-sprite": "^1.0.1",
44
44
  "@element-plus/icons-vue": "^2.3.1",
45
45
  "algoliasearch": "^4.10.5",
46
46
  "element-plus": "2.8.4",
47
+ "js-base64": "^3.7.7",
47
48
  "marked": "^4.1.1",
48
49
  "mitt": "^3.0.1",
49
50
  "unplugin-vue-components": "^0.26.0",
@@ -211,6 +211,7 @@
211
211
  <connectivity-graph
212
212
  :entry="entry.featureId[0]"
213
213
  :mapServer="envVars.FLATMAPAPI_LOCATION"
214
+ :sckanVersion="sckanVersion"
214
215
  @tap-node="onTapNode"
215
216
  ref="connectivityGraphRef"
216
217
  />
@@ -317,6 +318,7 @@ export default {
317
318
  timeoutID: undefined,
318
319
  graphViewLoaded: false,
319
320
  updatedCopyContent: '',
321
+ sckanVersion: '',
320
322
  }
321
323
  },
322
324
  watch: {
@@ -603,6 +605,7 @@ export default {
603
605
  },
604
606
  },
605
607
  mounted: function () {
608
+ this.sckanVersion = this.entry['knowledge-source'];
606
609
  this.updatedCopyContent = this.getUpdateCopyContent();
607
610
  EventBus.on('connectivity-graph-error', (errorInfo) => {
608
611
  this.pushConnectivityError(errorInfo);
@@ -60,6 +60,7 @@
60
60
  <script>
61
61
  /* eslint-disable no-alert, no-console */
62
62
  import { View as ElIconView } from '@element-plus/icons-vue'
63
+ import { Base64 } from 'js-base64';
63
64
  import BadgesGroup from './BadgesGroup.vue'
64
65
  import {
65
66
  ElButton as Button,
@@ -236,7 +237,7 @@ export default {
236
237
  this.discoverId = data.id
237
238
  this.version = data.version
238
239
  this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
239
- this.getBiolucidaInfo(this.discoverId)
240
+ this.getBiolucidaInfo()
240
241
  this.loading = false
241
242
  this.updateCopyContent();
242
243
  })
@@ -251,15 +252,30 @@ export default {
251
252
  lastName: function (fullName) {
252
253
  return fullName.split(',')[0]
253
254
  },
254
- getBiolucidaInfo: function (id) {
255
- let apiLocation = this.envVars.API_LOCATION
256
- let endpoint = apiLocation + 'image_search/' + id
257
- // Add parameters if we are sent them
258
- fetch(endpoint)
259
- .then((response) => response.json())
260
- .then((data) => {
261
- if (data.status == 'success') this.biolucidaData = data
262
- })
255
+ getBiolucidaInfo: function () {
256
+ const dataset_images = [];
257
+ const biolucida2DItems = 'biolucida-2d' in this.entry ? this.entry['biolucida-2d'] :[];
258
+ const biolucida3DItems = 'biolucida-3d' in this.entry ? this.entry['biolucida-3d'] :[];
259
+ // We use information from SciCrunch to create the sharelink
260
+ biolucida2DItems.concat(biolucida3DItems).forEach((bObject) => {
261
+ const image_id = bObject.biolucida?.identifier;
262
+ if (image_id) {
263
+ const sourcepkg_id = 'identifier' in bObject ? bObject['identifier'] : "";
264
+ // The encoded string is in the following format -
265
+ // ${image_id}-col-${collection_id}, collection id can be any valid collection id
266
+ // and 260 is used for now.
267
+ const code = encodeURIComponent(Base64.encode(`${image_id}-col-260`));
268
+ const share_link = `https://sparc.biolucida.net/image?c=${code}`
269
+ dataset_images.push({
270
+ share_link,
271
+ image_id,
272
+ sourcepkg_id,
273
+ });
274
+ }
275
+ });
276
+ if (dataset_images.length > 0) {
277
+ this.biolucidaData = { dataset_images };
278
+ }
263
279
  },
264
280
  updateCopyContent: function () {
265
281
  const contentArray = [];
@@ -33,7 +33,7 @@ import GalleryHelper from '@abi-software/gallery/src/mixins/GalleryHelpers.js'
33
33
  import Gallery from "@abi-software/gallery";
34
34
  import "@abi-software/gallery/dist/style.css";
35
35
  //provide the s3Bucket related methods and data.
36
- import S3Bucket from '../mixins/S3Bucket.vue'
36
+ import S3Bucket from '../mixins/S3Bucket.vue';
37
37
 
38
38
  export default {
39
39
  name: 'ImageGallery',
@@ -61,6 +61,8 @@ $tab-height: 30px;
61
61
  height: $tab-height;
62
62
  display: flex;
63
63
  flex-direction: row;
64
+ position: relative;
65
+ z-index: 1;
64
66
  }
65
67
 
66
68
  .title {
@@ -285,5 +285,6 @@ export default {
285
285
  "Homo sapiens",
286
286
  "Canis lupus familiaris",
287
287
  "Domestic Pig"
288
- ]
288
+ ],
289
+ "knowledge-source": "sckan-2024-03-26-npo",
289
290
  }