@abi-software/map-side-bar 2.9.2-beta.1 → 2.10.0-beta.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/map-side-bar",
3
- "version": "2.9.2-beta.1",
3
+ "version": "2.10.0-beta.0",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@abi-software/gallery": "^1.1.2",
42
- "@abi-software/map-utilities": "^1.6.1-beta.3",
42
+ "@abi-software/map-utilities": "^1.6.0",
43
43
  "@abi-software/svg-sprite": "^1.0.1",
44
44
  "@element-plus/icons-vue": "^2.3.1",
45
45
  "algoliasearch": "^4.10.5",
package/src/App.vue CHANGED
@@ -210,14 +210,16 @@ export default {
210
210
  action: function (action) {
211
211
  console.log('action fired: ', action)
212
212
  let facets = [];
213
- facets.push(
214
- ...action.labels.map(val => ({
215
- facet: capitalise(val),
216
- term: "Anatomical structure",
217
- facetPropPath: "anatomy.organ.category.name",
218
- }))
219
- );
220
- if (this.$refs.sideBar) {
213
+ if (action.labels) {
214
+ facets.push(
215
+ ...action.labels.map(val => ({
216
+ facet: capitalise(val),
217
+ term: "Anatomical structure",
218
+ facetPropPath: "anatomy.organ.category.name",
219
+ }))
220
+ );
221
+ }
222
+ if (this.$refs.sideBar && facets?.length) {
221
223
  console.log('openSearch', facets)
222
224
  this.$refs.sideBar.openSearch(facets, "");
223
225
  }
@@ -22,7 +22,7 @@
22
22
  <el-button
23
23
  link
24
24
  class="el-button-link"
25
- @click="onResetClick"
25
+ @click="openSearch([], '')"
26
26
  size="large"
27
27
  >
28
28
  Reset
@@ -133,9 +133,7 @@ import {
133
133
  ElIcon as Icon,
134
134
  ElInput as Input,
135
135
  ElPagination as Pagination,
136
- ElMessage as Message,
137
136
  } from "element-plus";
138
- import 'element-plus/es/components/message/style/css';
139
137
  import EventBus from './EventBus.js'
140
138
  import SearchFilters from "./SearchFilters.vue";
141
139
  import SearchHistory from "./SearchHistory.vue";
@@ -344,13 +342,13 @@ export default {
344
342
  // disable hover changes when show connectivity is clicked
345
343
  if (!this.freezed) {
346
344
  let payload = { tabType: "connectivity" };
347
-
345
+
348
346
  if (data) {
349
347
  payload = {...payload, ...data};
350
348
  } else if (this.expandedData) {
351
349
  payload = {...payload, ...this.expandedData};
352
350
  }
353
-
351
+
354
352
  this.$emit("hover-changed", payload);
355
353
  }
356
354
  },
@@ -365,34 +363,13 @@ export default {
365
363
  this.openSearch([], '');
366
364
  }
367
365
  },
368
- onResetClick: function () {
369
- this.openSearch([], '');
370
- this.$emit('connectivity-explorer-reset', []);
371
- },
372
366
  openSearch: function (filter, search = "") {
373
367
  this.searchInput = search;
374
368
  this.resetPageNavigation();
375
369
  //Proceed normally if cascader is ready
376
370
  if (this.cascaderIsReady) {
377
- const validatedFilters = this.$refs.filtersRef.getHierarchicalValidatedFilters(filter);
378
- const notFoundItems = validatedFilters.notFound || [];
379
- this.filter = validatedFilters.result;
380
-
381
- // Show not found filter items warning message
382
- notFoundItems.forEach((notFoundItem) => {
383
- const itemLabel = notFoundItem.tagLabel || notFoundItem.facet;
384
- Message({
385
- message: `${itemLabel} cannot be found in ${notFoundItem.term}!`,
386
- appendTo: this.$el,
387
- showClose: true,
388
- offset: 113,
389
- });
390
- });
391
-
392
- if (notFoundItems.length) {
393
- this.$emit('connectivity-explorer-reset', notFoundItems);
394
- }
395
-
371
+ this.filter =
372
+ this.$refs.filtersRef.getHierarchicalValidatedFilters(filter);
396
373
  //Facets provided but cannot find at least one valid
397
374
  //facet. Tell the users the search is invalid and reset
398
375
  //facets check boxes.
@@ -590,7 +567,6 @@ export default {
590
567
  width: 298px !important;
591
568
  height: 40px;
592
569
  padding-right: 14px;
593
- font-family: inherit;
594
570
 
595
571
  :deep(.el-input__inner) {
596
572
  font-family: inherit;
@@ -631,24 +607,6 @@ export default {
631
607
  padding: 1rem;
632
608
  }
633
609
 
634
- .content-card :deep(.el-message) {
635
- position: absolute !important;
636
- width: 80%;
637
- font-size: 12px;
638
- border-radius: var(--el-border-radius-base);
639
- --el-message-bg-color: var(--el-color-error-light-9);
640
- --el-message-border-color: var(--el-color-error);
641
- --el-message-text-color: var(--el-text-color-primary);
642
-
643
- .el-icon.el-message__icon {
644
- display: none;
645
- }
646
-
647
- .el-message__closeBtn {
648
- margin-left: auto;
649
- }
650
- }
651
-
652
610
  .content {
653
611
  // width: 515px;
654
612
  flex: 1 1 auto;
@@ -228,7 +228,7 @@ export default {
228
228
  updatedCopyContent: '',
229
229
  activeView: 'listView',
230
230
  connectivityLoading: false,
231
- connectivitySource: 'map', // sckan
231
+ connectivitySource: 'sckan',
232
232
  connectivityError: {},
233
233
  graphViewLoaded: false,
234
234
  connectivityFromMap: null,
@@ -277,7 +277,7 @@ export default {
277
277
  return this.entry.destinationsWithDatasets;
278
278
  },
279
279
  resources: function () {
280
- return this.entry.hyperlinks || [];
280
+ return this.entry.hyperlinks;
281
281
  },
282
282
  sckanVersion: function () {
283
283
  return this.entry.knowledgeSource;
@@ -528,17 +528,17 @@ export default {
528
528
  }
529
529
  },
530
530
  getConnectionsFromMap: async function () {
531
- if (this.entry.mapuuid) {
531
+ if (this.entry.mapuuid) {
532
532
  const url =
533
533
  this.flatmapApi +
534
534
  `flatmap/${this.entry.mapuuid}/connectivity/${this.entry.featureId[0]}`;
535
-
535
+
536
536
  try {
537
537
  const response = await fetch(url);
538
538
  if (!response.ok) {
539
539
  throw new Error(`Response status: ${response.status}`);
540
540
  }
541
-
541
+
542
542
  return await response.json();
543
543
  } catch (error) {
544
544
  throw new Error(error);
@@ -79,9 +79,7 @@ import {
79
79
  ElIcon as Icon,
80
80
  ElInput as Input,
81
81
  ElPagination as Pagination,
82
- ElMessage as Message,
83
82
  } from 'element-plus'
84
- import 'element-plus/es/components/message/style/css';
85
83
  import SearchFilters from './SearchFilters.vue'
86
84
  import SearchHistory from './SearchHistory.vue'
87
85
  import DatasetCard from './DatasetCard.vue'
@@ -132,7 +130,7 @@ export default {
132
130
  Input,
133
131
  Pagination
134
132
  },
135
- name: 'SideBarContent',
133
+ name: 'DatasetExplorer',
136
134
  props: {
137
135
  visible: {
138
136
  type: Boolean,
@@ -194,20 +192,8 @@ export default {
194
192
  this.resetPageNavigation()
195
193
  //Proceed normally if cascader is ready
196
194
  if (this.cascaderIsReady) {
197
- const validatedFilters = this.$refs.filtersRef.getHierarchicalValidatedFilters(filter);
198
- const notFoundItems = validatedFilters.notFound || [];
199
- this.filter = validatedFilters.result;
200
-
201
- // Show not found filter items warning message
202
- notFoundItems.forEach((notFoundItem) => {
203
- Message({
204
- message: `${notFoundItem.facet} cannot be found in ${notFoundItem.term}!`,
205
- appendTo: this.$el,
206
- showClose: true,
207
- offset: 113,
208
- });
209
- });
210
-
195
+ this.filter =
196
+ this.$refs.filtersRef.getHierarchicalValidatedFilters(filter)
211
197
  //Facets provided but cannot find at least one valid
212
198
  //facet. Tell the users the search is invalid and reset
213
199
  //facets check boxes.
@@ -430,7 +416,8 @@ export default {
430
416
  ? element['abi-contextual-information']
431
417
  : undefined,
432
418
  segmentation: element['mbf-segmentation'],
433
- simulation: element['abi-simulation-file'],
419
+ //omex format will be the preferred mimetype
420
+ simulation: element['abi-simulation-omex-file'] ? element['abi-simulation-omex-file'] : element['abi-simulation-file'],
434
421
  additionalLinks: element.additionalLinks,
435
422
  detailsReady: true,
436
423
  })
@@ -577,20 +564,6 @@ export default {
577
564
  padding: 1rem;
578
565
  }
579
566
 
580
- .content-card :deep(.el-message) {
581
- position: absolute !important;
582
- width: 80%;
583
- font-size: 12px;
584
- border-radius: var(--el-border-radius-base);
585
- --el-message-bg-color: var(--el-color-error-light-9);
586
- --el-message-border-color: var(--el-color-error);
587
- --el-message-text-color: var(--el-text-color-primary);
588
-
589
- .el-icon.el-message__icon {
590
- display: none;
591
- }
592
- }
593
-
594
567
  .content {
595
568
  // width: 515px;
596
569
  flex: 1 1 auto;
@@ -322,26 +322,69 @@ export default {
322
322
  }
323
323
  },
324
324
  createSimulationItems: function () {
325
- if (this.entry.simulation && this.entry.simulation.length > 0) {
326
- let action = {
327
- label: undefined,
328
- apiLocation: this.envVars.API_LOCATION,
329
- s3uri: this.entry.s3uri,
330
- version: this.datasetVersion,
331
- title: 'View simulation',
332
- type: 'Simulation',
333
- name: this.entry.name,
334
- description: this.entry.description,
335
- discoverId: this.datasetId,
336
- dataset: `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`,
337
- }
338
- this.items['Simulations'].push({
339
- id: 'simulation',
340
- title: ' ',
341
- type: 'Simulation',
342
- hideType: true,
343
- hideTitle: true,
344
- userData: action,
325
+ if (this.entry.simulation) {
326
+ this.entry.simulation.forEach((simulation) => {
327
+ if (simulation.additional_mimetype.name === "application/x.vnd.abi.simulation+json") {
328
+ let action = {
329
+ label: undefined,
330
+ apiLocation: this.envVars.API_LOCATION,
331
+ s3uri: this.entry.s3uri,
332
+ version: this.datasetVersion,
333
+ title: 'View simulation',
334
+ type: 'Simulation',
335
+ name: this.entry.name,
336
+ description: this.entry.description,
337
+ discoverId: this.datasetId,
338
+ dataset: `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`,
339
+ }
340
+ this.items['Simulations'].push({
341
+ id: 'simulation',
342
+ title: ' ',
343
+ type: 'Simulation',
344
+ hideType: true,
345
+ hideTitle: true,
346
+ userData: action,
347
+ })
348
+ } else {
349
+ const filePath = simulation.dataset.path
350
+ const id = simulation.identifier
351
+ //Despite of the name, this method can be used to retreive
352
+ //the thumbnail information for any none scaffold type thumbnail
353
+ const thumbnail = this.getThumbnailForPlot(
354
+ simulation,
355
+ this.entry.thumbnails
356
+ )
357
+ let thumbnailURL = undefined
358
+ let mimetype = ''
359
+ if (thumbnail) {
360
+ thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, {
361
+ id,
362
+ prefix: this.getS3Prefix(),
363
+ file_path: thumbnail.dataset.path,
364
+ s3Bucket: this.s3Bucket,
365
+ })
366
+ mimetype = thumbnail.mimetype.name
367
+ }
368
+ const resource = `${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${filePath}${this.getS3Args()}`
369
+ let action = {
370
+ label: capitalise(this.label),
371
+ resource: resource,
372
+ s3uri: this.entry.s3uri,
373
+ title: 'View simulation',
374
+ type: 'Simulation',
375
+ discoverId: this.discoverId,
376
+ version: this.datasetVersion,
377
+ }
378
+ this.items['Simulations'].push({
379
+ id,
380
+ title: baseName(filePath),
381
+ type: 'Simulation',
382
+ thumbnail: thumbnailURL,
383
+ userData: action,
384
+ hideType: true,
385
+ mimetype,
386
+ })
387
+ }
345
388
  })
346
389
  }
347
390
  },