Adjust conditions for unlawful cookies

This commit is contained in:
Kuba Orlik 2022-02-10 19:38:09 +01:00
parent 2b6346bca0
commit 54e5040348
4 changed files with 117 additions and 114 deletions

View File

@ -22,6 +22,7 @@ function generateHostPage(
isRequired: true,
title: `Cel ujawnienia danych właścicielowi domeny ${host}`,
...defaultValue('present'),
visibleIf: '{popup_type} != "none"',
choices: [
{
value: 'not_mentioned',
@ -140,7 +141,7 @@ function generateHostPage(
...defaultValue('was_processing_necessary'),
visibleIf: `{${f('legal_basis_type')}} = "legitimate_interest" or {${f(
'present'
)}} = "not_mentioned"`,
)}} = "not_mentioned" or {popup_type} = "none"`,
choices: [
{ value: 'yes', text: 'Tak, było konieczne' },
{ value: 'no', text: 'Nie, nie było konieczne' },

View File

@ -9,7 +9,6 @@ export type ParsedHostAnswers = ({
| 'mentioned_in_policy'
| 'mentioned_in_popup';
legal_basis_type: 'consent' | 'legitimate_interes' | 'not_mentioned';
popup_action: 'none' | 'closed_popup' | 'accept_all' | 'deny_all' | 'other';
was_processing_necessary: 'yes' | 'no' | 'not_sure';
} & (
| {

View File

@ -8,6 +8,22 @@ export class UnlawfulCookieAccess extends Problem {
getNecessaryExplainers(): ExplainerKey[] {
return [];
}
static qualifies(answers: ParsedAnswers, clusters: RequestCluster[]): boolean {
// są cookiesy, nie było zgody, nie są konieczne do działania strony
const cookie_clusters = Object.values(clusters).filter((c) => c.hasMarkedCookies());
return cookie_clusters.some((cluster) => {
const hostAnswers = answers.hosts[cluster.id];
return (
(hostAnswers.present == 'not_mentioned' ||
hostAnswers.present == 'not_before_making_a_choice' ||
['none', 'closed_popup', 'deny_all'].includes(answers.popup_action) ||
answers.popup_type === 'none') &&
hostAnswers.was_processing_necessary != 'yes'
);
});
}
getEmailContent() {
const cookie_clusters = Object.values(this.clusters).filter((c) => c.hasMarkedCookies());
const unnecessary_hosts = Object.entries(this.answers.hosts)
@ -152,17 +168,4 @@ export class UnlawfulCookieAccess extends Problem {
</>
);
}
static qualifies(answers: ParsedAnswers, clusters: RequestCluster[]): boolean {
// są cookiesy, nie było zgody, nie są konieczne do działania strony
const cookie_clusters = Object.values(clusters).filter((c) => c.hasMarkedCookies());
return cookie_clusters.some((cluster) => {
const hostAnswers = answers.hosts[cluster.id];
return (
(hostAnswers.present == 'not_mentioned' ||
hostAnswers.present == 'not_before_making_a_choice' ||
['none', 'closed_popup', 'deny_all'].includes(hostAnswers.popup_action)) &&
hostAnswers.was_processing_necessary != 'yes'
);
});
}
}