Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
76 changes: 69 additions & 7 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,96 @@
"style": "error",
"restriction": "error"
},
"plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest"],
"plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest", "vue"],
"rules": {
"unicorn/filename-case": [
"error",
{
"case": "snakeCase"
}
],
"eslint/func-style": [
"eslint/func-style": ["error", "declaration"],
"eslint/sort-keys": "off",
"eslint/no-ternary": "off", // A utiliser pour des opérations simples
"oxc/no-async-await": "off",
"oxc/no-rest-spread-properties": "off", // Enable if older browser support is needed
"eslint/max-statements": ["warn", 20],
"eslint/id-length": [
"error",
{
"style:": "declaration"
"exceptions": [
"x",
"y",
"z",
"i",
"j",
"k",
"r",
"g",
"b",
"id",
"ID",
"fs",
"os"
],
"min": 3
}
],
"eslint/sort-keys": "off",
"eslint/no-ternary": "off"
"eslint/no-console": "warn", // Disable for debugging. Disable later to not have browser logs
"sort-imports": ["error", { "allowSeparatedGroups": true }],
"eslint/no-undefined": "off", // Conflict with unicorn/no-typeof-undefined which prefers direct undefined comparison
"import/prefer-default-export": "off",
"import/no-named-export": "off",
"import/no-namespace": ["error", { "ignore": ["vuetify/*"] }],
"vue/max-props": ["error", { "maxProps": 8 }],
"oxc/no-optional-chaining": "off",
"node/no-process-env": "off",
"no-continue": "off",
"import/unambiguous": "off",
"max-params": ["warn", { "max": 4 }],
"eslint/no-magic-numbers": [
"error",
{
"ignore": [-1, 0, 1, 2, 3, 4],
"ignoreArrayIndexes": true
}
]
},
"overrides": [
{
"files": ["**/components/*"],
"files": ["**/components/**"],
"rules": {
"unicorn/filename-case": [
"error",
{
"case": "PascalCase"
"case": "pascalCase"
}
]
}
},
{
"files": [
"app/plugins/**",
"node_scripts/**",
"server/**",
"*.config.js"
],
"rules": {
"import/no-default-export": "off"
}
},
{
"files": ["tests/**"],
"rules": {
"vitest/require-hook": "off",
"vitest/no-hooks": "off"
}
},
{
"files": ["**/preload.js"],
"rules": {
"import/no-commonjs": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion app/components/DeleteDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
item: {
type: Object,
default: null,
default: undefined,
},
selectedCount: {
type: Number,
Expand Down
13 changes: 8 additions & 5 deletions app/components/DragAndDrop.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<script setup>
import GlassCard from "@ogw_front/components/GlassCard"

const props = defineProps({
const { multiple, accept, loading, showExtensions } = defineProps({
multiple: { type: Boolean, default: false },
accept: { type: String, default: "" },
loading: { type: Boolean, default: false },
showExtensions: { type: Boolean, default: true },
idleText: { type: String, default: "Click or Drag & Drop files" },
dropText: { type: String, default: "Drop to upload" },
loadingText: { type: String, default: "Uploading..." },
})

const emit = defineEmits(["files-selected"])
Expand Down Expand Up @@ -83,7 +80,13 @@
class="text-h6 font-weight-bold justify-center pa-0 mb-1 text-white"
style="transition: color 0.3s ease"
>
{{ loading ? loadingText : isDragging ? dropText : idleText }}
{{
loading
? "Uploading..."
: isDragging
? "Drop to upload"
: "Click or Drag & Drop files"
}}
</v-card-title>

<v-card-subtitle v-if="showExtensions" class="text-body-2 pa-0">
Expand Down
8 changes: 4 additions & 4 deletions app/components/GlassCard.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script setup>
import { computed, useAttrs } from "vue"
defineProps({
const { variant, rounded, padding, theme } = defineProps({
variant: {
type: String,
default: "panel",
validator: (v) => ["panel", "ui"].includes(v),
validator: (valid) => ["panel", "ui"].includes(valid),
},
rounded: { type: String, default: "xl" },
padding: { type: String, default: "pa-6" },
theme: { type: String, default: null },
theme: { type: String, default: undefined },
})
const attrs = useAttrs()
const isInteractive = computed(() => !!attrs.onClick)
const isInteractive = computed(() => Boolean(attrs.onClick))
</script>

<template>
Expand Down
6 changes: 1 addition & 5 deletions app/components/HybridRenderingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
timeout = setTimeout(later, wait)
}
}

function get_x_y(event) {
emit("click", event)
}
</script>

<template>
Expand All @@ -58,7 +54,7 @@
class="pa-0"
ref="viewer"
style="height: 100%; overflow: hidden; position: relative; z-index: 0"
@click="get_x_y"
@click="emit('click', $event)"
@keydown.esc="viewerStore.toggle_picking_mode(false)"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Launcher.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import Loading from "@ogw_front/components/Loading"
import Recaptcha from "@ogw_front/components/Recaptcha"
import Status from "@ogw_front/utils/status"
import { Status } from "@ogw_front/utils/status"
import { useInfraStore } from "@ogw_front/stores/infra"

const infraStore = useInfraStore()
Expand Down
2 changes: 1 addition & 1 deletion app/components/ObjectSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
.map((obj) => obj[key].object_priority)
.filter((priority) => priority !== undefined && priority !== null)
final_object[key] = { is_loadable: Math.min(...load_scores) }
if (priorities.length) {
if (priorities.length > 0) {
final_object[key].object_priority = Math.max(...priorities)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/PackagesVersions.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import Status from "@ogw_front/utils/status"
import { Status } from "@ogw_front/utils/status"
import { useGeodeStore } from "@ogw_front/stores/geode"

const { schema } = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion app/components/RemoteRenderingView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { useElementSize, useWindowSize } from "@vueuse/core"
import Status from "@ogw_front/utils/status"
import { Status } from "@ogw_front/utils/status"
import ViewToolbar from "@ogw_front/components/ViewToolbar"
import { useViewerStore } from "@ogw_front/stores/viewer"
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
Expand Down
4 changes: 2 additions & 2 deletions app/components/Screenshot.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import fileDownload from "js-file-download"
import GlassCard from "@ogw_front/components/GlassCard"
import fileDownload from "js-file-download"
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"

import { useViewerStore } from "@ogw_front/stores/viewer"
Expand Down Expand Up @@ -29,7 +29,7 @@
include_background: include_background.value,
},
{
response_function: async (response) => {
response_function: (response) => {
fileDownload(
response.blob,
`${filename.value}.${output_extension.value}`,
Expand Down
26 changes: 10 additions & 16 deletions app/components/SearchBar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<script setup>
const { modelValue, label } = defineProps({
modelValue: { type: String, default: "" },
label: { type: String, default: "Search..." },
})

const emit = defineEmits(["update:modelValue"])
</script>

<template>
<v-text-field
:model-value="modelValue"
@update:model-value="$emit('update:modelValue', $event)"
@update:model-value="emit('update:modelValue', $event)"
prepend-inner-icon="mdi-magnify"
:label="label"
variant="outlined"
Expand All @@ -17,18 +26,3 @@
</template>
</v-text-field>
</template>

<script setup>
defineProps({
modelValue: {
type: String,
default: "",
},
label: {
type: String,
default: "Search...",
},
})

defineEmits(["update:modelValue"])
</script>
4 changes: 3 additions & 1 deletion app/components/Step.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
step_index: { type: Number, required: true },
})

const emit = defineEmits(["reset_values"])

const stepper_tree = inject("stepper_tree")
const { current_step_index, steps } = toRefs(stepper_tree)

Expand Down Expand Up @@ -98,7 +100,7 @@
@increment_step="increment_step"
@decrement_step="decrement_step"
@update_values="update_values_event"
@reset_values="$emit('reset_values')"
@reset_values="emit('reset_values')"
/>
</v-card-text>
</v-stepper-vertical-item>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Viewer/ContextMenuItem.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import GlassCard from "@ogw_front/components/GlassCard"
import { useTheme } from "vuetify"
import { useMenuStore } from "@ogw_front/stores/menu"
import { useTheme } from "vuetify"

const CARD_WIDTH = 320
const CARD_HEIGHT = 500
Expand Down
6 changes: 1 addition & 5 deletions app/components/Viewer/Options/AttributeColorBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
const minimum = defineModel("minimum", { type: Number })
const maximum = defineModel("maximum", { type: Number })
const colorMap = defineModel("colorMap", { type: String })

function reset() {
emit("reset")
}
</script>

<template>
Expand All @@ -33,7 +29,7 @@
icon="mdi-arrow-left-right"
size="x-small"
variant="text"
@click="reset"
@click="emit('reset')"
v-tooltip="'Reset range'"
/>
</v-col>
Expand Down
8 changes: 2 additions & 6 deletions app/components/Viewer/Options/ColorMapList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@
if (!preset || !preset.RGBPoints) {
return
}

const ctx = canvas.getContext("2d")
const { height, width } = canvas
const lut = vtkColorTransferFunction()
const rgbPoints = preset.RGBPoints

for (let pointIdx = 0; pointIdx < rgbPoints.length; pointIdx += 4) {
lut.addRGBPoint(
rgbPoints[pointIdx],
Expand All @@ -69,15 +67,13 @@
rgbPoints[pointIdx + THREE],
)
}

const table = lut.getUint8Table(
rgbPoints[0],
rgbPoints.at(-LAST_POINT_OFFSET),
width,
true,
)
const imageData = ctx.createImageData(width, height)

for (let xCoord = 0; xCoord < width; xCoord += 1) {
const alpha = table[xCoord * 4 + THREE],
blue = table[xCoord * 4 + 2],
Expand Down Expand Up @@ -180,7 +176,7 @@
<v-list-item
v-for="(child, cIdx) in item.Children"
:key="cIdx"
@click="$emit('select', child)"
@click="emit('select', child)"
class="px-2 mb-1"
rounded="md"
>
Expand All @@ -202,7 +198,7 @@

<v-list-item
v-else
@click="$emit('select', item)"
@click="emit('select', item)"
class="px-2 mb-1"
rounded="md"
>
Expand Down
6 changes: 3 additions & 3 deletions app/components/Viewer/Options/ColorMapPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
watch([lutCanvas, selectedPresetName, () => min, () => max], drawLutCanvas)
watch(
() => modelValue,
(nv) => {
if (nv !== selectedPresetName.value) {
selectedPresetName.value = nv
(newValue) => {
if (newValue !== selectedPresetName.value) {
selectedPresetName.value = newValue
}
},
)
Expand Down
4 changes: 2 additions & 2 deletions app/components/Viewer/Options/TextureItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

async function files_uploaded_event(value) {
if (value.length) {
if (value.length > 0) {
await geodeStore.request(
back_schemas.opengeodeweb_back.save_viewable_file,
{
Expand All @@ -48,7 +48,7 @@
},
},
{
response_function: async (response) => {
response_function: (response) => {
texture_id.value = response.id
},
},
Expand Down
Loading