@abi-software/map-side-bar 2.14.8-demo.1 → 2.14.8-demo.2
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/dist/map-side-bar.js +1086 -1029
- package/dist/map-side-bar.umd.cjs +15 -15
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CellCard.vue +14 -2
- package/src/components/CellCardExplorer.vue +59 -3
- package/src/components/ConnectivityExplorer.vue +2 -2
- package/src/components/SearchHistory.vue +2 -1
- package/src/components/SideBar.vue +26 -6
package/package.json
CHANGED
|
@@ -395,9 +395,21 @@ export default {
|
|
|
395
395
|
},
|
|
396
396
|
openCard: function() {
|
|
397
397
|
this.$emit('open', this.cellType.id);
|
|
398
|
+
|
|
399
|
+
EventBus.emit('trackEvent', {
|
|
400
|
+
'event_name': `portal_maps_cell_card_open`,
|
|
401
|
+
'category': this.cellType.id || '',
|
|
402
|
+
'location': 'map_sidebar_cell_card',
|
|
403
|
+
});
|
|
398
404
|
},
|
|
399
405
|
closeCard: function() {
|
|
400
406
|
this.$emit('close');
|
|
407
|
+
|
|
408
|
+
EventBus.emit('trackEvent', {
|
|
409
|
+
'event_name': `portal_maps_cell_card_close`,
|
|
410
|
+
'category': this.cellType.id || '',
|
|
411
|
+
'location': 'map_sidebar_cell_card',
|
|
412
|
+
});
|
|
401
413
|
},
|
|
402
414
|
showSomaLocation: function (name) {
|
|
403
415
|
this.$emit('soma-location-hovered', name);
|
|
@@ -800,7 +812,6 @@ export default {
|
|
|
800
812
|
.source-publication-chip,
|
|
801
813
|
.source-publication-link {
|
|
802
814
|
display: inline-block;
|
|
803
|
-
border: 1px solid var(--cell-card-source-color);
|
|
804
815
|
border-radius: 4px;
|
|
805
816
|
color: white !important;
|
|
806
817
|
text-decoration: none;
|
|
@@ -808,7 +819,8 @@ export default {
|
|
|
808
819
|
}
|
|
809
820
|
|
|
810
821
|
.source-publication-chip {
|
|
811
|
-
padding: 2px
|
|
822
|
+
padding: 2px 8px;
|
|
823
|
+
font-size: 13px;
|
|
812
824
|
}
|
|
813
825
|
|
|
814
826
|
.alert-chip {
|
|
@@ -341,6 +341,12 @@ export default {
|
|
|
341
341
|
}
|
|
342
342
|
this.applyFilters(this.activeFilters);
|
|
343
343
|
this.emitSomaLocations(this.filterOptions);
|
|
344
|
+
|
|
345
|
+
EventBus.emit('trackEvent', {
|
|
346
|
+
'event_name': `portal_maps_action_filter`,
|
|
347
|
+
'category': `reset`,
|
|
348
|
+
'location': 'map_sidebar_cell_card_explorer',
|
|
349
|
+
});
|
|
344
350
|
},
|
|
345
351
|
searchAndFilterUpdate: function() {
|
|
346
352
|
this.page = 1;
|
|
@@ -354,18 +360,35 @@ export default {
|
|
|
354
360
|
this.page = 1;
|
|
355
361
|
this.start = 0;
|
|
356
362
|
this.applyFilters(this.activeFilters);
|
|
363
|
+
this.emitSomaLocations(this.filterOptions);
|
|
357
364
|
this.searchHistoryUpdate(this.activeFilters, this.searchInput);
|
|
358
365
|
this.loadingCards = false;
|
|
359
366
|
},
|
|
360
367
|
numberPerPageUpdate: function(value) {
|
|
361
368
|
this.numberPerPage = parseInt(value, 10) || 10;
|
|
362
|
-
|
|
369
|
+
|
|
370
|
+
EventBus.emit('trackEvent', {
|
|
371
|
+
'event_name': `portal_maps_cell_card_perPage`,
|
|
372
|
+
'category': value + '',
|
|
373
|
+
'location': 'map_sidebar_cell_card_explorer',
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
const preventPaginationTracking = this.page === 1;
|
|
377
|
+
this.pageChange(1, preventPaginationTracking);
|
|
363
378
|
},
|
|
364
|
-
pageChange: function(page) {
|
|
379
|
+
pageChange: function(page, preventTracking = false) {
|
|
365
380
|
this.page = page;
|
|
366
381
|
this.start = (page - 1) * this.numberPerPage;
|
|
367
382
|
this.applyFilters(this.activeFilters);
|
|
368
383
|
this.scrollToTop();
|
|
384
|
+
|
|
385
|
+
if (!preventTracking) {
|
|
386
|
+
EventBus.emit('trackEvent', {
|
|
387
|
+
'event_name': `portal_maps_cell_card_pagination`,
|
|
388
|
+
'category': `page_${this.page}`,
|
|
389
|
+
'location': 'map_sidebar_cell_card_explorer',
|
|
390
|
+
});
|
|
391
|
+
}
|
|
369
392
|
},
|
|
370
393
|
scrollToTop: function() {
|
|
371
394
|
if (this.$refs.content) {
|
|
@@ -399,6 +422,8 @@ export default {
|
|
|
399
422
|
this.$refs.filtersRef.checkShowAllBoxes();
|
|
400
423
|
}
|
|
401
424
|
}
|
|
425
|
+
|
|
426
|
+
this.emitSomaLocations(this.filterOptions);
|
|
402
427
|
},
|
|
403
428
|
cascaderReady: function() {
|
|
404
429
|
this.cascaderIsReady = true;
|
|
@@ -410,7 +435,10 @@ export default {
|
|
|
410
435
|
getSelectedSomaLocationFilters: function() {
|
|
411
436
|
return (this.activeFilters || [])
|
|
412
437
|
.filter((filter) => {
|
|
413
|
-
return
|
|
438
|
+
return (
|
|
439
|
+
this.normalizeFacetValue(filter?.term) === 'soma location' &&
|
|
440
|
+
this.normalizeFacetValue(filter?.facet) !== 'show all'
|
|
441
|
+
);
|
|
414
442
|
})
|
|
415
443
|
.map((filter) => this.normalizeFacetValue(filter?.facet))
|
|
416
444
|
.filter(Boolean);
|
|
@@ -561,6 +589,14 @@ export default {
|
|
|
561
589
|
label: 'Source',
|
|
562
590
|
children: this.buildFacetChildren(cellTypes, 'sourceNomenclatureLabel'),
|
|
563
591
|
},
|
|
592
|
+
{
|
|
593
|
+
key: 'notes',
|
|
594
|
+
label: 'Notes',
|
|
595
|
+
children: [
|
|
596
|
+
{ label: 'with notes' },
|
|
597
|
+
{ label: 'without notes' },
|
|
598
|
+
],
|
|
599
|
+
},
|
|
564
600
|
];
|
|
565
601
|
|
|
566
602
|
return options.filter((option) => option.children.length > 0);
|
|
@@ -658,6 +694,13 @@ export default {
|
|
|
658
694
|
return this.normalizeFacetValue(cellType.sourceNomenclatureLabel) === filterFacet;
|
|
659
695
|
}
|
|
660
696
|
|
|
697
|
+
if (filterTerm === 'notes') {
|
|
698
|
+
const hasNotes = (cellType.alertNotes?.length > 0 || cellType.curatorNotes?.length > 0);
|
|
699
|
+
if (filterFacet === 'with notes') return hasNotes;
|
|
700
|
+
if (filterFacet === 'without notes') return !hasNotes;
|
|
701
|
+
return false;
|
|
702
|
+
}
|
|
703
|
+
|
|
661
704
|
return false;
|
|
662
705
|
},
|
|
663
706
|
applyFilters: function(filters) {
|
|
@@ -689,6 +732,12 @@ export default {
|
|
|
689
732
|
if (!this.cellTypes.some((cellType) => cellType.id === this.activeCardId)) {
|
|
690
733
|
this.activeCardId = null;
|
|
691
734
|
}
|
|
735
|
+
|
|
736
|
+
this.$emit('search-changed', {
|
|
737
|
+
query: this.searchInput,
|
|
738
|
+
filter: filters,
|
|
739
|
+
tabType: "cellType",
|
|
740
|
+
});
|
|
692
741
|
},
|
|
693
742
|
showSomaLocation: function (name) {
|
|
694
743
|
this.$emit('soma-location-hovered', name);
|
|
@@ -699,6 +748,13 @@ export default {
|
|
|
699
748
|
onConnectivitySearch: function (query) {
|
|
700
749
|
this.$emit('connectivity-search', query);
|
|
701
750
|
},
|
|
751
|
+
getSearch: function () {
|
|
752
|
+
return this.searchInput;
|
|
753
|
+
},
|
|
754
|
+
getFilters: function () {
|
|
755
|
+
const hasFilters = this.activeFilters.some((f) => f.facet.toLowerCase() !== 'show all');
|
|
756
|
+
return hasFilters ? this.activeFilters : [];
|
|
757
|
+
},
|
|
702
758
|
},
|
|
703
759
|
}
|
|
704
760
|
</script>
|
|
@@ -420,7 +420,7 @@ export default {
|
|
|
420
420
|
this.openSearch([], '');
|
|
421
421
|
this.$emit('search-changed', {
|
|
422
422
|
value: [],
|
|
423
|
-
tabType: '
|
|
423
|
+
tabType: 'connectivity',
|
|
424
424
|
type: 'reset-update',
|
|
425
425
|
})
|
|
426
426
|
|
|
@@ -468,7 +468,7 @@ export default {
|
|
|
468
468
|
if (notFoundItems.length) {
|
|
469
469
|
this.$emit('search-changed', {
|
|
470
470
|
value: notFoundItems,
|
|
471
|
-
tabType: '
|
|
471
|
+
tabType: 'connectivity',
|
|
472
472
|
type: 'reset-update',
|
|
473
473
|
})
|
|
474
474
|
}
|
|
@@ -334,7 +334,8 @@ export default {
|
|
|
334
334
|
getParentComponentName: function () {
|
|
335
335
|
const isConnectivity = this.localStorageKey?.indexOf('connectivity') !== -1;
|
|
336
336
|
const isDataset = this.localStorageKey?.indexOf('dataset') !== -1;
|
|
337
|
-
const
|
|
337
|
+
const isCellCard = this.localStorageKey?.indexOf('cell-card') !== -1;
|
|
338
|
+
const location = isConnectivity ? 'connectivity' : isDataset ? 'dataset' : isCellCard ? 'cell_card' : '';
|
|
338
339
|
return location;
|
|
339
340
|
},
|
|
340
341
|
search: function (item) {
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
v-show="tab.id === activeTabId"
|
|
73
73
|
:envVars="envVars"
|
|
74
74
|
:activeSpecies="activeSpeciesForEntries"
|
|
75
|
+
@search-changed="searchChanged(tab.id, $event)"
|
|
75
76
|
@dataset-search="openDatasetSearchFromCellCard($event)"
|
|
76
77
|
@connectivity-search="openConnectivitySearch($event.facets, $event.query)"
|
|
77
78
|
@soma-location-hovered="showSomaLocation"
|
|
@@ -218,7 +219,11 @@ export default {
|
|
|
218
219
|
search: '',
|
|
219
220
|
filters: [],
|
|
220
221
|
},
|
|
221
|
-
connectivity:
|
|
222
|
+
connectivity: {
|
|
223
|
+
search: '',
|
|
224
|
+
filters: [],
|
|
225
|
+
},
|
|
226
|
+
cellCards: {
|
|
222
227
|
search: '',
|
|
223
228
|
filters: [],
|
|
224
229
|
},
|
|
@@ -504,6 +509,13 @@ export default {
|
|
|
504
509
|
this.state.connectivity.filters = connectivityExplorerTabRef.getFilters();
|
|
505
510
|
}
|
|
506
511
|
|
|
512
|
+
// Update cell card explorer state if available
|
|
513
|
+
const cellCardExplorerTabRef = this.getTabRef(undefined, 'cellCardExplorer');
|
|
514
|
+
if (cellCardExplorerTabRef) {
|
|
515
|
+
this.state.cellCards.search = cellCardExplorerTabRef.getSearch();
|
|
516
|
+
this.state.cellCards.filters = cellCardExplorerTabRef.getFilters();
|
|
517
|
+
}
|
|
518
|
+
|
|
507
519
|
// Update connectivity entries if available
|
|
508
520
|
if (this.connectivityEntry && this.connectivityEntry.length > 0) {
|
|
509
521
|
this.state.connectivityEntries = this.connectivityEntry.map((entry) => entry.id);
|
|
@@ -533,11 +545,15 @@ export default {
|
|
|
533
545
|
setState: function (state) {
|
|
534
546
|
// if state is not provided or formatted incorrectly, do nothing
|
|
535
547
|
if (!state || !state.dataset || !state.connectivity) return;
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
const
|
|
548
|
+
// Create a deep copy while preserving the original state structure for future extensibility
|
|
549
|
+
const newState = JSON.parse(JSON.stringify(state));
|
|
550
|
+
this.state = { ...this.state, ...newState };
|
|
551
|
+
const datasetFilters = this.state.dataset.filters;
|
|
552
|
+
const connectivityFilters = this.state.connectivity.filters;
|
|
553
|
+
const datasetSearch = this.state.dataset.search;
|
|
554
|
+
const connectivitySearch = this.state.connectivity.search;
|
|
555
|
+
const cellCardFilters = this.state.cellCards.filters || [];
|
|
556
|
+
const cellCardSearch = this.state.cellCards.search || '';
|
|
541
557
|
|
|
542
558
|
if (datasetFilters.length || datasetSearch) {
|
|
543
559
|
this.openSearch(datasetFilters, datasetSearch);
|
|
@@ -547,6 +563,10 @@ export default {
|
|
|
547
563
|
this.openConnectivitySearch(connectivityFilters, connectivitySearch);
|
|
548
564
|
}
|
|
549
565
|
|
|
566
|
+
if (cellCardFilters.length || cellCardSearch) {
|
|
567
|
+
this.openCellCardExplorerSearch(cellCardFilters, cellCardSearch);
|
|
568
|
+
}
|
|
569
|
+
|
|
550
570
|
if (state.activeTabId) {
|
|
551
571
|
this.$nextTick(() => {
|
|
552
572
|
const hasTab = this.tabEntries.find((t) => t.id === state.activeTabId);
|