Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration/encryption #232

Merged
merged 7 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/Detection_Engine/detection_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_status(self, ner_count, personal_data,financial_data, contact_data, medi
w_eth = 0.4
w_bio = 0.8

e_personal_data = (math.exp(ner_count) + math.exp(financial_data) + math.exp(contact_data) + math.exp(personal_data))
e_personal_data = math.exp((ner_count) + financial_data + contact_data + personal_data)
e_med = math.exp(medical_data)
e_gen = math.exp(genetic_data)
e_eth = math.exp(ethnic_data)
Expand Down
2 changes: 1 addition & 1 deletion gnd-app/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<button [routerLink]="['/upload']" id="UploadButton" type="button"
class="text-white bg-gray-800 hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700">Upload
a File</button>
<button [routerLink]="['/inbox']" id="InboxButton" type="button"
<button [routerLink]="['/outlook-inbox']" id="InboxButton" type="button"
class="text-white bg-gray-800 hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700">View
Inbox</button>

Expand Down
8 changes: 8 additions & 0 deletions gnd-app/src/app/inbox/inbox.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,12 @@ body {
height: auto;
white-space: normal;
font-family: "Roboto Bold";
}

.center-footer {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin-top: 20px;
}
16 changes: 15 additions & 1 deletion gnd-app/src/app/inbox/inbox.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,19 @@ <h2 class="analysis-box-header">Analysis Result:</h2>



</div>
</div>

<div class="buttons">
<button *ngIf="result" (click)="generatePDFReport()" type="button"
class="text-white bg-gray-800 hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700">Download
Report</button>
<!-- <button *ngIf="uploadedFileName" [routerLink]="['/violations']" type="button" class="text-white bg-gray-800 hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700">View Violations</button> -->
<!-- <button *ngIf="uploadedFileName" [routerLink]="['/report']" type="button" class="text-white bg-gray-800 hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700">View Report</button> -->
<!-- <button *ngIf="result" (click)="onVisualize()" id="vizButton" type="button"
class="text-white bg-gray-800 hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700">Visualise</button> -->
</div>
<div class="center-footer">
<p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">
GND may make mistakes. Please verify that your files are compliant with GDPR laws.</span></p>
</div>
</div>
31 changes: 29 additions & 2 deletions gnd-app/src/app/inbox/inbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import axios from 'axios';
import { Subscription } from 'rxjs';
import * as introJs from 'intro.js/intro.js';
import {WalkthroughService} from '../services/walkthrough.service';
import { ReportGenerationService, ViolationData } from '../services/report-generation.service';

@Component({
selector: 'app-inbox',
Expand All @@ -35,7 +36,9 @@ export class InboxComponent implements OnInit, OnDestroy {
ca_statement: string = '';
// currentAnalysis: any = {};

constructor(private http: HttpClient, private walkthroughService: WalkthroughService, private router: Router) { }
constructor(private http: HttpClient, private walkthroughService: WalkthroughService, private router: Router,
private reportGenerationService: ReportGenerationService
) { }

ngOnInit(): void {

Expand Down Expand Up @@ -89,6 +92,7 @@ export class InboxComponent implements OnInit, OnDestroy {
}


// documentStatus: string = "";
documentStatus: string = "";
nerCount: number = 0;
location: string = "";
Expand All @@ -103,7 +107,7 @@ export class InboxComponent implements OnInit, OnDestroy {
ragScore: string = "";

docStatus(status: number): string {
if(status == 1){
if(status <= 0.6){
return "Compliant"
}
return "Non-Compliant"
Expand Down Expand Up @@ -416,4 +420,27 @@ export class InboxComponent implements OnInit, OnDestroy {
toggleWalkthrough() {
this.startIntro();
}

async generatePDFReport() {
const data: ViolationData = {
documentStatus: this.documentStatus,
nerCount: this.nerCount,
location: this.location,
personalData: this.personalData,
financialData: this.financialData,
contactData: this.contactData,
medicalData: this.medicalData,
ethnicData: this.ethnicData,
biometricData: this.biometricData,
geneticData: this.geneticData,
consentAgreement: this.consentAgreement,
ragScore: this.ragScore
};
try {
await this.reportGenerationService.generatePDF(data);
}
catch (error) {
console.error('Error generating PDF:', error);
}
}
}
8 changes: 8 additions & 0 deletions gnd-app/src/app/outlook-inbox/outlook-inbox.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,12 @@ body {
height: auto;
white-space: normal;
font-family: "Roboto Bold";
}

.center-footer {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin-top: 20px;
}
4 changes: 4 additions & 0 deletions gnd-app/src/app/outlook-inbox/outlook-inbox.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,8 @@ <h2 class="analysis-box-header">Analysis Result:</h2>
<!-- <button *ngIf="result" (click)="onVisualize()" id="vizButton" type="button"
class="text-white bg-gray-800 hover:bg-gray-900 focus:outline-none focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700 dark:border-gray-700">Visualise</button> -->
</div>
<div class="center-footer">
<p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">
GND may make mistakes. Please verify that your files are compliant with GDPR laws.</span></p>
</div>
</div>
Loading
Loading