Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
.cache
dist

# Regenerated on every `nuxt prepare` by whichever app extends this layer
# (see nuxt.config.ts in Vease/Vease-Modeling for why it must be self-contained);
# its content depends on the consumer that generated it, so it can't be committed.
/tsconfig.json

# Node dependencies
node_modules

Expand Down Expand Up @@ -36,7 +41,6 @@ pnpm-lock.yaml
VTK.txt
*.nuxtrc

# Compiled Node-safe siblings of server/utils/ and shared/ (see scripts/build_node_utils.ts)
/server/**/*.js
/shared/**/*.js
# Compiled Node-safe build of server/utils/ and shared/ (see rolldown.config.ts)
/.build
/opengeodeweb_front_schemas.js
12 changes: 6 additions & 6 deletions app/components/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ interface Props {
tooltip: string;
color?: string;
size?: string | number;
// Vuetify's variant/density accept narrow literal unions; kept loose here since
// Callers pass plain strings and this is only a typing widening, not a behavior change.
variant?: any;
density?: any;
variant?: unknown;
density?: unknown;
tooltipLocation?: string;
iconSize?: string | number;
}
Expand All @@ -25,9 +23,11 @@ const {
iconSize = DEFAULT_ICON_SIZE,
} = defineProps<Props>();

const emit = defineEmits<{
interface Emits {
click: [event: MouseEvent];
}>();
}

const emit = defineEmits<Emits>();
</script>

<template>
Expand Down
10 changes: 6 additions & 4 deletions app/components/CameraManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import ToolPanel from "@ogw_front/components/ToolPanel.vue";

const DEFAULT_PANEL_WIDTH = 260;

const emit = defineEmits<{
interface Emits {
close: [];
}>();
}

const emit = defineEmits<Emits>();

interface Props {
showDialog: boolean;
Expand All @@ -21,15 +23,15 @@ const {
escapeFunction = undefined,
} = defineProps<Props>();

function handleClose() {
function handleClose(): void {
if (escapeFunction) {
escapeFunction();
} else {
emit("close");
}
}

const show = computed({
const show = computed<boolean>({
get: () => showDialog,
set: (val) => {
if (!val) {
Expand Down
10 changes: 5 additions & 5 deletions app/components/CameraManager/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const hybridViewerStore = useHybridViewerStore();
const savedPositions = cameraManagerStore.refAllCameraPositions();

const editingId = ref<number | undefined>(undefined);
const editingName = ref("");
const editingName = ref<string>("");

async function restorePosition(positionId: number) {
async function restorePosition(positionId: number): void {
const position = await cameraManagerStore.getCameraPosition(positionId);
if (position) {
if (hybridViewerStore.genericRenderWindow) {
Expand All @@ -21,16 +21,16 @@ async function restorePosition(positionId: number) {
}
}

async function deletePosition(positionId: number) {
async function deletePosition(positionId: number): void {
await cameraManagerStore.deleteCameraPosition(positionId);
}

function startEditing(position: { id?: number; name?: string }) {
function startEditing(position: { id?: number; name?: string }): void {
editingId.value = position.id;
editingName.value = position.name ?? "";
}

async function saveRename() {
async function saveRename(): void {
if (editingName.value && editingId.value !== undefined) {
await cameraManagerStore.renameCameraPosition(editingId.value, editingName.value);
}
Expand Down
8 changes: 3 additions & 5 deletions app/components/CameraManager/Saver.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<script setup lang="ts">
// Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
// oxlint-disable eslint/sort-imports
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
import { useCameraManagerStore } from "@ogw_front/stores/camera_manager";
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";

const cameraManagerStore = useCameraManagerStore();
const hybridViewerStore = useHybridViewerStore();

const newPositionName = ref("");
const newPositionName = ref<string>("");

async function saveCurrentPosition() {
async function saveCurrentPosition(): void {
if (!newPositionName.value) {
return;
}
Expand Down
24 changes: 12 additions & 12 deletions app/components/CameraOrientation.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<script setup lang="ts">
// Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
// oxlint-disable eslint/sort-imports
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
import ToolPanel from "@ogw_front/components/ToolPanel.vue";
import { applyCameraOptions } from "@ogw_internal/stores/hybrid_viewer/camera";
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
import { newInstance as vtkAnnotatedCubeActor } from "@kitware/vtk.js/Rendering/Core/AnnotatedCubeActor";
import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow";

Expand All @@ -22,10 +20,13 @@ const {
escapeFunction = undefined,
} = defineProps<Props>();

const show = defineModel<boolean>("show", { default: false });
const emit = defineEmits<{
interface Emits {
select: [value: string];
}>();
}

const emit = defineEmits<Emits>();

const show = defineModel<boolean>("show", { default: false });

const orientations = [
{
Expand Down Expand Up @@ -82,12 +83,11 @@ const hoveredFace = ref<string | undefined>(undefined);
const hybridViewerStore = useHybridViewerStore();
const cubeContainer = useTemplateRef("cubeContainer");

// VTK.js objects have no usable type declarations here; `any` is the pragmatic choice.
let genericRenderWindow: any = undefined;
let cubeActor: any = undefined;
let genericRenderWindow: unknown = undefined;
let cubeActor: unknown = undefined;
let isInteracting = false;

function initVTK() {
function initVTK(): void {
if (genericRenderWindow) {
return;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ function initVTK() {
renderer.resetCamera();
}

function syncCubeCamera() {
function syncCubeCamera(): void {
const options = hybridViewerStore.camera_options;
if (!genericRenderWindow || isInteracting || !options.position) {
return;
Expand Down Expand Up @@ -165,7 +165,7 @@ watch(hoveredFace, (newFace, oldFace) => {
if (!cubeActor) {
return;
}
function updateFace(face: string | undefined, active: boolean) {
function updateFace(face: string | undefined, active: boolean): void {
const config = orientations.find((orientation) => orientation.face === face);
if (config) {
cubeActor[`set${config.vtkKey}FaceProperty`]({
Expand Down
6 changes: 4 additions & 2 deletions app/components/ClippingPlaneCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ interface Props {

const { plane, index } = defineProps<Props>();

const emit = defineEmits<{
interface Emits {
remove: [];
flipNormal: [];
}>();
}

const emit = defineEmits<Emits>();
</script>

<template>
Expand Down
16 changes: 8 additions & 8 deletions app/components/ClippingPlanes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const { escapeFunction = undefined } = defineProps<Props>();
const show = defineModel<boolean>("show", { default: false });
const dataStore = useDataStore();
const hybridViewerStore = useHybridViewerStore();
const targetAllVisible = ref(true);
const targetAllVisible = ref<boolean>(true);
const selectedDatasetIds = ref<string[]>([]);
const planes = ref<{ origin?: number[]; normal: number[] }[]>([
{ origin: undefined, normal: [1, 0, 0] },
]);
const allItems = dataStore.refAllItems();
const availableDatasets = computed(() =>
const availableDatasets = computed<{ title: string; value: string }[]>(() =>
allItems.value.map((item) => ({
title: item.name || item.id,
value: item.id,
Expand All @@ -49,7 +49,7 @@ const {
debouncedApply: (...args: unknown[]) => debouncedApply?.(...args),
});

async function applyClippingPlanes() {
async function applyClippingPlanes(): Promise<void> {
const allIds = allItems.value.map((item) => item.id);
if (allIds.length === 0) {
return;
Expand All @@ -72,33 +72,33 @@ async function applyClippingPlanes() {

debouncedApply = useDebounceFn(() => applyClippingPlanes(), DEBOUNCE_DELAY);

function addPlane() {
function addPlane(): void {
// Index is always in-bounds (modulo the fixed-size list); the fallbacks only
// Satisfy noUncheckedIndexedAccess and are never hit at runtime.
const normal = DEFAULT_NORMALS[planes.value.length % DEFAULT_NORMALS.length] ??
DEFAULT_NORMALS[0] ?? [1, 0, 0];
planes.value.push({ origin: getSceneCenter(), normal });
}

function removePlane(index: number) {
function removePlane(index: number): void {
planes.value.splice(index, 1);
}

function flipNormal(plane: { normal: number[] }) {
function flipNormal(plane: { normal: number[] }): void {
plane.normal = plane.normal.map((component) => -component);
syncWidgets();
applyClippingPlanes();
}

async function resetClippingPlanes() {
async function resetClippingPlanes(): Promise<void> {
setFromWidget(true);
planes.value = [{ origin: undefined, normal: [1, 0, 0] }];
updateWidgetPlacement({ isReset: true });
setFromWidget(false);
await applyClippingPlanes();
}

async function removeClippingPlanes() {
async function removeClippingPlanes(): Promise<void> {
const allIds = allItems.value.map((item) => item.id);
await hybridViewerStore.setClippingPlanes(allIds, []);
}
Expand Down
19 changes: 9 additions & 10 deletions app/components/CrsSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { useBackStore } from "@ogw_front/stores/back";

const schema = schemas.opengeodeweb_back.geographic_coordinate_systems;

const emit = defineEmits<{
interface Emits {
update_values: [values: Record<string, unknown>];
increment_step: [];
decrement_step: [];
}>();
}

const emit = defineEmits<Emits>();

interface Props {
geodeObjectType: string;
Expand All @@ -17,18 +19,15 @@ interface Props {

const { geodeObjectType, keyToUpdate } = defineProps<Props>();

const search = ref("");
const data_table_loading = ref(false);
const search = ref<string>("");
const data_table_loading = ref<boolean>(false);
const crs_list = ref<Record<string, unknown>[]>([]);
const selected_crs = ref<unknown[]>([]);
const toggle_loading = useToggle(data_table_loading);
const backStore = useBackStore();

function get_selected_crs(crs_code: unknown) {
// Pre-existing off-by-one fixed: `i <= length` read one past the end of
// Crs_list, which would have thrown on `undefined["code"]` at runtime.
for (let i = 0; i < crs_list.value.length; i += 1) {
const crs = crs_list.value[i];
function get_selected_crs(crs_code: unknown): unknown {
for (const crs of crs_list.value) {
if (crs && crs["code"] === crs_code) {
return crs;
}
Expand All @@ -44,7 +43,7 @@ watch(selected_crs, (new_value) => {
emit("increment_step");
});

async function get_crs_table() {
async function get_crs_table(): void {
const params = { geode_object_type: geodeObjectType };
toggle_loading();
await backStore.request(
Expand Down
6 changes: 4 additions & 2 deletions app/components/DeleteDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ interface Props {

const { show = false, item = undefined, selectedCount = 0 } = defineProps<Props>();

const emit = defineEmits<{
interface Emits {
"update:show": [value: boolean];
confirm: [];
}>();
}

const emit = defineEmits<Emits>();
</script>

<template>
Expand Down
Loading
Loading