removed some logs

This commit is contained in:
Timo 2021-01-03 13:09:53 +02:00
parent d2fc1908e9
commit 4b2954827a
10 changed files with 6 additions and 45 deletions

View File

@ -24,7 +24,7 @@ export class AppConfigService {
loadAppConfig(): Observable<any> {
return this._httpClient.get<any>('/assets/config/config.json').pipe(
tap((config) => {
console.log('got', config);
console.log('[REDACTION] Started with config: ', config);
this._config = config;
})
);

View File

@ -30,7 +30,6 @@ export class RedRoleGuard implements CanActivate {
obs.next(true);
obs.complete();
} else {
console.log('this case');
this._router.navigate(['/ui/projects']);
obs.next(false);
obs.complete();

View File

@ -9,6 +9,7 @@ import { forkJoin } from 'rxjs';
import { PermissionsService } from '../../../common/service/permissions.service';
import { FormBuilder, FormGroup } from '@angular/forms';
import { debounce } from '../../../utils/debounce';
import { UserPreferenceService } from '../../../common/service/user-preference.service';
@Component({
selector: 'redaction-dictionary-listing-screen',
@ -26,6 +27,7 @@ export class DictionaryListingScreenComponent implements OnInit {
private readonly _dialogService: DialogService,
private readonly _sortingService: SortingService,
private readonly _formBuilder: FormBuilder,
private readonly _userPreferenceService: UserPreferenceService,
private readonly _dictionaryControllerService: DictionaryControllerService,
private readonly _appStateService: AppStateService,
public readonly permissionsService: PermissionsService
@ -52,7 +54,7 @@ export class DictionaryListingScreenComponent implements OnInit {
const appStateDictionaryData = this._appStateService.dictionaryData;
this.dictionaries = Object.keys(appStateDictionaryData)
.map((key) => appStateDictionaryData[key])
.filter((d) => !d.virtual);
.filter((d) => !d.virtual || (this._userPreferenceService.areDevFeaturesEnabled && d.type === 'false_positive'));
this.displayedDictionaries = [...this.dictionaries];
const dataObs = [];
this.dictionaries.forEach((item) => {

View File

@ -207,7 +207,6 @@ export class DictionaryOverviewScreenComponent {
}
);
} else {
console.log(invalidRowsExist);
this._notificationService.showToastNotification(
this._translateService.instant('dictionary-overview.error.entries-too-short'),
null,

View File

@ -194,7 +194,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
handleAnnotationSelected(annotationId: string) {
this.selectedAnnotation = this.annotations.find((a) => a.id === annotationId);
this.scrollToSelectedAnnotation();
console.log('selected: ', annotationId);
this._changeDetectorRef.detectChanges();
}

View File

@ -109,7 +109,6 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
});
instance.docViewer.on('pageNumberUpdated', (p) => {
console.log(this.shouldDeselectAnnotationsOnPageChange);
if (this.shouldDeselectAnnotationsOnPageChange) {
this.instance.annotManager.deselectAllAnnotations();
}

View File

@ -43,7 +43,6 @@ export class HtmlDebugScreenComponent {
.subscribe((data) => {
this.htmlData = data;
this.loading = false;
console.log(this.htmlData);
});
}
}

View File

@ -89,7 +89,6 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
this.filesAutoUpdateTimer = timer(0, 7500)
.pipe(
tap(async () => {
console.log('reload ... ');
await this.appStateService.reloadActiveProjectFilesIfNecessary();
})
)

View File

@ -188,39 +188,6 @@ export class AppStateService {
return activeFileWrapper;
}
private _automaticallyReanalyseErrorFiles(project: ProjectWrapper) {
const now = new Date().getTime();
project.files.forEach((file) => {
if (file.status === 'ERROR') {
console.log('Auto-Reanalyse file because of error');
this._reanalyseFileInCurrentSessionIfNeeded(project, file);
}
if (file.status === 'PROCESSING') {
const delta = now - file.newestDate.getTime();
if (delta > 1000 * 60 * 2) {
console.log('Auto-Reanalyse file because of timeout');
this._reanalyseFileInCurrentSessionIfNeeded(project, file);
}
}
});
}
private _reanalyseFileInCurrentSessionIfNeeded(project: ProjectWrapper, file: FileStatusWrapper) {
const result = sessionStorage.getItem('FILE_' + file.fileId);
if (!result) {
this._reanalysisControllerService.reanalyzeFile(project.projectId, file.fileId).subscribe(() => {});
sessionStorage.setItem('FILE_' + file.fileId, `${new Date().getTime()}`);
} else {
const now = new Date().getTime();
const lastAttempt = new Date(parseInt(result, 10)).getTime();
const delta = now - lastAttempt;
if (delta > 1000 * 60 * 2) {
this._reanalysisControllerService.reanalyzeFile(project.projectId, file.fileId).subscribe(() => {});
sessionStorage.setItem('FILE_' + file.fileId, `${new Date().getTime()}`);
}
}
}
async getFiles(project?: ProjectWrapper) {
if (!project) {
project = this.activeProject;

View File

@ -5,11 +5,9 @@ export function download(event: HttpResponse<Blob>, altName?: string) {
const contentDisposition = event.headers.get('Content-Disposition');
let fileName;
try {
fileName = contentDisposition
? contentDisposition.split('filename=')[1].replace(/"/g, '')
: undefined;
fileName = contentDisposition ? contentDisposition.split('filename=')[1].replace(/"/g, '') : undefined;
} catch (e) {
console.log('failed to parse content-disposition: ', contentDisposition);
console.log('[REDACTION] Failed to parse content-disposition: ', contentDisposition);
}
saveAs(event.body, fileName ? fileName : altName);
}