@geode/opengeodeweb-front 10.36.0-rc.4 → 10.36.0-rc.5

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.
@@ -29,6 +29,7 @@ const { width: containerWidth } = useElementSize(labelContainer);
29
29
  // The item prop can be either a DisplayItem wrapper (with a `.raw` domain object) or the domain object itself when this component is used outside CommonTreeView's slot machinery; the domain object always carries an id/title at runtime.
30
30
  interface LabeledItem {
31
31
  id: string;
32
+ geode_id?: string;
32
33
  title?: string;
33
34
  is_active?: boolean;
34
35
  category?: string;
@@ -96,9 +97,9 @@ async function copyToClipboard(text: string, label: string): Promise<void> {
96
97
  </template>
97
98
 
98
99
  <div class="d-flex flex-column ga-1">
99
- <span class="text-caption d-flex align-center">
100
+ <span v-if="actualItem.geode_id" class="text-caption d-flex align-center">
100
101
  <strong class="text-white mr-1">ID:</strong>
101
- <span data-testid="tooltipIdValue">{{ actualItem.id }}</span>
102
+ <span data-testid="tooltipIdValue">{{ actualItem.geode_id }}</span>
102
103
  <v-btn
103
104
  data-testid="copyIdBtn"
104
105
  icon
@@ -106,7 +107,7 @@ async function copyToClipboard(text: string, label: string): Promise<void> {
106
107
  density="compact"
107
108
  class="ml-1 text-white"
108
109
  style="width: 18px; height: 18px; min-width: 18px; min-height: 18px"
109
- @click.stop="copyToClipboard(actualItem.id, 'ID')"
110
+ @click.stop="copyToClipboard(actualItem.geode_id, 'ID')"
110
111
  >
111
112
  <v-icon size="12">mdi-content-copy</v-icon>
112
113
  </v-btn>
@@ -7,6 +7,8 @@ type ReadonlyMaybeRefOrGetter<Value> = Value | Ref<Value> | (() => Value);
7
7
  interface FilterableItem {
8
8
  readonly id: unknown;
9
9
  readonly title?: string;
10
+ // Present on geode objects (data and model components), absent on group nodes.
11
+ readonly geode_id?: string;
10
12
  readonly children?: readonly FilterableItem[];
11
13
  }
12
14
 
@@ -46,15 +48,15 @@ function customFilter(
46
48
  return false;
47
49
  }
48
50
  const query = searchQuery.toLowerCase();
49
- const { title = "", id = value } = item.raw;
50
- return [title, id].some((field) => String(field).toLowerCase().includes(query));
51
+ const { title = "", id = value, geode_id: geodeId } = item.raw;
52
+ return [title, id, geodeId].some((field) => String(field).toLowerCase().includes(query));
51
53
  }
52
54
 
53
55
  // Extracted so we never call String() directly on a value typed as `unknown`/`any`.
54
56
  // The `id` field can be anything at runtime, so only stringify primitives that have a sane toString.
55
57
  // Anything else falls back to "" instead of risking "[object Object]".
56
58
  function toSortKey(item: FilterableItem, field: "title" | "id"): string {
57
- const raw = item[field] ?? item.id ?? "";
59
+ const raw = (field === "id" ? item.geode_id : item.title) ?? item.id ?? "";
58
60
  if (typeof raw === "string" || typeof raw === "number" || typeof raw === "boolean") {
59
61
  return String(raw);
60
62
  }
@@ -136,7 +138,7 @@ function useTreeFilter(
136
138
  const children = (category.children ?? []).filter((child) =>
137
139
  customFilter(child.id, search.value, { raw: child }),
138
140
  );
139
- if (children.length > 0 || customFilter(category.id, search.value, { raw: category })) {
141
+ if (children.length > 0) {
140
142
  result.push({ ...category, children });
141
143
  }
142
144
  }
@@ -13,6 +13,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
13
13
 
14
14
  interface DataItem {
15
15
  id: string;
16
+ geode_id: string;
16
17
  name: string;
17
18
  viewer_type: string;
18
19
  geode_object_type: string;
@@ -35,6 +36,7 @@ interface ModelComponentInput {
35
36
 
36
37
  interface NewDataItem {
37
38
  id: string;
39
+ geode_id: string;
38
40
  name?: string;
39
41
  viewer_type: string;
40
42
  geode_object_type: string;
@@ -199,6 +201,7 @@ export const useDataStore = defineStore("data", () => {
199
201
  async function addItem(new_item: NewDataItem): Promise<string> {
200
202
  const itemData: DataItem = {
201
203
  id: new_item.id,
204
+ geode_id: new_item.geode_id,
202
205
  name: new_item.name ?? new_item.id,
203
206
  viewer_type: new_item.viewer_type,
204
207
  geode_object_type: new_item.geode_object_type,
@@ -59,6 +59,7 @@ export function useDataCollections(): {
59
59
  .filter((component: ModelComponentRecord) => !MESH_COMPONENT_TYPES.includes(component.type))
60
60
  .map((component: ModelComponentRecord) => ({
61
61
  id: component.geode_id,
62
+ geode_id: component.geode_id,
62
63
  title: component.name,
63
64
  category: component.type,
64
65
  viewer_id: Number(component.viewer_id),
@@ -14,6 +14,7 @@ interface ModelComponentRecord {
14
14
 
15
15
  interface FormattedComponent {
16
16
  readonly id: string;
17
+ readonly geode_id: string;
17
18
  readonly title: string;
18
19
  readonly category: string;
19
20
  readonly viewer_id: number;
@@ -29,6 +30,7 @@ interface FormattedComponentGroup {
29
30
  function toFormattedComponent(meshComponent: ModelComponentRecord): FormattedComponent {
30
31
  return {
31
32
  id: meshComponent.geode_id,
33
+ geode_id: meshComponent.geode_id,
32
34
  title: meshComponent.name,
33
35
  category: meshComponent.type,
34
36
  viewer_id: Math.trunc(Number(meshComponent.viewer_id)),
@@ -25,6 +25,7 @@ interface OpenedView {
25
25
  interface TreeviewChild {
26
26
  title: string;
27
27
  id: string;
28
+ geode_id: string;
28
29
  viewer_type: string;
29
30
  geode_object_type: string;
30
31
  }
@@ -170,10 +171,17 @@ export const useTreeviewStore = defineStore("treeview", () => {
170
171
  }
171
172
  }
172
173
 
173
- function addItem(geodeObjectType: string, name: string, id: string, viewer_type: string): void {
174
+ function addItem(
175
+ geodeObjectType: string,
176
+ name: string,
177
+ id: string,
178
+ geode_id: string,
179
+ viewer_type: string,
180
+ ): void {
174
181
  const child: TreeviewChild = {
175
182
  title: name,
176
183
  id,
184
+ geode_id,
177
185
  viewer_type,
178
186
  geode_object_type: geodeObjectType,
179
187
  };
@@ -38,7 +38,13 @@ async function importItem(item: NewDataItem): Promise<string> {
38
38
  item.viewer_type === "model" ? dataStore.addComponents(item) : Promise.resolve();
39
39
  const addDataRelationsTask =
40
40
  item.viewer_type === "model" ? dataStore.addComponentRelations(item) : Promise.resolve();
41
- treeviewStore.addItem(item.geode_object_type, item.name ?? item.id, item.id, item.viewer_type);
41
+ treeviewStore.addItem(
42
+ item.geode_object_type,
43
+ item.name ?? item.id,
44
+ item.id,
45
+ item.geode_id,
46
+ item.viewer_type,
47
+ );
42
48
  const addDataStyleTask = dataStyleStore.addDataStyle(item.id, item.geode_object_type);
43
49
  const addViewerTask = addDataTask.then(async () => {
44
50
  if (!(await dataStore.isItemViewable(item))) {
@@ -2,5 +2,6 @@ import type { TableDefinition } from "./table_definition";
2
2
 
3
3
  export const dataTable: TableDefinition = {
4
4
  name: "data",
5
- schema: "id, name, viewer_type, geode_object_type, visible, created_at, binary_light_viewable",
5
+ schema:
6
+ "id, geode_id, name, viewer_type, geode_object_type, visible, created_at, binary_light_viewable",
6
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.36.0-rc.4",
3
+ "version": "10.36.0-rc.5",
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": {