Skip to content

Conversation

@MaxNumerique
Copy link
Contributor

…persistence

create project manager plugin for import/export operations update tests for new functionality and async loading

…persistence

create project manager plugin for import/export operations
update tests for new functionality and async loading
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quel est l'objectif de ce plug-in, c'est pas déjà le rôle de l'app store?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour moi l'app_store ne fait que de la gestion d'état sans créer de fichier ni réseau. Il permet de créer un snapshot avec le save() sous forme d'objet.
Le plugin utilise les méthode de l'appStore pour transformer le snapshot en JSON et créé un Blob, enfin lance un téléchargement pour le save.

Pour moi, le plugin utilise app_store comme moteur de snapshot et ne réimplémente pas le save & load

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je crois que je comprends, dans l'idée il faudrait :
exporter : compresser l'état de Project_folder_path et lui passer aussi le snapshot pour restaurer le style, etc. et ziper le tout
importer : recoit le zip, remplace le project_folder actuel et utilise aussi le snapshot qui sera utilisé par les stores dans le Front

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un plug-in de pinia, c'est globalement l'idée d'ajouter une fonctionalité à tous les stores ou certains. Là, ce que tu veux ajouter ces pas vraiment en line avec pinia et les stores mais plutôt une action spécifique de l'app store. Qui en effet est un peu plus complexe que juste l'app store, ta question est pertinente.

Peut-être qu'il faut mettre la logique de ton plug-in dans un composable qui utiliserait l'app store et le geode store ? @JulienChampagnol qu'en penses tu ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je vais voir pour porter project_manager en tant que composable et non en tant que plugin Pinia et en même temps utiliser le store geode.js

@MaxNumerique MaxNumerique changed the title feat(save_and_load): add save/load methods to all stores for project … feat(save_and_load): add import/export methods to all stores for project … Oct 30, 2025
@MaxNumerique MaxNumerique changed the title feat(save_and_load): add import/export methods to all stores for project … feat(save_and_load): add import/export methods Oct 30, 2025
@MaxNumerique MaxNumerique requested a review from BotellaA October 30, 2025 15:40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JulienChampagnol que penses tu de cette proposition ?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
1


reported by reviewdog 🐶
2

JSON.stringify(snapshot.treeview, null, 2),


reported by reviewdog 🐶
2

JSON.stringify(snapshot.dataStyle, null, 2),


reported by reviewdog 🐶
2

JSON.stringify(stores.treeview.items, null, 2),


reported by reviewdog 🐶
2

JSON.stringify(stores.dataStyle.styles, null, 2),


reported by reviewdog 🐶
1

expect(stores.treeview.items.length).toBe(1)


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { useDataStyleStore } from "@/stores/data_style.js"


reported by reviewdog 🐶
File has too many dependencies (13). Maximum allowed is 10.

import { useDataStyleStore } from "@/stores/data_style.js"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("app.importStores restores stores", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("Project import", () => {


reported by reviewdog 🐶
Suggest using toHaveLength().

expect(stores.treeview.items.length).toBe(1)


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed

test("app.importStores restores stores", async () => {


reported by reviewdog 🐶
Expected catch or return

default: vi.fn(() => Promise.resolve({})),


reported by reviewdog 🐶
Expected catch or return

viewer_call: vi.fn(() => Promise.resolve({})),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

default: vi.fn(() => Promise.resolve({})),


reported by reviewdog 🐶
Prefer await to then()/catch()/finally()

viewer_call: vi.fn(() => Promise.resolve({})),


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use Array#forEach

.forEach((store) => stores.app.registerStore(store))


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

JSON.stringify(snapshot.treeview, null, 2),


reported by reviewdog 🐶
Do not use null literals

JSON.stringify(snapshot.dataStyle, null, 2),


reported by reviewdog 🐶
Do not use null literals

JSON.stringify(stores.treeview.items, null, 2),


reported by reviewdog 🐶
Do not use null literals

JSON.stringify(stores.dataStyle.styles, null, 2),


reported by reviewdog 🐶
Identifier name is too short (< 2).

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Unexpected empty function


reported by reviewdog 🐶
Unexpected empty function

vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {})


reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
Async function has no 'await' expression.

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Test has no assertions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infra_store.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(app_store.importStores).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable", () => {


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
0

if (!block_ids || block_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Expected { after 'if' condition.

if (ids.includes(child.id)) rebuilt.push(child)


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

function finalizeImportSelection() {


reported by reviewdog 🐶
Identifier name is too short (< 2).

selectionIds: selection.value.map((c) => c.id),


reported by reviewdog 🐶
Identifier name is too short (< 2).

(snapshot?.selection || []).map((c) => c.id) ||


reported by reviewdog 🐶
300

panelWidth.value = snapshot?.panelWidth || 300


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

snapshot?.isAdditionnalTreeDisplayed || false


reported by reviewdog 🐶
Optional chaining is not allowed.

panelWidth.value = snapshot?.panelWidth || 300


reported by reviewdog 🐶
Optional chaining is not allowed.

model_id.value = snapshot?.model_id || ""


reported by reviewdog 🐶
Optional chaining is not allowed.

isTreeCollection.value = snapshot?.isTreeCollection || false


reported by reviewdog 🐶
Optional chaining is not allowed.

selectedTree.value = snapshot?.selectedTree || null


reported by reviewdog 🐶
Optional chaining is not allowed.

snapshot?.selectionIds ||


reported by reviewdog 🐶
Optional chaining is not allowed.

(snapshot?.selection || []).map((c) => c.id) ||


reported by reviewdog 🐶
Do not use null literals

selectedTree.value = snapshot?.selectedTree || null


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!item) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await registerObject(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await addItem(id, item)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem start", {


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> treeview.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem start", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!item) continue


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

binary_light_viewable: item?.vtk_js?.binary_light_viewable,


reported by reviewdog 🐶
Optional chaining is not allowed.

Object.keys(snapshot?.db || {}),


reported by reviewdog 🐶
Optional chaining is not allowed.

for (const [id, item] of Object.entries(snapshot?.db || {})) {


reported by reviewdog 🐶
Expected { after 'for-of'.

delete dataStyleState.styles[id]


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!style || !objectType) continue


reported by reviewdog 🐶
Expected a function expression.

function setModelEdgesVisibility(id, visibility) {


reported by reviewdog 🐶
Expected a function expression.

function modelEdgesVisibility(id) {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Unexpected await inside a loop.

await meshStyleStore.applyMeshStyle(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await modelStyleStore.applyModelStyle(id)


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[DataStyle] setVisibility skipped: unknown id", id)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!style || !objectType) continue


reported by reviewdog 🐶
Use Object destructuring.

const object_type = meta.object_type


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { defineStore } from "pinia"


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Optional chaining is not allowed.

const stylesSnapshot = snapshot?.styles || {}


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null)


reported by reviewdog 🐶
The function has too many lines (62). Maximum allowed is 50.


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
1

expect(app_store.stores[1].$id).toBe("geodeStore")


reported by reviewdog 🐶
1

expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(mock_store_2.exportStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(userStore.importStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(geodeStore.importStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(mock_store_1.importStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
Enforce test and it usage conventions

test("export stores with exportStores method", () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("skip stores without exportSave method", () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("App Store > actions > importStores > import stores with importStores method", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("skip stores without importStores method", () => {


reported by reviewdog 🐶
Enforce lowercase test names


reported by reviewdog 🐶
Enforce lowercase test names

test("App Store > actions > importStores > import stores with importStores method", async () => {


reported by reviewdog 🐶
async is not allowed

test("App Store > actions > importStores > import stores with importStores method", async () => {


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.exportStores) continue


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.importStores) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await store.importStores(snapshot[storeId])


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error exporting store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[AppStore] import called with invalid snapshot")


reported by reviewdog 🐶
Unexpected console statement.

console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {}))


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error importing store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(`[AppStore] Imported ${importedCount} stores`)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.exportStores) continue


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.importStores) continue


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
0

if (!corner_ids || corner_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {

import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import fileDownload from "js-file-download"

export function useProjectManager() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

const geode = useGeodeStore()
const appStore = useAppStore()

async function exportProject() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

}
}

async function importProjectFile(file) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

await api_fetch(
{ schema, params: { snapshot, filename: defaultName } },
{
response_function: async (response) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Async function has no 'await' expression.

@@ -0,0 +1,88 @@
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import fileDownload from "js-file-download"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Imports should be sorted alphabetically.

)
})

describe("Project import", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
The function has too many lines (67). Maximum allowed is 50.

})

describe("Project import", () => {
test("app.importStores restores stores", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
The async function has too many lines (65). Maximum allowed is 50.

hybridViewer: { zScale: 1.5 },
}

console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

}

console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot))
console.log(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

"[TEST ProjectImport] treeview snapshot:",
JSON.stringify(snapshot.treeview, null, 2),
)
console.log(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Expected { after 'if' condition.

if (ids.includes(child.id)) rebuilt.push(child)


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

function finalizeImportSelection() {


reported by reviewdog 🐶
Identifier name is too short (< 2).

selectionIds: selection.value.map((c) => c.id),


reported by reviewdog 🐶
Identifier name is too short (< 2).

(snapshot?.selection || []).map((c) => c.id) ||


reported by reviewdog 🐶
300

panelWidth.value = snapshot?.panelWidth || 300


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

snapshot?.isAdditionnalTreeDisplayed || false


reported by reviewdog 🐶
Optional chaining is not allowed.

panelWidth.value = snapshot?.panelWidth || 300


reported by reviewdog 🐶
Optional chaining is not allowed.

model_id.value = snapshot?.model_id || ""


reported by reviewdog 🐶
Optional chaining is not allowed.

isTreeCollection.value = snapshot?.isTreeCollection || false


reported by reviewdog 🐶
Optional chaining is not allowed.

selectedTree.value = snapshot?.selectedTree || null


reported by reviewdog 🐶
Optional chaining is not allowed.

snapshot?.selectionIds ||


reported by reviewdog 🐶
Optional chaining is not allowed.

(snapshot?.selection || []).map((c) => c.id) ||


reported by reviewdog 🐶
Do not use null literals

selectedTree.value = snapshot?.selectedTree || null


reported by reviewdog 🐶
Identifier name is too short (< 2).

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Unexpected empty function


reported by reviewdog 🐶
Unexpected empty function

vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {})


reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
Async function has no 'await' expression.

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Test has no assertions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infra_store.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(app_store.importStores).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable", () => {


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
The function has too many lines (62). Maximum allowed is 50.


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
Unexpected empty function

importStores: vi.fn().mockImplementation(() => {}),


reported by reviewdog 🐶
1

expect(app_store.stores[1].$id).toBe("geodeStore")


reported by reviewdog 🐶
1

expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(mock_store_2.exportStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(userStore.importStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(geodeStore.importStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
1

expect(mock_store_1.importStores).toHaveBeenCalledTimes(1)


reported by reviewdog 🐶
Enforce test and it usage conventions

test("export stores with exportStores method", () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("skip stores without exportSave method", () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("App Store > actions > importStores > import stores with importStores method", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("skip stores without importStores method", () => {


reported by reviewdog 🐶
Enforce lowercase test names


reported by reviewdog 🐶
Enforce lowercase test names

test("App Store > actions > importStores > import stores with importStores method", async () => {


reported by reviewdog 🐶
async is not allowed

test("App Store > actions > importStores > import stores with importStores method", async () => {


reported by reviewdog 🐶
0

if (!block_ids || block_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Expected { after 'for-of'.

delete dataStyleState.styles[id]


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!style || !objectType) continue


reported by reviewdog 🐶
Expected a function expression.

function setModelEdgesVisibility(id, visibility) {


reported by reviewdog 🐶
Expected a function expression.

function modelEdgesVisibility(id) {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Unexpected await inside a loop.

await meshStyleStore.applyMeshStyle(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await modelStyleStore.applyModelStyle(id)


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[DataStyle] setVisibility skipped: unknown id", id)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!style || !objectType) continue


reported by reviewdog 🐶
Use Object destructuring.

const object_type = meta.object_type


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { defineStore } from "pinia"


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Optional chaining is not allowed.

const stylesSnapshot = snapshot?.styles || {}


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null)


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.exportStores) continue


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.importStores) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await store.importStores(snapshot[storeId])


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error exporting store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[AppStore] import called with invalid snapshot")


reported by reviewdog 🐶
Unexpected console statement.

console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {}))


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error importing store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(`[AppStore] Imported ${importedCount} stores`)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.exportStores) continue


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.importStores) continue


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
0

if (!corner_ids || corner_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!item) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await registerObject(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await addItem(id, item)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem start", {


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> treeview.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem start", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!item) continue


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

binary_light_viewable: item?.vtk_js?.binary_light_viewable,


reported by reviewdog 🐶
Optional chaining is not allowed.

Object.keys(snapshot?.db || {}),


reported by reviewdog 🐶
Optional chaining is not allowed.

for (const [id, item] of Object.entries(snapshot?.db || {})) {


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {


await stores.app.importStores(snapshot)

console.log(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

"[TEST ProjectImport] Treeview items after import:",
JSON.stringify(stores.treeview.items, null, 2),
)
console.log(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

hybrid: useHybridViewerStore(),
}
Object.values(stores)
.slice(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
1

console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot))
console.log(
"[TEST ProjectImport] treeview snapshot:",
JSON.stringify(snapshot.treeview, null, 2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
2

)
console.log(
"[TEST ProjectImport] dataStyle snapshot:",
JSON.stringify(snapshot.dataStyle, null, 2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
2

panelWidth: 320,
model_id: "",
isTreeCollection: false,
selectedTree: null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot))
console.log(
"[TEST ProjectImport] treeview snapshot:",
JSON.stringify(snapshot.treeview, null, 2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

)
console.log(
"[TEST ProjectImport] dataStyle snapshot:",
JSON.stringify(snapshot.dataStyle, null, 2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals


console.log(
"[TEST ProjectImport] Treeview items after import:",
JSON.stringify(stores.treeview.items, null, 2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

)
console.log(
"[TEST ProjectImport] Styles after import:",
JSON.stringify(stores.dataStyle.styles, null, 2),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Do not use null literals

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Optional chaining is not allowed.

snapshot?.isAdditionnalTreeDisplayed || false


reported by reviewdog 🐶
Optional chaining is not allowed.

panelWidth.value = snapshot?.panelWidth || 300


reported by reviewdog 🐶
Optional chaining is not allowed.

model_id.value = snapshot?.model_id || ""


reported by reviewdog 🐶
Optional chaining is not allowed.

isTreeCollection.value = snapshot?.isTreeCollection || false


reported by reviewdog 🐶
Optional chaining is not allowed.

selectedTree.value = snapshot?.selectedTree || null


reported by reviewdog 🐶
Optional chaining is not allowed.

snapshot?.selectionIds ||


reported by reviewdog 🐶
Optional chaining is not allowed.

(snapshot?.selection || []).map((c) => c.id) ||


reported by reviewdog 🐶
Do not use null literals

selectedTree.value = snapshot?.selectedTree || null


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unnecessary 'else' after 'return'.

return modelEdgesStyleStore.setModelEdgesVisibility(id, visibility)


reported by reviewdog 🐶
Expected { after 'for-of'.

delete dataStyleState.styles[id]


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!style || !objectType) continue


reported by reviewdog 🐶
Expected a function expression.

function setModelEdgesVisibility(id, visibility) {


reported by reviewdog 🐶
Expected a function expression.

function modelEdgesVisibility(id) {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Unexpected await inside a loop.

await meshStyleStore.applyMeshStyle(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await modelStyleStore.applyModelStyle(id)


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[DataStyle] setVisibility skipped: unknown id", id)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!style || !objectType) continue


reported by reviewdog 🐶
Use Object destructuring.

const object_type = meta.object_type


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { defineStore } from "pinia"


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Optional chaining is not allowed.

const stylesSnapshot = snapshot?.styles || {}


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
0

if (!block_ids || block_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Identifier name is too short (< 2).

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Unexpected empty function


reported by reviewdog 🐶
Unexpected empty function

vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {})


reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
Async function has no 'await' expression.

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Test has no assertions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infra_store.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(app_store.importStores).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable", () => {


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
0

if (!corner_ids || corner_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.exportStores) continue


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.importStores) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await store.importStores(snapshot[storeId])


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error exporting store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[AppStore] import called with invalid snapshot")


reported by reviewdog 🐶
Unexpected console statement.

console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {}))


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error importing store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(`[AppStore] Imported ${importedCount} stores`)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.exportStores) continue


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.importStores) continue


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!item) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await registerObject(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await addItem(id, item)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem start", {


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> treeview.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem start", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!item) continue


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

binary_light_viewable: item?.vtk_js?.binary_light_viewable,


reported by reviewdog 🐶
Optional chaining is not allowed.

Object.keys(snapshot?.db || {}),


reported by reviewdog 🐶
Optional chaining is not allowed.

for (const [id, item] of Object.entries(snapshot?.db || {})) {


describe("save", () => {
test("save stores with save method", () => {
describe("Export", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
The function has too many lines (62). Maximum allowed is 50.

email: "[email protected]",
})),
load: vi.fn().mockImplementation(() => {}),
importStores: vi.fn().mockImplementation(() => {}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected empty function

exportStores: vi
.fn()
.mockImplementation(() => ({ items: [], total: 0 })),
importStores: vi.fn().mockImplementation(() => {}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected empty function

save: vi.fn().mockImplementation(() => ({ data: "test" })),
load: vi.fn().mockImplementation(() => {}),
exportStores: vi.fn().mockImplementation(() => ({ data: "test" })),
importStores: vi.fn().mockImplementation(() => {}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected empty function

const mock_store_2 = {
$id: "withoutSave",
load: vi.fn().mockImplementation(() => {}),
importStores: vi.fn().mockImplementation(() => {}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected empty function

test("load stores with load method", () => {
const app_store = useAppStore()
const mock_store_1 = {
test("App Store > actions > importStores > import stores with importStores method", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce test and it usage conventions

})

test("skip stores without load method", () => {
test("skip stores without importStores method", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce test and it usage conventions


describe("save", () => {
test("save stores with save method", () => {
describe("Export", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce lowercase test names

test("load stores with load method", () => {
const app_store = useAppStore()
const mock_store_1 = {
test("App Store > actions > importStores > import stores with importStores method", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce lowercase test names

test("load stores with load method", () => {
const app_store = useAppStore()
const mock_store_1 = {
test("App Store > actions > importStores > import stores with importStores method", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
async is not allowed

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Optional chaining is not allowed.

(snapshot?.selection || []).map((c) => c.id) ||


reported by reviewdog 🐶
Do not use null literals

selectedTree.value = snapshot?.selectedTree || null


reported by reviewdog 🐶
Unnecessary 'else' after 'return'.

return modelEdgesStyleStore.setModelEdgesVisibility(id, visibility)


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
0

if (!block_ids || block_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Identifier name is too short (< 2).

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Unexpected empty function


reported by reviewdog 🐶
Unexpected empty function

vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {})


reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
Async function has no 'await' expression.

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Test has no assertions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infra_store.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(app_store.importStores).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable", () => {


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
0

if (!corner_ids || corner_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.exportStores) continue


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!store.importStores) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await store.importStores(snapshot[storeId])


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error exporting store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[AppStore] import called with invalid snapshot")


reported by reviewdog 🐶
Unexpected console statement.

console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {}))


reported by reviewdog 🐶
Unexpected console statement.

console.error(`[AppStore] Error importing store "${storeId}":`, error)


reported by reviewdog 🐶
Unexpected console statement.

console.log(`[AppStore] Imported ${importedCount} stores`)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.exportStores) continue


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!store.importStores) continue


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected { after 'for-of'.

delete dataStyleState.styles[id]


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!style || !objectType) continue


reported by reviewdog 🐶
Expected a function expression.

function setModelEdgesVisibility(id, visibility) {


reported by reviewdog 🐶
Expected a function expression.

function modelEdgesVisibility(id) {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Unexpected await inside a loop.

await meshStyleStore.applyMeshStyle(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await modelStyleStore.applyModelStyle(id)


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[DataStyle] setVisibility skipped: unknown id", id)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!style || !objectType) continue


reported by reviewdog 🐶
Use Object destructuring.

const object_type = meta.object_type


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { defineStore } from "pinia"


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Optional chaining is not allowed.

const stylesSnapshot = snapshot?.styles || {}


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!item) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await registerObject(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await addItem(id, item)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem start", {


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> treeview.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem start", id)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem -> hybridViewer.addItem done", id)


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!item) continue


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

binary_light_viewable: item?.vtk_js?.binary_light_viewable,


reported by reviewdog 🐶
Optional chaining is not allowed.

Object.keys(snapshot?.db || {}),


reported by reviewdog 🐶
Optional chaining is not allowed.

for (const [id, item] of Object.entries(snapshot?.db || {})) {

import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
import fileDownload from "js-file-download"

export function useProjectManager() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
The function useProjectManager has too many lines (87). Maximum allowed is 50.

}
}

async function importProjectFile(file) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
The async function importProjectFile has too many lines (56). Maximum allowed is 50.

return { exportProject, importProjectFile }
}

export default useProjectManager
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Prefer named exports


const schemaImport = back_schemas.opengeodeweb_back.import_project
const form = new FormData()
form.append("file", file, file?.name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

method: "POST",
body: form,
})
const snapshot = result?.snapshot ?? {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

async function importStores(snapshot) {
isAdditionnalTreeDisplayed.value =
snapshot?.isAdditionnalTreeDisplayed || false
panelWidth.value = snapshot?.panelWidth || 300
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

isAdditionnalTreeDisplayed.value =
snapshot?.isAdditionnalTreeDisplayed || false
panelWidth.value = snapshot?.panelWidth || 300
model_id.value = snapshot?.model_id || ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

snapshot?.isAdditionnalTreeDisplayed || false
panelWidth.value = snapshot?.panelWidth || 300
model_id.value = snapshot?.model_id || ""
isTreeCollection.value = snapshot?.isTreeCollection || false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

panelWidth.value = snapshot?.panelWidth || 300
model_id.value = snapshot?.model_id || ""
isTreeCollection.value = snapshot?.isTreeCollection || false
selectedTree.value = snapshot?.selectedTree || null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

selectedTree.value = snapshot?.selectedTree || null

pendingSelectionIds.value =
snapshot?.selectionIds ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!item) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await registerObject(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await addItem(id, item)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem start", {


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!item) continue


reported by reviewdog 🐶
Variable 'treeviewStore' is declared but never used. Unused variables should start with a '_'.

const treeviewStore = useTreeviewStore()


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

binary_light_viewable: item?.vtk_js?.binary_light_viewable,


reported by reviewdog 🐶
Optional chaining is not allowed.

Object.keys(snapshot?.db || {}),


reported by reviewdog 🐶
Optional chaining is not allowed.

for (const [id, item] of Object.entries(snapshot?.db || {})) {


reported by reviewdog 🐶
Expected { after 'for-of'.

delete dataStyleState.styles[id]


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!style || !objectType) continue


reported by reviewdog 🐶
Expected a function expression.

function setModelEdgesVisibility(id, visibility) {


reported by reviewdog 🐶
Expected a function expression.

function modelEdgesVisibility(id) {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Unexpected await inside a loop.

await meshStyleStore.applyMeshStyle(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await modelStyleStore.applyModelStyle(id)


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[DataStyle] setVisibility skipped: unknown id", id)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!style || !objectType) continue


reported by reviewdog 🐶
Use Object destructuring.

const object_type = meta.object_type


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { defineStore } from "pinia"


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Optional chaining is not allowed.

const stylesSnapshot = snapshot?.styles || {}


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
0

if (!block_ids || block_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Identifier name is too short (< 2).

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Unexpected empty function


reported by reviewdog 🐶
Unexpected empty function

vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {})


reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
Async function has no 'await' expression.

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Test has no assertions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infra_store.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(app_store.importStores).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable", () => {


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {

for (const { filename, geode_object } of files) {
console.log({ filename }, { geode_object })
promise_array.push(importFile(filename, geode_object))
const id = await importFile(filename, geode_object)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

} = data._value

console.log("data._value", data._value)
console.log("[importFile] response", {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

console.log("[importFile] response", {
id,
geode_object,
input_file: data._value?.input_file,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

visibility,
)
} else if (component_type === "Edge") {
return modelEdgesStyleStore.setModelEdgesVisibility(id, visibility)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unnecessary 'else' after 'return'.


function applyMeshStyle(id) {
const style = dataStyleStore.getStyle(id)
console.log(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

console.warn("[AppStore] import called with invalid snapshot")
return
}
console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

importedCount++
} catch (error) {
console.error(`[AppStore] Error loading store "${storeId}":`, error)
console.error(`[AppStore] Error importing store "${storeId}":`, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

}

console.log(`[AppStore] Loaded ${loadedCount} stores`)
console.log(`[AppStore] Imported ${importedCount} stores`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected console statement.

if (!store.save) {
continue
}
if (!store.exportStores) continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected use of continue statement.

continue
}

if (!store.importStores) continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected use of continue statement.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Unexpected empty function

vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {})


reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
Async function has no 'await' expression.

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Test has no assertions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infra_store.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(app_store.importStores).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable", () => {


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!item) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await registerObject(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await addItem(id, item)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem start", {


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!item) continue


reported by reviewdog 🐶
Variable 'treeviewStore' is declared but never used. Unused variables should start with a '_'.

const treeviewStore = useTreeviewStore()


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

binary_light_viewable: item?.vtk_js?.binary_light_viewable,


reported by reviewdog 🐶
Optional chaining is not allowed.

Object.keys(snapshot?.db || {}),


reported by reviewdog 🐶
Optional chaining is not allowed.

for (const [id, item] of Object.entries(snapshot?.db || {})) {


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {

}

export { importFile, importWorkflow }
async function importWorkflowFromSnapshot(items) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

vtk_js,
} = item

await dataBaseStore.registerObject(id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

} = item

await dataBaseStore.registerObject(id)
await dataBaseStore.addItem(id, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

vtk_js,
})

await treeviewStore.addItem(geode_object, displayed_name, id, object_type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

})

await treeviewStore.addItem(geode_object, displayed_name, id, object_type)
await hybridViewerStore.addItem(id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

}

const promises = []
if (typeof style?.visibility === "boolean") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {
promises.push(setModelBlocksVisibility(id, block_ids, style.visibility))
}
if (style?.color) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Optional chaining is not allowed.

import useDataStyleState from "../internal_stores/data_style_state.js"
import useMeshStyle from "../internal_stores/mesh/index.js"
import useModelStyle from "../internal_stores/model/index.js"
import { defineStore } from "pinia"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Imports should be sorted alphabetically.

const response = {
_data: new Blob(["zipcontent"], { type: "application/zip" }),
headers: {
get: (k) => (k === "new-file-name" ? "project_123.zip" : null),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Identifier name is too short (< 2).

test("exportProject triggers download", async () => {
const clickSpy = vi
.spyOn(HTMLAnchorElement.prototype, "click")
.mockImplementation(() => {})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected empty function

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
Optional chaining is not allowed.

const stylesSnapshot = snapshot?.styles || {}


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
Unexpected nested ternary expression without parentheses.

: payloadOrId?.visible != null


reported by reviewdog 🐶
Do not use null literals

: payloadOrId?.visible != null


reported by reviewdog 🐶
Do not use null literals


reported by reviewdog 🐶
Do not use null literals

return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null)


reported by reviewdog 🐶
Unexpected empty function

vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {})


reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.


reported by reviewdog 🐶
Async function has no 'await' expression.

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
Async function has no 'await' expression.

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Imports should be sorted alphabetically.

import { createTestingPinia } from "@pinia/testing"


reported by reviewdog 🐶
Enforce test and it usage conventions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Enforce test and it usage conventions

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Test has no assertions

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
Do not use setup or teardown hooks


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(infra_store.create_connection).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(viewer_call).toHaveBeenCalled()


reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

expect(app_store.importStores).toHaveBeenCalled()


reported by reviewdog 🐶
Enforce lowercase test names

describe("ProjectManager composable", () => {


reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!item) continue


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Unexpected await inside a loop.

await registerObject(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await addItem(id, item)


reported by reviewdog 🐶
Unexpected console statement.

console.log("[DataBase] addItem start", {


reported by reviewdog 🐶
Unexpected console statement.


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!item) continue


reported by reviewdog 🐶
Variable 'treeviewStore' is declared but never used. Unused variables should start with a '_'.

const treeviewStore = useTreeviewStore()


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

binary_light_viewable: item?.vtk_js?.binary_light_viewable,


reported by reviewdog 🐶
Optional chaining is not allowed.

Object.keys(snapshot?.db || {}),


reported by reviewdog 🐶
Optional chaining is not allowed.

for (const [id, item] of Object.entries(snapshot?.db || {})) {


reported by reviewdog 🐶
0

if (!surface_ids || surface_ids.length === 0) {


reported by reviewdog 🐶
Optional chaining is not allowed.

if (typeof style?.visibility === "boolean") {


reported by reviewdog 🐶
Optional chaining is not allowed.


reported by reviewdog 🐶
Expected { after 'if' condition.

if (cam.focal_point) camera.setFocalPoint(...cam.focal_point)


reported by reviewdog 🐶
Expected { after 'if' condition.

if (cam.view_up) camera.setViewUp(...cam.view_up)


reported by reviewdog 🐶
Expected { after 'if' condition.

if (cam.position) camera.setPosition(...cam.position)


reported by reviewdog 🐶
Expected { after 'if' condition.

if (cam.clipping_range) camera.setClippingRange(...cam.clipping_range)


reported by reviewdog 🐶
Expected { after 'if' condition.

if (typeof camera.modified === "function") camera.modified()


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected !== and instead saw !=

} else if (cam.view_angle != null) {


reported by reviewdog 🐶
Expected !== and instead saw !=

if (cam.roll != null && typeof camera.setRoll === "function") {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
The async function importStores has too many lines (60). Maximum allowed is 50.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

} else if (cam.view_angle != null) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (cam.roll != null && typeof camera.setRoll === "function") {


reported by reviewdog 🐶
0

Object.keys(camera_options).length > 0


reported by reviewdog 🐶
Unexpected use of undefined


reported by reviewdog 🐶
Unexpected use of undefined


reported by reviewdog 🐶
Unexpected use of undefined


reported by reviewdog 🐶
Unexpected use of undefined


reported by reviewdog 🐶
Unexpected use of undefined

cam.parallel_projection !== undefined &&


reported by reviewdog 🐶
Unexpected use of undefined

cam.parallel_scale !== undefined &&


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Optional chaining is not allowed.

const cam = snapshot?.camera_options


reported by reviewdog 🐶
Optional chaining is not allowed.

const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.update_camera


reported by reviewdog 🐶
object spread property are not allowed.

? { ...camera_options }


reported by reviewdog 🐶
Avoid creating new promises

await new Promise((resolve) => requestAnimationFrame(resolve))


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {


reported by reviewdog 🐶
Do not use null literals

} else if (cam.view_angle != null) {


reported by reviewdog 🐶
Do not use null literals

if (cam.roll != null && typeof camera.setRoll === "function") {


reported by reviewdog 🐶
Do not use useless undefined.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit


reported by reviewdog 🐶
async is not allowed


reported by reviewdog 🐶
async is not allowed

api_fetch: vi.fn(async (_req, options = {}) => {


reported by reviewdog 🐶
async is not allowed

vi.fn(async () => ({ snapshot: {} })),


reported by reviewdog 🐶
async is not allowed

test("exportProject triggers download", async () => {


reported by reviewdog 🐶
async is not allowed

test("importProjectFile loads snapshot", async () => {


reported by reviewdog 🐶
Filename should be in snake case

import { beforeEach, describe, expect, test, vi } from "vitest"


reported by reviewdog 🐶
Do not use null literals

get: (k) => (k === "new-file-name" ? "project_123.zip" : null),


reported by reviewdog 🐶
Unary operator '++' used.

exportCount++


reported by reviewdog 🐶
Unary operator '++' used.

importedCount++


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected { after 'for-of'.

delete dataStyleState.styles[id]


reported by reviewdog 🐶
Expected { after 'if' condition.

if (!style || !objectType) continue


reported by reviewdog 🐶
Expected a function expression.

function setModelEdgesVisibility(id, visibility) {


reported by reviewdog 🐶
Expected a function expression.

function modelEdgesVisibility(id) {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Expected a function expression.

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Unexpected await inside a loop.

await meshStyleStore.applyMeshStyle(id)


reported by reviewdog 🐶
Unexpected await inside a loop.

await modelStyleStore.applyModelStyle(id)


reported by reviewdog 🐶
Unexpected console statement.

console.warn("[DataStyle] setVisibility skipped: unknown id", id)


reported by reviewdog 🐶
Unexpected use of continue statement.

if (!style || !objectType) continue


reported by reviewdog 🐶
Use Object destructuring.

const object_type = meta.object_type


reported by reviewdog 🐶
Async function has no 'await' expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
async is not allowed

async function applyAllStylesFromState() {


reported by reviewdog 🐶
Optional chaining is not allowed.

const stylesSnapshot = snapshot?.styles || {}


reported by reviewdog 🐶
Optional chaining is not allowed.

const objectType = meta?.object_type


reported by reviewdog 🐶
Expected !== and instead saw !=

if (z_scale != null) {


reported by reviewdog 🐶
Expected a function expression.

function clear() {


reported by reviewdog 🐶
Expected a function expression.

function exportStores() {


reported by reviewdog 🐶
Expected a function expression.

async function importStores(snapshot) {


reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.

if (z_scale != null) {


reported by reviewdog 🐶
async is not allowed

async function importStores(snapshot) {


reported by reviewdog 🐶
Optional chaining is not allowed.

const z_scale = snapshot?.zScale


reported by reviewdog 🐶
Do not use Array#forEach

actors.forEach((actor) => renderer.removeActor(actor))


reported by reviewdog 🐶
Do not use Array#forEach

Object.keys(db).forEach((id) => delete db[id])


reported by reviewdog 🐶
Do not use null literals

if (z_scale != null) {

function exportStores() {
const snapshotDb = {}
for (const [id, item] of Object.entries(db)) {
if (!item) continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected { after 'if' condition.

)
}

function exportStores() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

return { db: snapshotDb }
}

async function importStores(snapshot) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Expected a function expression.

Object.keys(snapshot?.db || {}),
)
for (const [id, item] of Object.entries(snapshot?.db || {})) {
await registerObject(id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

)
for (const [id, item] of Object.entries(snapshot?.db || {})) {
await registerObject(id)
await addItem(id, item)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Unexpected await inside a loop.

const app_store = useAppStore()
const { viewer_call } = await import("@/composables/viewer_call.js")

expect(infra_store.create_connection).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

const { viewer_call } = await import("@/composables/viewer_call.js")

expect(infra_store.create_connection).toHaveBeenCalled()
expect(viewer_call).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().


expect(infra_store.create_connection).toHaveBeenCalled()
expect(viewer_call).toHaveBeenCalled()
expect(app_store.importStores).toHaveBeenCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().

useDataBaseStore: () => ({ items: {} }),
}))

describe("ProjectManager composable", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Enforce lowercase test names

viewer_call: vi.fn(),
}))

beforeEach(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants