Skip to content

Commit

Permalink
Perform review of commit 75bd648740a2de1ad36414d2dea2f7fa3b050e4d
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Oct 23, 2024
1 parent cf40d85 commit 6ee9e21
Show file tree
Hide file tree
Showing 282 changed files with 1,374 additions and 1,337 deletions.
8 changes: 6 additions & 2 deletions client/app/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ h6 {
}

.message,
.message-whistle-blower {
.message-whistleblower {
padding: 1em;
border: 1px solid #c8d1e0;
}
Expand Down Expand Up @@ -519,7 +519,7 @@ th:not(:first-child, :nth-last-child(-n+4)) {
margin-top: 1em;
}

.whistle-blower-file .top-row {
.whistleblower-file .top-row {
min-height: 30px;
}

Expand Down Expand Up @@ -1135,3 +1135,7 @@ body .dropdown-visible > div.multiselect-dropdown > div > span.dropdown-btn {
--bs-alert-color: #1D1F24;
--bs-alert-bg: #EBEFF5;
}

.tooltip {
position: absolute;
}
4 changes: 2 additions & 2 deletions client/app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { HTTP_INTERCEPTORS, withInterceptorsFromDi, provideHttpClient, HttpClien
import { appInterceptor, ErrorCatchingInterceptor, CompletedInterceptor } from "@app/services/root/app-interceptor.service";
import { APP_BASE_HREF, LocationStrategy, HashLocationStrategy, NgOptimizedImage } from "@angular/common";
import { FlowInjectionToken, NgxFlowModule } from "@flowjs/ngx-flow";
import { NgbDatepickerI18n, NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { NgbDatepickerI18n, NgbModule, NgbTooltipModule} from "@ng-bootstrap/ng-bootstrap";
import { CustomDatepickerI18n } from "@app/shared/services/custom-datepicker-i18n";
import { appRoutes } from "@app/app.routes";
import { BrowserModule, bootstrapApplication } from "@angular/platform-browser";
Expand All @@ -56,7 +56,7 @@ import {provideRouter} from "@angular/router";
bootstrapApplication(AppComponent, {
providers: [
provideRouter(appRoutes),
importProvidersFrom(NgbModule, BrowserModule, translationModule, NgSelectModule, FormsModule, NgIdleKeepaliveModule.forRoot(), MarkdownModule.forRoot({
importProvidersFrom(NgbModule, BrowserModule, translationModule, NgSelectModule, FormsModule, NgbTooltipModule, NgIdleKeepaliveModule.forRoot(), MarkdownModule.forRoot({
markedOptions: {
provide: MARKED_OPTIONS,
useValue: {
Expand Down
6 changes: 4 additions & 2 deletions client/app/src/app-guard.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Injectable, inject } from "@angular/core";
import {Injectable, inject} from "@angular/core";
import {Router, UrlTree} from "@angular/router";
import {Observable} from "rxjs";
import {AuthenticationService} from "@app/services/helper/authentication.service";
import {AppDataService} from "@app/app-data.service";
import {UtilsService} from "@app/shared/services/utils.service";

@Injectable({
providedIn: "root"
Expand All @@ -11,10 +12,11 @@ export class SessionGuard {
private router = inject(Router);
private appDataService = inject(AppDataService);
authenticationService = inject(AuthenticationService);
protected utilsService = inject(UtilsService);

canActivate(): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if (!this.authenticationService.session) {
this.router.navigateByUrl("/login").then();
this.utilsService.routeGuardRedirect();
return false;
} else {
this.appDataService.page = this.router.url;
Expand Down
4 changes: 1 addition & 3 deletions client/app/src/models/authentication/session.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {redirectResolverModel} from "../resolvers/redirect-resolver-model";

export class Session {
redirect: redirectResolverModel;
id: string;
role: string;
encryption: boolean;
Expand All @@ -13,6 +10,7 @@ export class Session {
two_factor: boolean;
permissions: { can_upload_files: boolean };
token: any;
redirect: string;
}

export interface Properties {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
WhistleblowerIdentity,
Comment
} from "@app/models/app/shared-public-model";
import {IarData} from "@app/models/reciever/Iar-data";
import {IarData} from "@app/models/receiver/iar-data";
import {RedactionData} from "@app/models/component-model/redaction";

export class RecieverTipData {
Expand Down
2 changes: 1 addition & 1 deletion client/app/src/models/resolvers/rtips-resolver-model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Data} from "@app/models/reciever/reciever-tip-data";
import {Data} from "@app/models/receiver/receiver-tip-data";

export interface rtipResolverModel {
submissionStatusStr: string;
Expand Down
2 changes: 1 addition & 1 deletion client/app/src/models/whistleblower/submission-resource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Answers} from "@app/models/reciever/reciever-tip-data";
import {Answers} from "@app/models/receiver/receiver-tip-data";

export class submissionResourceModel {
context_id: number;
Expand Down
2 changes: 1 addition & 1 deletion client/app/src/models/whistleblower/wb-tip-data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {RFile, WbFile, WhistleblowerIdentity, Comment} from "@app/models/app/shared-public-model";
import {Context, Answers, Questionnaire3, Questionnaire} from "@app/models/reciever/reciever-tip-data";
import {Context, Answers, Questionnaire3, Questionnaire} from "@app/models/receiver/receiver-tip-data";
import {RedactionData} from "@app/models/component-model/redaction";

export class WbTipData {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component} from "@angular/core";
import { PasswordChangeComponent } from "../../../shared/partials/password-change/password-change.component";
import { TranslateModule } from "@ngx-translate/core";
import { TranslatorPipe } from "@app/shared/pipes/translate";
import {PasswordChangeComponent} from "../../../shared/partials/password-change/password-change.component";
import {TranslateModule} from "@ngx-translate/core";
import {TranslatorPipe} from "@app/shared/pipes/translate";

@Component({
selector: "src-force-password-change",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Component, inject } from "@angular/core";
import {Component, inject} from "@angular/core";
import {TwoFactorAuthData} from "@app/services/helper/2fa.data.service";
import {HttpService} from "@app/shared/services/http.service";
import {PreferenceResolver} from "@app/shared/resolvers/preference.resolver";
import {AuthenticationService} from "@app/services/helper/authentication.service";
import {Router} from "@angular/router";
import { Enable2fa } from "../../../shared/partials/enable-2fa/enable-2fa";
import { TranslateModule } from "@ngx-translate/core";
import { TranslatorPipe } from "@app/shared/pipes/translate";
import {Enable2fa} from "../../../shared/partials/enable-2fa/enable-2fa";
import {TranslateModule} from "@ngx-translate/core";
import {TranslatorPipe} from "@app/shared/pipes/translate";

@Component({
selector: "src-forced-two-factor",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from "@angular/core";
import { PreferencesComponent } from "../../../shared/partials/preferences/preferences.component";
import {PreferencesComponent} from "../../../shared/partials/preferences/preferences.component";

@Component({
selector: "src-admin-preferences",
Expand Down
12 changes: 6 additions & 6 deletions client/app/src/pages/admin/auditlog/audit-log.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { AfterViewInit, Component, TemplateRef, ViewChild, ChangeDetectorRef, inject } from "@angular/core";
import {AfterViewInit, Component, TemplateRef, ViewChild, ChangeDetectorRef, inject} from "@angular/core";
import {NodeResolver} from "@app/shared/resolvers/node.resolver";
import {AuthenticationService} from "@app/services/helper/authentication.service";
import {Tab} from "@app/models/component-model/tab";
import {AuditLogTab1Component} from "@app/pages/admin/auditlog/auditlog-tab1/audit-log-tab1.component";
import {AuditLogTab2Component} from "@app/pages/admin/auditlog/auditlog-tab2/audit-log-tab2.component";
import {AuditLogTab3Component} from "@app/pages/admin/auditlog/auditlog-tab3/audit-log-tab3.component";
import {AuditLogTab4Component} from "@app/pages/admin/auditlog/auditlog-tab4/audit-log-tab4.component";
import { NgbNav, NgbNavItem, NgbNavItemRole, NgbNavLinkButton, NgbNavLinkBase, NgbNavContent, NgbNavOutlet } from "@ng-bootstrap/ng-bootstrap";
import { NgTemplateOutlet } from "@angular/common";
import { TranslatorPipe } from "@app/shared/pipes/translate";
import { TranslateModule } from "@ngx-translate/core";
import {NgbNav, NgbNavItem, NgbNavItemRole, NgbNavLinkButton, NgbNavLinkBase, NgbNavContent, NgbNavOutlet, NgbTooltipModule} from "@ng-bootstrap/ng-bootstrap";
import {NgTemplateOutlet} from "@angular/common";
import {TranslatorPipe} from "@app/shared/pipes/translate";
import {TranslateModule} from "@ngx-translate/core";

@Component({
selector: "src-auditlog",
templateUrl: "./audit-log.component.html",
standalone: true,
imports: [NgbNav, NgbNavItem, NgbNavItemRole, NgbNavLinkButton, NgbNavLinkBase, NgbNavContent, NgTemplateOutlet, NgbNavOutlet, AuditLogTab1Component, AuditLogTab2Component, AuditLogTab3Component, AuditLogTab4Component, TranslatorPipe, TranslateModule]
imports: [NgbNav, NgbNavItem, NgbNavItemRole, NgbNavLinkButton, NgbNavLinkBase, NgbNavContent, NgTemplateOutlet, NgbNavOutlet, NgbTooltipModule, AuditLogTab1Component, AuditLogTab2Component, AuditLogTab3Component, AuditLogTab4Component, TranslatorPipe, TranslateModule]
})
export class AuditLogComponent implements AfterViewInit {
private nodeResolver = inject(NodeResolver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
</tbody>
</table>
@if (auditLog.length > pageSize) {
<div class="float-start">
<ngb-pagination [(page)]="currentPage" [pageSize]="pageSize" [collectionSize]="auditLog.length" [boundaryLinks]="true">
<ng-template ngbPaginationPrevious>
< {{'Previous' | translate}}</ng-template>
<ng-template ngbPaginationNext>{{'Next' | translate}} ></ng-template>
<ng-template ngbPaginationFirst>
<< {{'First' | translate}}</ng-template>
<ng-template ngbPaginationLast>{{'Last' | translate}} >></ng-template>
</ngb-pagination>
<div>
<ngb-pagination dir="ltr" class="d-flex justify-content-center" [(page)]="currentPage" [pageSize]="pageSize" [collectionSize]="auditLog.length">
<ng-template ngbPaginationFirst><i class="fa-solid fa-backward-fast" ngbTooltip="{{'First' | translate}}"></i></ng-template>
<ng-template ngbPaginationPrevious><i class="fa-solid fa-backward-step" ngbTooltip="{{'Previous' | translate}}"></i></ng-template>
<ng-template ngbPaginationNext><i class="fa-solid fa-forward-step" ngbTooltip="{{'Next' | translate}}"></i></ng-template>
<ng-template ngbPaginationLast><i class="fa-solid fa-forward-fast" ngbTooltip="{{'Last' | translate}}"></i></ng-template>
</ngb-pagination>
</div>
}<div class="float-end"><button class="btn btn-sm btn-link" type="button" (click)="exportAuditLog()"> <i class="fa-solid fa-download"></i> <span>{{ 'Export' | translate }}</span> </button> @if (nodeResolver.dataModel.root_tenant) {
<span> <a class="btn btn-sm btn-link" type="button" (click)="utilsService.saveAs(authenticationService, 'globaleaks.log', '/api/admin/auditlog/debug')"> <i class="fa-solid fa-download"></i> globaleaks.log </a> <a class="btn btn-sm btn-link" type="button" (click)="utilsService.saveAs(authenticationService, 'access.log', '/api/admin/auditlog/access')"> <i class="fa-solid fa-download"></i> access.log </a> </span>
}
<div class="d-flex justify-content-end"><button class="btn btn-sm btn-link" type="button" (click)="exportAuditLog()"> <i class="fa-solid fa-download"></i> <span>{{ 'Export' | translate }}</span> </button> @if (nodeResolver.dataModel.root_tenant) {
<span><a class="btn btn-sm btn-link" type="button" (click)="utilsService.saveAs(authenticationService, 'globaleaks.log', '/api/admin/auditlog/debug')"> <i class="fa-solid fa-download"></i> globaleaks.log </a> <a class="btn btn-sm btn-link" type="button" (click)="utilsService.saveAs(authenticationService, 'access.log', '/api/admin/auditlog/access')"> <i class="fa-solid fa-download"></i> access.log</a></span>
}</div>
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Component, OnInit, inject } from "@angular/core";
import {Component, OnInit, inject} from "@angular/core";
import {auditlogResolverModel} from "@app/models/resolvers/auditlog-resolver-model";
import {AuditLogResolver} from "@app/shared/resolvers/audit-log-resolver.service";
import {NodeResolver} from "@app/shared/resolvers/node.resolver";
import {UtilsService} from "@app/shared/services/utils.service";
import {AuthenticationService} from "@app/services/helper/authentication.service";
import { DatePipe } from "@angular/common";
import { NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast } from "@ng-bootstrap/ng-bootstrap";
import { TranslatorPipe } from "@app/shared/pipes/translate";
import { TranslateModule } from "@ngx-translate/core";
import {DatePipe} from "@angular/common";
import {NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast, NgbTooltipModule} from "@ng-bootstrap/ng-bootstrap";
import {TranslatorPipe} from "@app/shared/pipes/translate";
import {TranslateModule} from "@ngx-translate/core";

@Component({
selector: "src-auditlog-tab1",
templateUrl: "./audit-log-tab1.component.html",
standalone: true,
imports: [NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast, DatePipe, TranslatorPipe, TranslateModule]
imports: [NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast, NgbTooltipModule, DatePipe, TranslatorPipe, TranslateModule]
})
export class AuditLogTab1Component implements OnInit {
protected authenticationService = inject(AuthenticationService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@
</tbody>
</table>
@if (users.length > pageSize) {
<div class="float-start">
<ngb-pagination [(page)]="currentPage" [pageSize]="pageSize" [collectionSize]="users.length" [boundaryLinks]="true">
<ng-template ngbPaginationPrevious>
< {{'Previous' | translate}}</ng-template>
<ng-template ngbPaginationNext>{{'Next' | translate}} ></ng-template>
<ng-template ngbPaginationFirst>
<< {{'First' | translate}}</ng-template>
<ng-template ngbPaginationLast>{{'Last' | translate}} >></ng-template>
</ngb-pagination>
<div>
<ngb-pagination dir="ltr" class="d-flex justify-content-center" [(page)]="currentPage" [pageSize]="pageSize" [collectionSize]="users.length">
<ng-template ngbPaginationFirst><i class="fa-solid fa-backward-fast" ngbTooltip="{{'First' | translate}}"></i></ng-template>
<ng-template ngbPaginationPrevious><i class="fa-solid fa-backward-step" ngbTooltip="{{'Previous' | translate}}"></i></ng-template>
<ng-template ngbPaginationNext><i class="fa-solid fa-forward-step" ngbTooltip="{{'Next' | translate}}"></i></ng-template>
<ng-template ngbPaginationLast><i class="fa-solid fa-forward-fast" ngbTooltip="{{'Last' | translate}}"></i></ng-template>
<ng-template ngbPaginationFirst><i class="fa-solid fa-backward-fast" ngbTooltip="{{'First' | translate}}"></i></ng-template>
<ng-template ngbPaginationPrevious><i class="fa-solid fa-backward-step" ngbTooltip="{{'Previous' | translate}}"></i></ng-template>
<ng-template ngbPaginationNext><i class="fa-solid fa-forward-step" ngbTooltip="{{'Next' | translate}}"></i></ng-template>
<ng-template ngbPaginationLast><i class="fa-solid fa-forward-fast" ngbTooltip="{{'Last' | translate}}"></i></ng-template>
</ngb-pagination>
</div>
} <div class="float-end"><button class="btn btn-sm btn-link" type="button" (click)="exportAuditLog()"> <i class="fa-solid fa-download"></i> <span>{{ 'Export' | translate }}</span> </button></div>
}
<div class="d-flex justify-content-end"><button class="btn btn-sm btn-link" type="button" (click)="exportAuditLog()"> <i class="fa-solid fa-download"></i> <span>{{ 'Export' | translate }}</span></button></div>
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Component, OnInit, inject } from "@angular/core";
import {Component, OnInit, inject} from "@angular/core";
import {UsersResolver} from "@app/shared/resolvers/users.resolver";
import {userResolverModel} from "@app/models/resolvers/user-resolver-model";
import {UtilsService} from "@app/shared/services/utils.service";
import { NgClass, DatePipe } from "@angular/common";
import { NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast } from "@ng-bootstrap/ng-bootstrap";
import { TranslatorPipe } from "@app/shared/pipes/translate";
import { TranslateModule } from "@ngx-translate/core";
import {NgClass, DatePipe} from "@angular/common";
import {NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast, NgbTooltipModule} from "@ng-bootstrap/ng-bootstrap";
import {TranslatorPipe} from "@app/shared/pipes/translate";
import {TranslateModule} from "@ngx-translate/core";

@Component({
selector: "src-auditlog-tab2",
templateUrl: "./audit-log-tab2.component.html",
standalone: true,
imports: [NgClass, NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast, DatePipe, TranslatorPipe, TranslateModule]
imports: [NgClass, NgbPagination, NgbPaginationPrevious, NgbPaginationNext, NgbPaginationFirst, NgbPaginationLast, NgbTooltipModule, DatePipe, TranslatorPipe, TranslateModule]
})
export class AuditLogTab2Component implements OnInit{
private utilsService = inject(UtilsService);
Expand All @@ -38,4 +38,4 @@ export class AuditLogTab2Component implements OnInit{
exportAuditLog() {
this.utilsService.generateCSV(JSON.stringify(this.users), 'users', ["id", "creation_date", "username", "salt", "role", "enabled", "last_login", "name", "description", "public_name", "mail_address", "change_email_address", "language", "password_change_needed", "password_change_date", "pgp_key_fingerprint", "pgp_key_public", "pgp_key_expiration", "pgp_key_remove", "picture", "tid", "notification", "encryption", "escrow", "two_factor", "forcefully_selected", "can_postpone_expiration", "can_delete_submission", "can_grant_access_to_reports", "can_transfer_access_to_reports", "can_edit_general_settings", "clicked_recovery_key", "accepted_privacy_policy", "contexts"]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@
</tbody>
</table>
@if (tips.length > pageSize) {
<div class="float-start">
<ngb-pagination [(page)]="currentPage" [pageSize]="pageSize" [collectionSize]="tips.length" [boundaryLinks]="true">
<ng-template ngbPaginationPrevious>
< {{'Previous' | translate}}</ng-template>
<ng-template ngbPaginationNext>{{'Next' | translate}} ></ng-template>
<ng-template ngbPaginationFirst>
<< {{'First' | translate}}</ng-template>
<ng-template ngbPaginationLast>{{'Last' | translate}} >></ng-template>
</ngb-pagination>
<div>
<ngb-pagination dir="ltr" class="d-flex justify-content-center" [(page)]="currentPage" [pageSize]="pageSize" [collectionSize]="tips.length">
<ng-template ngbPaginationFirst><i class="fa-solid fa-backward-fast" ngbTooltip="{{'First' | translate}}"></i></ng-template>
<ng-template ngbPaginationPrevious><i class="fa-solid fa-backward-step" ngbTooltip="{{'Previous' | translate}}"></i></ng-template>
<ng-template ngbPaginationNext><i class="fa-solid fa-forward-step" ngbTooltip="{{'Next' | translate}}"></i></ng-template>
<ng-template ngbPaginationLast><i class="fa-solid fa-forward-fast" ngbTooltip="{{'Last' | translate}}"></i></ng-template>
<ng-template ngbPaginationFirst><i class="fa-solid fa-backward-fast" ngbTooltip="{{'First' | translate}}"></i></ng-template>
<ng-template ngbPaginationPrevious><i class="fa-solid fa-backward-step" ngbTooltip="{{'Previous' | translate}}"></i></ng-template>
<ng-template ngbPaginationNext><i class="fa-solid fa-forward-step" ngbTooltip="{{'Next' | translate}}"></i></ng-template>
<ng-template ngbPaginationLast><i class="fa-solid fa-forward-fast" ngbTooltip="{{'Last' | translate}}"></i></ng-template>
</ngb-pagination>
</div>
}<div class="float-end"><button class="btn btn-sm btn-link" type="button" (click)="exportAuditLog()"> <i class="fa-solid fa-download"></i> <span>{{ 'Export' | translate }}</span> </button></div>
}
<div class="d-flex justify-content-end"><button class="btn btn-sm btn-link" type="button" (click)="exportAuditLog()"> <i class="fa-solid fa-download"></i> <span>{{ 'Export' | translate }}</span></button></div>
}
Loading

0 comments on commit 6ee9e21

Please sign in to comment.