@geode/opengeodeweb-front 10.29.0-rc.1 → 10.29.0-rc.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.
|
@@ -23,28 +23,24 @@ const menuStore = useMenuStore();
|
|
|
23
23
|
const dataStore = useDataStore();
|
|
24
24
|
|
|
25
25
|
const componentName = ref("");
|
|
26
|
+
const componentItem = ref(undefined);
|
|
26
27
|
|
|
27
28
|
watch(
|
|
28
29
|
() => menuStore.current_meta_data,
|
|
29
30
|
async (newMeta) => {
|
|
30
31
|
componentName.value = "";
|
|
32
|
+
componentItem.value = undefined;
|
|
31
33
|
if (!newMeta) {
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
componentName.value = comp.name;
|
|
43
|
-
} else {
|
|
44
|
-
componentName.value = newMeta.pickedComponentId;
|
|
45
|
-
}
|
|
46
|
-
} catch {
|
|
47
|
-
componentName.value = newMeta.pickedComponentId;
|
|
37
|
+
const modelId = newMeta.modelId || newMeta.id;
|
|
38
|
+
if (newMeta.pickedComponentId && modelId) {
|
|
39
|
+
const components = await dataStore.getAllMeshComponents(modelId);
|
|
40
|
+
const comp = components.find((component) => component.id === newMeta.pickedComponentId);
|
|
41
|
+
if (comp) {
|
|
42
|
+
componentName.value = comp.title;
|
|
43
|
+
componentItem.value = comp;
|
|
48
44
|
}
|
|
49
45
|
}
|
|
50
46
|
},
|
|
@@ -56,7 +52,7 @@ const cleanName = computed(() => {
|
|
|
56
52
|
if (!meta) {
|
|
57
53
|
return "Unnamed Object";
|
|
58
54
|
}
|
|
59
|
-
if (componentName.value) {
|
|
55
|
+
if (componentName.value && meta.viewer_type === "model_component") {
|
|
60
56
|
return componentName.value;
|
|
61
57
|
}
|
|
62
58
|
return meta.name || "Unnamed Object";
|
|
@@ -70,6 +66,18 @@ const displayTitle = computed(() => {
|
|
|
70
66
|
return middleTruncate(name, TRUNCATE_MAX_LENGTH, TRUNCATE_START_CHARS, TRUNCATE_END_CHARS);
|
|
71
67
|
});
|
|
72
68
|
|
|
69
|
+
const displayComponentTitle = computed(() => {
|
|
70
|
+
if (!componentItem.value) {
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
return middleTruncate(
|
|
74
|
+
componentItem.value.title,
|
|
75
|
+
TRUNCATE_MAX_LENGTH,
|
|
76
|
+
TRUNCATE_START_CHARS,
|
|
77
|
+
TRUNCATE_END_CHARS,
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
|
|
73
81
|
const copied = ref(false);
|
|
74
82
|
async function copyId(targetId) {
|
|
75
83
|
if (!targetId) {
|
|
@@ -86,16 +94,17 @@ async function copyId(targetId) {
|
|
|
86
94
|
}
|
|
87
95
|
}
|
|
88
96
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (!metaId) {
|
|
97
|
+
function formatId(id) {
|
|
98
|
+
if (!id) {
|
|
92
99
|
return "";
|
|
93
100
|
}
|
|
94
|
-
if (
|
|
95
|
-
return
|
|
101
|
+
if (id.length <= MAX_SHORT_ID_LENGTH) {
|
|
102
|
+
return id;
|
|
96
103
|
}
|
|
97
|
-
return `${
|
|
98
|
-
}
|
|
104
|
+
return `${id.slice(0, ID_SLICE_START)}...${id.slice(id.length - ID_SLICE_END_OFFSET)}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const formattedId = computed(() => formatId(metaData?.id));
|
|
99
108
|
</script>
|
|
100
109
|
|
|
101
110
|
<template>
|
|
@@ -138,6 +147,32 @@ const formattedId = computed(() => {
|
|
|
138
147
|
class="ml-1"
|
|
139
148
|
/>
|
|
140
149
|
</v-col>
|
|
150
|
+
|
|
151
|
+
<template v-if="componentItem">
|
|
152
|
+
<v-divider class="w-100 my-2" opacity="0.2" />
|
|
153
|
+
<v-col
|
|
154
|
+
class="text-subtitle-2 font-weight-bold text-truncate text-white w-100 pa-0"
|
|
155
|
+
cols="auto"
|
|
156
|
+
style="line-height: 1.3"
|
|
157
|
+
>
|
|
158
|
+
{{ displayComponentTitle }}
|
|
159
|
+
</v-col>
|
|
160
|
+
<v-col
|
|
161
|
+
class="text-caption font-weight-black text-uppercase text-secondary pa-0"
|
|
162
|
+
style="font-size: 0.68rem; line-height: 1.2"
|
|
163
|
+
>
|
|
164
|
+
{{ componentItem.category }}
|
|
165
|
+
</v-col>
|
|
166
|
+
<v-col
|
|
167
|
+
class="id-badge-container mt-1 d-inline-flex align-center px-2 py-0.5"
|
|
168
|
+
@click.stop="copyId(componentItem.id)"
|
|
169
|
+
>
|
|
170
|
+
<span class="id-text">
|
|
171
|
+
{{ formatId(componentItem.id) }}
|
|
172
|
+
</span>
|
|
173
|
+
<v-icon icon="mdi-content-copy" size="10" color="white" class="ml-1" />
|
|
174
|
+
</v-col>
|
|
175
|
+
</template>
|
|
141
176
|
</v-row>
|
|
142
177
|
</GlassCard>
|
|
143
178
|
</v-sheet>
|
package/package.json
CHANGED