-
Notifications
You must be signed in to change notification settings - Fork 2
feat(save_and_load): add import/export methods #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
…persistence create project manager plugin for import/export operations update tests for new functionality and async loading
…ns/OpenGeodeWeb-Front into feat/save_and_load
…b-Front into feat/save_and_load
plugins/project_manager.js
Outdated
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this comment.
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 ?
There was a problem hiding this 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 a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 7d392c0
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in 7d392c0
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 71 in 7d392c0
| await meshStyleStore.applyMeshStyle(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 73 in 7d392c0
| await modelStyleStore.applyModelStyle(id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in 7d392c0
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in 7d392c0
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in 7d392c0
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 7d392c0
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 7d392c0
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in 7d392c0
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in 7d392c0
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 67 in 7d392c0
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 236 in 7d392c0
| if (cam.focal_point) camera.setFocalPoint(cam.focal_point) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 237 in 7d392c0
| if (cam.view_up) camera.setViewUp(cam.view_up) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 238 in 7d392c0
| if (cam.position) camera.setPosition(cam.position) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 239 in 7d392c0
| if (cam.view_angle != null) camera.setViewAngle(cam.view_angle) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 240 in 7d392c0
| if (cam.clipping_range) camera.setClippingRange(cam.clipping_range) |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 227 in 7d392c0
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 239 in 7d392c0
| if (cam.view_angle != null) camera.setViewAngle(cam.view_angle) |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in 7d392c0
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 209 in 7d392c0
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 225 in 7d392c0
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Require for-in loops to include an if statement
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 249 in 7d392c0
| for (const key in cam) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 227 in 7d392c0
| if (z_scale != null) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 239 in 7d392c0
| if (cam.view_angle != null) camera.setViewAngle(cam.view_angle) |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 225 in 7d392c0
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 210 in 7d392c0
| const renderer = genericRenderWindow.value?.getRenderer?.() |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 211 in 7d392c0
| const camera = renderer?.getActiveCamera?.() |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 226 in 7d392c0
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 231 in 7d392c0
| const cam = snapshot?.camera_options |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 204 in 7d392c0
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in 7d392c0
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 227 in 7d392c0
| if (z_scale != null) { |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 239 in 7d392c0
| if (cam.view_angle != null) camera.setViewAngle(cam.view_angle) |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 214 in 7d392c0
| focal_point: Array.from(camera.getFocalPoint()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 215 in 7d392c0
| view_up: Array.from(camera.getViewUp()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 216 in 7d392c0
| position: Array.from(camera.getPosition()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 218 in 7d392c0
| clipping_range: Array.from(camera.getClippingRange()), |
| } | ||
|
|
||
| export { importFile, importWorkflow } | ||
| async function importWorkflowFromSnapshot(items) { |
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| export { importFile, importWorkflow } | ||
| async function importWorkflowFromSnapshot(items) { |
There was a problem hiding this comment.
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
| viewer_call: vi.fn(), | ||
| })) | ||
|
|
||
| beforeEach(async () => { |
There was a problem hiding this comment.
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
| }, | ||
| })) | ||
| vi.mock("@/composables/api_fetch.js", () => ({ | ||
| api_fetch: vi.fn(async (_req, options = {}) => { |
There was a problem hiding this comment.
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
| })) | ||
| vi.stubGlobal( | ||
| "$fetch", | ||
| vi.fn(async () => ({ snapshot: {} })), |
There was a problem hiding this comment.
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
| @@ -0,0 +1,129 @@ | |||
| import { beforeEach, describe, expect, test, vi } from "vitest" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Filename should be in snake case
| const response = { | ||
| _data: new Blob(["zipcontent"], { type: "application/zip" }), | ||
| headers: { | ||
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
There was a problem hiding this comment.
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
| snapshot[storeId] = store.save() | ||
| savedCount++ | ||
| snapshot[storeId] = store.exportStores() | ||
| exportCount++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unary operator '++' used.
| store.load(snapshot[storeId]) | ||
| loadedCount++ | ||
| await store.importStores(snapshot[storeId]) | ||
| importedCount++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unary operator '++' used.
| } | ||
|
|
||
| function load(snapshot) { | ||
| async function importStores(snapshot) { |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in a1725f8
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in a1725f8
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in a1725f8
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in a1725f8
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in a1725f8
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in a1725f8
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in a1725f8
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 67 in a1725f8
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Expected { after 'if' condition.
| if (status.value !== Status.NOT_CREATED) return |
reported by reviewdog 🐶
Expected { after 'if' condition.
| if (is_moving.value) return |
reported by reviewdog 🐶
Expected { after 'if' condition.
| if (!schema) return |
reported by reviewdog 🐶
Expected === and instead saw ==
| if (event.button == 0) { |
reported by reviewdog 🐶
Expected a function expression.
| async function initHybridViewer() { |
reported by reviewdog 🐶
Expected a function expression.
| async function addItem(id) { |
reported by reviewdog 🐶
Expected a function expression.
| async function setVisibility(id, visibility) { |
reported by reviewdog 🐶
Expected a function expression.
| async function setZScaling(z_scale) { |
reported by reviewdog 🐶
Expected a function expression.
| function syncRemoteCamera() { |
reported by reviewdog 🐶
Expected a function expression.
| function remoteRender() { |
reported by reviewdog 🐶
Expected a function expression.
| function setContainer(container) { |
reported by reviewdog 🐶
Expected a function expression.
| async function resize(width, height) { |
reported by reviewdog 🐶
Require for-in loops to include an if statement
| for (const key in params.camera_options) { |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| viewStream.onImageReady((e) => { |
reported by reviewdog 🐶
Variable 'viewStream' should be initialized on declaration.
| let viewStream |
reported by reviewdog 🐶
The function has too many lines (205). Maximum allowed is 50.
| export const useHybridViewerStore = defineStore("hybridViewer", () => { |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("hybridViewerStore.addItem", { value }) |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("syncRemoteCamera") |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("setContainer", container.value.$el) |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("onPressed") |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("onReleased") |
reported by reviewdog 🐶
1.0
| const zScale = ref(1.0) |
reported by reviewdog 🐶
180
| background: [180 / 255, 180 / 255, 180 / 255], |
reported by reviewdog 🐶
255
| background: [180 / 255, 180 / 255, 180 / 255], |
reported by reviewdog 🐶
180
| background: [180 / 255, 180 / 255, 180 / 255], |
reported by reviewdog 🐶
255
| background: [180 / 255, 180 / 255, 180 / 255], |
reported by reviewdog 🐶
180
| background: [180 / 255, 180 / 255, 180 / 255], |
reported by reviewdog 🐶
255
| background: [180 / 255, 180 / 255, 180 / 255], |
reported by reviewdog 🐶
0
| const polydata = reader.getOutputData(0) |
reported by reviewdog 🐶
20
| actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255) |
reported by reviewdog 🐶
255
| actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255) |
reported by reviewdog 🐶
20
| actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255) |
reported by reviewdog 🐶
255
| actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255) |
reported by reviewdog 🐶
20
| actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255) |
reported by reviewdog 🐶
255
| actor.getProperty().setColor(20 / 255, 20 / 255, 20 / 255) |
reported by reviewdog 🐶
0
| actor.setScale(scale[0], scale[1], z_scale) |
reported by reviewdog 🐶
1
| actor.setScale(scale[0], scale[1], z_scale) |
reported by reviewdog 🐶
0
| if (event.button == 0) { |
reported by reviewdog 🐶
600
| }, 600) |
reported by reviewdog 🐶
Async function has no 'await' expression.
| async function setVisibility(id, visibility) { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import vtkMapper from "@kitware/vtk.js/Rendering/Core/Mapper" |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import vtkActor from "@kitware/vtk.js/Rendering/Core/Actor" |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import Status from "@ogw_f/utils/status.js" |
reported by reviewdog 🐶
Named exports are not allowed.
| export const useHybridViewerStore = defineStore("hybridViewer", () => { |
reported by reviewdog 🐶
Imported module should be assigned
| import "@kitware/vtk.js/Rendering/Profiles/Geometry" |
reported by reviewdog 🐶
Prefer default export on a file with single export.
| export const useHybridViewerStore = defineStore("hybridViewer", () => { |
reported by reviewdog 🐶
async is not allowed
| async function initHybridViewer() { |
reported by reviewdog 🐶
async is not allowed
| async function addItem(id) { |
reported by reviewdog 🐶
async is not allowed
| async function setVisibility(id, visibility) { |
reported by reviewdog 🐶
async is not allowed
| async function setZScaling(z_scale) { |
reported by reviewdog 🐶
async is not allowed
| async function resize(width, height) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.set_z_scaling |
reported by reviewdog 🐶
Do not use Array#forEach
| actors.forEach((actor) => { |
reported by reviewdog 🐶
Do not use null literals
| let gridActor = null |
reported by reviewdog 🐶
Do not use null literals
| let wheelEventEndTimeout = null |
reported by reviewdog 🐶
Don't use a zero fraction in the number.
| const zScale = ref(1.0) |
| return new Promise((resolve, reject) => { | ||
| if (!client) { | ||
| reject() | ||
| if (!client?.getConnection) { |
There was a problem hiding this comment.
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.
…b-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this 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 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 125 in 933cb71
| const n = a.map((x) => Number(x)) |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 126 in 933cb71
| return n.every((x) => Number.isFinite(x)) ? n : null |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 127 in 933cb71
| } catch (_) { |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 218 in 933cb71
| w: container.value?.$el?.offsetWidth, |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 219 in 933cb71
| h: container.value?.$el?.offsetHeight, |
reported by reviewdog 🐶
The async function importStores has too many lines (76). Maximum allowed is 50.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 334 in 933cb71
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("[hybrid_viewer] initHybridViewer: status", status.value) |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("[hybrid_viewer] ws_connect done") |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("[hybrid_viewer] viewStream created (-1)") |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("[hybrid_viewer] onImageReady", { |
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
| console.log("[hybrid_viewer] addItem render done") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 133 in 933cb71
| console.log("[hybrid_viewer] syncRemoteCamera") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 145 in 933cb71
| console.log("[hybrid_viewer] camera raw", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 176 in 933cb71
| console.log("[hybrid_viewer] camera normalized", normalized) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 180 in 933cb71
| console.warn( |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 188 in 933cb71
| console.log("[hybrid_viewer] viewer.update_camera request", params) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 197 in 933cb71
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 208 in 933cb71
| console.log("[hybrid_viewer] viewer.render request") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 215 in 933cb71
| console.log("[hybrid_viewer] setContainer attach", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 227 in 933cb71
| console.log("[hybrid_viewer] bgImage style before", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 240 in 933cb71
| console.log("[hybrid_viewer] onPressed", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 248 in 933cb71
| console.log("[hybrid_viewer] onPressed applied", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 255 in 933cb71
| console.log("[hybrid_viewer] onReleased", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 262 in 933cb71
| console.log("[hybrid_viewer] onReleased -> syncRemoteCamera") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 271 in 933cb71
| console.log("[hybrid_viewer] wheel", { bg_opacity: imageStyle.opacity }) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 275 in 933cb71
| console.log("[hybrid_viewer] wheel end -> syncRemoteCamera") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 288 in 933cb71
| console.log("[hybrid_viewer] resize", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 304 in 933cb71
| console.log("[hybrid_viewer] resize applied", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 342 in 933cb71
| console.log("[hybrid_viewer] importStores snapshot camera", cam) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 354 in 933cb71
| console.log("[hybrid_viewer] importStores normalized camera", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 364 in 933cb71
| console.warn( |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 379 in 933cb71
| console.log("[hybrid_viewer] importStores -> viewer.update_camera", { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 336 in 933cb71
| if (z_scale != null) { |
reported by reviewdog 🐶
3
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 163 in 933cb71
| const fp = toNumArray(raw.focal_point, 3) |
reported by reviewdog 🐶
3
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 164 in 933cb71
| const vu = toNumArray(raw.view_up, 3) |
reported by reviewdog 🐶
3
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 165 in 933cb71
| const pos = toNumArray(raw.position, 3) |
reported by reviewdog 🐶
2
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 166 in 933cb71
| const cr = toNumArray(raw.clipping_range, 2) |
reported by reviewdog 🐶
3
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 346 in 933cb71
| const fp = toNumArray(cam.focal_point, 3) |
reported by reviewdog 🐶
3
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 347 in 933cb71
| const vu = toNumArray(cam.view_up, 3) |
reported by reviewdog 🐶
3
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 348 in 933cb71
| const pos = toNumArray(cam.position, 3) |
reported by reviewdog 🐶
2
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 349 in 933cb71
| const cr = toNumArray(cam.clipping_range, 2) |
reported by reviewdog 🐶
Catch parameter '_' is caught but never used.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 127 in 933cb71
| } catch (_) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 334 in 933cb71
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| image: typeof e?.image, |
reported by reviewdog 🐶
Optional chaining is not allowed.
| polydata?.getBounds?.(), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 216 in 933cb71
| el: container.value?.$el, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 218 in 933cb71
| w: container.value?.$el?.offsetWidth, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 219 in 933cb71
| h: container.value?.$el?.offsetHeight, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 319 in 933cb71
| const renderer = genericRenderWindow.value?.getRenderer?.() |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 320 in 933cb71
| const camera = renderer?.getActiveCamera?.() |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 335 in 933cb71
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 340 in 933cb71
| const cam = snapshot?.camera_options |
reported by reviewdog 🐶
Function toNumArray does not capture any variables from its parent scope
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 121 in 933cb71
| function toNumArray(arrLike, expectedLen) { |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 313 in 933cb71
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 315 in 933cb71
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 124 in 933cb71
| if (a.length !== expectedLen) return null |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 126 in 933cb71
| return n.every((x) => Number.isFinite(x)) ? n : null |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 128 in 933cb71
| return null |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 336 in 933cb71
| if (z_scale != null) { |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 123 in 933cb71
| const a = Array.from(arrLike ?? []) |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 323 in 933cb71
| focal_point: Array.from(camera.getFocalPoint()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 324 in 933cb71
| view_up: Array.from(camera.getViewUp()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 325 in 933cb71
| position: Array.from(camera.getPosition()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 327 in 933cb71
| clipping_range: Array.from(camera.getClippingRange()), |
reported by reviewdog 🐶
The function is equivalent to Number. Call Number directly.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 125 in 933cb71
| const n = a.map((x) => Number(x)) |
reported by reviewdog 🐶
Prefer omitting the catch binding parameter if it is unused
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 127 in 933cb71
| } catch (_) { |
| } | ||
|
|
||
| export { importFile, importWorkflow } | ||
| async function importWorkflowFromSnapshot(items) { |
There was a problem hiding this comment.
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 importWorkflowFromSnapshot has too many lines (69). Maximum allowed is 50.
| displayed_name: item.displayed_name, | ||
| }) | ||
|
|
||
| await dataBaseStore.registerObject(item.id) |
There was a problem hiding this comment.
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 dataBaseStore.registerObject(item.id) | ||
| console.log("[importWorkflowFromSnapshot] registerObject ok", item.id) | ||
|
|
||
| await dataBaseStore.addItem(item.id, { |
There was a problem hiding this comment.
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.
| }) | ||
| console.log("[importWorkflowFromSnapshot] addItem ok", item.id) | ||
|
|
||
| await treeviewStore.addItem( |
There was a problem hiding this comment.
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.
| ) | ||
| console.log("[importWorkflowFromSnapshot] treeview.addItem ok", item.id) | ||
|
|
||
| await hybridViewerStore.addItem(item.id) |
There was a problem hiding this comment.
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 dataStyleStore.applyDefaultStyle(item.id) | ||
| console.log( |
There was a problem hiding this comment.
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.
| ids.push(item.id) | ||
| } | ||
| hybridViewerStore.remoteRender() | ||
| console.log("[importWorkflowFromSnapshot] remoteRender called") |
There was a problem hiding this comment.
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.
| } | ||
| hybridViewerStore.remoteRender() | ||
| console.log("[importWorkflowFromSnapshot] remoteRender called") | ||
| console.log("[importWorkflowFromSnapshot] done", { ids }) |
There was a problem hiding this comment.
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.
| return ids | ||
| } | ||
|
|
||
| export { importFile, importWorkflow, importWorkflowFromSnapshot } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Named exports are not allowed.
|
|
||
| export { importFile, importWorkflow } | ||
| async function importWorkflowFromSnapshot(items) { | ||
| console.log("[importWorkflowFromSnapshot] start", { count: items?.length }) |
There was a problem hiding this comment.
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.
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this 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.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 240 in 28abd57
| const renderer = genericRenderWindow.value?.getRenderer?.() |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 241 in 28abd57
| const camera = renderer?.getActiveCamera?.() |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 256 in 28abd57
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 261 in 28abd57
| const cam = snapshot?.camera_options |
reported by reviewdog 🐶
Function sanitizeCameraOptions does not capture any variables from its parent scope
| function sanitizeCameraOptions(opts) { |
reported by reviewdog 🐶
Function toNums does not capture any variables from its parent scope
| function sanitizeCameraOptions(opts) { |
reported by reviewdog 🐶
Function logCameraOptions does not capture any variables from its parent scope
| function logCameraOptions(label, opts) { |
reported by reviewdog 🐶
Function types does not capture any variables from its parent scope
| function logCameraOptions(label, opts) { |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 234 in 28abd57
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 236 in 28abd57
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
| if (!opts) return null |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 257 in 28abd57
| if (z_scale != null) { |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
| Array.from(arr || []) |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
| const types = (arr) => Array.from(arr || []).map((v) => typeof v) |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 244 in 28abd57
| focal_point: Array.from(camera.getFocalPoint()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 245 in 28abd57
| view_up: Array.from(camera.getViewUp()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 246 in 28abd57
| position: Array.from(camera.getPosition()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 248 in 28abd57
| clipping_range: Array.from(camera.getClippingRange()), |
reported by reviewdog 🐶
The function is equivalent to Number. Call Number directly.
| .map((n) => Number(n)) |
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this 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 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 213 in e6d2c43
| view_up: Array.from(camera.getViewUp()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 214 in e6d2c43
| position: Array.from(camera.getPosition()), |
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 216 in e6d2c43
| clipping_range: Array.from(camera.getClippingRange()), |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in e6d2c43
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 136 in e6d2c43
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 154 in e6d2c43
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 167 in e6d2c43
| function clear() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 162 in e6d2c43
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 163 in e6d2c43
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 157 in e6d2c43
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in e6d2c43
| if (!item) continue |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 154 in e6d2c43
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 147 in e6d2c43
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 159 in e6d2c43
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 161 in e6d2c43
| 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() { |
There was a problem hiding this comment.
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 (97). Maximum allowed is 50.
| } | ||
| } | ||
|
|
||
| async function importProjectFile(file) { |
There was a problem hiding this comment.
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 (66). Maximum allowed is 50.
| return { exportProject, importProjectFile } | ||
| } | ||
|
|
||
| export default useProjectManager |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 ?? {} |
There was a problem hiding this comment.
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) { | ||
| const z_scale = snapshot?.zScale |
There was a problem hiding this comment.
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.
| function clear() { | ||
| const renderer = genericRenderWindow.value.getRenderer() | ||
| const actors = renderer.getActors() | ||
| actors.forEach((actor) => renderer.removeActor(actor)) |
There was a problem hiding this comment.
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 Array#forEach
| const actors = renderer.getActors() | ||
| actors.forEach((actor) => renderer.removeActor(actor)) | ||
| genericRenderWindow.value.getRenderWindow().render() | ||
| Object.keys(db).forEach((id) => delete db[id]) |
There was a problem hiding this comment.
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 Array#forEach
|
|
||
| async function importStores(snapshot) { | ||
| const z_scale = snapshot?.zScale | ||
| if (z_scale != null) { |
There was a problem hiding this comment.
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
| const camera = renderer?.getActiveCamera?.() | ||
| const cameraSnapshot = camera | ||
| ? { | ||
| focal_point: Array.from(camera.getFocalPoint()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
There was a problem hiding this 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 await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 162 in 17607da
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 163 in 17607da
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 157 in 17607da
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in 17607da
| if (!item) continue |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 154 in 17607da
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 147 in 17607da
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 159 in 17607da
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 161 in 17607da
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
| const lines_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultVisibility = true | ||
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
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).
| const lines_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultVisibility = true | ||
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
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).
| const lines_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultVisibility = true | ||
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
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).
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } | ||
| const blocks_defaultVisibility = true | ||
| const blocks_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
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).
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } | ||
| const blocks_defaultVisibility = true | ||
| const blocks_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
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).
| view_up: Array.from(camera.getViewUp()), | ||
| position: Array.from(camera.getPosition()), | ||
| view_angle: camera.getViewAngle(), | ||
| clipping_range: Array.from(camera.getClippingRange()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer the spread operator (...) over Array.from()
| function exportStores() { | ||
| const snapshotDb = {} | ||
| for (const [id, item] of Object.entries(db)) { | ||
| if (!item) continue |
There was a problem hiding this comment.
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.
| return flat_indexes | ||
| } | ||
|
|
||
| function exportStores() { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
| } | ||
| } | ||
|
|
||
| function clear() { |
There was a problem hiding this comment.
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 camera_options = snapshot?.camera_options | ||
| if (!camera_options) return |
There was a problem hiding this comment.
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.
| await setZScaling(z_scale) | ||
| } | ||
|
|
||
| const camera_options = snapshot?.camera_options |
There was a problem hiding this comment.
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.
| Object.keys(snapshot?.db || {}), | ||
| ) | ||
| for (const [id, item] of Object.entries(snapshot?.db || {})) { | ||
| await registerObject(id) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
| async function importStores(snapshot) { | ||
| await hybridViewerStore.initHybridViewer() | ||
| hybridViewerStore.clear() | ||
| console.log( |
There was a problem hiding this comment.
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.
| function exportStores() { | ||
| const snapshotDb = {} | ||
| for (const [id, item] of Object.entries(db)) { | ||
| if (!item) continue |
There was a problem hiding this comment.
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.
| return { db: snapshotDb } | ||
| } | ||
|
|
||
| async function importStores(snapshot) { |
There was a problem hiding this comment.
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
| viewable_filename: item.viewable_filename, | ||
| displayed_name: item.displayed_name, | ||
| vtk_js: { | ||
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
There was a problem hiding this comment.
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.
| hybridViewerStore.clear() | ||
| console.log( | ||
| "[DataBase] importStores entries:", | ||
| Object.keys(snapshot?.db || {}), |
There was a problem hiding this comment.
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.
| "[DataBase] importStores entries:", | ||
| Object.keys(snapshot?.db || {}), | ||
| ) | ||
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
There was a problem hiding this comment.
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) { | ||
| const stylesSnapshot = snapshot?.styles || {} | ||
| for (const id of Object.keys(dataStyleState.styles)) | ||
| delete dataStyleState.styles[id] |
There was a problem hiding this comment.
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 'for-of'.
| const meta = dataBaseStore.itemMetaDatas(id) | ||
| const objectType = meta?.object_type | ||
| const style = dataStyleState.styles[id] | ||
| if (!style || !objectType) continue |
There was a problem hiding this comment.
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.
| return Promise.resolve([]) | ||
| } | ||
|
|
||
| function setModelEdgesVisibility(id, visibility) { |
There was a problem hiding this comment.
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 modelStyleStore.setModelEdgesVisibility(id, visibility) | ||
| } | ||
|
|
||
| function modelEdgesVisibility(id) { |
There was a problem hiding this comment.
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 modelStyleStore.modelEdgesVisibility(id) | ||
| } | ||
|
|
||
| function exportStores() { |
There was a problem hiding this comment.
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.
| 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 { getDefaultStyle } from "../utils/default_styles.js" |
There was a problem hiding this comment.
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.
| return { styles: dataStyleState.styles } | ||
| } | ||
|
|
||
| async function importStores(snapshot) { |
There was a problem hiding this comment.
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
| } | ||
| } | ||
|
|
||
| async function applyAllStylesFromState() { |
There was a problem hiding this comment.
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
| } | ||
|
|
||
| async function importStores(snapshot) { | ||
| const stylesSnapshot = snapshot?.styles || {} |
There was a problem hiding this comment.
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.
| const ids = Object.keys(dataStyleState.styles || {}) | ||
| for (const id of ids) { | ||
| const meta = dataBaseStore.itemMetaDatas(id) | ||
| const objectType = meta?.object_type |
There was a problem hiding this comment.
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.
…persistence
create project manager plugin for import/export operations update tests for new functionality and async loading