From c13b53890ab05f0e08422249da4734d19e1b2488 Mon Sep 17 00:00:00 2001 From: Drew McMillan Date: Sun, 21 Sep 2025 23:26:12 +0100 Subject: [PATCH 1/5] privacy-signup-form --- functions/utilities/privacy/privacyKeys.js | 4 ++- functions/views/_layout.pug | 20 +++++++------- functions/views/signup.pug | 4 ++- static/scripts/user.js | 32 +++++++++++++++------- static/styles/forms.less | 4 +++ 5 files changed, 42 insertions(+), 22 deletions(-) diff --git a/functions/utilities/privacy/privacyKeys.js b/functions/utilities/privacy/privacyKeys.js index 67f7dff2..73b905f8 100644 --- a/functions/utilities/privacy/privacyKeys.js +++ b/functions/utilities/privacy/privacyKeys.js @@ -1,6 +1,8 @@ /* * -* YOU MUST update these values in parallel-squared repo as well as here: +* YOU MUST also update these values in +* parallel-squared repo +* static/scripts/user.js in this repo * */ diff --git a/functions/views/_layout.pug b/functions/views/_layout.pug index be83dbb9..f0b79cf0 100644 --- a/functions/views/_layout.pug +++ b/functions/views/_layout.pug @@ -140,16 +140,16 @@ html else article(class=(sidebarDisabled ? 'sidebarDisabled' : '')): block content - if user && !user.acceptedTerms && path !== '/privacy-notice' - #accept-terms.modal - .modal-background - .modal-body - h2 Privacy Updates - form(v-on:submit="user.acceptTerms") - p.checkbox - input#terms-modal(type="checkbox" required) - label(for="terms-modal") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Data Protection Terms & Conditions]. - button(type="submit") Continue + //- if user && !user.acceptedTerms && path !== '/privacy-notice' + //- #accept-terms.modal + //- .modal-background + //- .modal-body + //- h2 Privacy Updates + //- form(v-on:submit="user.acceptTerms") + //- p.checkbox + //- input#terms-modal(type="checkbox" required) + //- label(for="terms-modal") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Data Protection Terms & Conditions]. + //- button(type="submit") Continue if user && !user.code && user.showWelcomeMsg .modal(v-if="showWelcomeMsg") diff --git a/functions/views/signup.pug b/functions/views/signup.pug index a603e41c..0fe1430d 100644 --- a/functions/views/signup.pug +++ b/functions/views/signup.pug @@ -93,8 +93,10 @@ block content div(class="info") {{user.signupForm.messages[user.signupForm.type].emailOfParentSubtext}} input(type="email" v-model="user.signupForm.guardianEmail" required) - p.checkbox + p.checkbox(v-if="!user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") input#terms(type="checkbox" required) label(for="terms") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Privacy Notice]. + p(class="under13Terms" v-if="user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") We will + button(type="submit") Sign up diff --git a/static/scripts/user.js b/static/scripts/user.js index f2dd5ba8..6bf6d2f3 100755 --- a/static/scripts/user.js +++ b/static/scripts/user.js @@ -2,7 +2,9 @@ // Parallel Login // ============================================================================= - +const latestPrivacyVersion = 'privacy-sept-2025-001'; +const acceptedKey = `${latestPrivacyVersion}-accepted`; +const acceptedByKey = `${latestPrivacyVersion}-acceptedBy`; const ERRORS = { 'auth/invalid-email': 'This email address is invalid.', @@ -487,6 +489,13 @@ export default function() { let primaryEmailType = signupForm.type === 'teacher' ? 'teacher' : signupForm.primaryEmailType + const isUnder13 = signupForm.birthYear ? user.isUnderThirteen(signupForm.birthYear, signupForm.birthMonth) : false; + + const privacyData = isUnder13 ? {} : { + [acceptedKey]: Date.now(), + [acceptedByKey]: 'student-signup' + } + const signupData = { first: signupForm.first || null, last: signupForm.last || null, @@ -500,20 +509,23 @@ export default function() { postCode: signupForm.postCode || null, guardianEmail, acceptedTerms: true, + ...privacyData, userReference: generateUserReference(), primaryEmailType, source: window.SIGNUP_SOURCE || null } - userPromise = fbAuth.createUserWithEmailAndPassword(signupForm.email, signupForm.password) - .then(({user}) => { - return fbDatabase.collection('users').doc(user.uid).set(signupData); - }) - .catch(error => { - console.error(error); - signupForm.loading = false; - signupForm.error = ERRORS[error.code] || ERRORS.default; - }); + console.log('signupData', signupData, 'isUnder13', isUnder13); + + // userPromise = fbAuth.createUserWithEmailAndPassword(signupForm.email, signupForm.password) + // .then(({user}) => { + // return fbDatabase.collection('users').doc(user.uid).set(signupData); + // }) + // .catch(error => { + // console.error(error); + // signupForm.loading = false; + // signupForm.error = ERRORS[error.code] || ERRORS.default; + // }); } }; diff --git a/static/styles/forms.less b/static/styles/forms.less index e1a58abb..37bd201d 100644 --- a/static/styles/forms.less +++ b/static/styles/forms.less @@ -107,6 +107,10 @@ .info { display: inline-block; } + .under13Terms { + font-size: 16px; + color: inherit; + } .radio-label { display: inline-block; font-size: 16px; From be9c1cdacb06eca0610ede258520018a743965a0 Mon Sep 17 00:00:00 2001 From: Drew McMillan Date: Sun, 21 Sep 2025 23:26:59 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A7=20Continue=20to=20implement=20?= =?UTF-8?q?and=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/scripts/user.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/static/scripts/user.js b/static/scripts/user.js index 6bf6d2f3..426e0829 100755 --- a/static/scripts/user.js +++ b/static/scripts/user.js @@ -515,17 +515,15 @@ export default function() { source: window.SIGNUP_SOURCE || null } - console.log('signupData', signupData, 'isUnder13', isUnder13); - - // userPromise = fbAuth.createUserWithEmailAndPassword(signupForm.email, signupForm.password) - // .then(({user}) => { - // return fbDatabase.collection('users').doc(user.uid).set(signupData); - // }) - // .catch(error => { - // console.error(error); - // signupForm.loading = false; - // signupForm.error = ERRORS[error.code] || ERRORS.default; - // }); + userPromise = fbAuth.createUserWithEmailAndPassword(signupForm.email, signupForm.password) + .then(({user}) => { + return fbDatabase.collection('users').doc(user.uid).set(signupData); + }) + .catch(error => { + console.error(error); + signupForm.loading = false; + signupForm.error = ERRORS[error.code] || ERRORS.default; + }); } }; From 688614fb8a21f0ca786ddb6c02a7dd005c01d996 Mon Sep 17 00:00:00 2001 From: Drew McMillan Date: Tue, 23 Sep 2025 16:14:22 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A7=20Continue=20to=20implement=20?= =?UTF-8?q?and=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/views/signup.pug | 6 +++--- static/scripts/user.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/views/signup.pug b/functions/views/signup.pug index 0fe1430d..4734c30c 100644 --- a/functions/views/signup.pug +++ b/functions/views/signup.pug @@ -72,7 +72,7 @@ block content span {{user.signupForm.messages[user.signupForm.type].yearOfBirth}} select(v-model="user.signupForm.birthYear") - var year = 1920; - while year < 2019 + while year < 2024 option= year++ label(v-if="user.signupForm.type === 'teacher'") @@ -95,8 +95,8 @@ block content p.checkbox(v-if="!user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") input#terms(type="checkbox" required) - label(for="terms") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Privacy Notice]. + label(for="terms") We will email you with updates on Parallelograms, Parallel Circles and other offerings from Parallel. By checking this box you consent to receiving these emails, and also confirm that you have read and accept our #[a(href="/privacy-notice" target="_blank") Privacy Notice]. - p(class="under13Terms" v-if="user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") We will + p(class="under13Terms" v-if="user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") As this user is under the age of 13, we require a parent or guardian to read and accept our Privacy Notice. We will be in touch via the parent/guardian email address you have provided above. You will need to accept the Privacy Notice within 7 days and can continue to access the Parallel website in the meantime. button(type="submit") Sign up diff --git a/static/scripts/user.js b/static/scripts/user.js index 426e0829..5d2563cb 100755 --- a/static/scripts/user.js +++ b/static/scripts/user.js @@ -131,7 +131,7 @@ export default function() { const passwordForm = {loading: false, error: ''}; const signupForm = {error: null, loading: false, level: 'year6', - birthYear: 2000, type: location.hash === '#teacher' ? 'teacher' : 'student', primaryEmailType: null, messages: {}}; + birthYear: 2010, type: location.hash === '#teacher' ? 'teacher' : 'student', primaryEmailType: null, messages: {}}; signupForm.messages.student = { firstName: "Student first name", From 7b744665b3fe842e61983961dfab9342c1261b26 Mon Sep 17 00:00:00 2001 From: Drew McMillan Date: Wed, 24 Sep 2025 22:56:49 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=A7=20Continue=20to=20implement=20?= =?UTF-8?q?and=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/views/signup.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/views/signup.pug b/functions/views/signup.pug index 4734c30c..8effc33f 100644 --- a/functions/views/signup.pug +++ b/functions/views/signup.pug @@ -97,6 +97,6 @@ block content input#terms(type="checkbox" required) label(for="terms") We will email you with updates on Parallelograms, Parallel Circles and other offerings from Parallel. By checking this box you consent to receiving these emails, and also confirm that you have read and accept our #[a(href="/privacy-notice" target="_blank") Privacy Notice]. - p(class="under13Terms" v-if="user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") As this user is under the age of 13, we require a parent or guardian to read and accept our Privacy Notice. We will be in touch via the parent/guardian email address you have provided above. You will need to accept the Privacy Notice within 7 days and can continue to access the Parallel website in the meantime. + p(class="under13Terms" v-if="user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") As this student is under the age of 13, we require a parent or guardian to read and accept our Privacy Notice. We will be in touch via the parent/guardian email address you have provided above. The Privacy Notice will need to be accepted within 7 days and the student can continue to access the Parallel website in the meantime. button(type="submit") Sign up From e673e65e4f361380dba09367a7d694a3c48bb341 Mon Sep 17 00:00:00 2001 From: Drew McMillan Date: Wed, 24 Sep 2025 22:57:54 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A7=20Continue=20to=20implement=20?= =?UTF-8?q?and=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/views/_layout.pug | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/functions/views/_layout.pug b/functions/views/_layout.pug index 3a320b3b..6a84ab82 100644 --- a/functions/views/_layout.pug +++ b/functions/views/_layout.pug @@ -140,16 +140,16 @@ html else article(class=(sidebarDisabled ? 'sidebarDisabled' : '')): block content - if user && !user.acceptedTerms && path !== '/privacy-notice' - #accept-terms.modal - .modal-background - .modal-body - h2 Privacy Updates - form(v-on:submit="user.acceptTerms") - p.checkbox - input#terms-modal(type="checkbox" required) - label(for="terms-modal") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Data Privacy policy]. - button(type="submit") Continue + //- if user && !user.acceptedTerms && path !== '/privacy-notice' + //- #accept-terms.modal + //- .modal-background + //- .modal-body + //- h2 Privacy Updates + //- form(v-on:submit="user.acceptTerms") + //- p.checkbox + //- input#terms-modal(type="checkbox" required) + //- label(for="terms-modal") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Data Privacy policy]. + //- button(type="submit") Continue if user && !user.code && user.showWelcomeMsg .modal(v-if="showWelcomeMsg")