diff --git a/ui/.prettierignore b/ui/.prettierignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/ui/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/ui/.prettierrc b/ui/.prettierrc new file mode 100644 index 0000000..5a05ecb --- /dev/null +++ b/ui/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "semi": true, + "trailingComma": "es5" +} diff --git a/ui/README.md b/ui/README.md index 253da2a..f2a6300 100644 --- a/ui/README.md +++ b/ui/README.md @@ -20,5 +20,10 @@ npm run build npm run lint ``` +### Formats files +``` +npm run format +``` + ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/ui/package-lock.json b/ui/package-lock.json index ce22cc7..3ae6b20 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -8,7 +8,7 @@ "name": "fitwave", "version": "0.1.0", "dependencies": { - "@vueuse/head": "^2.0.0", + "@unhead/vue": "^1.9.11", "core-js": "^3.8.3", "js-cookie": "^3.0.5", "pinia": "^2.1.7", @@ -25,7 +25,8 @@ "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", "eslint": "^7.32.0", - "eslint-plugin-vue": "^8.0.3" + "eslint-plugin-vue": "^8.0.3", + "prettier": "^3.2.5" } }, "node_modules/@achrinza/node-ipc": { @@ -2418,18 +2419,6 @@ "url": "https://github.com/sponsors/harlan-zw" } }, - "node_modules/@unhead/ssr": { - "version": "1.9.11", - "resolved": "https://registry.npmjs.org/@unhead/ssr/-/ssr-1.9.11.tgz", - "integrity": "sha512-qp7a1uRxzYGr1nRYtkbrYmbUOMZaxIErYDg3ZXA4cc4AZ90OFqb6CfRvk79ywWdatfavsfSj29K1NMgKQyH9ZQ==", - "dependencies": { - "@unhead/schema": "1.9.11", - "@unhead/shared": "1.9.11" - }, - "funding": { - "url": "https://github.com/sponsors/harlan-zw" - } - }, "node_modules/@unhead/vue": { "version": "1.9.11", "resolved": "https://registry.npmjs.org/@unhead/vue/-/vue-1.9.11.tgz", @@ -3106,6 +3095,22 @@ "node": ">=6.0.0" } }, + "node_modules/@vue/component-compiler-utils/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@vue/component-compiler-utils/node_modules/yallist": { "version": "2.1.2", "resolved": "https://registry.npmmirror.com/yallist/-/yallist-2.1.2.tgz", @@ -3202,20 +3207,6 @@ "integrity": "sha512-Iu8Tbg3f+emIIMmI2ycSI8QcEuAUgPTgHwesDU1eKMLE4YC/c/sFbGc70QgMq31ijRftV0R7vCm9co6rldCeOA==", "dev": true }, - "node_modules/@vueuse/head": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@vueuse/head/-/head-2.0.0.tgz", - "integrity": "sha512-ykdOxTGs95xjD4WXE4na/umxZea2Itl0GWBILas+O4oqS7eXIods38INvk3XkJKjqMdWPcpCyLX/DioLQxU1KA==", - "dependencies": { - "@unhead/dom": "^1.7.0", - "@unhead/schema": "^1.7.0", - "@unhead/ssr": "^1.7.0", - "@unhead/vue": "^1.7.0" - }, - "peerDependencies": { - "vue": ">=2.7 || >=3" - } - }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -8902,16 +8893,18 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmmirror.com/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, - "optional": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/pretty-error": { diff --git a/ui/package.json b/ui/package.json index 655cce6..8031a1d 100644 --- a/ui/package.json +++ b/ui/package.json @@ -5,10 +5,11 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,vue,html,css,scss}\"" }, "dependencies": { - "@vueuse/head": "^2.0.0", + "@unhead/vue": "^1.9.11", "core-js": "^3.8.3", "js-cookie": "^3.0.5", "pinia": "^2.1.7", @@ -25,7 +26,8 @@ "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", "eslint": "^7.32.0", - "eslint-plugin-vue": "^8.0.3" + "eslint-plugin-vue": "^8.0.3", + "prettier": "^3.2.5" }, "eslintConfig": { "root": true, diff --git a/ui/src/App.vue b/ui/src/App.vue index 787b806..ea561cf 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -10,7 +10,7 @@ import AppHeader from './components/AppHeader.vue'; export default { components: { - AppHeader - } -} + AppHeader, + }, +}; diff --git a/ui/src/components/AppHeader.vue b/ui/src/components/AppHeader.vue index 1258950..57bf2f7 100644 --- a/ui/src/components/AppHeader.vue +++ b/ui/src/components/AppHeader.vue @@ -6,19 +6,19 @@ diff --git a/ui/src/main.js b/ui/src/main.js index c69d60b..f227819 100644 --- a/ui/src/main.js +++ b/ui/src/main.js @@ -4,6 +4,7 @@ import router from './router'; import { createPinia } from 'pinia'; import PrimeVue from 'primevue/config'; import ToastService from 'primevue/toastservice'; +import { createHead } from '@unhead/vue'; import 'primevue/resources/themes/saga-blue/theme.css'; import 'primevue/resources/primevue.min.css'; import 'primeicons/primeicons.css'; @@ -15,5 +16,6 @@ app.use(createPinia()); app.use(router); app.use(PrimeVue); app.use(ToastService); +app.use(createHead()); app.mount('#app'); diff --git a/ui/src/pages/ActivitiesPage.vue b/ui/src/pages/ActivitiesPage.vue index 87a6f0d..258400e 100644 --- a/ui/src/pages/ActivitiesPage.vue +++ b/ui/src/pages/ActivitiesPage.vue @@ -9,12 +9,14 @@ - + - + @@ -26,6 +28,7 @@ import { useToast } from 'primevue/usetoast'; import DataTable from 'primevue/datatable'; import Column from 'primevue/column'; import Paginator from 'primevue/paginator'; +import { useHead } from '@unhead/vue'; export default { name: 'ActivitiesPage', @@ -33,9 +36,11 @@ export default { DataTable, Column, Paginator, - Toast + Toast, }, setup() { + useHead({ title: 'Activities' }); + const activities = ref([]); const count = ref(0); let currentPage = 1; @@ -73,13 +78,13 @@ export default { activities, count, loading, - handlePageChange + handlePageChange, }; }, methods: { athleteName(row) { return `${row.athlete.firstname} ${row.athlete.lastname}`; - } - } -} + }, + }, +}; diff --git a/ui/src/pages/AthletesPage.vue b/ui/src/pages/AthletesPage.vue index 842907a..3261384 100644 --- a/ui/src/pages/AthletesPage.vue +++ b/ui/src/pages/AthletesPage.vue @@ -9,12 +9,14 @@ - + - + @@ -26,6 +28,7 @@ import { useToast } from 'primevue/usetoast'; import DataTable from 'primevue/datatable'; import Column from 'primevue/column'; import Paginator from 'primevue/paginator'; +import { useHead } from '@unhead/vue'; export default { name: 'AthletesPage', @@ -36,6 +39,8 @@ export default { Toast, }, setup() { + useHead({ title: 'Athletes' }); + const athletes = ref([]); const count = ref(0); let currentPage = 1; @@ -73,8 +78,8 @@ export default { athletes, count, loading, - handlePageChange + handlePageChange, }; - } -} + }, +}; diff --git a/ui/src/pages/GearsPage.vue b/ui/src/pages/GearsPage.vue index abff799..cf1324e 100644 --- a/ui/src/pages/GearsPage.vue +++ b/ui/src/pages/GearsPage.vue @@ -8,12 +8,14 @@ - + - + @@ -25,6 +27,7 @@ import { useToast } from 'primevue/usetoast'; import DataTable from 'primevue/datatable'; import Column from 'primevue/column'; import Paginator from 'primevue/paginator'; +import { useHead } from '@unhead/vue'; export default { name: 'GearsPage', @@ -32,9 +35,11 @@ export default { DataTable, Column, Paginator, - Toast + Toast, }, setup() { + useHead({ title: 'Gears' }); + const gears = ref([]); const count = ref(0); let currentPage = 1; @@ -72,13 +77,13 @@ export default { gears, count, loading, - handlePageChange + handlePageChange, }; }, methods: { athleteName(row) { return `${row.athlete.firstname} ${row.athlete.lastname}`; - } - } -} + }, + }, +}; diff --git a/ui/src/pages/HomePage.vue b/ui/src/pages/HomePage.vue index 769f1de..bfbb3aa 100644 --- a/ui/src/pages/HomePage.vue +++ b/ui/src/pages/HomePage.vue @@ -6,15 +6,14 @@ - + diff --git a/ui/src/pages/LoginPage.vue b/ui/src/pages/LoginPage.vue index 67b8318..dee0d8a 100644 --- a/ui/src/pages/LoginPage.vue +++ b/ui/src/pages/LoginPage.vue @@ -11,8 +11,9 @@