Skip to content

Commit 6cf565a

Browse files
committed
Code review changes
1 parent ea2a8c9 commit 6cf565a

File tree

2 files changed

+43
-52
lines changed

2 files changed

+43
-52
lines changed

customHttp.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ customHeaders:
55
value: >-
66
default-src 'self' *.kinde.com; style-src 'self' 'unsafe-inline'
77
https://fonts.googleapis.com; frame-src
8-
https://www.youtube-nocookie.com; child-src 'self'; connect-src 'self'
9-
ws https://api.management.inkeep.com https://api.inkeep.com
10-
wss://api.inkeep.com https://api.hsforms.com https://app.kinde.com
11-
https://kinde.com https://kinde-api-docs-proxy.pages.dev
12-
https://analytics.usehall.com; base-uri
13-
'none'; font-src 'self' https://fonts.gstatic.com; img-src 'self'
14-
data: https://storage.googleapis.com https://imagedelivery.net
8+
https://www.youtube-nocookie.com; child-src 'self';
9+
connect-src 'self' ws https://api.management.inkeep.com
10+
https://api.inkeep.com wss://api.inkeep.com https://api.hsforms.com
11+
https://app.kinde.com https://kinde.com
12+
https://kinde-api-docs-proxy.pages.dev https://analytics.usehall.com;
13+
base-uri 'none'; font-src 'self' https://fonts.gstatic.com; img-src
14+
'self' data: https://storage.googleapis.com https://imagedelivery.net
1515
https://customer-xcbruusbiervz265.cloudflarestream.com
1616
https://i.ytimg.com; media-src 'self'
1717
https://customer-xcbruusbiervz265.cloudflarestream.com
@@ -46,7 +46,8 @@ customHeaders:
4646
'sha256-w78n7W12c94ck4KhBCBA4NrjqkbDvSutqee+u+no0Tg='
4747
'sha256-/4BQzbQ0kgR1l13wtSM3rZ7nSvyV3PX/ShEfhZA1WoQ='
4848
'sha256-zB5rUhTjHzt+r/RjhhI8CyMb5Y63k+J7ICVfQ7iHJqA='
49-
'sha256-fFmtUWM/kGeUru+1rcCArLmnXKoEjis5I/dYQkZA+HM=' 'self'
49+
'sha256-fFmtUWM/kGeUru+1rcCArLmnXKoEjis5I/dYQkZA+HM='
50+
'sha256-13ENHEoc4foVPMgYwApSstLrIGX/6Y5xvroD2DkDFcE=' 'self'
5051
widgets.kinde.com kinde.com
5152
https://cdn.jsdelivr.net/npm/@scalar/[email protected]/dist/browser/standalone.min.js
5253
- key: Strict-Transport-Security
@@ -79,8 +80,8 @@ customHeaders:
7980
'self' ws https://api.management.inkeep.com https://api.inkeep.com
8081
wss://api.inkeep.com https://api.hsforms.com https://app.kinde.com
8182
https://kinde.com https://api-spec.kinde.com
82-
https://kinde-api-docs-proxy.pages.dev https://analytics.usehall.com; img-src
83-
https://storage.googleapis.com
83+
https://kinde-api-docs-proxy.pages.dev https://analytics.usehall.com;
84+
img-src https://storage.googleapis.com
8485
- pattern: /kinde-apis/frontend/*
8586
headers:
8687
- key: Content-Security-Policy
@@ -93,5 +94,5 @@ customHeaders:
9394
'self' ws https://api.management.inkeep.com https://api.inkeep.com
9495
wss://api.inkeep.com https://api.hsforms.com https://app.kinde.com
9596
https://kinde.com https://api-spec.kinde.com
96-
https://kinde-api-docs-proxy.pages.dev https://analytics.usehall.com; img-src
97-
https://storage.googleapis.com
97+
https://kinde-api-docs-proxy.pages.dev https://analytics.usehall.com;
98+
img-src https://storage.googleapis.com

src/components/SubProcessorsForm.astro

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -356,27 +356,27 @@
356356
};
357357

358358
document.addEventListener('DOMContentLoaded', function() {
359-
const form = document.getElementById('subProcessorsForm') as HTMLFormElement;
360-
const results = document.getElementById('results') as HTMLElement;
361-
const tableContainer = document.getElementById('subProcessorsTable') as HTMLElement;
359+
const form = document.getElementById('subProcessorsForm');
360+
const results = document.getElementById('results');
361+
const tableContainer = document.getElementById('subProcessorsTable');
362362

363363
if (!form || !results || !tableContainer) {
364364
console.error('Required form elements not found');
365365
return;
366366
}
367367

368368
// Function to get URL parameter value
369-
function getUrlParameter(name: string): string | null {
369+
function getUrlParameter(name) {
370370
const urlParams = new URLSearchParams(window.location.search);
371371
return urlParams.get(name);
372372
}
373373

374374
// Function to update URL with current selections
375375
function updateUrl() {
376-
const dataRegionInputs = form.querySelectorAll('input[name="dataRegion"]:checked') as NodeListOf<HTMLInputElement>;
377-
const servicesInputs = form.querySelectorAll('input[name="services"]:checked') as NodeListOf<HTMLInputElement>;
378-
const emailServicesInputs = form.querySelectorAll('input[name="emailServices"]:checked') as NodeListOf<HTMLInputElement>;
379-
const smsServicesInputs = form.querySelectorAll('input[name="smsServices"]:checked') as NodeListOf<HTMLInputElement>;
376+
const dataRegionInputs = form.querySelectorAll('input[name="dataRegion"]:checked');
377+
const servicesInputs = form.querySelectorAll('input[name="services"]:checked');
378+
const emailServicesInputs = form.querySelectorAll('input[name="emailServices"]:checked');
379+
const smsServicesInputs = form.querySelectorAll('input[name="smsServices"]:checked');
380380

381381
const dataRegion = dataRegionInputs.length > 0 ? dataRegionInputs[0].value : '';
382382
const services = Array.from(servicesInputs).map(input => input.value);
@@ -411,7 +411,7 @@
411411

412412
if (dataRegion) {
413413
const dataRegionValue = dataRegion.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
414-
const dataRegionInput = form.querySelector(`input[name="dataRegion"][value="${dataRegionValue}"]`) as HTMLInputElement;
414+
const dataRegionInput = form.querySelector(`input[name="dataRegion"][value="${dataRegionValue}"]`);
415415
if (dataRegionInput) {
416416
dataRegionInput.checked = true;
417417
}
@@ -421,7 +421,7 @@
421421
const serviceArray = services.split(',');
422422
serviceArray.forEach(service => {
423423
const serviceValue = service.charAt(0).toUpperCase() + service.slice(1);
424-
const serviceInput = form.querySelector(`input[name="services"][value="${serviceValue}"]`) as HTMLInputElement;
424+
const serviceInput = form.querySelector(`input[name="services"][value="${serviceValue}"]`);
425425
if (serviceInput) {
426426
serviceInput.checked = true;
427427
}
@@ -437,7 +437,7 @@
437437
} else {
438438
emailServicesValue = emailServices.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
439439
}
440-
const emailServicesInput = form.querySelector(`input[name="emailServices"][value="${emailServicesValue}"]`) as HTMLInputElement;
440+
const emailServicesInput = form.querySelector(`input[name="emailServices"][value="${emailServicesValue}"]`);
441441
if (emailServicesInput) {
442442
emailServicesInput.checked = true;
443443
}
@@ -452,7 +452,7 @@
452452
} else {
453453
smsServicesValue = smsServices.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
454454
}
455-
const smsServicesInput = form.querySelector(`input[name="smsServices"][value="${smsServicesValue}"]`) as HTMLInputElement;
455+
const smsServicesInput = form.querySelector(`input[name="smsServices"][value="${smsServicesValue}"]`);
456456
if (smsServicesInput) {
457457
smsServicesInput.checked = true;
458458
}
@@ -461,10 +461,10 @@
461461

462462
// Function to check if all required fields are filled
463463
function checkFormCompletion() {
464-
const dataRegionInputs = form.querySelectorAll('input[name="dataRegion"]:checked') as NodeListOf<HTMLInputElement>;
465-
const servicesInputs = form.querySelectorAll('input[name="services"]:checked') as NodeListOf<HTMLInputElement>;
466-
const emailServicesInputs = form.querySelectorAll('input[name="emailServices"]:checked') as NodeListOf<HTMLInputElement>;
467-
const smsServicesInputs = form.querySelectorAll('input[name="smsServices"]:checked') as NodeListOf<HTMLInputElement>;
464+
const dataRegionInputs = form.querySelectorAll('input[name="dataRegion"]:checked');
465+
const servicesInputs = form.querySelectorAll('input[name="services"]:checked');
466+
const emailServicesInputs = form.querySelectorAll('input[name="emailServices"]:checked');
467+
const smsServicesInputs = form.querySelectorAll('input[name="smsServices"]:checked');
468468

469469
const dataRegion = dataRegionInputs.length > 0 ? dataRegionInputs[0].value : '';
470470
const services = Array.from(servicesInputs).map(input => input.value);
@@ -473,29 +473,24 @@
473473

474474
if (dataRegion && services.length > 0 && emailServices && smsServices) {
475475
// Get relevant sub-processors
476-
const relevantSubProcessors: Array<{
477-
service: string;
478-
entityType: string;
479-
link: string;
480-
location: string;
481-
}> = [];
476+
const relevantSubProcessors = [];
482477

483478
services.forEach(service => {
484-
const serviceKey = service.toLowerCase() as keyof typeof subProcessorsData;
479+
const serviceKey = service.toLowerCase();
485480
if (subProcessorsData[serviceKey]) {
486-
subProcessorsData[serviceKey].forEach((processor: any) => {
487-
// Check if processor should be included based on conditions
488-
if (processor.condition) {
489-
if (processor.condition === "emailServices === 'Kinde default'") {
490-
if (emailServices !== 'Kinde default') {
491-
return; // Skip this processor
492-
}
493-
} else if (processor.condition === "smsServices === 'Kinde default'") {
494-
if (smsServices !== 'Kinde default') {
495-
return; // Skip this processor
481+
subProcessorsData[serviceKey].forEach((processor) => {
482+
// Check if processor should be included based on conditions
483+
if (processor.condition) {
484+
if (processor.condition === "emailServices === 'Kinde default'") {
485+
if (emailServices !== 'Kinde default') {
486+
return; // Skip this processor
487+
}
488+
} else if (processor.condition === "smsServices === 'Kinde default'") {
489+
if (smsServices !== 'Kinde default') {
490+
return; // Skip this processor
491+
}
496492
}
497493
}
498-
}
499494

500495
relevantSubProcessors.push({
501496
service: processor.service,
@@ -539,12 +534,7 @@
539534
});
540535
});
541536

542-
function displayResults(processors: Array<{
543-
service: string;
544-
entityType: string;
545-
link: string;
546-
location: string;
547-
}>) {
537+
function displayResults(processors) {
548538
if (processors.length === 0) {
549539
tableContainer.innerHTML = '<p class="text-gray-600">No sub-processors found for your configuration.</p>';
550540
} else {

0 commit comments

Comments
 (0)