@abi-software/mapintegratedvuer 0.7.0-vue3.8 → 0.7.1-auth.0

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/mapintegratedvuer",
3
- "version": "0.7.0-vue3.8",
3
+ "version": "0.7.1-auth.0",
4
4
  "license": "Apache-2.0",
5
5
  "scripts": {
6
6
  "serve": "vite --host --force",
@@ -42,12 +42,12 @@
42
42
  "*.js"
43
43
  ],
44
44
  "dependencies": {
45
- "@abi-software/flatmapvuer": "^0.6.0-vue3.8",
45
+ "@abi-software/flatmapvuer": "^0.6.1-auth.0",
46
46
  "@abi-software/map-side-bar": "^1.7.0-vue3.4",
47
47
  "@abi-software/plotvuer": "^0.4.0-vue-3-alpha.10",
48
48
  "@abi-software/scaffoldvuer": "^0.4.0-vue3.6",
49
49
  "@abi-software/simulationvuer": "^0.7.0-vue-3-alpha.5",
50
- "@abi-software/svg-sprite": "^0.4.0-vue3-beta.0",
50
+ "@abi-software/svg-sprite": "^0.4.0-vue3.3",
51
51
  "@cypress/vite-dev-server": "^5.0.7",
52
52
  "@element-plus/icons-vue": "^2.3.1",
53
53
  "@pinia/testing": "^0.1.3",
@@ -126,6 +126,9 @@
126
126
  }
127
127
  ]
128
128
  },
129
+ "overrides": {
130
+ "@abi-software/flatmapvuer": "$@abi-software/flatmapvuer"
131
+ },
129
132
  "browserslist": [
130
133
  "> 1%",
131
134
  "last 2 versions"
package/src/App.vue CHANGED
@@ -85,6 +85,7 @@ export default {
85
85
  flatmapAPI: import.meta.env.VITE_FLATMAPAPI_LOCATION,
86
86
  nlLinkPrefix: import.meta.env.VITE_NL_LINK_PREFIX,
87
87
  rootUrl: import.meta.env.VITE_ROOT_URL,
88
+ userToken: '',
88
89
  }
89
90
  }
90
91
  },
@@ -233,6 +233,7 @@ export default {
233
233
  this.options.flatmapAPI ? this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI) : null,
234
234
  this.options.nlLinkPrefix ? this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix) : null
235
235
  this.options.rootUrl ? this.settingsStore.updateRootUrl(this.options.rootUrl) : null
236
+ this.options.userToken ? this.settingsStore.updateUserToken(this.options.userToken) : null
236
237
  }
237
238
  },
238
239
  mounted: async function() {
@@ -16,6 +16,7 @@
16
16
  :enableOpenMapUI="true"
17
17
  :flatmapAPI="flatmapAPI"
18
18
  :sparcAPI="apiLocation"
19
+ :userApiKey="userApiKey"
19
20
  @open-map="openMap"
20
21
  />
21
22
  </template>
@@ -15,6 +15,7 @@
15
15
  :openMapOptions="openMapOptions"
16
16
  :flatmapAPI="flatmapAPI"
17
17
  :sparcAPI="apiLocation"
18
+ :userApiKey="userApiKey"
18
19
  @pan-zoom-callback="flatmapPanZoomCallback"
19
20
  @open-map="openMap"
20
21
  />
@@ -305,13 +306,17 @@ export default {
305
306
  }
306
307
 
307
308
  if (flatmapImp) {
309
+ // create the star marker
308
310
  let wrapperElement = document.createElement("div");
309
311
  wrapperElement.innerHTML = YellowStar;
310
312
 
313
+ // add it to the flatmap
311
314
  const markerIdentifier = flatmapImp.addMarker(marker, {
312
315
  element: wrapperElement,
313
316
  className: "highlight-marker"
314
317
  });
318
+
319
+ // update the store with the marker identifier
315
320
  this.settingsStore.updateFeaturedMarkerIdentifier({
316
321
  index,
317
322
  markerIdentifier,
@@ -362,9 +367,12 @@ export default {
362
367
 
363
368
  :deep(.maplibregl-marker) {
364
369
  &.standard-marker {
370
+ cursor: pointer !important;
365
371
  z-index: 2;
366
372
  }
367
373
  &.highlight-marker {
374
+ visibility: visible !important;
375
+ cursor: pointer !important;
368
376
  z-index: 1;
369
377
  div {
370
378
  scale: 0.5;
@@ -278,6 +278,7 @@ export default {
278
278
  } catch (error) {
279
279
  markerSpecies = undefined;
280
280
  }
281
+ this.updateFeatureMarkers([markerCurie], undefined)
281
282
  this.settingsStore.updateFeaturedMarker({
282
283
  identifier,
283
284
  marker: markerCurie,
@@ -286,19 +287,45 @@ export default {
286
287
  });
287
288
  });
288
289
  },
290
+ // Check if the old featured dataset api has any info
291
+ oldFeaturedDatasetApiHasInfo: async function () {
292
+ let response = await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)
293
+ let data = await response.json()
294
+ if (!data.identifiers || data.identifiers.length == 0) {
295
+ return false;
296
+ } else {
297
+ return data.identifiers;
298
+ }
299
+ },
300
+ // Check if the new featured dataset api has any info
301
+ newFeaturedDatasetApiHasInfo: async function () {
302
+ let response = await fetch(`${this.apiLocation}get_featured_dataset`)
303
+ let data = await response.json()
304
+ if (!data.datasets || data.datasets.length == 0) {
305
+ return false;
306
+ } else {
307
+ return data.datasets.map(d => d.id);
308
+ }
309
+ },
310
+
289
311
  /**
290
312
  * Get a list of featured datasets to display.
291
313
  */
292
- getFeaturedDatasets: function () {
293
- const local_this = this;
294
- fetch(`${this.apiLocation}get_featured_datasets_identifiers`)
295
- .then(response => response.json())
296
- .then(data => {
297
- this.settingsStore.updateFeatured(data.identifiers);
298
- data.identifiers.forEach(element => {
299
- local_this.getDatasetAnatomyInfo(element);
300
- });
301
- });
314
+ getFeaturedDatasets: async function () {
315
+ let datasetIds = [];
316
+
317
+ // Check the two api endpoints for featured datasets, old one first
318
+ let oldInfo = await this.oldFeaturedDatasetApiHasInfo();
319
+ if (oldInfo) datasetIds = oldInfo;
320
+ else {
321
+ let newInfo = await this.newFeaturedDatasetApiHasInfo();
322
+ if (newInfo) datasetIds = newInfo;
323
+ }
324
+ // Update the store with the new list of featured datasets
325
+ this.settingsStore.updateFeatured(datasetIds);
326
+ datasetIds.forEach(element => {
327
+ this.getDatasetAnatomyInfo(element)
328
+ });
302
329
  },
303
330
  zoomToFeatures: function () {
304
331
  return;
@@ -403,9 +430,12 @@ export default {
403
430
  created: function () {
404
431
  this.flatmapAPI = undefined;
405
432
  this.apiLocation = undefined;
433
+ this.userApiKey = undefined;
406
434
  if (this.settingsStore.flatmapAPI)
407
435
  this.flatmapAPI = this.settingsStore.flatmapAPI;
408
436
  if (this.settingsStore.sparcApi)
409
437
  this.apiLocation = this.settingsStore.sparcApi;
438
+ if (this.settingsStore.userToken)
439
+ this.userApiKey = this.settingsStore.userToken;
410
440
  },
411
441
  };
@@ -14,6 +14,7 @@ export const useSettingsStore = defineStore('settings', {
14
14
  flatmapAPI: undefined,
15
15
  nlLinkPrefix: undefined,
16
16
  rootUrl: undefined,
17
+ userToken: undefined,
17
18
  facets: { species: [], gender: [], organ: [] },
18
19
  facetLabels: [],
19
20
  markers: [],
@@ -64,6 +65,9 @@ export const useSettingsStore = defineStore('settings', {
64
65
  updateRootUrl(rootUrl) {
65
66
  this.rootUrl = rootUrl;
66
67
  },
68
+ updateUserToken(userToken) {
69
+ this.userToken = userToken;
70
+ },
67
71
  updateMarkers(markers) {
68
72
  this.markers = markers;
69
73
  },
package/vite.config.js CHANGED
@@ -11,7 +11,7 @@ export default defineConfig(({ command, mode }) => {
11
11
  css: {
12
12
  preprocessorOptions: {
13
13
  scss: {
14
- additionalData: `@use '${pathSrc}/assets/styles' as *;`
14
+ additionalData: `@use './src/assets/styles' as *;`
15
15
  },
16
16
  },
17
17
  },