From d23707777ee9d334ea7ebc19906c1f8b5816ffb0 Mon Sep 17 00:00:00 2001 From: utarwyn Date: Sun, 27 Oct 2024 22:06:35 +0100 Subject: [PATCH] Adapt contact forms to new API --- .env.example | 1 + .github/workflows/deploy.yml | 3 + README.md | 2 + package-lock.json | 42 +++-- package.json | 2 +- src/components/company/CaseStudyForm.vue | 148 +++-------------- src/components/contributor/Newsletter.vue | 167 +++++++------------ src/components/home/ContactForm.vue | 169 ++++---------------- src/components/shared/AppButton.vue | 2 +- src/components/shared/form/AppTextfield.vue | 4 +- src/main.ts | 1 + src/router/index.ts | 3 +- src/util/fetch.ts | 6 +- src/util/form.ts | 32 ++++ vite.config.ts | 28 ++-- 15 files changed, 217 insertions(+), 393 deletions(-) create mode 100644 .env.example create mode 100644 src/util/form.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..292a14c --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +VITE_API_URL= diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 826b5f4..45ce893 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,9 @@ on: push: branches: [main] +env: + VITE_API_URL: ${{ vars.API_URL }} + jobs: build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index b1191d9..ea9454b 100755 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ with [Vue.js](https://vuejs.org). ## 🚀 Project Setup +Copy `.env.example` to `.env` + ```sh npm install ``` diff --git a/package-lock.json b/package-lock.json index 708fe6b..0977a05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "@fontsource-variable/mulish": "^5.1.0", - "@hcaptcha/vue3-hcaptcha": "^1.3.0", + "altcha": "^1.0.6", "vue": "^3.5.6", "vue-router": "^4.4.5" }, @@ -31,6 +31,11 @@ "vue-tsc": "^2.1.6" } }, + "node_modules/@altcha/crypto": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@altcha/crypto/-/crypto-0.0.1.tgz", + "integrity": "sha512-qZMdnoD3lAyvfSUMNtC2adRi666Pxdcw9zqfMU5qBOaJWqpN9K+eqQGWqeiKDMqL0SF+EytNG4kR/Pr/99GJ6g==" + }, "node_modules/@babel/helper-string-parser": { "version": "7.24.8", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", @@ -558,17 +563,6 @@ "resolved": "https://registry.npmjs.org/@fontsource-variable/mulish/-/mulish-5.1.0.tgz", "integrity": "sha512-ruMyFi0klNO3ILhkPDKxgNiXg0IxdZnqI5pVQ4MvJx9MdV9+aFKDRK9Cn6eOwz5YmDMeFmAZQBJkVEyyXM78jg==" }, - "node_modules/@hcaptcha/vue3-hcaptcha": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@hcaptcha/vue3-hcaptcha/-/vue3-hcaptcha-1.3.0.tgz", - "integrity": "sha512-IEonS6JiYdU7uy6aeib8cYtMO4nj8utwStbA9bWHyYbOvOvhpkV+AW8vfSKh6SntYxqle/TRwhv+kU9p92CfsA==", - "dependencies": { - "vue": "^3.2.19" - }, - "peerDependencies": { - "vue": "^3.0.0" - } - }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -1359,6 +1353,30 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/altcha": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/altcha/-/altcha-1.0.6.tgz", + "integrity": "sha512-H5bXDfbn/H9UQhW4kVdqPPRODvFsdOrftPUQ/hFWehjhV0LI8Mnq67knvJqCC3mw+s06h4KbIYGw43uVHCHEtQ==", + "hasInstallScript": true, + "dependencies": { + "@altcha/crypto": "^0.0.1" + }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "4.18.0" + } + }, + "node_modules/altcha/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", diff --git a/package.json b/package.json index 12fd3b6..a84fd54 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@fontsource-variable/mulish": "^5.1.0", - "@hcaptcha/vue3-hcaptcha": "^1.3.0", + "altcha": "^1.0.6", "vue": "^3.5.6", "vue-router": "^4.4.5" }, diff --git a/src/components/company/CaseStudyForm.vue b/src/components/company/CaseStudyForm.vue index e07a430..36d70f9 100644 --- a/src/components/company/CaseStudyForm.vue +++ b/src/components/company/CaseStudyForm.vue @@ -3,13 +3,13 @@
@@ -17,13 +17,13 @@ @@ -31,7 +31,7 @@
- -
{{ error }} @@ -79,133 +73,41 @@ aria-label="Soumettez le formulaire" />
+ +