Skip to content

Commit 8573f1c

Browse files
committed
Remove deprecated unused code
1 parent fbfb35c commit 8573f1c

File tree

4 files changed

+3
-30
lines changed

4 files changed

+3
-30
lines changed

client/app/src/pages/app/app.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h1>Error!</h1><br/><br/>
2727
<src-demo></src-demo>
2828
</div>
2929
}
30-
@if (isWhistleblowerPage() && location.hash!=='#/admin/' && !appDataService.public.node.disable_privacy_badge) {
30+
@if (utilsService.isWhistleblowerPage() && location.hash!=='#/admin/' && !appDataService.public.node.disable_privacy_badge) {
3131
<div>
3232
<src-privacybadge></src-privacybadge>
3333
</div>

client/app/src/pages/app/app.component.ts

-5
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@ export class AppComponent implements AfterViewInit, OnInit, OnDestroy{
151151
this.checkToShowSidebar();
152152
}
153153

154-
isWhistleblowerPage(): boolean {
155-
const currentHash = location.hash;
156-
return currentHash === "#/" || currentHash === "#/submission";
157-
}
158-
159154
public ngAfterViewInit(): void {
160155
this.appDataService.showLoadingPanel$.subscribe((value:any) => {
161156
this.showLoadingPanel = value;

client/app/src/shared/services/field-utilities.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ export class FieldUtilitiesService {
290290
}
291291

292292
parseFields(fields: any, parsedFields: any) {
293-
294293
fields.forEach((field: any) =>{
295294
parsedFields = this.parseField(field, parsedFields);
296295
});

client/app/src/shared/services/utils.service.ts

+2-23
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {ActivatedRoute, Router} from "@angular/router";
55
import {NgbModal} from "@ng-bootstrap/ng-bootstrap";
66
import {RequestSupportComponent} from "@app/shared/modals/request-support/request-support.component";
77
import {HttpService} from "@app/shared/services/http.service";
8-
import {TokenResource} from "@app/shared/services/token-resource.service";
98
import {HttpClient, HttpHeaders} from "@angular/common/http";
109
import {Observable, from, map, switchMap} from "rxjs";
1110
import {ConfirmationWithPasswordComponent} from "@app/shared/modals/confirmation-with-password/confirmation-with-password.component";
@@ -40,7 +39,6 @@ export class UtilsService {
4039
private activatedRoute = inject(ActivatedRoute);
4140
private appDataService = inject(AppDataService);
4241
private cryptoService = inject(CryptoService);
43-
private tokenResource = inject(TokenResource);
4442
private translateService = inject(TranslateService);
4543
private clipboardService = inject(ClipboardService);
4644
private http = inject(HttpClient);
@@ -86,17 +84,6 @@ export class UtilsService {
8684
return ret;
8785
}
8886

89-
download(url: string): Observable<void> {
90-
return from(this.tokenResource.getWithProofOfWork()).pipe(
91-
switchMap((token: any) => {
92-
window.open(`${url}?token=${token.id}:${token.answer}`);
93-
return new Observable<void>((observer) => {
94-
observer.complete();
95-
});
96-
})
97-
);
98-
}
99-
10087
isUploading(uploads?: any) {
10188
if (uploads) {
10289
for (const key in uploads) {
@@ -108,14 +95,6 @@ export class UtilsService {
10895
return false;
10996
}
11097

111-
removeStyles(renderer: Renderer2, document:Document, link:string){
112-
const defaultBootstrapLink = document.head.querySelector(`link[href="${link}"]`);
113-
if (defaultBootstrapLink) {
114-
renderer.removeChild(document.head, defaultBootstrapLink);
115-
}
116-
}
117-
118-
11998
resumeFileUploads(uploads: any) {
12099
if (uploads) {
121100
for (const key in uploads) {
@@ -252,8 +231,8 @@ export class UtilsService {
252231
}
253232

254233
isWhistleblowerPage() {
255-
const currentUrl = this.router.url;
256-
return this.appDataService.public.node.wizard_done && (!this.authenticationService.session || (location.hash==="#/" || location.hash.startsWith("#/submission"))) && ((currentUrl === "/" && !this.appDataService.public.node.enable_signup) || currentUrl === "/submission" || currentUrl === "/blank");
234+
const currentHash = location.hash;
235+
return currentHash === "#/" || currentHash === "#/submission";
257236
}
258237

259238
stopPropagation(event: Event) {

0 commit comments

Comments
 (0)