From fa988cd0f4bdc853d57d8d77f4eedf19ee622a10 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Thu, 11 Nov 2021 20:25:06 +0100 Subject: [PATCH] Add option to classify data as location data --- report-window/domain-summary.tsx | 1 + report-window/report-window.tsx | 16 +++++++++++++++- stolen-data-entry.ts | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/report-window/domain-summary.tsx b/report-window/domain-summary.tsx index 77d03c1..a96cb13 100644 --- a/report-window/domain-summary.tsx +++ b/report-window/domain-summary.tsx @@ -5,6 +5,7 @@ import { Classifications, Sources } from "../stolen-data-entry"; const emailClassifications: Record = { id: "sztucznie nadane mi ID", history: "część mojej historii przeglądania", + location: "informacje na temat mojej lokalizacji geograficznej", }; const emailSources: Record = { diff --git a/report-window/report-window.tsx b/report-window/report-window.tsx index c15fb11..3e55fe8 100644 --- a/report-window/report-window.tsx +++ b/report-window/report-window.tsx @@ -1,6 +1,8 @@ import React from "react"; import ReactDOM from "react-dom"; import { getMemory } from "../memory"; +import { Classifications } from "../stolen-data-entry"; +import { useEmitter } from "../util"; import EmailTemplate from "./email-template"; import HARConverter from "./har-converter"; @@ -8,6 +10,10 @@ function Report() { const origin = new URL(document.location.toString()).searchParams.get( "origin" ); + const [counter, setCounter] = useEmitter(getMemory()); + function refresh() { + setCounter((c) => c + 1); + } const clusters = getMemory().getClustersForOrigin(origin); const marked_entries = Object.values(clusters) .map((cluster) => cluster.getMarkedRequests()) @@ -51,10 +57,18 @@ function Report() { {entry.value} - { + entry.classification = e.target + .value as keyof typeof Classifications; + refresh(); + }} + > {[ ["history", "Historia przeglądania"], ["id", "Sztucznie nadane id"], + ["location", "Informacje na temat mojej lokalizacji"], ].map(([key, name]) => (