@geode/opengeodeweb-front 10.43.1-rc.1 → 10.43.1-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.
|
@@ -32,7 +32,7 @@ function newItemId(): number {
|
|
|
32
32
|
return lastItemId;
|
|
33
33
|
}
|
|
34
34
|
const planes = ref<ClippingPlane[]>([{ id: newItemId(), origin: undefined, normal: [1, 0, 0] }]);
|
|
35
|
-
const allItems = dataStore.
|
|
35
|
+
const allItems = dataStore.refRegisteredItems();
|
|
36
36
|
const sliceEnabled = ref<boolean>(false);
|
|
37
37
|
const slices = ref<{ id: number; axis: SliceAxis; index: number }[]>([
|
|
38
38
|
{ id: newItemId(), axis: DEFAULT_SLICE_AXIS, index: 0 },
|
|
@@ -43,7 +43,7 @@ const targetAllVisible = ref<boolean>(true);
|
|
|
43
43
|
const selectedDatasetIds = ref<string[]>([]);
|
|
44
44
|
const factor = ref<number>(factorRange.defaultValue);
|
|
45
45
|
|
|
46
|
-
const allItems = dataStore.
|
|
46
|
+
const allItems = dataStore.refRegisteredItems();
|
|
47
47
|
const availableDatasets = computed<{ title: string; value: string }[]>(() =>
|
|
48
48
|
allItems.value.map((item) => ({
|
|
49
49
|
title: item.name || item.id,
|
package/app/stores/data.ts
CHANGED
|
@@ -127,6 +127,8 @@ export const useDataStore = defineStore("data", () => {
|
|
|
127
127
|
refFormatedCollectionComponents,
|
|
128
128
|
} = useDataCollections();
|
|
129
129
|
const { getComponentRelations } = useDataRelations();
|
|
130
|
+
// Ids the viewer holds a pipeline for: an item is stored before it is registered, and non viewable items never are
|
|
131
|
+
const registeredIds = reactive(new Set<string>());
|
|
130
132
|
async function item(id: string): Promise<DataItem> {
|
|
131
133
|
const data_item = await data_db.get(id);
|
|
132
134
|
if (!data_item) {
|
|
@@ -161,6 +163,13 @@ export const useDataStore = defineStore("data", () => {
|
|
|
161
163
|
},
|
|
162
164
|
);
|
|
163
165
|
}
|
|
166
|
+
function isRegistered(id: string): boolean {
|
|
167
|
+
return registeredIds.has(id);
|
|
168
|
+
}
|
|
169
|
+
function refRegisteredItems(): ComputedRef<DataItem[]> {
|
|
170
|
+
const items = refAllItems();
|
|
171
|
+
return computed(() => items.value.filter((data_item) => isRegistered(data_item.id)));
|
|
172
|
+
}
|
|
164
173
|
async function meshComponentType(modelId: string, geode_id: string): Promise<string | undefined> {
|
|
165
174
|
const component = await model_components_db
|
|
166
175
|
.where("[id+geode_id]")
|
|
@@ -179,6 +188,7 @@ export const useDataStore = defineStore("data", () => {
|
|
|
179
188
|
params,
|
|
180
189
|
timeout: 0,
|
|
181
190
|
});
|
|
191
|
+
registeredIds.add(id);
|
|
182
192
|
return result;
|
|
183
193
|
}
|
|
184
194
|
async function deregisterObject(id: string): Promise<unknown> {
|
|
@@ -186,6 +196,7 @@ export const useDataStore = defineStore("data", () => {
|
|
|
186
196
|
const params = {
|
|
187
197
|
id,
|
|
188
198
|
};
|
|
199
|
+
registeredIds.delete(id);
|
|
189
200
|
const result = await viewerStore.request({
|
|
190
201
|
schema,
|
|
191
202
|
params,
|
|
@@ -346,6 +357,7 @@ export const useDataStore = defineStore("data", () => {
|
|
|
346
357
|
}
|
|
347
358
|
|
|
348
359
|
async function clear(): Promise<void> {
|
|
360
|
+
registeredIds.clear();
|
|
349
361
|
await data_db.clear();
|
|
350
362
|
await model_components_db.clear();
|
|
351
363
|
await model_components_relation_db.clear();
|
|
@@ -363,6 +375,8 @@ export const useDataStore = defineStore("data", () => {
|
|
|
363
375
|
}
|
|
364
376
|
return {
|
|
365
377
|
refAllItems,
|
|
378
|
+
refRegisteredItems,
|
|
379
|
+
isRegistered,
|
|
366
380
|
item,
|
|
367
381
|
allItems,
|
|
368
382
|
refItem,
|
package/package.json
CHANGED