Prepare for unlawful data problem

This commit is contained in:
Kuba Orlik 2022-02-10 21:52:40 +01:00
parent 468391489c
commit 943e3bde1d
6 changed files with 83 additions and 34 deletions

View File

@ -1,20 +1,7 @@
import { RequestCluster } from '../../request-cluster';
import { ExplainerKey } from '../explainers';
import { v } from '../verbs';
import { Problem } from './problem';
function formatRange(cluster: RequestCluster) {
const parts = [] as string[];
console.log(cluster);
if (cluster.hasMarkedCookies()) {
parts.push('mojego identyfikatora internetowego pozyskanego z Cookie');
}
if (cluster.exposesOrigin()) {
parts.push('części mojej historii przeglądania');
}
return parts.join(' oraz ');
}
export default class NoInformationAtAllProblem extends Problem {
getEmailContent() {
const _ = (word: string) => v(word, this.answers.zaimek);
@ -24,13 +11,7 @@ export default class NoInformationAtAllProblem extends Problem {
<p>
{_('Moje')} dane osobowe zostały ujawnione podmiotom, które właścicielami domen:
</p>
<ul>
{this.getMarkedClusters().map((cluster) => (
<li key={cluster.id}>
{cluster.id} (w zakresie: {formatRange(cluster)})
</li>
))}
</ul>
{this.getRangeDescription()}
<p>
Na stronie brakuje jednak jakichkolwiek informacji o tym, jakie cele przetwarzania
takich danych oraz jakie podstawy prawne takiego przetwarzania.

View File

@ -1,14 +0,0 @@
import { RequestCluster } from '../../request-cluster';
import { ExplainerKey } from '../explainers';
import { ParsedAnswers } from '../parse-answers';
export abstract class Problem {
constructor(public answers: ParsedAnswers, public clusters: Record<string, RequestCluster>) {}
getMarkedClusters() {
return Object.values(this.clusters).filter((c) => c.hasMarks());
}
abstract getEmailContent(): JSX.Element;
abstract getNecessaryExplainers(): ExplainerKey[];
}

View File

@ -0,0 +1,38 @@
import { RequestCluster } from '../../request-cluster';
import { ExplainerKey } from '../explainers';
import { ParsedAnswers } from '../parse-answers';
function formatRange(cluster: RequestCluster) {
const parts = [] as string[];
console.log(cluster);
if (cluster.hasMarkedCookies()) {
parts.push('mojego identyfikatora internetowego pozyskanego z Cookie');
}
if (cluster.exposesOrigin()) {
parts.push('części mojej historii przeglądania');
}
return parts.join(' oraz ');
}
export abstract class Problem {
constructor(public answers: ParsedAnswers, public clusters: Record<string, RequestCluster>) {}
abstract getEmailContent(): JSX.Element;
abstract getNecessaryExplainers(): ExplainerKey[];
getMarkedClusters() {
return Object.values(this.clusters).filter((c) => c.hasMarks());
}
getRangeDescription() {
return (
<ul>
{this.getMarkedClusters().map((cluster) => (
<li key={cluster.id}>
{cluster.id} (w zakresie: {formatRange(cluster)})
</li>
))}
</ul>
);
}
}

View File

@ -0,0 +1,35 @@
import { RequestCluster } from '../../request-cluster';
import { ExplainerKey } from '../explainers';
import { ParsedAnswers, ParsedHostAnswers } from '../parse-answers';
import { v } from '../verbs';
import { Problem } from './problem';
type UnlawfulDataClassification = 'no_purpose';
export function classifyUnlawfulData(
hostAnswers: ParsedHostAnswers,
cluster: RequestCluster
): UnlawfulDataClassification {
if (hostAnswers.present == 'not_mentioned' && hostAnswers.was_processing_necessary == 'no') {
return 'no_purpose';
}
}
export class UnlawfulData extends Problem {
static qualifies(answers: ParsedAnswers, clusters: RequestCluster[]): boolean {}
getEmailContent() {
const _ = (key: string) => v(key, this.answers.zaimek);
return (
<>
<h2>Przetwarzanie danych osobowych bez ważnej podsawy prawnej</h2>
<p>
{_('Moje')} dane osobowe zostały ujawnione podmiotom, które właścicielami domen:
</p>
{this.getRangeDescription()}
</>
);
}
getNecessaryExplainers() {
return [] as ExplainerKey[];
}
}

View File

@ -27,3 +27,11 @@ nav {
margin-right: 0.5rem;
}
}
p,
li,
h1,
h2,
h3 {
max-width: 70ex;
}

View File

@ -31,6 +31,7 @@ const words = {
odmówiłeś: ['odmówiłeś', 'odmówiłaś', 'odmówiłoś', 'odmówiliście'],
odznaczyłem: ['odznaczyłem', 'odznaczyłam', 'odznaczyłom', 'odznaczyliśmy'],
proszę: ['proszę', 'proszę', 'proszę', 'prosimy'],
odmówiłem: ['odmówiłem', 'odmówiłam', 'odmówiłom', 'odmówiliśmy'],
} as { [key: string]: string[] };
export default words;