From a2da06af12726678837f27c908f14d369200b8fd Mon Sep 17 00:00:00 2001 From: Dominik Date: Fri, 13 Dec 2024 09:16:08 +0100 Subject: [PATCH 01/12] ci: adjust dockerfile ENV for staging --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff083ed8f6..7c60317c6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,14 +41,17 @@ COPY . /app RUN --mount=type=secret,id=GITHUB_PERSONAL_TOKEN export GITHUB_PERSONAL_TOKEN=$(cat /run/secrets/GITHUB_PERSONAL_TOKEN) && git config --global url."https://$GITHUB_PERSONAL_TOKEN@github.com/".insteadOf ssh://git@github.com -RUN (\ +RUN \ npm ci; \ + --mount=type=secret,id=GOOGLE_RECAPTCHA_SITE_KEY \ + sh -c ' \ if test $AIDA_URL; then \ curl -o /app/node_modules/asktravis/dist/aida.js $AIDA_URL; \ curl -o /app/node_modules/asktravis/dist/aida.js.map $AIDA_URL.map || true; \ fi; \ - ember build --environment=production; \ -) + export GOOGLE_RECAPTCHA_SITE_KEY=$(cat /run/secrets/GOOGLE_RECAPTCHA_SITE_KEY) && \ + ember build --environment=production' + RUN cp -a public/* dist/ From de9117e90d45e853018cdb6bac9b572aa24bc37b Mon Sep 17 00:00:00 2001 From: Dominik Date: Fri, 13 Dec 2024 10:37:15 +0100 Subject: [PATCH 02/12] ci: move npm command to separate RUN --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7c60317c6c..f3351eb3de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,8 +41,9 @@ COPY . /app RUN --mount=type=secret,id=GITHUB_PERSONAL_TOKEN export GITHUB_PERSONAL_TOKEN=$(cat /run/secrets/GITHUB_PERSONAL_TOKEN) && git config --global url."https://$GITHUB_PERSONAL_TOKEN@github.com/".insteadOf ssh://git@github.com +RUN npm ci + RUN \ - npm ci; \ --mount=type=secret,id=GOOGLE_RECAPTCHA_SITE_KEY \ sh -c ' \ if test $AIDA_URL; then \ From 5e31e85dfd85fbcedcc0191e9208037326cfdd59 Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 22 Jan 2025 13:24:04 +0100 Subject: [PATCH 03/12] build: add google gtm env vars --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index f3351eb3de..84e0059f69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,8 @@ RUN \ curl -o /app/node_modules/asktravis/dist/aida.js.map $AIDA_URL.map || true; \ fi; \ export GOOGLE_RECAPTCHA_SITE_KEY=$(cat /run/secrets/GOOGLE_RECAPTCHA_SITE_KEY) && \ + export GOOGLE_ANALYTICS_ID=$(cat /run/secrets/GOOGLE_ANALYTICS_ID) && \ + export GOOGLE_TAGS_CONTAINER_ID=$(cat /run/secrets/GOOGLE_TAGS_CONTAINER_ID) && \ ember build --environment=production' From a9fff444b844f6abbd603910592da5a252774c59 Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 22 Jan 2025 14:44:37 +0100 Subject: [PATCH 04/12] build: add last google related env --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 84e0059f69..5e49a5fa8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,6 +53,7 @@ RUN \ export GOOGLE_RECAPTCHA_SITE_KEY=$(cat /run/secrets/GOOGLE_RECAPTCHA_SITE_KEY) && \ export GOOGLE_ANALYTICS_ID=$(cat /run/secrets/GOOGLE_ANALYTICS_ID) && \ export GOOGLE_TAGS_CONTAINER_ID=$(cat /run/secrets/GOOGLE_TAGS_CONTAINER_ID) && \ + export GOOGLE_TAGS_PARAMS=$(cat /run/secrets/GOOGLE_TAGS_PARAMS) && \ ember build --environment=production' From 0acd43684b900d4f8490b446cd0337a1d0cc9dba Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 22 Jan 2025 15:16:43 +0100 Subject: [PATCH 05/12] build: add missing mount statments --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5e49a5fa8d..ee45ee244c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,9 @@ RUN npm ci RUN \ --mount=type=secret,id=GOOGLE_RECAPTCHA_SITE_KEY \ + --mount=type=secret,id=GOOGLE_ANALYTICS_ID \ + --mount=type=secret,id=GOOGLE_TAGS_CONTAINER_ID \ + --mount=type=secret,id=GOOGLE_TAGS_PARAMS \ sh -c ' \ if test $AIDA_URL; then \ curl -o /app/node_modules/asktravis/dist/aida.js $AIDA_URL; \ From 8444189cbdec8523dc2687cd4123cb9b767eee58 Mon Sep 17 00:00:00 2001 From: Dominik Date: Thu, 9 Nov 2023 16:23:51 +0100 Subject: [PATCH 06/12] feat: add billing email validation --- app/components/billing/payment-details-tab.js | 17 +++++++++++++++++ .../components/billing/payment-details-tab.hbs | 1 + 2 files changed, 18 insertions(+) diff --git a/app/components/billing/payment-details-tab.js b/app/components/billing/payment-details-tab.js index 63222b470a..0ec05651a2 100644 --- a/app/components/billing/payment-details-tab.js +++ b/app/components/billing/payment-details-tab.js @@ -161,6 +161,23 @@ export default Component.extend({ onCaptchaResolved(reCaptchaResponse) { this.updatePaymentDetails.perform(reCaptchaResponse); }, + validateBillingEmails(billingEmailField) { + if (!billingEmailField) { + return true; + } + + const emailRegex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i; + const emails = billingEmailField.split(',').map(email => email.trim()); + + const invalidEmails = emails.filter(email => !emailRegex.test(email)); + + if (invalidEmails.length > 0) { + const invalidEmailsList = invalidEmails.join(', '); + return `The following email addresses are not valid: ${invalidEmailsList}`; + } + + return true; + }, submit() { if (!this.enableSubmit || this.disableForm) return; window.grecaptcha.execute(); diff --git a/app/templates/components/billing/payment-details-tab.hbs b/app/templates/components/billing/payment-details-tab.hbs index cb0172990e..93ea7ca6a7 100644 --- a/app/templates/components/billing/payment-details-tab.hbs +++ b/app/templates/components/billing/payment-details-tab.hbs @@ -59,6 +59,7 @@ @disabled={{this.disableForm}} @showValidationStatusIcons={{false}} @onChange={{action (mut this.billingInfo.billingEmail)}} + @validator={{action "validateBillingEmails"}} as |Field| > From 5762f72fc1cb77fb646595dae60055d2f15ff33c Mon Sep 17 00:00:00 2001 From: Dominik Date: Fri, 10 Nov 2023 11:52:01 +0100 Subject: [PATCH 07/12] fix: correct regex for email validation --- app/components/billing/payment-details-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/billing/payment-details-tab.js b/app/components/billing/payment-details-tab.js index 0ec05651a2..4a3770d9e1 100644 --- a/app/components/billing/payment-details-tab.js +++ b/app/components/billing/payment-details-tab.js @@ -166,7 +166,7 @@ export default Component.extend({ return true; } - const emailRegex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i; + const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/; const emails = billingEmailField.split(',').map(email => email.trim()); const invalidEmails = emails.filter(email => !emailRegex.test(email)); From 8ee23e008530e5310b7bb2efef4ed22e8fd9a9aa Mon Sep 17 00:00:00 2001 From: Dominik Date: Mon, 13 Nov 2023 08:56:42 +0100 Subject: [PATCH 08/12] Trigger CI From 2118923b1e05e4cdb9dc3a58b7c90895f88908ee Mon Sep 17 00:00:00 2001 From: Dominik Date: Mon, 13 Nov 2023 09:28:24 +0100 Subject: [PATCH 09/12] test: fix attempt --- tests/integration/components/billing/payment-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/components/billing/payment-test.js b/tests/integration/components/billing/payment-test.js index bec7c58d6d..daa665a4b6 100644 --- a/tests/integration/components/billing/payment-test.js +++ b/tests/integration/components/billing/payment-test.js @@ -30,7 +30,7 @@ module('Integration | Component | billing-payment', function (hooks) { firstName: '', lastName: '', companyName: '', - billingEmail: '', + billingEmail: 'some@email.com', street: '', billingSuite: '', billingCity: '', From 631b85136cd436647db888c7ab86a65d5c6c580a Mon Sep 17 00:00:00 2001 From: Dominik Date: Mon, 13 Nov 2023 11:55:52 +0100 Subject: [PATCH 10/12] feat: add validation on initial account setup --- app/components/billing/first-plan.js | 18 +++++++++++++++++- .../components/billing/first-plan.hbs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/components/billing/first-plan.js b/app/components/billing/first-plan.js index 6d147c26d2..bb4fb81a9d 100644 --- a/app/components/billing/first-plan.js +++ b/app/components/billing/first-plan.js @@ -326,7 +326,23 @@ export default Component.extend({ }, togglePlanDetails() { this.set('planDetailsVisible', !this.planDetailsVisible); - } + }, + validateBillingEmails(billingEmailField) { + if (!billingEmailField) { + return true; + } + + const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/; + const emails = billingEmailField.split(',').map(email => email.trim()); + const invalidEmails = emails.filter(email => !emailRegex.test(email)); + + if (invalidEmails.length > 0) { + const invalidEmailsList = invalidEmails.join(', '); + return `The following email addresses are not valid: ${invalidEmailsList}`; + } + + return true; + }, } }); diff --git a/app/templates/components/billing/first-plan.hbs b/app/templates/components/billing/first-plan.hbs index 88c2c144dd..5e6174af5e 100644 --- a/app/templates/components/billing/first-plan.hbs +++ b/app/templates/components/billing/first-plan.hbs @@ -43,7 +43,7 @@
From 05bcc9a3c46bf5073d064321639f6058ea7bdc02 Mon Sep 17 00:00:00 2001 From: Dominik Date: Mon, 13 Nov 2023 12:16:43 +0100 Subject: [PATCH 11/12] refactor: remove not needed bracket --- app/templates/account-activation.hbs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/templates/account-activation.hbs b/app/templates/account-activation.hbs index 7ee21ef775..772d17f2b8 100644 --- a/app/templates/account-activation.hbs +++ b/app/templates/account-activation.hbs @@ -14,8 +14,7 @@ + > - < From 66c4ae2eb1022a4ff2902920f030ef4c3ee9cd7e Mon Sep 17 00:00:00 2001 From: Dominik Date: Mon, 13 Nov 2023 13:00:14 +0100 Subject: [PATCH 12/12] refactor: replace old email validation with new --- app/templates/components/billing/first-plan.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/components/billing/first-plan.hbs b/app/templates/components/billing/first-plan.hbs index 5e6174af5e..13c20f1f0e 100644 --- a/app/templates/components/billing/first-plan.hbs +++ b/app/templates/components/billing/first-plan.hbs @@ -43,7 +43,7 @@