Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Switch to double quotes
052ad665aceaf8ef10ffc3eba8111799517e2cae

# Revert internal name to "uvdat"
4db15705dbcb5c2b1be39e96990804cdf03fbf1b
# Format with Prettier
c5e40b27cd426c9665e28db54dc092d3997eb718
2 changes: 1 addition & 1 deletion web/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="vite/client" />

interface ViteTypeOptions {
strictImportMetaEnv: unknown
strictImportMetaEnv: unknown;
}

interface ImportMetaEnv {
Expand Down
39 changes: 21 additions & 18 deletions web/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
import { globalIgnores } from 'eslint/config'
import pluginVue from 'eslint-plugin-vue'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import skipFormatting from 'eslint-config-prettier/flat'
import { globalIgnores } from "eslint/config";
import pluginVue from "eslint-plugin-vue";
import {
defineConfigWithVueTs,
vueTsConfigs,
} from "@vue/eslint-config-typescript";
import skipFormatting from "eslint-config-prettier/flat";

export default defineConfigWithVueTs(
{
name: 'app/files-to-lint',
files: ['**/*.{vue,ts,mts,tsx}'],
name: "app/files-to-lint",
files: ["**/*.{vue,ts,mts,tsx}"],
},
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
...pluginVue.configs['flat/essential'],
globalIgnores(["**/dist/**", "**/dist-ssr/**", "**/coverage/**"]),
...pluginVue.configs["flat/essential"],
vueTsConfigs.recommended,
{
rules: {
// allowModifiers: Vuetify uses dot notation for column slots (v-slot:item.columnName)
'vue/valid-v-slot': ['error', { allowModifiers: true }],
"vue/valid-v-slot": ["error", { allowModifiers: true }],
// `any` is used everywhere and will be difficult to eliminate
'@typescript-eslint/no-explicit-any': 'off',
"@typescript-eslint/no-explicit-any": "off",
// Temporary ignores until rules can be fixed
'vue/require-v-for-key': 'off',
'vue/valid-v-for': 'off',
'vue/return-in-computed-property': 'off',
'vue/no-ref-as-operand': 'off',
'vue/no-side-effects-in-computed-properties': 'off',
'vue/no-async-in-computed-properties': 'off',
'vue/no-use-v-if-with-v-for': 'off',
"vue/require-v-for-key": "off",
"vue/valid-v-for": "off",
"vue/return-in-computed-property": "off",
"vue/no-ref-as-operand": "off",
"vue/no-side-effects-in-computed-properties": "off",
"vue/no-async-in-computed-properties": "off",
"vue/no-use-v-if-with-v-for": "off",
},
},
skipFormatting,
)
);
54 changes: 30 additions & 24 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
<!DOCTYPE html>
<html lang="" style="overflow: hidden;">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&icon_names=format_line_spacing,straighten" />
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<title>GeoDatalytics</title>
</head>

<body>
<noscript>
<strong>We're sorry but GeoDatalytics doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<!-- built files will be auto injected -->
</body>
<!doctype html>
<html lang="" style="overflow: hidden">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&icon_names=format_line_spacing,straighten"
/>
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32" />
<title>GeoDatalytics</title>
</head>

<body>
<noscript>
<strong
>We're sorry but GeoDatalytics doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<!-- built files will be auto injected -->
</body>
</html>
9 changes: 6 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
"serve": "vite",
"serve:prod": "vite preview",
"build": "vite build",
"test:lint": "eslint . --no-fix",
"test:format": "prettier --experimental-cli --check .",
"test:lint": "eslint --no-fix .",
"test:type": "vue-tsc --build",
"test": "npm-run-all test:lint test:type",
"format": "eslint . --fix"
"test": "npm-run-all test:format test:lint test:type",
"format:lint": "eslint --fix .",
"format:format": "prettier --experimental-cli --write .",
"format": "npm-run-all format:lint format:format"
},
"dependencies": {
"@mdi/font": "7.4.47",
Expand Down
10 changes: 7 additions & 3 deletions web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import ToggleCompareMap from "./components/map/ToggleCompareMap.vue";
import SideBars from "./components/sidebars/SideBars.vue";
import ControlsBar from "./components/ControlsBar.vue";

import { useAppStore, usePanelStore, useProjectStore, useConversionStore } from "@/store";
import {
useAppStore,
usePanelStore,
useProjectStore,
useConversionStore,
} from "@/store";
const appStore = useAppStore();
const panelStore = usePanelStore();
const projectStore = useProjectStore();
Expand All @@ -16,7 +21,7 @@ const conversionStore = useConversionStore();
const showError = computed(() => appStore.currentError !== undefined);

// useTheme must be called within a setup function
appStore.themeManager = useTheme()
appStore.themeManager = useTheme();

function onReady() {
if (appStore.currentUser) {
Expand All @@ -32,7 +37,6 @@ const login = () => {

onMounted(onReady);
watch(() => appStore.currentUser, onReady);

</script>

<template>
Expand Down
26 changes: 13 additions & 13 deletions web/src/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import axios from "axios";
import OauthClient from "@resonant/oauth-client";
import S3FileFieldClient from 'django-s3-file-field';
import S3FileFieldClient from "django-s3-file-field";
import { useAppStore } from "@/store";

declare module 'axios' {
declare module "axios" {
interface AxiosRequestConfig {
errorMsg?: string;
}
}

const OAUTH2_CLIENT_ID = 'cBmD6D6F2YAmMWHNQZFPUr4OpaXVpW5w4Thod6Kj';
const OAUTH2_CLIENT_ID = "cBmD6D6F2YAmMWHNQZFPUr4OpaXVpW5w4Thod6Kj";

export const baseURL = `${import.meta.env.VITE_APP_API_ROOT}api/v1/`;

Expand All @@ -19,13 +19,13 @@ export const apiClient = axios.create({
export const oauthClient = new OauthClient(
new URL(`${import.meta.env.VITE_APP_API_ROOT}oauth/`),
OAUTH2_CLIENT_ID,
{ redirectUrl: new URL(window.location.origin) }
{ redirectUrl: new URL(window.location.origin) },
);

export let s3ffClient: S3FileFieldClient = new S3FileFieldClient({
baseUrl: baseURL + 's3-upload/',
baseUrl: baseURL + "s3-upload/",
// This lacks auth headers, but they'll be added once logged in.
})
});

export async function restoreLogin() {
if (!oauthClient) {
Expand All @@ -39,11 +39,11 @@ export async function restoreLogin() {
}
});
s3ffClient = new S3FileFieldClient({
baseUrl: baseURL + 's3-upload/',
baseUrl: baseURL + "s3-upload/",
apiConfig: {
headers: oauthClient.authHeaders
}
})
headers: oauthClient.authHeaders,
},
});
}
}

Expand All @@ -60,7 +60,7 @@ apiClient.interceptors.response.use(
const appStore = useAppStore();

if (error.config?.errorMsg) {
appStore.currentError = error.config?.errorMsg
appStore.currentError = error.config?.errorMsg;
return { data: undefined };
}

Expand All @@ -76,10 +76,10 @@ apiClient.interceptors.response.use(
appStore.currentError = "An error occurred.";
}
return { data: undefined };
}
},
);

export const logout = async () => {
await oauthClient.logout();
window.location.href = `${import.meta.env.VITE_APP_API_ROOT}accounts/logout/`
window.location.href = `${import.meta.env.VITE_APP_API_ROOT}accounts/logout/`;
};
Loading