Skip to content

Commit 29b176c

Browse files
authored
Merge pull request ABI-Software#482 from akhuoa/feature/connectivity-single-listing
Single listing with SCKAN as the primary listing
2 parents c92341a + d2d6594 commit 29b176c

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

src/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<el-button @click="setWholebody()" size="small">Set to Wholebody</el-button>
2525
<el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
2626
<el-button @click="setSearch()" size="small">Set Search</el-button>
27+
<el-button @click="toggleLongLabel()" size="small">Toggle Long Label</el-button>
2728
</div>
2829
</div>
2930
<template #reference>
@@ -40,6 +41,7 @@
4041
:startingMap="startingMap"
4142
:options="options"
4243
:state="state"
44+
:showLongLabel="showLongLabel"
4345
:shareLink="shareLink"
4446
:useHelpModeDialog="true"
4547
:connectivityInfoSidebar="true"
@@ -158,6 +160,7 @@ export default {
158160
startingMap: "AC",
159161
ElIconSetting: shallowRef(ElIconSetting),
160162
routerIsReady: false,
163+
showLongLabel: true,
161164
}
162165
},
163166
computed: {
@@ -309,6 +312,9 @@ export default {
309312
setSearch: function() {
310313
this.$refs.map.openSearch([], "10.26275/1uno-tynt");
311314
},
315+
toggleLongLabel: function() {
316+
this.showLongLabel = !this.showLongLabel;
317+
},
312318
mapIsLoaded: function(map) {
313319
console.log("map is loaded", map)
314320
// map.changeViewingMode('Annotation')

src/components/MapContent.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
v-if="isReady"
1212
@onFullscreen="onFullscreen"
1313
:state="stateToSet"
14+
:showLongLabel="showLongLabel"
1415
ref="flow"
1516
@vue:mounted="flowMounted"
1617
/>
@@ -59,6 +60,10 @@ export default {
5960
type: Object,
6061
default: undefined
6162
},
63+
showLongLabel: {
64+
type: Boolean,
65+
default: true,
66+
},
6267
/**
6368
* The options include APIs and Keys.
6469
*/

src/components/SplitFlow.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
:connectivityKnowledge="connectivityKnowledge"
3131
:filterOptions="filterOptions"
3232
:showVisibilityFilter="showVisibilityFilter"
33+
:showLongLabel="showLongLabel"
3334
@tabClicked="onSidebarTabClicked"
3435
@tabClosed="onSidebarTabClosed"
3536
@actionClick="actionClick"
@@ -146,7 +147,11 @@ export default {
146147
state: {
147148
type: Object,
148149
default: undefined,
149-
}
150+
},
151+
showLongLabel: {
152+
type: Boolean,
153+
default: true,
154+
},
150155
},
151156
data: function () {
152157
return {
@@ -480,9 +485,25 @@ export default {
480485
if (entry.ready) {
481486
result['nerve-label'] = entry['nerve-label'] || ck['nerve-label'];
482487
}
488+
if (ck && ck['long-label']) {
489+
result['long-label'] = ck['long-label'];
490+
}
483491
return result;
484492
});
485493
494+
// Fetch long-label from global connectivities if not exist in the payload,
495+
// this is for the case when user click on the flatmap paths/features directly without going through sidebar list,
496+
// which will only have id and label in the payload
497+
if (!this.connectivityEntry[0]['long-label'] && this.connectivityEntry[0].mapuuid) {
498+
const connectivityData = this.connectivitiesStore.globalConnectivities[this.connectivityEntry[0].mapuuid] || [];
499+
if (connectivityData.length) {
500+
const ck = connectivityData.find(ck => ck.id === this.connectivityEntry[0].id);
501+
if (ck && ck['long-label']) {
502+
this.connectivityEntry[0]['long-label'] = ck['long-label'];
503+
}
504+
}
505+
}
506+
486507
if (this.connectivityExplorerClicked.length) {
487508
// only remove clicked if not placeholder entry
488509
if (this.connectivityEntry.every(entry => entry.ready)) {

0 commit comments

Comments
 (0)