@geode/opengeodeweb-front 10.4.0 → 10.4.1-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.
package/.oxlintrc.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "style": "error",
8
8
  "restriction": "error"
9
9
  },
10
- "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest"],
10
+ "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest", "vue"],
11
11
  "rules": {
12
12
  "unicorn/filename-case": [
13
13
  "error",
@@ -15,26 +15,91 @@
15
15
  "case": "snakeCase"
16
16
  }
17
17
  ],
18
- "eslint/func-style": [
18
+ "eslint/func-style": ["error", "declaration"],
19
+ "eslint/sort-keys": "off",
20
+ "eslint/no-ternary": "off", // A utiliser pour des opérations simples
21
+ "oxc/no-async-await": "off",
22
+ "oxc/no-rest-spread-properties": "off", // Enable if older browser support is needed
23
+ "eslint/max-statements": ["warn", 20],
24
+ "eslint/id-length": [
19
25
  "error",
20
26
  {
21
- "style:": "declaration"
27
+ "exceptions": [
28
+ "x",
29
+ "y",
30
+ "z",
31
+ "i",
32
+ "j",
33
+ "k",
34
+ "r",
35
+ "g",
36
+ "b",
37
+ "id",
38
+ "ID",
39
+ "fs",
40
+ "os"
41
+ ],
42
+ "min": 3
22
43
  }
23
44
  ],
24
- "eslint/sort-keys": "off",
25
- "eslint/no-ternary": "off"
45
+ "eslint/no-console": "warn", // Disable for debugging. Disable later to not have browser logs
46
+ "sort-imports": ["error", { "allowSeparatedGroups": true }],
47
+ "eslint/no-undefined": "off", // Conflict with unicorn/no-typeof-undefined which prefers direct undefined comparison
48
+ "import/prefer-default-export": "off",
49
+ "import/no-named-export": "off",
50
+ "import/no-namespace": ["error", { "ignore": ["vuetify/*"] }],
51
+ "vue/max-props": ["error", { "maxProps": 8 }],
52
+ "oxc/no-optional-chaining": "off",
53
+ "node/no-process-env": "off",
54
+ "no-continue": "off",
55
+ "import/unambiguous": "off",
56
+ "max-params": ["warn", { "max": 4 }],
57
+ "import/no-nodejs-modules": "off",
58
+ "eslint/no-magic-numbers": [
59
+ "error",
60
+ {
61
+ "ignore": [-1, 0, 1, 2, 3, 4],
62
+ "ignoreArrayIndexes": true
63
+ }
64
+ ]
26
65
  },
27
66
  "overrides": [
28
67
  {
29
- "files": ["**/components/*"],
68
+ "files": ["**/components/**"],
30
69
  "rules": {
31
70
  "unicorn/filename-case": [
32
71
  "error",
33
72
  {
34
- "case": "PascalCase"
73
+ "case": "pascalCase"
35
74
  }
36
75
  ]
37
76
  }
77
+ },
78
+ {
79
+ "files": [
80
+ "app/plugins/**",
81
+ "node_scripts/**",
82
+ "server/**",
83
+ "*.config.js"
84
+ ],
85
+ "rules": {
86
+ "import/no-default-export": "off"
87
+ }
88
+ },
89
+ {
90
+ "files": ["tests/**"],
91
+ "rules": {
92
+ "vitest/require-hook": "off",
93
+ "vitest/no-hooks": "off",
94
+ "vitest/no-importing-vitest-globals": "off",
95
+ "import/no-relative-parent-imports": "warn"
96
+ }
97
+ },
98
+ {
99
+ "files": ["**/preload.js"],
100
+ "rules": {
101
+ "import/no-commonjs": "off"
102
+ }
38
103
  }
39
104
  ]
40
105
  }
@@ -13,7 +13,7 @@
13
13
 
14
14
  const model_id = computed(() => treeviewStore.model_id)
15
15
 
16
- const metaDatas = computed(() => dataStore.getItem(model_id.value).value)
16
+ const metaDatas = dataStore.refItem(model_id.value)
17
17
  </script>
18
18
 
19
19
  <template>
@@ -1,5 +1,4 @@
1
1
  <script setup>
2
- import { useDataStore } from "@ogw_front/stores/data"
3
2
  import { useEventListener } from "@vueuse/core"
4
3
  import { useMenuStore } from "@ogw_front/stores/menu"
5
4
 
@@ -16,7 +15,6 @@
16
15
  const CLOSE_DELAY = 100
17
16
 
18
17
  const menuStore = useMenuStore()
19
- const dataStore = useDataStore()
20
18
 
21
19
  const { id, x, y, containerWidth, containerHeight } = defineProps({
22
20
  id: { type: String, required: true },
@@ -26,13 +24,7 @@
26
24
  containerHeight: { type: Number, required: true },
27
25
  })
28
26
 
29
- const meta_data = computed(() => {
30
- const itemId = id || menuStore.current_id
31
- if (!itemId) {
32
- return {}
33
- }
34
- return dataStore.getItem(itemId).value || {}
35
- })
27
+ const meta_data = computed(() => menuStore.current_meta_data || {})
36
28
 
37
29
  const show_menu = ref(true)
38
30
  const isDragging = ref(false)
@@ -15,17 +15,18 @@ const viewer_generic_schemas = viewer_schemas.opengeodeweb_viewer.generic
15
15
  export const useDataStore = defineStore("data", () => {
16
16
  const viewerStore = useViewerStore()
17
17
 
18
- function getItem(id) {
19
- if (!id) {
20
- return ref({})
21
- }
18
+ function item(id) {
19
+ return database.data.get(id)
20
+ }
21
+
22
+ function refItem(id) {
22
23
  return useObservable(
23
24
  liveQuery(() => database.data.get(id)),
24
25
  { initialValue: {} },
25
26
  )
26
27
  }
27
28
 
28
- function getAllItems() {
29
+ function refAllItems() {
29
30
  return useObservable(
30
31
  liveQuery(() => database.data.toArray()),
31
32
  { initialValue: [] },
@@ -181,8 +182,9 @@ export const useDataStore = defineStore("data", () => {
181
182
  }
182
183
 
183
184
  return {
184
- getAllItems,
185
- getItem,
185
+ refAllItems,
186
+ item,
187
+ refItem,
186
188
  meshComponentType,
187
189
  formatedMeshComponents,
188
190
  registerObject,
@@ -61,11 +61,11 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
61
61
  }
62
62
  }
63
63
 
64
- function applyAllStylesFromState() {
64
+ async function applyAllStylesFromState() {
65
65
  const ids = Object.keys(dataStyleState.styles || {})
66
66
  const promises = []
67
67
  for (const id of ids) {
68
- const meta = dataStore.getItem(id).value
68
+ const meta = await dataStore.item(id)
69
69
  const viewerType = meta?.viewer_type
70
70
  const style = dataStyleState.styles[id]
71
71
  if (style && viewerType === "mesh") {
@@ -132,6 +132,7 @@ export const useMenuStore = defineStore("menu", () => {
132
132
  const containerTop = ref(0)
133
133
  const containerLeft = ref(0)
134
134
  const active_item_index = ref(undefined)
135
+ const current_meta_data = ref({})
135
136
 
136
137
  function getMenuItems(objectType, geodeObject) {
137
138
  if (!objectType || !geodeObject || !menus.value[objectType]) {
@@ -143,6 +144,7 @@ export const useMenuStore = defineStore("menu", () => {
143
144
  function closeMenu() {
144
145
  active_item_index.value = undefined
145
146
  current_id.value = undefined
147
+ current_meta_data.value = {}
146
148
  menuX.value = 0
147
149
  menuY.value = 0
148
150
  display_menu.value = false
@@ -162,6 +164,7 @@ export const useMenuStore = defineStore("menu", () => {
162
164
  }
163
165
 
164
166
  current_id.value = id
167
+ current_meta_data.value = meta_data || {}
165
168
 
166
169
  if (x !== undefined && y !== undefined) {
167
170
  menuX.value = x
@@ -202,6 +205,7 @@ export const useMenuStore = defineStore("menu", () => {
202
205
  return {
203
206
  display_menu,
204
207
  current_id,
208
+ current_meta_data,
205
209
  menuX,
206
210
  menuY,
207
211
  containerWidth,
@@ -171,9 +171,9 @@ export default function useModelStyle() {
171
171
  return Promise.all(promise_array)
172
172
  }
173
173
 
174
- function setModelMeshComponentsDefaultStyle(id) {
175
- const item = dataStore.getItem(id)
176
- const { mesh_components } = item.value
174
+ async function setModelMeshComponentsDefaultStyle(id) {
175
+ const item = await dataStore.item(id)
176
+ const { mesh_components } = item
177
177
  const promise_array = []
178
178
  if ("Corner" in mesh_components) {
179
179
  promise_array.push(modelCornersStyleStore.setModelCornersDefaultStyle(id))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.4.0",
3
+ "version": "10.4.1-rc.1",
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": {
@@ -31,8 +31,8 @@
31
31
  "build": ""
32
32
  },
33
33
  "dependencies": {
34
- "@geode/opengeodeweb-back": "latest",
35
- "@geode/opengeodeweb-viewer": "latest",
34
+ "@geode/opengeodeweb-back": "next",
35
+ "@geode/opengeodeweb-viewer": "next",
36
36
  "@kitware/vtk.js": "33.3.0",
37
37
  "@mdi/font": "7.4.47",
38
38
  "@pinia/nuxt": "0.11.3",
@@ -5,4 +5,4 @@
5
5
  # pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
6
6
  #
7
7
 
8
- opengeodeweb-back==6.*,>=6.2.0rc2
8
+ opengeodeweb-back==6.*,>=6.3.0
@@ -5,4 +5,4 @@
5
5
  # pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
6
6
  #
7
7
 
8
- opengeodeweb-viewer==1.*,>=1.15.4rc1
8
+ opengeodeweb-viewer==1.*,>=1.15.5rc1