diff --git a/Makefile b/Makefile index 39fa09fc..02e5ff62 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ nuclear: -docker rm -vf $$(docker ps -a -q) -docker rmi -f $$(docker images -a -q) -docker system prune -af --volumes + -docker volume rm donations_checkout_node_modules-vol # original commands interactive: build backing diff --git a/package-lock.json b/package-lock.json index 5f47749d..5e4ff79d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2571,6 +2571,15 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -2926,7 +2935,11 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } } } }, @@ -4615,6 +4628,12 @@ "schema-utils": "^0.4.5" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -6140,6 +6159,12 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "nan": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", + "optional": true + }, "nanoid": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", @@ -8738,6 +8763,11 @@ } } }, + "vue-google-autocomplete": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/vue-google-autocomplete/-/vue-google-autocomplete-1.1.4.tgz", + "integrity": "sha512-a1aRG+F0A8crf/RnWW1EXxA/aaFh/Qpu6GSxOjfpWPNgvReNttYgAcwft1I+XvULuNjFc6YNciv/tHUHxxt0Qg==" + }, "vue-hot-reload-api": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz", diff --git a/package.json b/package.json index 714ba460..20b306e3 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "vee-validate": "^3.2.1", "vue": "^2.7.0", "vue-clipboard2": "^0.3.0", + "vue-google-autocomplete": "^1.1.4", "vue-js-modal": "^2.0.1", "vue-loader": "^15.7.0", "vue-router": "^3.5.2", diff --git a/server/app.py b/server/app.py index 684d3f01..ed151422 100644 --- a/server/app.py +++ b/server/app.py @@ -602,6 +602,7 @@ def donate_form(): bundles=bundles, stripe=app.config["STRIPE_KEYS"]["publishable_key"], recaptcha=app.config["RECAPTCHA_KEYS"]["site_key"], + autocomplete=app.config["ADDRESS_AUTOCOMPLETE_KEY"], use_thermometer=USE_THERMOMETER, ) diff --git a/server/config.py b/server/config.py index 0c730575..d555108a 100644 --- a/server/config.py +++ b/server/config.py @@ -144,3 +144,8 @@ def bool_env(val): BAD_ACTOR_API_URL = os.getenv("BAD_ACTOR_API_URL", None) BAD_ACTOR_NOTIFICATION_URL = os.getenv("BAD_ACTOR_NOTIFICATION_URL", None) BLOCK_LIST = os.getenv("BLOCK_LIST", None) + +######## +# Google APIs +# +ADDRESS_AUTOCOMPLETE_KEY = os.getenv("ADDRESS_AUTOCOMPLETE_KEY", None) diff --git a/server/forms.py b/server/forms.py index ed9b6884..d6a6ff0a 100644 --- a/server/forms.py +++ b/server/forms.py @@ -76,6 +76,9 @@ class DonateForm(BaseForm): u"Installment Period", [validators.AnyOf(["yearly", "monthly", "None"])] ) zipcode = StringField(u"ZIP Code", [validators.Length(max=5)]) + address = StringField(u"Address") + city = StringField(u"City") + state = StringField(u"State") class CircleForm(BaseForm): diff --git a/server/static/js/src/entry/donate/TopForm.vue b/server/static/js/src/entry/donate/TopForm.vue index 0d86c7c0..a7e97220 100644 --- a/server/static/js/src/entry/donate/TopForm.vue +++ b/server/static/js/src/entry/donate/TopForm.vue @@ -82,8 +82,8 @@ -
- {{ genericErrorMessage }} -
++ {{ genericErrorMessage }} +
+By donating, you will receive member communications at the email address you provide.
@@ -196,6 +252,7 @@ diff --git a/server/static/js/src/entry/donate/constants.js b/server/static/js/src/entry/donate/constants.js index f1e5feb7..4abbb34c 100644 --- a/server/static/js/src/entry/donate/constants.js +++ b/server/static/js/src/entry/donate/constants.js @@ -26,6 +26,24 @@ export const BASE_FORM_STATE = { validator: validators.isNotEmpty, message: 'Enter your last name', }, + address: { + value: '', + isValid: false, + validator: validators.isNotEmpty, + message: 'Enter your address', + }, + city: { + value: '', + isValid: false, + validator: validators.isNotEmpty, + message: 'Enter your city', + }, + state: { + value: '', + isValid: false, + validator: validators.isNotEmpty, + message: 'Enter your state', + }, reason: { value: '', isValid: false, diff --git a/server/templates/donate-form.html b/server/templates/donate-form.html index aabbd593..c4335367 100644 --- a/server/templates/donate-form.html +++ b/server/templates/donate-form.html @@ -10,11 +10,12 @@ {% endblock %} {% block head_scripts %} -{% if form_data and message %} - -{% endif %} + + {% if form_data and message %} + + {% endif %} {% endblock %} {% block content %} diff --git a/webpack/config.common.js b/webpack/config.common.js index a1bc73d3..893f41b3 100644 --- a/webpack/config.common.js +++ b/webpack/config.common.js @@ -62,7 +62,6 @@ module.exports = { { test: /\.vue$/, - exclude: /node_modules/, loader: 'vue-loader', },