diff --git a/ui/.devcontainer/devcontainer.json b/ui/.devcontainer/devcontainer.json index 1d9f5b2..c4804c1 100644 --- a/ui/.devcontainer/devcontainer.json +++ b/ui/.devcontainer/devcontainer.json @@ -2,15 +2,19 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/javascript-node { "name": "Advent22 UI", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:1-18-bookworm", + "image": "mcr.microsoft.com/devcontainers/javascript-node:4-20-trixie", + // Features to add to the dev container. More info: https://containers.dev/features. "features": { + "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/devcontainers-extra/features/apt-get-packages:1": { - "packages": "git-flow, git-lfs" + "packages": "git-flow" }, "ghcr.io/devcontainers-extra/features/vue-cli:2": {} }, + // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. @@ -29,11 +33,16 @@ ] } }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "yarn install", - "postStartCommand": "yarn install --production false", - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "node" + + // Use 'postStartCommand' to run commands after the container is started. + "postStartCommand": "npx --yes update-browserslist-db@latest && yarn install --production false" + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } diff --git a/ui/.vscode/settings.json b/ui/.vscode/settings.json index 46192d7..57ee8c2 100644 --- a/ui/.vscode/settings.json +++ b/ui/.vscode/settings.json @@ -1,21 +1,23 @@ { - "editor.formatOnSave": true, - "[vue]": { + "[scss][vue][typescript][javascript][json][jsonc][jsonl]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + + "[jsonc]": { + "editor.formatOnSave": false, }, + "editor.codeActionsOnSave": { "source.organizeImports": "explicit" }, + "git.closeDiffOnOperation": true, + "editor.formatOnSave": true, "editor.tabSize": 2, + "sass.disableAutoIndent": true, "sass.format.convert": false, "sass.format.deleteWhitespace": true, - "volar.inlayHints.eventArgumentInInlineHandlers": false + + "prettier.trailingComma": "all", } diff --git a/ui/babel.config.json b/ui/babel.config.json index 7895cad..07c2147 100644 --- a/ui/babel.config.json +++ b/ui/babel.config.json @@ -1,3 +1,5 @@ { - "presets": ["@vue/cli-plugin-babel/preset"] -} + "presets": [ + "@vue/cli-plugin-babel/preset" + ] +} \ No newline at end of file diff --git a/ui/package.json b/ui/package.json index 95b7ed5..3d0c92c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -3,11 +3,12 @@ "version": "0.1.0", "private": true, "scripts": { - "serve": "vue-cli-service serve --host 0.0.0.0 --port 8080", + "serve": "vue-cli-service serve", "build": "vue-cli-service build", "test:unit": "vue-cli-service test:unit", "test:unit-watch": "vue-cli-service test:unit --watch", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "ui": "vue ui --host 0.0.0.0 --headless" }, "devDependencies": { "@fortawesome/fontawesome-svg-core": "^6.6.0", @@ -25,6 +26,7 @@ "@vue/cli-service": "~5.0.0", "@vue/eslint-config-typescript": "^13.0.0", "@vue/test-utils": "^2.4.6", + "@vue/tsconfig": "^0.5.1", "animate.css": "^4.1.1", "axios": "^1.7.3", "bulma": "^1.0.2", @@ -37,12 +39,8 @@ "pinia": "^2.2.1", "sass": "^1.77.8", "sass-loader": "^16.0.0", - "typescript": "~5.5.4", + "typescript": ">=4.7.4 <5.5.0", "vue": "^3.5.25", "vue-class-component": "^8.0.0-0" - }, - "dependencies": {}, - "prettier": { - "trailingComma": "all" } } diff --git a/ui/src/components/AdminButton.vue b/ui/src/components/AdminButton.vue index caca308..ea14ee5 100644 --- a/ui/src/components/AdminButton.vue +++ b/ui/src/components/AdminButton.vue @@ -12,7 +12,7 @@