@geode/opengeodeweb-front 10.4.1 → 10.4.2-rc.1

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.
Files changed (128) hide show
  1. package/app/components/DeleteDialog.vue +1 -1
  2. package/app/components/DragAndDrop.vue +8 -5
  3. package/app/components/FileUploader.vue +3 -3
  4. package/app/components/GlassCard.vue +4 -4
  5. package/app/components/HybridRenderingView.vue +1 -5
  6. package/app/components/Inspector/InspectionButton.vue +6 -7
  7. package/app/components/Launcher.vue +1 -1
  8. package/app/components/ObjectSelector.vue +1 -1
  9. package/app/components/PackagesVersions.vue +1 -1
  10. package/app/components/RemoteRenderingView.vue +1 -1
  11. package/app/components/Screenshot.vue +2 -2
  12. package/app/components/SearchBar.vue +10 -16
  13. package/app/components/Step.vue +3 -1
  14. package/app/components/ViewToolbar.vue +0 -1
  15. package/app/components/Viewer/ContextMenu.vue +11 -11
  16. package/app/components/Viewer/ContextMenuItem.vue +1 -1
  17. package/app/components/Viewer/Options/AttributeColorBar.vue +1 -5
  18. package/app/components/Viewer/Options/ColorMapList.vue +2 -6
  19. package/app/components/Viewer/Options/ColorMapPicker.vue +3 -3
  20. package/app/components/Viewer/Options/ColoringTypeSelector.vue +1 -1
  21. package/app/components/Viewer/Options/TextureItem.vue +2 -2
  22. package/app/components/Viewer/Options/TexturesSelector.vue +4 -4
  23. package/app/components/Viewer/Tree/ObjectTree.vue +4 -8
  24. package/app/components/ZScaling.vue +4 -4
  25. package/app/composables/project_manager.js +0 -2
  26. package/app/composables/run_function_when_microservices_connected.js +0 -2
  27. package/app/stores/data.js +18 -12
  28. package/app/stores/data_style.js +11 -11
  29. package/app/stores/geode.js +2 -2
  30. package/app/stores/hybrid_viewer.js +15 -24
  31. package/app/stores/infra.js +6 -2
  32. package/app/stores/lambda.js +1 -1
  33. package/app/stores/menu.js +1 -2
  34. package/app/stores/viewer.js +6 -6
  35. package/app/utils/colormap.js +3 -1
  36. package/app/utils/local.js +29 -34
  37. package/app/utils/status.js +1 -1
  38. package/app/utils/upload_file.js +2 -2
  39. package/app/utils/validate_schema.js +2 -2
  40. package/internal/database/database.js +17 -4
  41. package/internal/stores/data_style/mesh/cells/cell.js +1 -1
  42. package/internal/stores/data_style/mesh/cells/common.js +1 -1
  43. package/internal/stores/data_style/mesh/cells/vertex.js +1 -1
  44. package/internal/stores/data_style/mesh/edges/common.js +1 -1
  45. package/internal/stores/data_style/mesh/edges/edge.js +2 -2
  46. package/internal/stores/data_style/mesh/edges/vertex.js +1 -1
  47. package/internal/stores/data_style/mesh/index.js +2 -2
  48. package/internal/stores/data_style/mesh/points/common.js +1 -1
  49. package/internal/stores/data_style/mesh/points/vertex.js +1 -1
  50. package/internal/stores/data_style/mesh/polygons/common.js +1 -1
  51. package/internal/stores/data_style/mesh/polygons/polygon.js +1 -1
  52. package/internal/stores/data_style/mesh/polygons/vertex.js +1 -1
  53. package/internal/stores/data_style/mesh/polyhedra/common.js +1 -1
  54. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +1 -1
  55. package/internal/stores/data_style/mesh/polyhedra/vertex.js +1 -1
  56. package/internal/stores/data_style/model/blocks/color.js +1 -4
  57. package/internal/stores/data_style/model/blocks/common.js +1 -1
  58. package/internal/stores/data_style/model/blocks/index.js +5 -3
  59. package/internal/stores/data_style/model/blocks/visibility.js +1 -3
  60. package/internal/stores/data_style/model/corners/color.js +1 -4
  61. package/internal/stores/data_style/model/corners/common.js +1 -1
  62. package/internal/stores/data_style/model/corners/index.js +5 -3
  63. package/internal/stores/data_style/model/corners/visibility.js +1 -4
  64. package/internal/stores/data_style/model/edges/common.js +1 -1
  65. package/internal/stores/data_style/model/index.js +2 -2
  66. package/internal/stores/data_style/model/lines/color.js +1 -4
  67. package/internal/stores/data_style/model/lines/common.js +1 -1
  68. package/internal/stores/data_style/model/lines/index.js +5 -3
  69. package/internal/stores/data_style/model/lines/visibility.js +1 -4
  70. package/internal/stores/data_style/model/points/common.js +1 -1
  71. package/internal/stores/data_style/model/surfaces/color.js +1 -3
  72. package/internal/stores/data_style/model/surfaces/common.js +1 -1
  73. package/internal/stores/data_style/model/surfaces/index.js +5 -3
  74. package/internal/stores/data_style/model/surfaces/visibility.js +1 -2
  75. package/internal/utils/api_fetch.js +5 -7
  76. package/internal/utils/viewer_call.js +5 -7
  77. package/nuxt.config.js +8 -1
  78. package/package.json +3 -3
  79. package/scripts/generate_geode_objects.js +1 -1
  80. package/tests/integration/microservices/back/requirements.txt +1 -1
  81. package/tests/integration/microservices/viewer/requirements.txt +1 -1
  82. package/tests/integration/setup.js +5 -5
  83. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +2 -2
  84. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +2 -2
  85. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +2 -2
  86. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +2 -2
  87. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +2 -2
  88. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +2 -2
  89. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +2 -2
  90. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +2 -2
  91. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +2 -2
  92. package/tests/integration/stores/data_style/model/index.nuxt.test.js +2 -2
  93. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +2 -2
  94. package/tests/integration/stores/data_style/model/points.nuxt.test.js +2 -2
  95. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +25 -25
  96. package/tests/integration/stores/viewer.nuxt.test.js +3 -3
  97. package/tests/setup_indexeddb.js +1 -1
  98. package/tests/unit/components/CrsSelector.nuxt.test.js +4 -4
  99. package/tests/unit/components/ExtensionSelector.nuxt.test.js +4 -7
  100. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +1 -1
  101. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +1 -1
  102. package/tests/unit/components/FileSelector.nuxt.test.js +1 -1
  103. package/tests/unit/components/FileUploader.nuxt.test.js +1 -1
  104. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +1 -1
  105. package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +1 -1
  106. package/tests/unit/components/Launcher.nuxt.test.js +1 -1
  107. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
  108. package/tests/unit/components/ObjectSelector.nuxt.test.js +1 -1
  109. package/tests/unit/components/PackagesVersions.nuxt.test.js +1 -1
  110. package/tests/unit/components/Step.nuxt.test.js +1 -1
  111. package/tests/unit/components/Stepper.nuxt.test.js +1 -1
  112. package/tests/unit/composables/api_fetch.nuxt.test.js +3 -3
  113. package/tests/unit/composables/{ProjectManager.nuxt.test.js → project_manager.nuxt.test.js} +12 -13
  114. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +6 -6
  115. package/tests/unit/composables/upload_file.nuxt.test.js +2 -2
  116. package/tests/unit/plugins/project_load.nuxt.test.js +4 -4
  117. package/tests/unit/stores/{App.nuxt.test.js → app.nuxt.test.js} +1 -3
  118. package/tests/unit/stores/{Feedback.nuxt.test.js → feedback.nuxt.test.js} +8 -5
  119. package/tests/unit/stores/{Geode.nuxt.test.js → geode.nuxt.test.js} +3 -3
  120. package/tests/unit/stores/{Infra.nuxt.test.js → infra.nuxt.test.js} +2 -2
  121. package/tests/unit/stores/{Lambda.nuxt.test.js → lambda.nuxt.test.js} +2 -2
  122. package/tests/unit/stores/{Treeview.nuxt.test.js → treeview.nuxt.test.js} +2 -2
  123. package/tests/unit/stores/{Viewer.nuxt.test.js → viewer.nuxt.test.js} +1 -1
  124. package/tests/unit/utils/recaptcha.nuxt.test.js +11 -7
  125. package/tests/unit/utils/validate_schema.nuxt.test.js +1 -1
  126. package/tests/utils.js +1 -0
  127. package/tests/vitest.config.js +12 -4
  128. package/vuetify_config.js +1 -1
@@ -5,9 +5,8 @@ import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering
5
5
  import { newInstance as vtkMapper } from "@kitware/vtk.js/Rendering/Core/Mapper"
6
6
  import { newInstance as vtkXMLPolyDataReader } from "@kitware/vtk.js/IO/XML/XMLPolyDataReader"
7
7
 
8
- import Status from "@ogw_front/utils/status"
9
- import { database } from "../../internal/database/database.js"
10
- import { useDataStore } from "@ogw_front/stores/data"
8
+ import { Status } from "@ogw_front/utils/status"
9
+ import { database } from "@ogw_internal/database/database.js"
11
10
  import { useViewerStore } from "@ogw_front/stores/viewer"
12
11
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
13
12
 
@@ -28,7 +27,6 @@ const WHEEL_TIME_OUT_MS = 600
28
27
 
29
28
  export const useHybridViewerStore = defineStore("hybridViewer", () => {
30
29
  const viewerStore = useViewerStore()
31
- const dataStore = useDataStore()
32
30
  const hybridDb = reactive({})
33
31
  const status = ref(Status.NOT_CREATED)
34
32
  const camera_options = reactive({})
@@ -36,7 +34,7 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
36
34
  const is_moving = ref(false)
37
35
  const zScale = ref(1)
38
36
  let viewStream = undefined
39
- let gridActor = undefined
37
+ const gridActor = undefined
40
38
 
41
39
  async function initHybridViewer() {
42
40
  if (status.value !== Status.NOT_CREATED) {
@@ -60,9 +58,6 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
60
58
  if (is_moving.value) {
61
59
  return
62
60
  }
63
- const webGLRenderWindow =
64
- genericRenderWindow.value.getApiSpecificRenderWindow()
65
- const imageStyle = webGLRenderWindow.getReferenceByName("bgImage").style
66
61
  webGLRenderWindow.setBackgroundImage(event.image)
67
62
  imageStyle.opacity = 1
68
63
  })
@@ -126,7 +121,6 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
126
121
  if (!schema) {
127
122
  return
128
123
  }
129
- const viewerStore = useViewerStore()
130
124
  await viewerStore.request(schema, {
131
125
  z_scale,
132
126
  })
@@ -147,7 +141,6 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
147
141
  distance: camera.getDistance(),
148
142
  },
149
143
  }
150
- const viewerStore = useViewerStore()
151
144
  viewerStore.request(
152
145
  viewer_schemas.opengeodeweb_viewer.viewer.update_camera,
153
146
  params,
@@ -165,7 +158,6 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
165
158
  }
166
159
 
167
160
  function remoteRender() {
168
- const viewerStore = useViewerStore()
169
161
  return viewerStore.request(viewer_schemas.opengeodeweb_viewer.viewer.render)
170
162
  }
171
163
 
@@ -256,32 +248,31 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
256
248
  const z_scale = snapshot.zScale
257
249
 
258
250
  function applyCamera() {
259
- const { camera_options } = snapshot
260
- if (!camera_options) {
251
+ const { camera_options: snapshot_camera_options } = snapshot
252
+ if (!snapshot_camera_options) {
261
253
  return
262
254
  }
263
255
 
264
256
  const renderer = genericRenderWindow.value.getRenderer()
265
257
  const camera = renderer.getActiveCamera()
266
258
 
267
- camera.setFocalPoint(...camera_options.focal_point)
268
- camera.setViewUp(...camera_options.view_up)
269
- camera.setPosition(...camera_options.position)
270
- camera.setViewAngle(camera_options.view_angle)
271
- camera.setClippingRange(...camera_options.clipping_range)
259
+ camera.setFocalPoint(...snapshot_camera_options.focal_point)
260
+ camera.setViewUp(...snapshot_camera_options.view_up)
261
+ camera.setPosition(...snapshot_camera_options.position)
262
+ camera.setViewAngle(snapshot_camera_options.view_angle)
263
+ camera.setClippingRange(...snapshot_camera_options.clipping_range)
272
264
 
273
265
  genericRenderWindow.value.getRenderWindow().render()
274
266
 
275
267
  const payload = {
276
268
  camera_options: {
277
- focal_point: [...camera_options.focal_point],
278
- view_up: [...camera_options.view_up],
279
- position: [...camera_options.position],
280
- view_angle: camera_options.view_angle,
281
- clipping_range: [...camera_options.clipping_range],
269
+ focal_point: [...snapshot_camera_options.focal_point],
270
+ view_up: [...snapshot_camera_options.view_up],
271
+ position: [...snapshot_camera_options.position],
272
+ view_angle: snapshot_camera_options.view_angle,
273
+ clipping_range: [...snapshot_camera_options.clipping_range],
282
274
  },
283
275
  }
284
- const viewerStore = useViewerStore()
285
276
  return viewerStore.request(
286
277
  viewer_schemas.opengeodeweb_viewer.viewer.update_camera,
287
278
  payload,
@@ -1,5 +1,5 @@
1
1
  import { appMode, getAppMode } from "@ogw_front/utils/app_mode"
2
- import Status from "@ogw_front/utils/status"
2
+ import { Status } from "@ogw_front/utils/status"
3
3
  import { useLambdaStore } from "@ogw_front/stores/lambda"
4
4
 
5
5
  export const useInfraStore = defineStore("infra", {
@@ -32,7 +32,11 @@ export const useInfraStore = defineStore("infra", {
32
32
  const store_name = store.$id
33
33
  console.log("[INFRA] Registering microservice:", store_name)
34
34
 
35
- if (!this.microservices.find((store) => store.$id === store_name)) {
35
+ if (
36
+ !this.microservices.find(
37
+ (microservice) => microservice.$id === store_name,
38
+ )
39
+ ) {
36
40
  this.microservices.push(store)
37
41
  console.log("[INFRA] Microservice registered:", store_name)
38
42
  }
@@ -1,4 +1,4 @@
1
- import Status from "@ogw_front/utils/status"
1
+ import { Status } from "@ogw_front/utils/status"
2
2
  import { useFeedbackStore } from "@ogw_front/stores/feedback"
3
3
 
4
4
  export const useLambdaStore = defineStore("lambda", {
@@ -21,10 +21,9 @@ import Grid2DEdgesOptions from "@ogw_front/components/Viewer/Grid/2D/EdgesOption
21
21
  import Grid2DPointsOptions from "@ogw_front/components/Viewer/Grid/2D/PointsOptions"
22
22
 
23
23
  // Grid 3D components
24
+ import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions"
24
25
  import Grid3DEdgesOptions from "@ogw_front/components/Viewer/Grid/3D/EdgesOptions"
25
26
  import Grid3DPointsOptions from "@ogw_front/components/Viewer/Grid/3D/PointsOptions"
26
- // import Grid3DFacetsOptions from "@ogw_front/components/Viewer/Grid/3D/FacetsOptions"
27
- import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions"
28
27
 
29
28
  // Solid components
30
29
  import SolidEdgesOptions from "@ogw_front/components/Viewer/Solid/EdgesOptions"
@@ -5,11 +5,11 @@ import vtkWSLinkClient, {
5
5
  import _ from "lodash"
6
6
  // oxlint-disable-next-line no-unassigned-import
7
7
  import "@kitware/vtk.js/Rendering/OpenGL/Profiles/Geometry"
8
- import Status from "@ogw_front/utils/status"
8
+ import { Status } from "@ogw_front/utils/status"
9
9
  import { appMode } from "@ogw_front/utils/app_mode"
10
10
  import schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
11
11
  import { useInfraStore } from "@ogw_front/stores/infra"
12
- import { viewer_call } from "../../internal/utils/viewer_call"
12
+ import { viewer_call } from "@ogw_internal/utils/viewer_call"
13
13
 
14
14
  const MS_PER_SECOND = 1000
15
15
  const SECONDS_PER_REQUEST = 10
@@ -19,7 +19,6 @@ export const useViewerStore = defineStore(
19
19
  "viewer",
20
20
  () => {
21
21
  const infraStore = useInfraStore()
22
-
23
22
  const default_local_port = ref("1234")
24
23
  const client = ref({})
25
24
  const config = ref(undefined)
@@ -151,10 +150,11 @@ export const useViewerStore = defineStore(
151
150
  }
152
151
 
153
152
  async function launch() {
153
+ status.value = Status.CREATING
154
154
  console.log("[VIEWER] Launching viewer microservice...")
155
- const port = await globalThis.electronAPI.run_viewer()
156
- console.log("[VIEWER] Viewer launched on port:", port)
157
- return port
155
+ const launched_port = await globalThis.electronAPI.run_viewer()
156
+ console.log("[VIEWER] Viewer launched on port:", launched_port)
157
+ return launched_port
158
158
  }
159
159
 
160
160
  async function connect() {
@@ -1,5 +1,7 @@
1
1
  import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
2
2
 
3
- export function getRGBPointsFromPreset(presetName) {
3
+ function getRGBPointsFromPreset(presetName) {
4
4
  return vtkColorMaps.getPresetByName(presetName).RGBPoints
5
5
  }
6
+
7
+ export { getRGBPointsFromPreset }
@@ -1,9 +1,9 @@
1
- import { on, once } from "node:events"
2
1
  import child_process from "node:child_process"
3
2
  import fs from "node:fs"
3
+ import { on } from "node:events"
4
4
  import path from "node:path"
5
- import { setTimeout } from "timers/promises"
6
5
  import { rimraf } from "rimraf"
6
+ import { setTimeout } from "node:timers/promises"
7
7
 
8
8
  // Third party imports
9
9
  import { WebSocket } from "ws"
@@ -11,7 +11,6 @@ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.jso
11
11
  import { getPort } from "get-port-please"
12
12
  import isElectron from "is-electron"
13
13
  import pTimeout from "p-timeout"
14
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
15
14
 
16
15
  const MAX_DELETE_FOLDER_RETRIES = 5
17
16
  const DEFAULT_TIMEOUT_SECONDS = 30
@@ -48,12 +47,12 @@ function executable_name(name) {
48
47
  return name
49
48
  }
50
49
 
51
- function create_path(path) {
52
- if (!fs.existsSync(path)) {
53
- fs.mkdirSync(path, { recursive: true })
54
- console.log(`${path} directory created successfully!`)
50
+ function create_path(dir_path) {
51
+ if (!fs.existsSync(dir_path)) {
52
+ fs.mkdirSync(dir_path, { recursive: true })
53
+ console.log(`${dir_path} directory created successfully!`)
55
54
  }
56
- return path
55
+ return dir_path
57
56
  }
58
57
 
59
58
  function get_available_port() {
@@ -63,10 +62,10 @@ function get_available_port() {
63
62
  })
64
63
  }
65
64
 
66
- function commandExistsSync(executable_name) {
65
+ function commandExistsSync(exec_name) {
67
66
  const envPath = process.env.PATH || ""
68
67
  return envPath.split(path.delimiter).some((dir) => {
69
- const filePath = path.join(dir, executable_name)
68
+ const filePath = path.join(dir, exec_name)
70
69
  return fs.existsSync(filePath) && fs.statSync(filePath).isFile()
71
70
  })
72
71
  }
@@ -81,15 +80,15 @@ async function wait_for_ready(child, expected_response) {
81
80
  }
82
81
 
83
82
  async function run_script(
84
- executable_name,
85
- executable_path,
83
+ exec_name,
84
+ exec_path,
86
85
  args,
87
86
  expected_response,
88
87
  timeout_seconds = DEFAULT_TIMEOUT_SECONDS,
89
88
  ) {
90
- const command = commandExistsSync(executable_name)
91
- ? executable_name
92
- : path.join(executable_path, executable_name)
89
+ const command = commandExistsSync(exec_name)
90
+ ? exec_name
91
+ : path.join(exec_path, exec_name)
93
92
  console.log("run_script", command, args)
94
93
  const child = child_process.spawn(command, args, {
95
94
  encoding: "utf8",
@@ -126,8 +125,10 @@ async function run_script(
126
125
  }
127
126
  }
128
127
 
129
- async function run_back(executable_name, executable_path, args = {}) {
130
- let { project_folder_path, upload_folder_path } = args
128
+ async function run_back(exec_name, exec_path, args = {}) {
129
+ const { project_folder_path, upload_folder_path: upload_folder_path_arg } =
130
+ args
131
+ let upload_folder_path = upload_folder_path_arg
131
132
  if (!project_folder_path) {
132
133
  throw new Error("project_folder_path is required")
133
134
  }
@@ -145,17 +146,12 @@ async function run_back(executable_name, executable_path, args = {}) {
145
146
  if (process.env.NODE_ENV === "development" || !process.env.NODE_ENV) {
146
147
  back_args.push("--debug")
147
148
  }
148
- console.log("run_back", executable_name, executable_path, back_args)
149
- await run_script(
150
- executable_name,
151
- executable_path,
152
- back_args,
153
- "Serving Flask app",
154
- )
149
+ console.log("run_back", exec_name, exec_path, back_args)
150
+ await run_script(exec_name, exec_path, back_args, "Serving Flask app")
155
151
  return port
156
152
  }
157
153
 
158
- async function run_viewer(executable_name, executable_path, args = {}) {
154
+ async function run_viewer(exec_name, exec_path, args = {}) {
159
155
  if (!args.project_folder_path) {
160
156
  throw new Error("project_folder_path is required")
161
157
  }
@@ -165,13 +161,8 @@ async function run_viewer(executable_name, executable_path, args = {}) {
165
161
  `--data_folder_path ${args.project_folder_path}`,
166
162
  `--timeout ${0}`,
167
163
  ]
168
- console.log("run_viewer", executable_name, executable_path, viewer_args)
169
- await run_script(
170
- executable_name,
171
- executable_path,
172
- viewer_args,
173
- "Starting factory",
174
- )
164
+ console.log("run_viewer", exec_name, exec_path, viewer_args)
165
+ await run_script(exec_name, exec_path, viewer_args, "Starting factory")
175
166
  return port
176
167
  }
177
168
 
@@ -183,13 +174,16 @@ async function delete_folder_recursive(data_folder_path) {
183
174
  for (let i = 0; i <= MAX_DELETE_FOLDER_RETRIES; i += 1) {
184
175
  try {
185
176
  console.log(`Deleting folder: ${data_folder_path}`)
177
+ // oxlint-disable-next-line no-await-in-loop
186
178
  await rimraf(data_folder_path)
187
179
  console.log(`Deleted folder: ${data_folder_path}`)
188
180
  return
189
181
  } catch (error) {
190
182
  console.error(`Error deleting folder ${data_folder_path}:`, error)
191
183
  // Wait before retrying
192
- const DELAY = 1000 * (i + 1)
184
+ const MILLISECONDS_PER_RETRY = 1000
185
+ const DELAY = MILLISECONDS_PER_RETRY * (i + 1)
186
+ // oxlint-disable-next-line no-await-in-loop
193
187
  await setTimeout(DELAY)
194
188
  console.log("Retrying delete folder")
195
189
  }
@@ -218,8 +212,9 @@ function kill_back(back_port) {
218
212
 
219
213
  function kill_viewer(viewer_port) {
220
214
  function do_kill() {
215
+ // oxlint-disable-next-line avoid-new
221
216
  return new Promise((resolve) => {
222
- const socket = new WebSocket("ws://localhost:" + viewer_port + "/ws")
217
+ const socket = new WebSocket(`ws://localhost:${viewer_port}/ws`)
223
218
  socket.on("open", () => {
224
219
  console.log("Connected to WebSocket server")
225
220
  socket.send(
@@ -7,4 +7,4 @@ const Status = {
7
7
  CONNECTED: "CONNECTED",
8
8
  }
9
9
 
10
- export default Status
10
+ export { Status }
@@ -1,7 +1,7 @@
1
1
  import { useFeedbackStore } from "@ogw_front/stores/feedback"
2
2
  import { useGeodeStore } from "@ogw_front/stores/geode"
3
3
 
4
- export async function upload_file(
4
+ async function upload_file(
5
5
  { route, file },
6
6
  { request_error_function, response_function, response_error_function } = {},
7
7
  ) {
@@ -52,4 +52,4 @@ export async function upload_file(
52
52
  })
53
53
  }
54
54
 
55
- export default upload_file
55
+ export { upload_file }
@@ -1,6 +1,6 @@
1
1
  import Ajv from "ajv"
2
2
 
3
- export function validate_schema(schema, body) {
3
+ function validate_schema(schema, body) {
4
4
  const ajv = new Ajv()
5
5
  const list_keywords = ["methods", "route", "max_retry", "rpc"]
6
6
  for (const keyword of list_keywords) {
@@ -10,4 +10,4 @@ export function validate_schema(schema, body) {
10
10
  return { valid, error: ajv.errorsText() }
11
11
  }
12
12
 
13
- export default validate_schema
13
+ export { validate_schema }
@@ -40,7 +40,7 @@ class Database extends Dexie {
40
40
  (tableName) => currentStores[tableName],
41
41
  )
42
42
 
43
- database.close()
43
+ databaseContainer.instance.close()
44
44
 
45
45
  if (allExisting) {
46
46
  const existingDb = new Dexie("Database")
@@ -55,7 +55,7 @@ class Database extends Dexie {
55
55
  }
56
56
  }
57
57
  await existingDb.open()
58
- database = existingDb
58
+ databaseContainer.instance = existingDb
59
59
  } else {
60
60
  const newDb = new ExtendedDatabase(
61
61
  currentVersion,
@@ -63,11 +63,24 @@ class Database extends Dexie {
63
63
  newTables,
64
64
  )
65
65
  await newDb.open()
66
- database = newDb
66
+ databaseContainer.instance = newDb
67
67
  }
68
68
  }
69
69
  }
70
70
 
71
- let database = new Database()
71
+ const databaseContainer = { instance: new Database() }
72
+
73
+ const database = new Proxy(
74
+ {},
75
+ {
76
+ get(target, prop) {
77
+ const value = databaseContainer.instance[prop]
78
+ if (typeof value === "function") {
79
+ return value.bind(databaseContainer.instance)
80
+ }
81
+ return value
82
+ },
83
+ },
84
+ )
72
85
 
73
86
  export { Database, database }
@@ -35,7 +35,7 @@ export function useMeshCellsCellAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshCellsCellAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshCellsCellAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -1,4 +1,4 @@
1
- import { useDataStyleStateStore } from "../../state"
1
+ import { useDataStyleStateStore } from "@ogw_internal/stores/data_style/state"
2
2
 
3
3
  export function useMeshCellsCommonStyle() {
4
4
  const dataStyleStateStore = useDataStyleStateStore()
@@ -35,7 +35,7 @@ export function useMeshCellsVertexAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshCellsVertexAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshCellsVertexAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -1,4 +1,4 @@
1
- import { useDataStyleStateStore } from "../../state"
1
+ import { useDataStyleStateStore } from "@ogw_internal/stores/data_style/state"
2
2
 
3
3
  export function useMeshEdgesCommonStyle() {
4
4
  const dataStyleStateStore = useDataStyleStateStore()
@@ -19,7 +19,7 @@ export function useMeshEdgesEdgeAttributeStyle() {
19
19
  }
20
20
 
21
21
  function meshEdgesEdgeAttributeStoredConfig(id, name) {
22
- const storedConfigs = meshEdgesEdgeAttribute(id).storedConfigs
22
+ const { storedConfigs } = meshEdgesEdgeAttribute(id)
23
23
  if (name in storedConfigs) {
24
24
  return storedConfigs[name]
25
25
  }
@@ -35,7 +35,7 @@ export function useMeshEdgesEdgeAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshEdgesEdgeAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshEdgesEdgeAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -35,7 +35,7 @@ export function useMeshEdgesVertexAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshEdgesVertexAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshEdgesVertexAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -5,7 +5,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
5
5
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer"
7
7
 
8
- import { useDataStyleStateStore } from "../state"
8
+ import { useDataStyleStateStore } from "@ogw_internal/stores/data_style/state"
9
9
  import { useMeshCellsStyle } from "./cells"
10
10
  import { useMeshEdgesStyle } from "./edges"
11
11
  import { useMeshPointsStyle } from "./points"
@@ -15,7 +15,7 @@ import { useMeshPolyhedraStyle } from "./polyhedra"
15
15
  // Local constants
16
16
  const meshSchemas = viewer_schemas.opengeodeweb_viewer.mesh
17
17
 
18
- export default function useMeshStyle() {
18
+ export function useMeshStyle() {
19
19
  const hybridViewerStore = useHybridViewerStore()
20
20
  const viewerStore = useViewerStore()
21
21
  const dataStyleState = useDataStyleStateStore()
@@ -1,4 +1,4 @@
1
- import { useDataStyleStateStore } from "../../state"
1
+ import { useDataStyleStateStore } from "@ogw_internal/stores/data_style/state"
2
2
 
3
3
  export function useMeshPointsCommonStyle() {
4
4
  const dataStyleStateStore = useDataStyleStateStore()
@@ -35,7 +35,7 @@ export function useMeshPointsVertexAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshPointsVertexAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshPointsVertexAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -1,4 +1,4 @@
1
- import { useDataStyleStateStore } from "../../state"
1
+ import { useDataStyleStateStore } from "@ogw_internal/stores/data_style/state"
2
2
 
3
3
  export function useMeshPolygonsCommonStyle() {
4
4
  const dataStyleStateStore = useDataStyleStateStore()
@@ -35,7 +35,7 @@ export function useMeshPolygonsPolygonAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshPolygonsPolygonAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshPolygonsPolygonAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -35,7 +35,7 @@ export function useMeshPolygonsVertexAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshPolygonsVertexAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshPolygonsVertexAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -1,4 +1,4 @@
1
- import { useDataStyleStateStore } from "../../state"
1
+ import { useDataStyleStateStore } from "@ogw_internal/stores/data_style/state"
2
2
 
3
3
  export function useMeshPolyhedraCommonStyle() {
4
4
  const dataStyleStateStore = useDataStyleStateStore()
@@ -35,7 +35,7 @@ export function useMeshPolyhedraPolyhedronAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshPolyhedraPolyhedronAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshPolyhedraPolyhedronAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -35,7 +35,7 @@ export function useMeshPolyhedraVertexAttributeStyle() {
35
35
  name,
36
36
  { minimum, maximum, colorMap },
37
37
  ) {
38
- const storedConfigs = meshPolyhedraVertexAttribute(id).storedConfigs
38
+ const { storedConfigs } = meshPolyhedraVertexAttribute(id)
39
39
  storedConfigs[name] = { minimum, maximum, colorMap }
40
40
  return storedConfigs[name]
41
41
  }
@@ -2,8 +2,8 @@
2
2
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
3
 
4
4
  // Local imports
5
- import { useModelBlocksCommonStyle } from "./common"
6
5
  import { useDataStore } from "@ogw_front/stores/data"
6
+ import { useModelBlocksCommonStyle } from "./common"
7
7
  import { useViewerStore } from "@ogw_front/stores/viewer"
8
8
 
9
9
  // Local constants
@@ -17,11 +17,9 @@ export function useModelBlocksColorStyle() {
17
17
  function modelBlockColor(id, block_id) {
18
18
  return modelBlocksCommonStyle.modelBlockStyle(id, block_id).color
19
19
  }
20
-
21
20
  function saveModelBlockColor(id, block_id, color) {
22
21
  modelBlocksCommonStyle.modelBlockStyle(id, block_id).color = color
23
22
  }
24
-
25
23
  async function setModelBlocksColor(id, block_ids, color) {
26
24
  if (!block_ids || block_ids.length === 0) {
27
25
  return
@@ -45,7 +43,6 @@ export function useModelBlocksColorStyle() {
45
43
  for (const block_id of block_ids) {
46
44
  saveModelBlockColor(id, block_id, color)
47
45
  }
48
-
49
46
  console.log(
50
47
  setModelBlocksColor.name,
51
48
  { id },
@@ -1,4 +1,4 @@
1
- import { useDataStyleStateStore } from "../../state"
1
+ import { useDataStyleStateStore } from "@ogw_internal/stores/data_style/state"
2
2
 
3
3
  export function useModelBlocksCommonStyle() {
4
4
  const dataStyleStateStore = useDataStyleStateStore()
@@ -1,8 +1,12 @@
1
1
  // Local imports
2
+ import { useDataStore } from "@ogw_front/stores/data"
2
3
  import { useModelBlocksColorStyle } from "./color"
3
4
  import { useModelBlocksCommonStyle } from "./common"
4
5
  import { useModelBlocksVisibilityStyle } from "./visibility"
5
- import { useDataStore } from "@ogw_front/stores/data"
6
+
7
+ async function setModelBlocksDefaultStyle(_id) {
8
+ // Placeholder for oxlint
9
+ }
6
10
 
7
11
  export function useModelBlocksStyle() {
8
12
  const dataStore = useDataStore()
@@ -23,8 +27,6 @@ export function useModelBlocksStyle() {
23
27
  ])
24
28
  }
25
29
 
26
- async function setModelBlocksDefaultStyle(id) {}
27
-
28
30
  return {
29
31
  applyModelBlocksStyle,
30
32
  setModelBlocksDefaultStyle,