diff --git a/.github/workflows/code-format.yaml b/.github/workflows/code-format.yaml
new file mode 100644
index 0000000..37457c3
--- /dev/null
+++ b/.github/workflows/code-format.yaml
@@ -0,0 +1,19 @@
+# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
+
+name: Code format
+
+on: pull_request
+
+jobs:
+ code-format:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: 'npm'
+ - run: npm ci
+ - run: npm run format-check
diff --git a/.prettierrc.json b/.prettierrc.json
index 17a23d0..3f0896e 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1,7 +1,7 @@
-
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"singleQuote": true,
- "printWidth": 100
+ "printWidth": 100,
+ "trailingComma": "es5"
}
diff --git a/README.md b/README.md
index 852e82d..36a181b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# client
-This template should help get you started developing with Vue 3 in Vite.
+This is the client SPA for DomoticASW, it is deployed as a submodule inside DomoticASW's server.
## Recommended IDE Setup
@@ -14,9 +14,10 @@ TypeScript cannot handle type information for `.vue` imports by default, so we r
See [Vite Configuration Reference](https://vite.dev/config/).
-## Project Setup
+## Setup
```sh
+./setup.sh
npm install
```
diff --git a/hooks/pre-commit b/hooks/pre-commit
new file mode 100755
index 0000000..e8bc3ed
--- /dev/null
+++ b/hooks/pre-commit
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed.
+# Called by "git commit" with no arguments. The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+
+# Redirect output to stderr.
+exec 1>&2
+
+if ! npm run format-check; then
+ echo Run \"npm run format\" to fix
+ exit 1
+fi
diff --git a/package.json b/package.json
index 7534450..5522765 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,8 @@
"type-check": "vue-tsc --build",
"lint": "eslint .",
"lint-fix": "npm run lint --fix",
- "format": "prettier --write src/"
+ "format": "prettier --write src/",
+ "format-check": "prettier --check src/"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.11",
diff --git a/src/App.vue b/src/App.vue
index 6fa3bca..610a7f5 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,19 +3,19 @@ import { RouterView } from 'vue-router'
import LoadingOverlay from './components/LoadingOverlay.vue'
import ErrorPresenter from './components/ErrorPresenter.vue'
import SuccessPresenter from './components/SuccessPresenter.vue'
+import DeviceGroupsDialog from './components/DeviceGroupsDialog.vue'