diff --git a/.oxlintrc.json b/.oxlintrc.json
index a033f40f..b121e0fa 100644
--- a/.oxlintrc.json
+++ b/.oxlintrc.json
@@ -7,7 +7,7 @@
"style": "error",
"restriction": "error"
},
- "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest"],
+ "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest", "vue"],
"rules": {
"unicorn/filename-case": [
"error",
@@ -15,26 +15,88 @@
"case": "snakeCase"
}
],
- "eslint/func-style": [
+ "eslint/func-style": ["error", "declaration"],
+ "eslint/sort-keys": "off",
+ "eslint/no-ternary": "off", // A utiliser pour des opérations simples
+ "oxc/no-async-await": "off",
+ "oxc/no-rest-spread-properties": "off", // Enable if older browser support is needed
+ "eslint/max-statements": ["warn", 20],
+ "eslint/id-length": [
"error",
{
- "style:": "declaration"
+ "exceptions": [
+ "x",
+ "y",
+ "z",
+ "i",
+ "j",
+ "k",
+ "r",
+ "g",
+ "b",
+ "id",
+ "ID",
+ "fs",
+ "os"
+ ],
+ "min": 3
}
],
- "eslint/sort-keys": "off",
- "eslint/no-ternary": "off"
+ "eslint/no-console": "warn", // Disable for debugging. Disable later to not have browser logs
+ "sort-imports": ["error", { "allowSeparatedGroups": true }],
+ "eslint/no-undefined": "off", // Conflict with unicorn/no-typeof-undefined which prefers direct undefined comparison
+ "import/prefer-default-export": "off",
+ "import/no-named-export": "off",
+ "import/no-namespace": ["error", { "ignore": ["vuetify/*"] }],
+ "vue/max-props": ["error", { "maxProps": 8 }],
+ "oxc/no-optional-chaining": "off",
+ "node/no-process-env": "off",
+ "no-continue": "off",
+ "import/unambiguous": "off",
+ "max-params": ["warn", { "max": 4 }],
+ "eslint/no-magic-numbers": [
+ "error",
+ {
+ "ignore": [-1, 0, 1, 2, 3, 4],
+ "ignoreArrayIndexes": true
+ }
+ ]
},
"overrides": [
{
- "files": ["**/components/*"],
+ "files": ["**/components/**"],
"rules": {
"unicorn/filename-case": [
"error",
{
- "case": "PascalCase"
+ "case": "pascalCase"
}
]
}
+ },
+ {
+ "files": [
+ "app/plugins/**",
+ "node_scripts/**",
+ "server/**",
+ "*.config.js"
+ ],
+ "rules": {
+ "import/no-default-export": "off"
+ }
+ },
+ {
+ "files": ["tests/**"],
+ "rules": {
+ "vitest/require-hook": "off",
+ "vitest/no-hooks": "off"
+ }
+ },
+ {
+ "files": ["**/preload.js"],
+ "rules": {
+ "import/no-commonjs": "off"
+ }
}
]
}
diff --git a/app/components/DeleteDialog.vue b/app/components/DeleteDialog.vue
index 9a895cbe..2533aa5d 100644
--- a/app/components/DeleteDialog.vue
+++ b/app/components/DeleteDialog.vue
@@ -8,7 +8,7 @@
},
item: {
type: Object,
- default: null,
+ default: undefined,
},
selectedCount: {
type: Number,
diff --git a/app/components/DragAndDrop.vue b/app/components/DragAndDrop.vue
index 547ce722..a9bdb0dc 100644
--- a/app/components/DragAndDrop.vue
+++ b/app/components/DragAndDrop.vue
@@ -1,14 +1,11 @@
diff --git a/app/components/HybridRenderingView.vue b/app/components/HybridRenderingView.vue
index 4a906fd6..f1bde200 100644
--- a/app/components/HybridRenderingView.vue
+++ b/app/components/HybridRenderingView.vue
@@ -43,10 +43,6 @@
timeout = setTimeout(later, wait)
}
}
-
- function get_x_y(event) {
- emit("click", event)
- }
@@ -58,7 +54,7 @@
class="pa-0"
ref="viewer"
style="height: 100%; overflow: hidden; position: relative; z-index: 0"
- @click="get_x_y"
+ @click="emit('click', $event)"
@keydown.esc="viewerStore.toggle_picking_mode(false)"
/>
diff --git a/app/components/Launcher.vue b/app/components/Launcher.vue
index b85f3f57..297bb88b 100644
--- a/app/components/Launcher.vue
+++ b/app/components/Launcher.vue
@@ -1,7 +1,7 @@
+
-
-
diff --git a/app/components/Step.vue b/app/components/Step.vue
index da379e80..b95b4c9b 100644
--- a/app/components/Step.vue
+++ b/app/components/Step.vue
@@ -10,6 +10,8 @@
step_index: { type: Number, required: true },
})
+ const emit = defineEmits(["reset_values"])
+
const stepper_tree = inject("stepper_tree")
const { current_step_index, steps } = toRefs(stepper_tree)
@@ -98,7 +100,7 @@
@increment_step="increment_step"
@decrement_step="decrement_step"
@update_values="update_values_event"
- @reset_values="$emit('reset_values')"
+ @reset_values="emit('reset_values')"
/>
diff --git a/app/components/Viewer/ContextMenuItem.vue b/app/components/Viewer/ContextMenuItem.vue
index 709ea80e..78583635 100644
--- a/app/components/Viewer/ContextMenuItem.vue
+++ b/app/components/Viewer/ContextMenuItem.vue
@@ -1,7 +1,7 @@
@@ -33,7 +29,7 @@
icon="mdi-arrow-left-right"
size="x-small"
variant="text"
- @click="reset"
+ @click="emit('reset')"
v-tooltip="'Reset range'"
/>
diff --git a/app/components/Viewer/Options/ColorMapList.vue b/app/components/Viewer/Options/ColorMapList.vue
index 816917a3..dcfcb968 100644
--- a/app/components/Viewer/Options/ColorMapList.vue
+++ b/app/components/Viewer/Options/ColorMapList.vue
@@ -55,12 +55,10 @@
if (!preset || !preset.RGBPoints) {
return
}
-
const ctx = canvas.getContext("2d")
const { height, width } = canvas
const lut = vtkColorTransferFunction()
const rgbPoints = preset.RGBPoints
-
for (let pointIdx = 0; pointIdx < rgbPoints.length; pointIdx += 4) {
lut.addRGBPoint(
rgbPoints[pointIdx],
@@ -69,7 +67,6 @@
rgbPoints[pointIdx + THREE],
)
}
-
const table = lut.getUint8Table(
rgbPoints[0],
rgbPoints.at(-LAST_POINT_OFFSET),
@@ -77,7 +74,6 @@
true,
)
const imageData = ctx.createImageData(width, height)
-
for (let xCoord = 0; xCoord < width; xCoord += 1) {
const alpha = table[xCoord * 4 + THREE],
blue = table[xCoord * 4 + 2],
@@ -180,7 +176,7 @@
@@ -202,7 +198,7 @@
diff --git a/app/components/Viewer/Options/ColorMapPicker.vue b/app/components/Viewer/Options/ColorMapPicker.vue
index d70b9eeb..87651175 100644
--- a/app/components/Viewer/Options/ColorMapPicker.vue
+++ b/app/components/Viewer/Options/ColorMapPicker.vue
@@ -120,9 +120,9 @@
watch([lutCanvas, selectedPresetName, () => min, () => max], drawLutCanvas)
watch(
() => modelValue,
- (nv) => {
- if (nv !== selectedPresetName.value) {
- selectedPresetName.value = nv
+ (newValue) => {
+ if (newValue !== selectedPresetName.value) {
+ selectedPresetName.value = newValue
}
},
)
diff --git a/app/components/Viewer/Options/TextureItem.vue b/app/components/Viewer/Options/TextureItem.vue
index c04bf6ea..054e90f4 100644
--- a/app/components/Viewer/Options/TextureItem.vue
+++ b/app/components/Viewer/Options/TextureItem.vue
@@ -37,7 +37,7 @@
}
async function files_uploaded_event(value) {
- if (value.length) {
+ if (value.length > 0) {
await geodeStore.request(
back_schemas.opengeodeweb_back.save_viewable_file,
{
@@ -48,7 +48,7 @@
},
},
{
- response_function: async (response) => {
+ response_function: (response) => {
texture_id.value = response.id
},
},
diff --git a/app/components/Viewer/Options/TexturesSelector.vue b/app/components/Viewer/Options/TexturesSelector.vue
index 7f125f34..31a303cd 100644
--- a/app/components/Viewer/Options/TexturesSelector.vue
+++ b/app/components/Viewer/Options/TexturesSelector.vue
@@ -10,10 +10,10 @@
const internal_textures = ref([])
onMounted(() => {
- if (textures.value !== null) {
- internal_textures.value = textures.value
- } else {
+ if (textures.value === null) {
internal_textures.value = [{ id: "", texture_name: "" }]
+ } else {
+ internal_textures.value = textures.value
}
})
@@ -22,7 +22,7 @@
const filtered = internal_textures.value.filter(
(texture) => texture.texture_name !== "" && texture.id !== "",
)
- if (filtered.length !== 0) {
+ if (filtered.length > 0) {
textures.value = filtered
}
}
diff --git a/app/components/Viewer/Tree/ObjectTree.vue b/app/components/Viewer/Tree/ObjectTree.vue
index 6eeba20f..fbc642e1 100644
--- a/app/components/Viewer/Tree/ObjectTree.vue
+++ b/app/components/Viewer/Tree/ObjectTree.vue
@@ -9,10 +9,6 @@
const treeviewStore = useTreeviewStore()
const emit = defineEmits(["show-menu"])
- function handleTreeMenu({ event, itemId }) {
- emit("show-menu", { event, itemId })
- }
-
function onResizeStart(event) {
const startWidth = treeviewStore.panelWidth
const startX = event.clientX
@@ -60,11 +56,11 @@
diff --git a/app/components/ZScaling.vue b/app/components/ZScaling.vue
index 45d8ef56..b79c020e 100644
--- a/app/components/ZScaling.vue
+++ b/app/components/ZScaling.vue
@@ -5,6 +5,8 @@
const { width } = defineProps({
width: { type: Number, default: 400 },
})
+
+ const emit = defineEmits(["close"])
- Close
- Close
+ Apply
diff --git a/app/composables/project_manager.js b/app/composables/project_manager.js
index 39c7d8ad..120fc82a 100644
--- a/app/composables/project_manager.js
+++ b/app/composables/project_manager.js
@@ -108,5 +108,3 @@ export function useProjectManager() {
return { exportProject, importProjectFile }
}
-
-export default useProjectManager
diff --git a/app/composables/run_function_when_microservices_connected.js b/app/composables/run_function_when_microservices_connected.js
index a261a03a..62ffc49e 100644
--- a/app/composables/run_function_when_microservices_connected.js
+++ b/app/composables/run_function_when_microservices_connected.js
@@ -14,5 +14,3 @@ export function run_function_when_microservices_connected(function_to_run) {
})
}
}
-
-export default run_function_when_microservices_connected
diff --git a/app/stores/data.js b/app/stores/data.js
index aadb08d3..797fc85c 100644
--- a/app/stores/data.js
+++ b/app/stores/data.js
@@ -41,13 +41,15 @@ export const useDataStore = defineStore("data", () => {
Block: "Blocks",
}
- const componentsByType = items.reduce((accumulator, item) => {
+ const componentsByType = {}
+ for (const item of items) {
if (componentTitles[item.type]) {
- if (!accumulator[item.type]) accumulator[item.type] = []
- accumulator[item.type].push(item)
+ if (!componentsByType[item.type]) {
+ componentsByType[item.type] = []
+ }
+ componentsByType[item.type].push(item)
}
- return accumulator
- }, {})
+ }
return Object.keys(componentTitles)
.filter((type) => componentsByType[type])
@@ -123,12 +125,12 @@ export const useDataStore = defineStore("data", () => {
response_function: async (response) => {
const allComponents = [
...response.mesh_components.map(
- ({ boundaries, internals, ...component }) => component,
+ ({ _boundaries, _internals, ...component }) => component,
),
...response.collection_components.map(
- ({ items, ...component }) => component,
+ ({ _items, ...component }) => component,
),
- ].map((component) => ({ ...component, id }))
+ ].map((component) => Object.assign(component, { id }))
await addModelComponents(allComponents)
},
},
diff --git a/app/stores/data_style.js b/app/stores/data_style.js
index 4e2e8aeb..d5e3f537 100644
--- a/app/stores/data_style.js
+++ b/app/stores/data_style.js
@@ -1,9 +1,9 @@
-import { getDefaultStyle } from "@ogw_front/utils/default_styles"
import { database } from "../../internal/database/database.js"
+import { getDefaultStyle } from "@ogw_front/utils/default_styles"
import { useDataStore } from "@ogw_front/stores/data"
import { useDataStyleStateStore } from "../../internal/stores/data_style/state"
-import useMeshStyle from "../../internal/stores/data_style/mesh/index"
-import useModelStyle from "../../internal/stores/data_style/model/index"
+import { useMeshStyle } from "../../internal/stores/data_style/mesh/index"
+import { useModelStyle } from "../../internal/stores/data_style/model/index"
export const useDataStyleStore = defineStore("dataStyle", () => {
const dataStyleState = useDataStyleStateStore()
diff --git a/app/stores/geode.js b/app/stores/geode.js
index 7970713c..87e951f6 100644
--- a/app/stores/geode.js
+++ b/app/stores/geode.js
@@ -1,4 +1,4 @@
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { api_fetch } from "../../internal/utils/api_fetch"
import { appMode } from "@ogw_front/utils/app_mode"
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
diff --git a/app/stores/hybrid_viewer.js b/app/stores/hybrid_viewer.js
index 6ac88356..363d70a7 100644
--- a/app/stores/hybrid_viewer.js
+++ b/app/stores/hybrid_viewer.js
@@ -5,9 +5,8 @@ import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering
import { newInstance as vtkMapper } from "@kitware/vtk.js/Rendering/Core/Mapper"
import { newInstance as vtkXMLPolyDataReader } from "@kitware/vtk.js/IO/XML/XMLPolyDataReader"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { database } from "../../internal/database/database.js"
-import { useDataStore } from "@ogw_front/stores/data"
import { useViewerStore } from "@ogw_front/stores/viewer"
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
@@ -28,7 +27,6 @@ const WHEEL_TIME_OUT_MS = 600
export const useHybridViewerStore = defineStore("hybridViewer", () => {
const viewerStore = useViewerStore()
- const dataStore = useDataStore()
const hybridDb = reactive({})
const status = ref(Status.NOT_CREATED)
const camera_options = reactive({})
diff --git a/app/stores/infra.js b/app/stores/infra.js
index eafb9af8..ed6cea54 100644
--- a/app/stores/infra.js
+++ b/app/stores/infra.js
@@ -1,5 +1,5 @@
import { appMode, getAppMode } from "@ogw_front/utils/app_mode"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { useLambdaStore } from "@ogw_front/stores/lambda"
export const useInfraStore = defineStore("infra", {
diff --git a/app/stores/lambda.js b/app/stores/lambda.js
index 1bcb07cd..d5e59744 100644
--- a/app/stores/lambda.js
+++ b/app/stores/lambda.js
@@ -1,4 +1,4 @@
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { useFeedbackStore } from "@ogw_front/stores/feedback"
export const useLambdaStore = defineStore("lambda", {
diff --git a/app/stores/menu.js b/app/stores/menu.js
index f96bcca2..d3cbd341 100644
--- a/app/stores/menu.js
+++ b/app/stores/menu.js
@@ -21,10 +21,9 @@ import Grid2DEdgesOptions from "@ogw_front/components/Viewer/Grid/2D/EdgesOption
import Grid2DPointsOptions from "@ogw_front/components/Viewer/Grid/2D/PointsOptions"
// Grid 3D components
+import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions"
import Grid3DEdgesOptions from "@ogw_front/components/Viewer/Grid/3D/EdgesOptions"
import Grid3DPointsOptions from "@ogw_front/components/Viewer/Grid/3D/PointsOptions"
-// import Grid3DFacetsOptions from "@ogw_front/components/Viewer/Grid/3D/FacetsOptions"
-import Grid3DCellsOptions from "@ogw_front/components/Viewer/Grid/3D/CellsOptions"
// Solid components
import SolidEdgesOptions from "@ogw_front/components/Viewer/Solid/EdgesOptions"
diff --git a/app/stores/viewer.js b/app/stores/viewer.js
index b70a48ff..967155d4 100644
--- a/app/stores/viewer.js
+++ b/app/stores/viewer.js
@@ -5,7 +5,7 @@ import vtkWSLinkClient, {
import _ from "lodash"
// oxlint-disable-next-line no-unassigned-import
import "@kitware/vtk.js/Rendering/OpenGL/Profiles/Geometry"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { appMode } from "@ogw_front/utils/app_mode"
import schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import { useInfraStore } from "@ogw_front/stores/infra"
@@ -19,7 +19,6 @@ export const useViewerStore = defineStore(
"viewer",
() => {
const infraStore = useInfraStore()
-
const default_local_port = ref("1234")
const client = ref({})
const config = ref(undefined)
@@ -151,6 +150,7 @@ export const useViewerStore = defineStore(
}
async function launch() {
+ status.value = Status.CREATING
console.log("[VIEWER] Launching viewer microservice...")
const port = await globalThis.electronAPI.run_viewer()
console.log("[VIEWER] Viewer launched on port:", port)
diff --git a/app/utils/colormap.js b/app/utils/colormap.js
index da86a7fe..2bac1194 100644
--- a/app/utils/colormap.js
+++ b/app/utils/colormap.js
@@ -1,5 +1,7 @@
import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
-export function getRGBPointsFromPreset(presetName) {
+function getRGBPointsFromPreset(presetName) {
return vtkColorMaps.getPresetByName(presetName).RGBPoints
}
+
+export { getRGBPointsFromPreset }
diff --git a/app/utils/local.js b/app/utils/local.js
index fd3183b2..fb77dbe9 100644
--- a/app/utils/local.js
+++ b/app/utils/local.js
@@ -1,9 +1,9 @@
-import { on, once } from "node:events"
import child_process from "node:child_process"
import fs from "node:fs"
+import { on } from "node:events"
import path from "node:path"
-import { setTimeout } from "timers/promises"
import { rimraf } from "rimraf"
+import { setTimeout } from "node:timers/promises"
// Third party imports
import { WebSocket } from "ws"
@@ -11,7 +11,6 @@ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.jso
import { getPort } from "get-port-please"
import isElectron from "is-electron"
import pTimeout from "p-timeout"
-import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
const MAX_DELETE_FOLDER_RETRIES = 5
const DEFAULT_TIMEOUT_SECONDS = 30
@@ -183,13 +182,16 @@ async function delete_folder_recursive(data_folder_path) {
for (let i = 0; i <= MAX_DELETE_FOLDER_RETRIES; i += 1) {
try {
console.log(`Deleting folder: ${data_folder_path}`)
+ // oxlint-disable-next-line no-await-in-loop
await rimraf(data_folder_path)
console.log(`Deleted folder: ${data_folder_path}`)
return
} catch (error) {
console.error(`Error deleting folder ${data_folder_path}:`, error)
// Wait before retrying
- const DELAY = 1000 * (i + 1)
+ const MILLISECONDS_PER_RETRY = 1000
+ const DELAY = MILLISECONDS_PER_RETRY * (i + 1)
+ // oxlint-disable-next-line no-await-in-loop
await setTimeout(DELAY)
console.log("Retrying delete folder")
}
@@ -218,8 +220,9 @@ function kill_back(back_port) {
function kill_viewer(viewer_port) {
function do_kill() {
+ // oxlint-disable-next-line avoid-new
return new Promise((resolve) => {
- const socket = new WebSocket("ws://localhost:" + viewer_port + "/ws")
+ const socket = new WebSocket(`ws://localhost:${viewer_port}/ws`)
socket.on("open", () => {
console.log("Connected to WebSocket server")
socket.send(
diff --git a/app/utils/status.js b/app/utils/status.js
index 7532411e..f7809d29 100644
--- a/app/utils/status.js
+++ b/app/utils/status.js
@@ -7,4 +7,4 @@ const Status = {
CONNECTED: "CONNECTED",
}
-export default Status
+export { Status }
diff --git a/app/utils/upload_file.js b/app/utils/upload_file.js
index 456a8aed..65ccf14b 100644
--- a/app/utils/upload_file.js
+++ b/app/utils/upload_file.js
@@ -1,7 +1,7 @@
import { useFeedbackStore } from "@ogw_front/stores/feedback"
import { useGeodeStore } from "@ogw_front/stores/geode"
-export async function upload_file(
+async function upload_file(
{ route, file },
{ request_error_function, response_function, response_error_function } = {},
) {
@@ -52,4 +52,4 @@ export async function upload_file(
})
}
-export default upload_file
+export { upload_file }
diff --git a/app/utils/validate_schema.js b/app/utils/validate_schema.js
index 8dce56bc..f68e9c09 100644
--- a/app/utils/validate_schema.js
+++ b/app/utils/validate_schema.js
@@ -1,6 +1,6 @@
import Ajv from "ajv"
-export function validate_schema(schema, body) {
+function validate_schema(schema, body) {
const ajv = new Ajv()
const list_keywords = ["methods", "route", "max_retry", "rpc"]
for (const keyword of list_keywords) {
@@ -10,4 +10,4 @@ export function validate_schema(schema, body) {
return { valid, error: ajv.errorsText() }
}
-export default validate_schema
+export { validate_schema }
diff --git a/internal/database/database.js b/internal/database/database.js
index 11c81856..a1fd0434 100644
--- a/internal/database/database.js
+++ b/internal/database/database.js
@@ -40,7 +40,7 @@ class Database extends Dexie {
(tableName) => currentStores[tableName],
)
- database.close()
+ databaseContainer.instance.close()
if (allExisting) {
const existingDb = new Dexie("Database")
@@ -55,7 +55,7 @@ class Database extends Dexie {
}
}
await existingDb.open()
- database = existingDb
+ databaseContainer.instance = existingDb
} else {
const newDb = new ExtendedDatabase(
currentVersion,
@@ -63,11 +63,24 @@ class Database extends Dexie {
newTables,
)
await newDb.open()
- database = newDb
+ databaseContainer.instance = newDb
}
}
}
-let database = new Database()
+const databaseContainer = { instance: new Database() }
+
+const database = new Proxy(
+ {},
+ {
+ get(target, prop) {
+ const value = databaseContainer.instance[prop]
+ if (typeof value === "function") {
+ return value.bind(databaseContainer.instance)
+ }
+ return value
+ },
+ },
+)
export { Database, database }
diff --git a/internal/stores/data_style/mesh/cells/cell.js b/internal/stores/data_style/mesh/cells/cell.js
index c1fd27a0..40132c77 100644
--- a/internal/stores/data_style/mesh/cells/cell.js
+++ b/internal/stores/data_style/mesh/cells/cell.js
@@ -35,7 +35,7 @@ export function useMeshCellsCellAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshCellsCellAttribute(id).storedConfigs
+ const { storedConfigs } = meshCellsCellAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/cells/vertex.js b/internal/stores/data_style/mesh/cells/vertex.js
index dbb85665..775db33f 100644
--- a/internal/stores/data_style/mesh/cells/vertex.js
+++ b/internal/stores/data_style/mesh/cells/vertex.js
@@ -35,7 +35,7 @@ export function useMeshCellsVertexAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshCellsVertexAttribute(id).storedConfigs
+ const { storedConfigs } = meshCellsVertexAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/edges/edge.js b/internal/stores/data_style/mesh/edges/edge.js
index f4e7aa1a..4f630bd0 100644
--- a/internal/stores/data_style/mesh/edges/edge.js
+++ b/internal/stores/data_style/mesh/edges/edge.js
@@ -19,7 +19,7 @@ export function useMeshEdgesEdgeAttributeStyle() {
}
function meshEdgesEdgeAttributeStoredConfig(id, name) {
- const storedConfigs = meshEdgesEdgeAttribute(id).storedConfigs
+ const { storedConfigs } = meshEdgesEdgeAttribute(id)
if (name in storedConfigs) {
return storedConfigs[name]
}
@@ -35,7 +35,7 @@ export function useMeshEdgesEdgeAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshEdgesEdgeAttribute(id).storedConfigs
+ const { storedConfigs } = meshEdgesEdgeAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/edges/vertex.js b/internal/stores/data_style/mesh/edges/vertex.js
index f32ec35e..1dba58d5 100644
--- a/internal/stores/data_style/mesh/edges/vertex.js
+++ b/internal/stores/data_style/mesh/edges/vertex.js
@@ -35,7 +35,7 @@ export function useMeshEdgesVertexAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshEdgesVertexAttribute(id).storedConfigs
+ const { storedConfigs } = meshEdgesVertexAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/index.js b/internal/stores/data_style/mesh/index.js
index c7e00a24..8af53fcf 100644
--- a/internal/stores/data_style/mesh/index.js
+++ b/internal/stores/data_style/mesh/index.js
@@ -15,7 +15,7 @@ import { useMeshPolyhedraStyle } from "./polyhedra"
// Local constants
const meshSchemas = viewer_schemas.opengeodeweb_viewer.mesh
-export default function useMeshStyle() {
+export function useMeshStyle() {
const hybridViewerStore = useHybridViewerStore()
const viewerStore = useViewerStore()
const dataStyleState = useDataStyleStateStore()
diff --git a/internal/stores/data_style/mesh/points/vertex.js b/internal/stores/data_style/mesh/points/vertex.js
index 854fda78..4c964b9a 100644
--- a/internal/stores/data_style/mesh/points/vertex.js
+++ b/internal/stores/data_style/mesh/points/vertex.js
@@ -35,7 +35,7 @@ export function useMeshPointsVertexAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshPointsVertexAttribute(id).storedConfigs
+ const { storedConfigs } = meshPointsVertexAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/polygons/polygon.js b/internal/stores/data_style/mesh/polygons/polygon.js
index de482105..60deff1b 100644
--- a/internal/stores/data_style/mesh/polygons/polygon.js
+++ b/internal/stores/data_style/mesh/polygons/polygon.js
@@ -35,7 +35,7 @@ export function useMeshPolygonsPolygonAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshPolygonsPolygonAttribute(id).storedConfigs
+ const { storedConfigs } = meshPolygonsPolygonAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/polygons/vertex.js b/internal/stores/data_style/mesh/polygons/vertex.js
index afb0ba02..6c70ffe1 100644
--- a/internal/stores/data_style/mesh/polygons/vertex.js
+++ b/internal/stores/data_style/mesh/polygons/vertex.js
@@ -35,7 +35,7 @@ export function useMeshPolygonsVertexAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshPolygonsVertexAttribute(id).storedConfigs
+ const { storedConfigs } = meshPolygonsVertexAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/polyhedra/polyhedron.js b/internal/stores/data_style/mesh/polyhedra/polyhedron.js
index 20a0e95a..45fea324 100644
--- a/internal/stores/data_style/mesh/polyhedra/polyhedron.js
+++ b/internal/stores/data_style/mesh/polyhedra/polyhedron.js
@@ -35,7 +35,7 @@ export function useMeshPolyhedraPolyhedronAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshPolyhedraPolyhedronAttribute(id).storedConfigs
+ const { storedConfigs } = meshPolyhedraPolyhedronAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/mesh/polyhedra/vertex.js b/internal/stores/data_style/mesh/polyhedra/vertex.js
index d2985935..fa2a49fb 100644
--- a/internal/stores/data_style/mesh/polyhedra/vertex.js
+++ b/internal/stores/data_style/mesh/polyhedra/vertex.js
@@ -35,7 +35,7 @@ export function useMeshPolyhedraVertexAttributeStyle() {
name,
{ minimum, maximum, colorMap },
) {
- const storedConfigs = meshPolyhedraVertexAttribute(id).storedConfigs
+ const { storedConfigs } = meshPolyhedraVertexAttribute(id)
storedConfigs[name] = { minimum, maximum, colorMap }
return storedConfigs[name]
}
diff --git a/internal/stores/data_style/model/index.js b/internal/stores/data_style/model/index.js
index 7651d9b0..5951fb88 100644
--- a/internal/stores/data_style/model/index.js
+++ b/internal/stores/data_style/model/index.js
@@ -16,7 +16,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer"
// Local constants
const model_schemas = viewer_schemas.opengeodeweb_viewer.model
-export default function useModelStyle() {
+export function useModelStyle() {
const dataStore = useDataStore()
const dataStyleStateStore = useDataStyleStateStore()
const modelCornersStyleStore = useModelCornersStyle()
diff --git a/internal/utils/api_fetch.js b/internal/utils/api_fetch.js
index 0955c516..cc7a80eb 100644
--- a/internal/utils/api_fetch.js
+++ b/internal/utils/api_fetch.js
@@ -1,7 +1,7 @@
// oxlint-disable-next-line id-length
import _ from "lodash"
import { useFeedbackStore } from "@ogw_front/stores/feedback"
-import validate_schema from "@ogw_front/utils/validate_schema"
+import { validate_schema } from "@ogw_front/utils/validate_schema"
const ERROR_400 = 400
@@ -74,5 +74,3 @@ export function api_fetch(
},
})
}
-
-export default api_fetch
diff --git a/internal/utils/viewer_call.js b/internal/utils/viewer_call.js
index 632e6169..7ae4abae 100644
--- a/internal/utils/viewer_call.js
+++ b/internal/utils/viewer_call.js
@@ -1,6 +1,6 @@
import pTimeout from "p-timeout"
import { useFeedbackStore } from "@ogw_front/stores/feedback"
-import validate_schema from "@ogw_front/utils/validate_schema"
+import { validate_schema } from "@ogw_front/utils/validate_schema"
const ERROR_400 = 400
@@ -71,5 +71,3 @@ export async function viewer_call(
return await performCall()
}
-
-export default viewer_call
diff --git a/scripts/generate_geode_objects.js b/scripts/generate_geode_objects.js
index c3b2392c..fc178f58 100644
--- a/scripts/generate_geode_objects.js
+++ b/scripts/generate_geode_objects.js
@@ -1,4 +1,3 @@
-// oxlint-disable-next-line id-length
import fs from "node:fs"
import path from "node:path"
import process from "node:process"
diff --git a/tests/integration/microservices/back/requirements.txt b/tests/integration/microservices/back/requirements.txt
index 8cd5bae9..bd3a3ef5 100644
--- a/tests/integration/microservices/back/requirements.txt
+++ b/tests/integration/microservices/back/requirements.txt
@@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
#
-opengeodeweb-back==6.*,>=6.2.0rc2
diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt
index ae4c544e..4d097394 100644
--- a/tests/integration/microservices/viewer/requirements.txt
+++ b/tests/integration/microservices/viewer/requirements.txt
@@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
#
-opengeodeweb-viewer==1.*,>=1.15.4rc1
diff --git a/tests/integration/setup.js b/tests/integration/setup.js
index 4f4827be..2b81cd88 100644
--- a/tests/integration/setup.js
+++ b/tests/integration/setup.js
@@ -16,7 +16,7 @@ import {
run_back,
run_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { appMode } from "@ogw_front/utils/app_mode"
import { importFile } from "@ogw_front/utils/file_import_workflow"
import { setupActivePinia } from "../utils"
@@ -64,11 +64,9 @@ async function runMicroservices() {
async function setupIntegrationTests(file_name, geode_object) {
setupActivePinia()
const viewerStore = useViewerStore()
-
const { back_port, viewer_port, project_folder_path } =
await runMicroservices()
await viewerStore.ws_connect()
-
const id = await importFile(file_name, geode_object)
expect(viewerStore.status).toBe(Status.CONNECTED)
console.log("end of setupIntegrationTests")
diff --git a/tests/integration/stores/data_style/mesh/cells.nuxt.test.js b/tests/integration/stores/data_style/mesh/cells.nuxt.test.js
index c76d20bd..2dc05be3 100644
--- a/tests/integration/stores/data_style/mesh/cells.nuxt.test.js
+++ b/tests/integration/stores/data_style/mesh/cells.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/mesh/edges.nuxt.test.js b/tests/integration/stores/data_style/mesh/edges.nuxt.test.js
index dfc1b215..6b130f49 100644
--- a/tests/integration/stores/data_style/mesh/edges.nuxt.test.js
+++ b/tests/integration/stores/data_style/mesh/edges.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/mesh/index.nuxt.test.js b/tests/integration/stores/data_style/mesh/index.nuxt.test.js
index 2f3283ba..211be639 100644
--- a/tests/integration/stores/data_style/mesh/index.nuxt.test.js
+++ b/tests/integration/stores/data_style/mesh/index.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/mesh/points.nuxt.test.js b/tests/integration/stores/data_style/mesh/points.nuxt.test.js
index d9a3a003..080c1068 100644
--- a/tests/integration/stores/data_style/mesh/points.nuxt.test.js
+++ b/tests/integration/stores/data_style/mesh/points.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js b/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js
index d9c470a1..6e575536 100644
--- a/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js
+++ b/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js b/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js
index 68554808..1c852895 100644
--- a/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js
+++ b/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/model/blocks.nuxt.test.js b/tests/integration/stores/data_style/model/blocks.nuxt.test.js
index 38e725ac..28cb3d7b 100644
--- a/tests/integration/stores/data_style/model/blocks.nuxt.test.js
+++ b/tests/integration/stores/data_style/model/blocks.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStore } from "@ogw_front/stores/data"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
diff --git a/tests/integration/stores/data_style/model/corners.nuxt.test.js b/tests/integration/stores/data_style/model/corners.nuxt.test.js
index 53446779..761f7efc 100644
--- a/tests/integration/stores/data_style/model/corners.nuxt.test.js
+++ b/tests/integration/stores/data_style/model/corners.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStore } from "@ogw_front/stores/data"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
diff --git a/tests/integration/stores/data_style/model/edges.nuxt.test.js b/tests/integration/stores/data_style/model/edges.nuxt.test.js
index a44c535d..9d188e98 100644
--- a/tests/integration/stores/data_style/model/edges.nuxt.test.js
+++ b/tests/integration/stores/data_style/model/edges.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/model/index.nuxt.test.js b/tests/integration/stores/data_style/model/index.nuxt.test.js
index 21df4f81..e5de9700 100644
--- a/tests/integration/stores/data_style/model/index.nuxt.test.js
+++ b/tests/integration/stores/data_style/model/index.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/model/lines.nuxt.test.js b/tests/integration/stores/data_style/model/lines.nuxt.test.js
index 33c90950..5bdfbc93 100644
--- a/tests/integration/stores/data_style/model/lines.nuxt.test.js
+++ b/tests/integration/stores/data_style/model/lines.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStore } from "@ogw_front/stores/data"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
diff --git a/tests/integration/stores/data_style/model/points.nuxt.test.js b/tests/integration/stores/data_style/model/points.nuxt.test.js
index 15c77f50..1760946a 100644
--- a/tests/integration/stores/data_style/model/points.nuxt.test.js
+++ b/tests/integration/stores/data_style/model/points.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/integration/stores/data_style/model/surfaces.nuxt.test.js b/tests/integration/stores/data_style/model/surfaces.nuxt.test.js
index b213e57c..19a124fc 100644
--- a/tests/integration/stores/data_style/model/surfaces.nuxt.test.js
+++ b/tests/integration/stores/data_style/model/surfaces.nuxt.test.js
@@ -8,7 +8,7 @@ import {
kill_back,
kill_viewer,
} from "@ogw_front/utils/local"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupIntegrationTests } from "../../../setup"
import { useDataStore } from "@ogw_front/stores/data"
import { useDataStyleStore } from "@ogw_front/stores/data_style"
@@ -20,30 +20,30 @@ const model_surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces
const file_name = "test.og_brep"
const geode_object = "BRep"
-let back_port = 0,
- id = "",
- project_folder_path = "",
- viewer_port = 0
+describe("model surfaces", () => {
+ let back_port = 0,
+ id = "",
+ project_folder_path = "",
+ viewer_port = 0
-beforeEach(async () => {
- ;({ id, back_port, viewer_port, project_folder_path } =
- await setupIntegrationTests(file_name, geode_object))
-}, INTERVAL_TIMEOUT)
+ beforeEach(async () => {
+ ;({ id, back_port, viewer_port, project_folder_path } =
+ await setupIntegrationTests(file_name, geode_object))
+ }, INTERVAL_TIMEOUT)
-afterEach(async () => {
- console.log(
- "afterEach model surfaces kill",
- back_port,
- viewer_port,
- project_folder_path,
- )
- await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
- delete_folder_recursive(project_folder_path)
-})
+ afterEach(async () => {
+ console.log(
+ "afterEach model surfaces kill",
+ back_port,
+ viewer_port,
+ project_folder_path,
+ )
+ await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
+ delete_folder_recursive(project_folder_path)
+ })
-describe("Model surfaces", () => {
- describe("Surfaces visibility", () => {
- test("Visibility true", async () => {
+ describe("surfaces visibility", () => {
+ test("visibility true", async () => {
const dataStyleStore = useDataStyleStore()
const viewerStore = useViewerStore()
const dataStore = useDataStore()
@@ -78,8 +78,8 @@ describe("Model surfaces", () => {
})
})
- describe("Surfaces color", () => {
- test("Color red", async () => {
+ describe("surfaces color", () => {
+ test("color red", async () => {
const dataStyleStore = useDataStyleStore()
const viewerStore = useViewerStore()
const dataStore = useDataStore()
diff --git a/tests/integration/stores/viewer.nuxt.test.js b/tests/integration/stores/viewer.nuxt.test.js
index c8d50900..1cec5036 100644
--- a/tests/integration/stores/viewer.nuxt.test.js
+++ b/tests/integration/stores/viewer.nuxt.test.js
@@ -9,7 +9,7 @@ import {
runMicroservices,
teardownIntegrationTests,
} from "../../integration/setup"
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupActivePinia } from "../../utils"
import { useViewerStore } from "@ogw_front/stores/viewer"
diff --git a/tests/setup_indexeddb.js b/tests/setup_indexeddb.js
index 7132d02a..364011a9 100644
--- a/tests/setup_indexeddb.js
+++ b/tests/setup_indexeddb.js
@@ -1,4 +1,4 @@
import { setup } from "vitest-indexeddb"
-// eslint-disable-next-line jest/require-hook
+// oxlint-disable-next-line jest/require-hook
setup()
diff --git a/tests/unit/components/CrsSelector.nuxt.test.js b/tests/unit/components/CrsSelector.nuxt.test.js
index 2cf59fa8..23596300 100644
--- a/tests/unit/components/CrsSelector.nuxt.test.js
+++ b/tests/unit/components/CrsSelector.nuxt.test.js
@@ -1,17 +1,17 @@
// Third party imports
-import { mountSuspended } from "@nuxt/test-utils/runtime"
import { beforeEach, describe, expect, test, vi } from "vitest"
+import { mountSuspended } from "@nuxt/test-utils/runtime"
// Local imports
+import { setupActivePinia, vuetify } from "../../utils"
import CrsSelector from "@ogw_front/components/CrsSelector"
import { useGeodeStore } from "@ogw_front/stores/geode"
-import { setupActivePinia, vuetify } from "../../utils"
const EXPECTED_LENGTH = 1
const FIRST_INDEX = 0
-let pinia
-let geodeStore
+let pinia = undefined
+let geodeStore = undefined
beforeEach(() => {
pinia = setupActivePinia()
diff --git a/tests/unit/components/ExtensionSelector.nuxt.test.js b/tests/unit/components/ExtensionSelector.nuxt.test.js
index 4ebe7e93..b00e3c7d 100644
--- a/tests/unit/components/ExtensionSelector.nuxt.test.js
+++ b/tests/unit/components/ExtensionSelector.nuxt.test.js
@@ -1,9 +1,9 @@
// Third party imports
import * as components from "vuetify/components"
-import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
-import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
import { beforeEach, describe, expect, test, vi } from "vitest"
+import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
import { nextTick } from "vue"
+import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
// Local imports
import { setupActivePinia, vuetify } from "../../utils"
diff --git a/tests/unit/components/Launcher.nuxt.test.js b/tests/unit/components/Launcher.nuxt.test.js
index d556ed8a..ec263a3a 100644
--- a/tests/unit/components/Launcher.nuxt.test.js
+++ b/tests/unit/components/Launcher.nuxt.test.js
@@ -5,8 +5,8 @@ import ResizeObserver from "resize-observer-polyfill"
import { flushPromises } from "@vue/test-utils"
import { mountSuspended } from "@nuxt/test-utils/runtime"
-import { useInfraStore } from "@ogw_front/stores/infra"
import { setupActivePinia, vuetify } from "../../utils"
+import { useInfraStore } from "@ogw_front/stores/infra"
// Mock navigator.locks API
const mockLockRequest = vi
diff --git a/tests/unit/composables/ProjectManager.nuxt.test.js b/tests/unit/composables/project_manager.nuxt.test.js
similarity index 80%
rename from tests/unit/composables/ProjectManager.nuxt.test.js
rename to tests/unit/composables/project_manager.nuxt.test.js
index fb15af11..e268bd6d 100644
--- a/tests/unit/composables/ProjectManager.nuxt.test.js
+++ b/tests/unit/composables/project_manager.nuxt.test.js
@@ -135,51 +135,71 @@ const hybridViewerStoreMock = {
// MOCKS
vi.stubGlobal("$fetch", vi.fn().mockResolvedValue({ snapshot: snapshotMock }))
-vi.mock("../../../internal/utils/viewer_call", () => ({
- viewer_call: viewer_call_mock_fn,
-}))
+vi.mock(
+ import("../../../internal/utils/viewer_call", () => ({
+ viewer_call: viewer_call_mock_fn,
+ })),
+)
-vi.mock("@ogw_front/composables/api_fetch", () => ({
- api_fetch: vi.fn(async (_req, options = {}) => {
- const response = {
- _data: new Blob(["zipcontent"], { type: "application/zip" }),
- headers: {
- get: (k) => (k === "new-file-name" ? "project_123.vease" : undefined),
- },
- }
- if (options.response_function) {
- await options.response_function(response)
- }
- return response
- }),
-}))
-vi.mock("js-file-download", () => ({ default: vi.fn() }))
-vi.mock("@ogw_front/stores/infra", () => ({
- useInfraStore: () => infraStoreMock,
-}))
-vi.mock("@ogw_front/stores/viewer", () => ({
- useViewerStore: () => viewerStoreMock,
-}))
-vi.mock("@ogw_front/stores/treeview", () => ({
- useTreeviewStore: () => treeviewStoreMock,
-}))
-vi.mock("@ogw_front/stores/data", () => ({
- useDataStore: () => dataStoreMock,
-}))
-vi.mock("@ogw_front/stores/data_style", () => ({
- useDataStyleStore: () => dataStyleStoreMock,
-}))
-vi.mock("@ogw_front/stores/hybrid_viewer", () => ({
- useHybridViewerStore: () => hybridViewerStoreMock,
-}))
-vi.mock("@ogw_front/stores/geode", () => ({
- useGeodeStore: () => geodeStoreMock,
-}))
-vi.mock("@ogw_front/stores/app", () => ({
- useAppStore: () => ({
- exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
- }),
-}))
+vi.mock(
+ import("@ogw_front/composables/api_fetch", () => ({
+ api_fetch: vi.fn(async (_req, options = {}) => {
+ const response = {
+ _data: new Blob(["zipcontent"], { type: "application/zip" }),
+ headers: {
+ get: (k) => (k === "new-file-name" ? "project_123.vease" : undefined),
+ },
+ }
+ if (options.response_function) {
+ await options.response_function(response)
+ }
+ return response
+ }),
+ })),
+)
+vi.mock(import("js-file-download", () => ({ default: vi.fn() })))
+vi.mock(
+ import("@ogw_front/stores/infra", () => ({
+ useInfraStore: () => infraStoreMock,
+ })),
+)
+vi.mock(
+ import("@ogw_front/stores/viewer", () => ({
+ useViewerStore: () => viewerStoreMock,
+ })),
+)
+vi.mock(
+ import("@ogw_front/stores/treeview", () => ({
+ useTreeviewStore: () => treeviewStoreMock,
+ })),
+)
+vi.mock(
+ import("@ogw_front/stores/data", () => ({
+ useDataStore: () => dataStoreMock,
+ })),
+)
+vi.mock(
+ import("@ogw_front/stores/data_style", () => ({
+ useDataStyleStore: () => dataStyleStoreMock,
+ })),
+)
+vi.mock(
+ import("@ogw_front/stores/hybrid_viewer", () => ({
+ useHybridViewerStore: () => hybridViewerStoreMock,
+ })),
+)
+vi.mock(
+ import("@ogw_front/stores/geode", () => ({
+ useGeodeStore: () => geodeStoreMock,
+ })),
+)
+vi.mock(
+ import("@ogw_front/stores/app", () => ({
+ useAppStore: () => ({
+ exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
+ }),
+ })),
+)
vi.stubGlobal("useAppStore", () => ({
exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
@@ -242,7 +262,6 @@ function verifyRemaining() {
beforeEach(() => {
setupActivePinia()
- // reset spies
const storesList = [
viewerStoreMock,
treeviewStoreMock,
diff --git a/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js b/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js
index 6b04c237..9879c9ed 100644
--- a/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js
+++ b/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js
@@ -1,19 +1,19 @@
// Third party imports
-import { flushPromises } from "@vue/test-utils"
import { beforeEach, describe, expect, test, vi } from "vitest"
+import { flushPromises } from "@vue/test-utils"
// Local imports
+import { Status } from "@ogw_front/utils/status"
import { run_function_when_microservices_connected } from "@ogw_front/composables/run_function_when_microservices_connected"
import { setupActivePinia } from "../../utils"
-import Status from "@ogw_front/utils/status"
import { useGeodeStore } from "@ogw_front/stores/geode"
import { useInfraStore } from "@ogw_front/stores/infra"
import { useViewerStore } from "@ogw_front/stores/viewer"
const dumb_obj = { dumb_method: () => true }
-let infraStore
-let geodeStore
-let viewerStore
+let infraStore = undefined
+let geodeStore = undefined
+let viewerStore = undefined
beforeEach(() => {
setupActivePinia()
diff --git a/tests/unit/composables/upload_file.nuxt.test.js b/tests/unit/composables/upload_file.nuxt.test.js
index 0e2a8775..cfa97d63 100644
--- a/tests/unit/composables/upload_file.nuxt.test.js
+++ b/tests/unit/composables/upload_file.nuxt.test.js
@@ -5,7 +5,7 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
// Local imports
import { setupActivePinia } from "../../utils"
-import upload_file from "@ogw_front/utils/upload_file"
+import { upload_file } from "@ogw_front/utils/upload_file"
import { useFeedbackStore } from "@ogw_front/stores/feedback"
import { useGeodeStore } from "@ogw_front/stores/geode"
diff --git a/tests/unit/plugins/project_load.nuxt.test.js b/tests/unit/plugins/project_load.nuxt.test.js
index 2510f1c6..0f5d5d09 100644
--- a/tests/unit/plugins/project_load.nuxt.test.js
+++ b/tests/unit/plugins/project_load.nuxt.test.js
@@ -13,22 +13,26 @@ const PANEL_WIDTH = 320
const Z_SCALE = 1.5
const STORES_SLICE_START = 1
-vi.mock("../../../internal/utils/viewer_call", () => ({
- viewer_call: vi.fn(async () => {
- await Promise.resolve()
- }),
-}))
-vi.mock("../../../app/stores/hybrid_viewer", () => ({
- useHybridViewerStore: () => ({
- $id: "hybridViewer",
- initHybridViewer: vi.fn(),
- clear: vi.fn(),
- addItem: vi.fn(),
- setZScaling: vi.fn(),
- save: vi.fn(),
- load: vi.fn(),
- }),
-}))
+vi.mock(
+ import("../../../internal/utils/viewer_call", () => ({
+ viewer_call: vi.fn(async () => {
+ await Promise.resolve()
+ }),
+ })),
+)
+vi.mock(
+ import("../../../app/stores/hybrid_viewer", () => ({
+ useHybridViewerStore: () => ({
+ $id: "hybridViewer",
+ initHybridViewer: vi.fn(),
+ clear: vi.fn(),
+ addItem: vi.fn(),
+ setZScaling: vi.fn(),
+ save: vi.fn(),
+ load: vi.fn(),
+ }),
+ })),
+)
beforeEach(() => {
setupActivePinia()
diff --git a/tests/unit/stores/App.nuxt.test.js b/tests/unit/stores/app.nuxt.test.js
similarity index 98%
rename from tests/unit/stores/App.nuxt.test.js
rename to tests/unit/stores/app.nuxt.test.js
index 823cc68c..00586aea 100644
--- a/tests/unit/stores/App.nuxt.test.js
+++ b/tests/unit/stores/app.nuxt.test.js
@@ -1,6 +1,4 @@
import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
-import { createTestingPinia } from "@pinia/testing"
-import { setActivePinia } from "pinia"
import { useAppStore } from "@ogw_front/stores/app"
diff --git a/tests/unit/stores/Feedback.nuxt.test.js b/tests/unit/stores/feedback.nuxt.test.js
similarity index 93%
rename from tests/unit/stores/Feedback.nuxt.test.js
rename to tests/unit/stores/feedback.nuxt.test.js
index 8158ad9b..45b77739 100644
--- a/tests/unit/stores/Feedback.nuxt.test.js
+++ b/tests/unit/stores/feedback.nuxt.test.js
@@ -5,6 +5,9 @@ import { beforeEach, describe, expect, expectTypeOf, test } from "vitest"
import { setupActivePinia } from "../../utils"
import { useFeedbackStore } from "@ogw_front/stores/feedback"
+const ERROR_500 = 500
+const MILISECONDS_TIMEOUT = 1000
+
beforeEach(() => {
setupActivePinia()
})
@@ -23,7 +26,7 @@ describe("Feedback Store", () => {
test("test add_error", () => {
const feedbackStore = useFeedbackStore()
feedbackStore.add_error(
- 500,
+ ERROR_500,
"/test",
"test message",
"test description",
@@ -36,7 +39,7 @@ describe("Feedback Store", () => {
const feedbackStore = useFeedbackStore()
feedbackStore.feedbacks_timeout_miliseconds = 500
feedbackStore.add_error(
- 500,
+ ERROR_500,
"/test",
"test message",
"test description",
@@ -44,7 +47,7 @@ describe("Feedback Store", () => {
expect(feedbackStore.feedbacks).toHaveLength(1)
setTimeout(() => {
expect(feedbackStore.feedbacks).toHaveLength(0)
- }, 1000)
+ }, MILISECONDS_TIMEOUT)
})
})
@@ -58,7 +61,7 @@ describe("Feedback Store", () => {
setTimeout(() => {
expect(feedbackStore.feedbacks).toHaveLength(0)
- }, 1000)
+ }, MILISECONDS_TIMEOUT)
})
})
diff --git a/tests/unit/stores/Geode.nuxt.test.js b/tests/unit/stores/geode.nuxt.test.js
similarity index 99%
rename from tests/unit/stores/Geode.nuxt.test.js
rename to tests/unit/stores/geode.nuxt.test.js
index 46c6d90a..78bfdf1e 100644
--- a/tests/unit/stores/Geode.nuxt.test.js
+++ b/tests/unit/stores/geode.nuxt.test.js
@@ -1,12 +1,12 @@
// Third party imports
+import { describe, expect, expectTypeOf, test, vi } from "vitest"
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
import { registerEndpoint } from "@nuxt/test-utils/runtime"
-import { describe, expect, expectTypeOf, test, vi } from "vitest"
// Local imports
+import { Status } from "@ogw_front/utils/status"
import { appMode } from "@ogw_front/utils/app_mode"
import { setupActivePinia } from "../../utils"
-import Status from "@ogw_front/utils/status"
import { useGeodeStore } from "@ogw_front/stores/geode"
import { useInfraStore } from "@ogw_front/stores/infra"
diff --git a/tests/unit/stores/Infra.nuxt.test.js b/tests/unit/stores/infra.nuxt.test.js
similarity index 99%
rename from tests/unit/stores/Infra.nuxt.test.js
rename to tests/unit/stores/infra.nuxt.test.js
index c4c48273..7ffe6830 100644
--- a/tests/unit/stores/Infra.nuxt.test.js
+++ b/tests/unit/stores/infra.nuxt.test.js
@@ -3,7 +3,7 @@ import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
import { registerEndpoint } from "@nuxt/test-utils/runtime"
// Local imports
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { appMode } from "@ogw_front/utils/app_mode"
import { setupActivePinia } from "../../utils"
import { useGeodeStore } from "@ogw_front/stores/geode"
diff --git a/tests/unit/stores/Lambda.nuxt.test.js b/tests/unit/stores/lambda.nuxt.test.js
similarity index 98%
rename from tests/unit/stores/Lambda.nuxt.test.js
rename to tests/unit/stores/lambda.nuxt.test.js
index ffe936cc..106690a6 100644
--- a/tests/unit/stores/Lambda.nuxt.test.js
+++ b/tests/unit/stores/lambda.nuxt.test.js
@@ -3,7 +3,7 @@ import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
import { registerEndpoint } from "@nuxt/test-utils/runtime"
// Local imports
-import Status from "@ogw_front/utils/status"
+import { Status } from "@ogw_front/utils/status"
import { setupActivePinia } from "../../utils"
import { useFeedbackStore } from "@ogw_front/stores/feedback"
import { useLambdaStore } from "@ogw_front/stores/lambda"
diff --git a/tests/unit/stores/Treeview.nuxt.test.js b/tests/unit/stores/treeview.nuxt.test.js
similarity index 100%
rename from tests/unit/stores/Treeview.nuxt.test.js
rename to tests/unit/stores/treeview.nuxt.test.js
diff --git a/tests/unit/stores/Viewer.nuxt.test.js b/tests/unit/stores/viewer.nuxt.test.js
similarity index 100%
rename from tests/unit/stores/Viewer.nuxt.test.js
rename to tests/unit/stores/viewer.nuxt.test.js
diff --git a/tests/unit/utils/validate_schema.nuxt.test.js b/tests/unit/utils/validate_schema.nuxt.test.js
index 3c619f3f..475e9837 100644
--- a/tests/unit/utils/validate_schema.nuxt.test.js
+++ b/tests/unit/utils/validate_schema.nuxt.test.js
@@ -2,7 +2,7 @@
import { describe, expect, test } from "vitest"
// Local imports
-import validate_schema from "@ogw_front/utils/validate_schema"
+import { validate_schema } from "@ogw_front/utils/validate_schema"
// CONSTANTS
const MIN_0 = 0
diff --git a/tests/vitest.config.js b/tests/vitest.config.js
index 674af6e4..3d4e0120 100644
--- a/tests/vitest.config.js
+++ b/tests/vitest.config.js
@@ -7,16 +7,16 @@ const DEFAULT_RETRY = 0
const globalRetry = process.env.CI ? RETRIES : DEFAULT_RETRY
-// eslint-disable-next-line import/no-default-export
+// oxlint-disable-next-line import/no-default-export
export default defineConfig({
test: {
- globals: true,
+ globals: false,
setupFiles: [path.resolve(__dirname, "./setup_indexeddb.js")],
projects: [
await defineVitestProject({
test: {
name: "unit",
- globals: true,
+ globals: false,
include: ["tests/unit/**/*.test.js"],
environment: "nuxt",
setupFiles: [path.resolve(__dirname, "./setup_indexeddb.js")],
@@ -31,7 +31,7 @@ export default defineConfig({
await defineVitestProject({
test: {
name: "integration",
- globals: true,
+ globals: false,
include: ["tests/integration/**/*.test.js"],
environment: "nuxt",
fileParallelism: false,
diff --git a/vuetify_config.js b/vuetify_config.js
index 7eb78d56..9d7a1e59 100644
--- a/vuetify_config.js
+++ b/vuetify_config.js
@@ -19,4 +19,4 @@ const vuetify = {
},
}
-export default vuetify
+export { vuetify }