@geode/opengeodeweb-front 10.29.0-rc.1 → 10.29.0-rc.3

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
- if (newMeta.viewer_type === "model_component" && newMeta.modelId && newMeta.pickedComponentId) {
36
- try {
37
- const comp = await dataStore.getComponentByViewerId(
38
- newMeta.modelId,
39
- newMeta.pickedComponentId,
40
- );
41
- if (comp && comp.name) {
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
- const formattedId = computed(() => {
90
- const metaId = metaData?.id;
91
- if (!metaId) {
97
+ function formatId(id) {
98
+ if (!id) {
92
99
  return "";
93
100
  }
94
- if (metaId.length <= MAX_SHORT_ID_LENGTH) {
95
- return metaId;
101
+ if (id.length <= MAX_SHORT_ID_LENGTH) {
102
+ return id;
96
103
  }
97
- return `${metaId.slice(0, ID_SLICE_START)}...${metaId.slice(metaId.length - ID_SLICE_END_OFFSET)}`;
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>
@@ -19,7 +19,7 @@ const hybridViewerStore = useHybridViewerStore();
19
19
  const blocksVisibility = computed({
20
20
  get: () => dataStyleStore.modelComponentTypeVisibility(modelId, "Block"),
21
21
  set: async (newValue) => {
22
- await dataStyleStore.setModelComponentTypeVisibility(modelId, "Block", newValue);
22
+ await dataStyleStore.setModelBlocksVisibility(modelId, targetBlockIds, newValue);
23
23
  hybridViewerStore.remoteRender();
24
24
  },
25
25
  });
@@ -36,7 +36,7 @@ const blockVisibility = computed({
36
36
  const blocksColor = computed({
37
37
  get: () => dataStyleStore.modelComponentTypeColor(modelId, "Block"),
38
38
  set: async (color) => {
39
- await dataStyleStore.setModelComponentTypeColor(modelId, "Block", color);
39
+ await dataStyleStore.setModelBlocksColor(modelId, targetBlockIds, color);
40
40
  hybridViewerStore.remoteRender();
41
41
  },
42
42
  });
@@ -52,7 +52,7 @@ const blockColor = computed({
52
52
  const blocksActiveColoring = computed({
53
53
  get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Block"),
54
54
  set: async (coloringType) => {
55
- await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Block", coloringType);
55
+ await dataStyleStore.setModelBlocksActiveColoring(modelId, targetBlockIds, coloringType);
56
56
  hybridViewerStore.remoteRender();
57
57
  },
58
58
  });
@@ -13,14 +13,13 @@ const { modelId, cornerId, targetCornerIds } = defineProps({
13
13
  });
14
14
 
15
15
  const dataStyleStore = useDataStyleStore();
16
- console.log("CornersOptions setup!");
17
16
  const hybridViewerStore = useHybridViewerStore();
18
17
 
19
18
  // Visibility
20
19
  const cornersVisibility = computed({
21
20
  get: () => dataStyleStore.modelComponentTypeVisibility(modelId, "Corner"),
22
21
  set: async (newValue) => {
23
- await dataStyleStore.setModelComponentTypeVisibility(modelId, "Corner", newValue);
22
+ await dataStyleStore.setModelCornersVisibility(modelId, targetCornerIds, newValue);
24
23
  hybridViewerStore.remoteRender();
25
24
  },
26
25
  });
@@ -37,7 +36,7 @@ const cornerVisibility = computed({
37
36
  const cornersColor = computed({
38
37
  get: () => dataStyleStore.modelComponentTypeColor(modelId, "Corner"),
39
38
  set: async (color) => {
40
- await dataStyleStore.setModelComponentTypeColor(modelId, "Corner", color);
39
+ await dataStyleStore.setModelCornersColor(modelId, targetCornerIds, color);
41
40
  hybridViewerStore.remoteRender();
42
41
  },
43
42
  });
@@ -53,7 +52,7 @@ const cornerColor = computed({
53
52
  const cornersActiveColoring = computed({
54
53
  get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Corner"),
55
54
  set: async (coloringType) => {
56
- await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Corner", coloringType);
55
+ await dataStyleStore.setModelCornersActiveColoring(modelId, targetCornerIds, coloringType);
57
56
  hybridViewerStore.remoteRender();
58
57
  },
59
58
  });
@@ -19,7 +19,7 @@ const hybridViewerStore = useHybridViewerStore();
19
19
  const linesVisibility = computed({
20
20
  get: () => dataStyleStore.modelComponentTypeVisibility(modelId, "Line"),
21
21
  set: async (newValue) => {
22
- await dataStyleStore.setModelComponentTypeVisibility(modelId, "Line", newValue);
22
+ await dataStyleStore.setModelLinesVisibility(modelId, targetLineIds, newValue);
23
23
  hybridViewerStore.remoteRender();
24
24
  },
25
25
  });
@@ -36,7 +36,7 @@ const lineVisibility = computed({
36
36
  const linesColor = computed({
37
37
  get: () => dataStyleStore.modelComponentTypeColor(modelId, "Line"),
38
38
  set: async (color) => {
39
- await dataStyleStore.setModelComponentTypeColor(modelId, "Line", color);
39
+ await dataStyleStore.setModelLinesColor(modelId, targetLineIds, color);
40
40
  hybridViewerStore.remoteRender();
41
41
  },
42
42
  });
@@ -52,7 +52,7 @@ const lineColor = computed({
52
52
  const linesActiveColoring = computed({
53
53
  get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Line"),
54
54
  set: async (coloringType) => {
55
- await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Line", coloringType);
55
+ await dataStyleStore.setModelLinesActiveColoring(modelId, targetLineIds, coloringType);
56
56
  hybridViewerStore.remoteRender();
57
57
  },
58
58
  });
@@ -63,9 +63,13 @@ watch(
63
63
 
64
64
  const targetComponentIds = ref([]);
65
65
  watch(
66
- () => [modelId.value, componentType.value],
66
+ () => [modelId.value, componentType.value, itemProps.meta_data.targetComponentIds],
67
67
  async () => {
68
68
  targetComponentIds.value = [];
69
+ if (itemProps.meta_data.targetComponentIds) {
70
+ targetComponentIds.value = itemProps.meta_data.targetComponentIds;
71
+ return;
72
+ }
69
73
  if (componentType.value && modelId.value) {
70
74
  const currentModelId = modelId.value;
71
75
  const currentType = componentType.value;
@@ -19,7 +19,7 @@ const hybridViewerStore = useHybridViewerStore();
19
19
  const surfacesVisibility = computed({
20
20
  get: () => dataStyleStore.modelComponentTypeVisibility(modelId, "Surface"),
21
21
  set: async (newValue) => {
22
- await dataStyleStore.setModelComponentTypeVisibility(modelId, "Surface", newValue);
22
+ await dataStyleStore.setModelSurfacesVisibility(modelId, targetSurfaceIds, newValue);
23
23
  hybridViewerStore.remoteRender();
24
24
  },
25
25
  });
@@ -36,7 +36,7 @@ const surfaceVisibility = computed({
36
36
  const surfacesColor = computed({
37
37
  get: () => dataStyleStore.modelComponentTypeColor(modelId, "Surface"),
38
38
  set: async (color) => {
39
- await dataStyleStore.setModelComponentTypeColor(modelId, "Surface", color);
39
+ await dataStyleStore.setModelSurfacesColor(modelId, targetSurfaceIds, color);
40
40
  hybridViewerStore.remoteRender();
41
41
  },
42
42
  });
@@ -52,7 +52,7 @@ const surfaceColor = computed({
52
52
  const surfacesActiveColoring = computed({
53
53
  get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Surface"),
54
54
  set: async (coloringType) => {
55
- await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Surface", coloringType);
55
+ await dataStyleStore.setModelSurfacesActiveColoring(modelId, targetSurfaceIds, coloringType);
56
56
  hybridViewerStore.remoteRender();
57
57
  },
58
58
  });
@@ -79,7 +79,7 @@ const itemsForTreeView = computed(() => {
79
79
  for (const category of filteredCategories.value) {
80
80
  result.push({
81
81
  ...category,
82
- children: sortAndFormatItems(componentsCache.value?.[category.id], sortType.value),
82
+ children: sortAndFormatItems(componentsCache.value[category.id], sortType.value),
83
83
  });
84
84
  }
85
85
  return result;
@@ -87,12 +87,16 @@ const itemsForTreeView = computed(() => {
87
87
 
88
88
  function showContextMenu(event, item) {
89
89
  const actualItem = item.raw || item;
90
+ const typeId = actualItem.category || actualItem.id;
91
+ const typeItem = itemsForTreeView.value.find((type) => type.id === typeId);
92
+ const targetComponentIds = typeItem ? typeItem.children.map((child) => child.id) : undefined;
90
93
  emit("show-menu", {
91
94
  event,
92
95
  itemId: actualItem.category ? actualItem.id : id,
93
96
  context_type: actualItem.category ? "model_component" : "model_component_type",
94
97
  modelId: id,
95
98
  modelComponentType: actualItem.category ? undefined : actualItem.id,
99
+ targetComponentIds,
96
100
  });
97
101
  }
98
102
 
@@ -108,7 +112,7 @@ function handleHoverEnter({ item, immediate = false }) {
108
112
  () =>
109
113
  actualItem.category
110
114
  ? [actualItem.viewer_id]
111
- : actualItem.children?.map((child) => child.viewer_id) || [],
115
+ : actualItem.children.map((child) => child.viewer_id),
112
116
  "model",
113
117
  immediate,
114
118
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.29.0-rc.1",
3
+ "version": "10.29.0-rc.3",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {