From e103418ea61285a9b9b194613b52269590d27630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 13 Dec 2021 12:46:45 +0200 Subject: [PATCH 01/19] RED-3017: Removed breadcrumbs logic from guards --- apps/red-ui/src/app/app-routing.module.ts | 1 - .../base-screen/base-screen.component.html | 2 +- .../breadcrumbs/breadcrumbs.component.html | 6 +- .../src/app/guards/dossier-files-guard.ts | 29 +------ apps/red-ui/src/app/guards/dossiers.guard.ts | 25 +----- .../src/app/guards/file-preview.guard.ts | 33 +------- .../src/app/guards/go-back-guard.service.ts | 18 ---- .../dossier/dossiers-routing.module.ts | 9 +- .../src/app/services/breadcrumbs.service.ts | 82 ++++++++++++++----- libs/common-ui | 2 +- .../src/lib/shared/breadcrumb-types.ts | 7 ++ libs/red-domain/src/lib/shared/index.ts | 1 + 12 files changed, 84 insertions(+), 131 deletions(-) delete mode 100644 apps/red-ui/src/app/guards/go-back-guard.service.ts create mode 100644 libs/red-domain/src/lib/shared/breadcrumb-types.ts diff --git a/apps/red-ui/src/app/app-routing.module.ts b/apps/red-ui/src/app/app-routing.module.ts index 24a5d3557..b13a5055e 100644 --- a/apps/red-ui/src/app/app-routing.module.ts +++ b/apps/red-ui/src/app/app-routing.module.ts @@ -35,7 +35,6 @@ const routes: Routes = [ component: BaseScreenComponent, loadChildren: () => import('./modules/dossier/dossiers.module').then(m => m.DossiersModule), canActivate: [CompositeRouteGuard], - canDeactivate: [DossiersGuard], data: { routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard, DossiersGuard], requiredRoles: ['RED_USER', 'RED_MANAGER'], diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index 04d3e1bc7..534a5c4fb 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -7,7 +7,7 @@ -
+ diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html index 536e40188..9a15c7caa 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html @@ -5,6 +5,7 @@ [itemSize]="50" [noDataText]="'file-attributes-csv-import.no-data.title' | translate" [selectionEnabled]="true" + [tableColumnConfigs]="tableColumnConfigs" emptyColumnWidth="auto" noDataIcon="red:attribute" > diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html index 1587c511c..296eb49c8 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html @@ -25,6 +25,7 @@ [itemSize]="80" [noDataIcon]="'iqser:document'" [noDataText]="'audit-screen.no-data.title' | translate" + [tableColumnConfigs]="tableColumnConfigs" [totalSize]="logs?.totalHits || 0" > diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html index 1fb70d6d1..8e7cd2833 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html @@ -20,7 +20,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index d311fb1ad..b30f090a1 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -30,6 +30,7 @@ [noMatchText]="'dictionary-listing.no-match.title' | translate" [selectionEnabled]="true" [showNoDataButton]="currentUser.isAdmin" + [tableColumnConfigs]="tableColumnConfigs" emptyColumnWidth="1fr" noDataIcon="red:dictionary" > diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index 999b7e161..97115261d 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -30,6 +30,7 @@ [noMatchText]="'dossier-attributes-listing.no-match.title' | translate" [selectionEnabled]="true" [showNoDataButton]="currentUser.isAdmin" + [tableColumnConfigs]="tableColumnConfigs" emptyColumnWidth="1fr" noDataIcon="red:attribute" > diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html index 00cb18b89..f32777255 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html @@ -19,6 +19,7 @@ [noDataText]="'dossier-templates-listing.no-data.title' | translate" [noMatchText]="'dossier-templates-listing.no-match.title' | translate" [selectionEnabled]="true" + [tableColumnConfigs]="tableColumnConfigs" noDataIcon="red:template" > diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index 78ad18174..f820ff322 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -27,6 +27,7 @@ [noDataText]="'file-attributes-listing.no-data.title' | translate" [noMatchText]="'file-attributes-listing.no-match.title' | translate" [selectionEnabled]="true" + [tableColumnConfigs]="tableColumnConfigs" emptyColumnWidth="1fr" noDataIcon="red:attribute" > diff --git a/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.html index 2feb42084..9d77bbc85 100644 --- a/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/justifications/justifications-screen/justifications-screen.component.html @@ -4,6 +4,7 @@ [itemSize]="80" [noDataText]="'justifications-listing.no-data.title' | translate" [selectionEnabled]="true" + [tableColumnConfigs]="tableColumnConfigs" noDataIcon="iqser:document" > diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html index 4b28fb1c3..2d69a12d1 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html @@ -15,6 +15,7 @@ [noDataText]="'trash.no-data.title' | translate" [noMatchText]="'trash.no-match.title' | translate" [selectionEnabled]="true" + [tableColumnConfigs]="tableColumnConfigs" [tableItemClasses]="{ disabled: disabledFn }" noDataIcon="red:template" > diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html index e81873d9d..99891428b 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html @@ -37,6 +37,7 @@ [itemSize]="80" [noMatchText]="'user-listing.no-match.title' | translate" [selectionEnabled]="true" + [tableColumnConfigs]="tableColumnConfigs" emptyColumnWidth="1fr" > diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html index 3c4108bcc..7319b9040 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html @@ -4,6 +4,7 @@ [itemSize]="50" [noDataText]="'edit-dossier-dialog.deleted-documents.no-data.title' | translate" [selectionEnabled]="true" + [tableColumnConfigs]="tableColumnConfigs" [tableItemClasses]="{ disabled: disabledFn }" noDataIcon="iqser:document" > diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html index 1010b0c02..7074f226c 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html @@ -23,6 +23,7 @@ [noMatchText]="'dossier-overview.no-match.title' | translate" [selectionEnabled]="true" [showNoDataButton]="true" + [tableColumnConfigs]="tableColumnConfigs" [tableItemClasses]="{ disabled: disabledFn, 'last-opened': lastOpenedFn }" helpModeKey="document-list" > diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts index 147dba9b7..bf8865bdd 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts @@ -17,7 +17,7 @@ import { FileUploadService } from '@upload-download/services/file-upload.service import { StatusOverlayService } from '@upload-download/services/status-overlay.service'; import * as moment from 'moment'; import { Observable, timer } from 'rxjs'; -import { filter, switchMap, tap } from 'rxjs/operators'; +import { filter, skip, switchMap, tap } from 'rxjs/operators'; import { convertFiles, Files, handleFileDrop } from '@utils/index'; import { CircleButtonTypes, @@ -73,6 +73,7 @@ export class DossierOverviewScreenComponent extends ListingComponent imple private readonly _needsWorkFilterTemplate: TemplateRef; @ViewChild('fileInput', { static: true }) private readonly _fileInput: ElementRef; @ViewChild(TableComponent) private readonly _tableComponent: TableComponent; + private _fileAttributeConfigs: IFileAttributeConfig[]; constructor( protected readonly _injector: Injector, @@ -99,19 +100,7 @@ export class DossierOverviewScreenComponent extends ListingComponent imple .getEntityChanged$(this.dossierId) .pipe(tap(dossier => (this.dossierTemplateId = dossier.dossierTemplateId))); this.currentDossier = this._dossiersService.find(this.dossierId); - - this.fileAttributeConfigs = this._fileAttributesService.getFileAttributeConfig( - this.currentDossier.dossierTemplateId, - )?.fileAttributeConfigs; - this.tableColumnConfigs = this.configService.tableConfig(this.displayedAttributes); - } - - private _fileAttributeConfigs: IFileAttributeConfig[]; - - set fileAttributeConfigs(value: IFileAttributeConfig[]) { - this._fileAttributeConfigs = value || []; - this.displayedInFileListAttributes = this._fileAttributeConfigs.filter(config => config.displayedInFileList); - this.displayedAttributes = this.displayedInFileListAttributes.filter(c => c.displayedInFileList); + this._updateFileAttributes(); } get checkedRequiredFilters(): NestedFilter[] { @@ -123,6 +112,7 @@ export class DossierOverviewScreenComponent extends ListingComponent imple } disabledFn = (file: File) => file.excluded; + lastOpenedFn = (file: File) => this._userPreferenceService.getLastOpenedFileForDossier(file.dossierId) === file.id; async ngOnInit(): Promise { @@ -150,11 +140,15 @@ export class DossierOverviewScreenComponent extends ListingComponent imple this._computeAllFilters(); }); - this.addSubscription = this._dossierTemplatesService.entityChanged$.subscribe(() => { - this.fileAttributeConfigs = this._fileAttributesService.getFileAttributeConfig( - this.currentDossier.dossierTemplateId, - )?.fileAttributeConfigs; - }); + this.addSubscription = this._dossierTemplatesService + .getEntityChanged$(this.currentDossier.dossierTemplateId) + .pipe( + skip(1), + tap(() => { + this._updateFileAttributes(); + }), + ) + .subscribe(); try { this.dossierAttributes = await this._dossierAttributesService.getWithValues(this.currentDossier); @@ -170,14 +164,12 @@ export class DossierOverviewScreenComponent extends ListingComponent imple super.ngOnDestroy(); } - async ngOnAttach() { - await this.ngOnInit(); + ngOnAttach() { + this._fileDropOverlayService.initFileDropHandling(this.dossierId); this._tableComponent?.scrollToLastIndex(); } - ngOnDetach() { - this.ngOnDestroy(); - } + ngOnDetach() {} forceReanalysisAction($event: LongPressEvent) { this.analysisForced = !$event.touchEnd && this._userPreferenceService.areDevFeaturesEnabled; @@ -203,6 +195,15 @@ export class DossierOverviewScreenComponent extends ListingComponent imple recentlyModifiedChecker = (file: File) => moment(file.lastUpdated).add(this._appConfigService.values.RECENT_PERIOD_IN_HOURS, 'hours').isAfter(moment()); + private _updateFileAttributes(): void { + this._fileAttributeConfigs = + this._fileAttributesService.getFileAttributeConfig(this.currentDossier.dossierTemplateId)?.fileAttributeConfigs || []; + this.displayedInFileListAttributes = this._fileAttributeConfigs.filter(config => config.displayedInFileList); + this.displayedAttributes = this.displayedInFileListAttributes.filter(c => c.displayedInFileList); + this.tableColumnConfigs = this.configService.tableConfig(this.displayedAttributes); + this._computeAllFilters(); + } + private async _reloadFiles() { await this._filesService.loadAll(this.dossierId).toPromise(); this._computeAllFilters(); diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/screen/dossiers-listing-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/screen/dossiers-listing-screen.component.html index 16f8d9509..a0cd34fa2 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/screen/dossiers-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/screen/dossiers-listing-screen.component.html @@ -13,6 +13,7 @@ [noDataText]="'dossier-listing.no-data.title' | translate" [noMatchText]="'dossier-listing.no-match.title' | translate" [showNoDataButton]="currentUser.isManager" + [tableColumnConfigs]="tableColumnConfigs" helpModeKey="dossier-list" noDataIcon="red:folder" > diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts index 94b0625fd..156fcd7c6 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/document-info.service.ts @@ -27,9 +27,9 @@ export class DocumentInfoService { fileAttributes$(fileId: string, dossierId: string, dossierTemplateId: string) { const getAttributes = () => this._fileAttributesService.getFileAttributeConfig(dossierTemplateId).fileAttributeConfigs; - const dossierTemplateChange$ = this._dossierTemplatesService.entityChanged$.pipe( - filter(template => template.dossierTemplateId === dossierTemplateId), - ); + const dossierTemplateChange$ = this._dossierTemplatesService + .getEntityChanged$(dossierTemplateId) + .pipe(filter(template => template.dossierTemplateId === dossierTemplateId)); const fileChange$ = this._filesMapService.watch$(dossierId, fileId); return merge(dossierTemplateChange$, fileChange$).pipe( map(getAttributes), diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html index 76b7bdbbf..16bf74fde 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html @@ -16,6 +16,7 @@ [itemSize]="85" [noDataText]="'search-screen.no-data' | translate" [noMatchText]="'search-screen.no-match' | translate" + [tableColumnConfigs]="tableColumnConfigs" noDataIcon="iqser:search" > diff --git a/libs/common-ui b/libs/common-ui index c3244477c..e0de29cb6 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit c3244477c0479dd174fa7d17c2a7e3621f26bd6d +Subproject commit e0de29cb68bc171b2737f613eafb162a43ca32ca From af293b1aed6caef571598153f8044de65beb0aeb Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 14 Dec 2021 14:36:46 +0200 Subject: [PATCH 10/19] update common ui --- libs/common-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common-ui b/libs/common-ui index e0de29cb6..6bd54f11a 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit e0de29cb68bc171b2737f613eafb162a43ca32ca +Subproject commit 6bd54f11ab7a6cdfec3edddbef2af3d3c437066a From eac1d9f2a8fd8fad12e91e3d8aea14e14752d5d2 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 09:25:14 +0200 Subject: [PATCH 11/19] Legal basis port --- .../src/app/models/file/annotation.wrapper.ts | 2 ++ .../app/models/file/redaction-log-entry.wrapper.ts | 1 + .../change-legal-basis-dialog.component.html | 10 ++++++++++ .../change-legal-basis-dialog.component.ts | 14 +++++++++++++- .../document-info/document-info.component.html | 1 + .../document-info/document-info.component.ts | 2 ++ .../red-ui/src/app/services/permissions.service.ts | 6 +++++- apps/red-ui/src/app/utils/functions.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 2 ++ libs/red-domain/src/lib/files/file.model.ts | 2 +- .../src/lib/redaction-log/redaction-log-entry.ts | 1 + 11 files changed, 39 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index b7994d106..a7dde41e1 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -42,6 +42,8 @@ export class AnnotationWrapper { legalBasisValue: string; legalBasisChangeValue?: string; resizing?: boolean; + rectangle?: boolean; + section?: string; manual?: boolean; diff --git a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts index 72a70f608..9dc800a87 100644 --- a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts +++ b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts @@ -10,6 +10,7 @@ export interface RedactionLogEntryWrapper { reference?: Array; startOffset?: number; type?: string; + rectangle?: boolean; color?: Array; dictionaryEntry?: boolean; diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html index 690ff3b32..97a07755e 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.html @@ -21,6 +21,16 @@ +
+ + +
+ +
+ + +
+
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.ts index c48c4fafc..16f9f5e8f 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/change-legal-basis-dialog/change-legal-basis-dialog.component.ts @@ -31,7 +31,15 @@ export class ChangeLegalBasisDialogComponent implements OnInit { ) {} get changed(): boolean { - return this.form.get('reason').value.legalBasis !== this._data.annotations[0].legalBasis; + return ( + this.form.get('reason').value.legalBasis !== this._data.annotations[0].legalBasis || + this.form.get('section').value !== this._data.annotations[0].section || + this.form.get('classification').value !== this._data.annotations[0].value + ); + } + + get allRectangles(): boolean { + return this._data.annotations.reduce((acc, a) => acc && a.rectangle, true); } async ngOnInit() { @@ -55,13 +63,17 @@ export class ChangeLegalBasisDialogComponent implements OnInit { return this._formBuilder.group({ reason: [null, Validators.required], comment: this.isDocumentAdmin ? [null] : [null, Validators.required], + classification: [this.allRectangles ? this._data.annotations[0].value : null], + section: [this._data.annotations[0].section], }); } save() { this.dialogRef.close({ legalBasis: this.form.get('reason').value.legalBasis, + section: this.form.get('section').value, comment: this.form.get('comment').value, + value: this.form.get('classification').value, }); } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html index f5f1120fe..d4b4d65fd 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html @@ -2,6 +2,7 @@
= 2; + return spaceCount >= 3; }; if (direction === 'FORWARD') { diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index ce5e8969d..e7fbced47 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -359,6 +359,8 @@ "comment": "Comment", "legalBasis": "Legal Basis", "reason": "Select redaction reason", + "section": "Paragraph / Location", + "classification": "Value / Classification", "reason-placeholder": "Select a reason..." }, "header": "Edit Redaction Reason" diff --git a/libs/red-domain/src/lib/files/file.model.ts b/libs/red-domain/src/lib/files/file.model.ts index 4e839dace..81148059e 100644 --- a/libs/red-domain/src/lib/files/file.model.ts +++ b/libs/red-domain/src/lib/files/file.model.ts @@ -104,7 +104,7 @@ export class File extends Entity implements IFile { this.isNew = this.workflowStatus === WorkflowFileStatuses.NEW; this.isUnderReview = this.workflowStatus === WorkflowFileStatuses.UNDER_REVIEW; this.isUnderApproval = this.workflowStatus === WorkflowFileStatuses.UNDER_APPROVAL; - this.canBeApproved = !this.analysisRequired && !this.hasSuggestions; + this.canBeApproved = !this.analysisRequired && !this.hasSuggestions && !this.isProcessing && !this.isError; this.canBeOpened = !this.isError && !this.isPending && this.numberOfAnalyses > 0; this.canBeOCRed = !this.excluded && !this.lastOCRTime && (this.isNew || this.isUnderReview || this.isUnderApproval); diff --git a/libs/red-domain/src/lib/redaction-log/redaction-log-entry.ts b/libs/red-domain/src/lib/redaction-log/redaction-log-entry.ts index 209fc808f..c2577442e 100644 --- a/libs/red-domain/src/lib/redaction-log/redaction-log-entry.ts +++ b/libs/red-domain/src/lib/redaction-log/redaction-log-entry.ts @@ -14,6 +14,7 @@ export interface IRedactionLogEntry { engines?: List; excluded?: boolean; hint?: boolean; + rectangle?: boolean; id?: string; image?: boolean; imageHasTransparency?: boolean; From 82f7864a0a384bd5b9900c072c56fdbcd29a4112 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 21:03:50 +0200 Subject: [PATCH 12/19] rectangle/value/section for 3.x --- .../file/manual-redaction-entry.wrapper.ts | 1 - .../manual-annotation-dialog.component.html | 50 +++++++++++-------- .../manual-annotation-dialog.component.ts | 23 ++++++--- .../pdf-viewer/pdf-viewer.component.ts | 9 ++-- .../services/annotation-actions.service.ts | 11 +++- .../services/manual-annotation.service.ts | 4 +- .../redaction-log/add-redaction.request.ts | 2 + .../redaction-log/manual-redaction-entry.ts | 1 + 8 files changed, 63 insertions(+), 38 deletions(-) diff --git a/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts b/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts index 79504dea3..345b7c4e4 100644 --- a/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts +++ b/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts @@ -13,7 +13,6 @@ export class ManualRedactionEntryWrapper { readonly quads: any, readonly manualRedactionEntry: IManualRedactionEntry, readonly type: ManualRedactionEntryType, - readonly annotationType: 'TEXT' | 'RECTANGLE' = 'TEXT', readonly rectId?: string, ) {} } diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html index 1788ae51a..46db18d59 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html @@ -3,19 +3,37 @@
- +
{{ format(data.manualRedactionEntryWrapper.manualRedactionEntry.value) }}
- +
+
+ + + + {{ displayedDictionaryLabel }} + + + {{ dictionary.label }} + + + +
+
-
- - +
+ +
-
- +
+ + +
- - {{ displayedDictionaryLabel }} - - - {{ dictionary.label }} - - - +
+ +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 55ce35c2b..710b4fc6b 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -28,7 +28,7 @@ export class ManualAnnotationDialogComponent implements OnInit { isDictionaryRequest: boolean; isFalsePositiveRequest: boolean; - redactionDictionaries: Dictionary[] = []; + possibleDictionaries: Dictionary[] = []; legalOptions: LegalBasisOption[] = []; private readonly _dossier: Dossier; @@ -51,7 +51,7 @@ export class ManualAnnotationDialogComponent implements OnInit { this.redactionForm = this._getForm(); - this.redactionDictionaries = this._redactionDictionaries; + this.possibleDictionaries = this._possibleDictionaries; } get title() { @@ -61,24 +61,25 @@ export class ManualAnnotationDialogComponent implements OnInit { get displayedDictionaryLabel() { const dictType = this.redactionForm.get('dictionary').value; if (dictType) { - return this.redactionDictionaries.find(d => d.type === dictType).label; + return this.possibleDictionaries.find(d => d.type === dictType).label; } return null; } - private get _redactionDictionaries(): Dictionary[] { - const redactionDictionaries: Dictionary[] = []; + private get _possibleDictionaries(): Dictionary[] { + const possibleDictionaries: Dictionary[] = []; const dossier = this._dossier; for (const key of Object.keys(this._appStateService.dictionaryData[dossier.dossierTemplateId])) { const dictionaryData = this._appStateService.getDictionary(key, dossier.dossierTemplateId); if (!dictionaryData.virtual && dictionaryData.addToDictionaryAction) { - redactionDictionaries.push(dictionaryData); + possibleDictionaries.push(dictionaryData); } } - redactionDictionaries.sort((a, b) => a.label.localeCompare(b.label)); - return redactionDictionaries; + possibleDictionaries.sort((a, b) => a.label.localeCompare(b.label)); + + return possibleDictionaries; } async ngOnInit() { @@ -111,11 +112,13 @@ export class ManualAnnotationDialogComponent implements OnInit { private _getForm(): FormGroup { return this._formBuilder.group({ + section: [null], reason: this.isDictionaryRequest ? [null] : [null, Validators.required], dictionary: this.isDictionaryRequest ? [this.isFalsePositiveRequest ? 'false_positive' : null, Validators.required] : ['manual', Validators.required], comment: this.isDocumentAdmin ? [null] : [null, Validators.required], + classification: ['non-readable content'], }); } @@ -133,5 +136,9 @@ export class ManualAnnotationDialogComponent implements OnInit { } const commentValue = this.redactionForm.get('comment').value; addRedactionRequest.comment = commentValue ? { text: commentValue } : null; + addRedactionRequest.section = this.redactionForm.get('section').value; + addRedactionRequest.value = addRedactionRequest.rectangle + ? this.redactionForm.get('classification').value + : addRedactionRequest.value; } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts index b25e6535a..7db374e3b 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts @@ -495,12 +495,10 @@ export class PdfViewerComponent implements OnInit, OnChanges { const activeAnnotation = this.annotationManager.getSelectedAnnotations()[0]; const activePage = activeAnnotation.getPageNumber(); const quads = [this._annotationDrawService.annotationToQuads(activeAnnotation, this.instance)]; - const manualRedaction = this._getManualRedaction({ [activePage]: quads }, 'Rectangle'); + const manualRedaction = this._getManualRedaction({ [activePage]: quads }); this._cleanUpSelectionAndButtonState(); - this.manualAnnotationRequested.emit( - new ManualRedactionEntryWrapper(quads, manualRedaction, 'REDACTION', 'RECTANGLE', activeAnnotation.Id), - ); + this.manualAnnotationRequested.emit(new ManualRedactionEntryWrapper(quads, manualRedaction, 'REDACTION', activeAnnotation.Id)); } private _cleanUpSelectionAndButtonState() { @@ -619,7 +617,7 @@ export class PdfViewerComponent implements OnInit, OnChanges { private _getManualRedaction( quads: Readonly>, - text: string, + text?: string, convertQuads = false, ): IManualRedactionEntry { const entry: IManualRedactionEntry = { positions: [] }; @@ -633,6 +631,7 @@ export class PdfViewerComponent implements OnInit, OnChanges { } entry.value = text; + entry.rectangle = !text; return entry; } diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts index 816c7f418..d9b5c3945 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts @@ -88,10 +88,17 @@ export class AnnotationActionsService { 'changeLegalBasis', $event, { annotations, dossier: this._dossier(file) }, - (data: { comment: string; legalBasis: string }) => { + (data: { comment: string; legalBasis: string; section: string; value: string }) => { annotations.forEach(annotation => { this._processObsAndEmit( - this._manualAnnotationService.changeLegalBasis(annotation.annotationId, file, data.legalBasis, data.comment), + this._manualAnnotationService.changeLegalBasis( + annotation.annotationId, + file, + data.section, + data.value, + data.legalBasis, + data.comment, + ), annotation, annotationsChanged, ); diff --git a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts index aa9c72a1f..e633cfb30 100644 --- a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts @@ -102,11 +102,11 @@ export class ManualAnnotationService extends GenericService } // /manualRedaction/request/legalBasis - changeLegalBasis(annotationId: string, file: File, legalBasis: string, comment?: string) { + changeLegalBasis(annotationId: string, file: File, section: string, value: string, legalBasis: string, comment?: string) { const mode: AnnotationActionMode = this._permissionsService.isApprover(this._dossier(file)) ? 'change-legal-basis' : 'request-change-legal-basis'; - return this._makeRequest(mode, file, { annotationId, legalBasis, comment }); + return this._makeRequest(mode, file, { annotationId, legalBasis, comment, section, value }); } // this wraps diff --git a/libs/red-domain/src/lib/redaction-log/add-redaction.request.ts b/libs/red-domain/src/lib/redaction-log/add-redaction.request.ts index ca567f0e8..40040a583 100644 --- a/libs/red-domain/src/lib/redaction-log/add-redaction.request.ts +++ b/libs/red-domain/src/lib/redaction-log/add-redaction.request.ts @@ -10,4 +10,6 @@ export interface IAddRedactionRequest { reason?: string; type?: string; value?: string; + section?: string; + rectangle?: boolean; } diff --git a/libs/red-domain/src/lib/redaction-log/manual-redaction-entry.ts b/libs/red-domain/src/lib/redaction-log/manual-redaction-entry.ts index 45ae9f6c1..a8a9abf9d 100644 --- a/libs/red-domain/src/lib/redaction-log/manual-redaction-entry.ts +++ b/libs/red-domain/src/lib/redaction-log/manual-redaction-entry.ts @@ -16,4 +16,5 @@ export interface IManualRedactionEntry { type?: string; user?: string; value?: string; + rectangle?: boolean; } From 8e815d2e10fae204815c63f00d4c55a82863e8eb Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 21:15:08 +0200 Subject: [PATCH 13/19] edit value/section for UI - backend still not working --- apps/red-ui/src/app/models/file/annotation.wrapper.ts | 2 ++ .../components/pdf-viewer/pdf-viewer.component.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index a7dde41e1..7c2876e8f 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -219,6 +219,8 @@ export class AnnotationWrapper { annotationWrapper.comments = redactionLogEntry.comments || []; annotationWrapper.manual = redactionLogEntry.manual; annotationWrapper.engines = redactionLogEntry.engines; + annotationWrapper.section = redactionLogEntry.section; + annotationWrapper.rectangle = redactionLogEntry.rectangle; this._createContent(annotationWrapper, redactionLogEntry); this._setSuperType(annotationWrapper, redactionLogEntry); diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts index 7db374e3b..daa248d77 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts @@ -240,7 +240,7 @@ export class PdfViewerComponent implements OnInit, OnChanges { // this will auto select rectangle after drawing if (annotations.length === 1 && annotations[0].ToolName === 'AnnotationCreateRectangle') { this.annotationManager.selectAnnotations(annotations); - annotations[0].enableRotationControl(); + annotations[0].disableRotationControl(); } }); diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index e7fbced47..75eb97847 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1260,6 +1260,8 @@ "dictionary": "Dictionary", "legalBasis": "Legal Basis", "reason": "Reason", + "section": "Paragraph / Location", + "classification": "Value / Classification", "reason-placeholder": "Select a reason ...", "rectangle": "Custom Rectangle", "text": "Selected text:" From da201b543a1e2e95696ad8bd9ce723d896405661 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 21:41:53 +0200 Subject: [PATCH 14/19] Search Screen port --- .../screens/search-screen/search-screen.component.html | 4 ++++ .../dossier/screens/search-screen/search-screen.component.ts | 2 ++ apps/red-ui/src/assets/i18n/en.json | 1 + libs/red-domain/src/lib/search/search-list-item.ts | 1 + 4 files changed, 8 insertions(+) diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html index 16bf74fde..5c44f4aca 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html @@ -56,6 +56,10 @@
+
+ +
+
; readonly routerLink: string; From 7a9b98f9282535939d1984f97fa6f6906a570209 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 22:09:47 +0200 Subject: [PATCH 15/19] Fixed User Preference and title service KC logout issue --- apps/red-ui/src/app/services/config.service.ts | 1 + .../src/app/services/general-settings.service.ts | 3 +-- .../red-ui/src/app/services/user-preference.service.ts | 1 + apps/red-ui/src/app/utils/configuration.initializer.ts | 10 ++++++---- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/services/config.service.ts b/apps/red-ui/src/app/services/config.service.ts index c50b4c3b9..d22af1396 100644 --- a/apps/red-ui/src/app/services/config.service.ts +++ b/apps/red-ui/src/app/services/config.service.ts @@ -48,6 +48,7 @@ export class ConfigService { } updateDisplayName(name: string): void { + console.log('got name', name); this._values = { ...this._values, APP_NAME: name } as const; this._titleService.setTitle(this._values.APP_NAME || 'RedactManager'); } diff --git a/apps/red-ui/src/app/services/general-settings.service.ts b/apps/red-ui/src/app/services/general-settings.service.ts index 9eae86e67..10353d8c2 100644 --- a/apps/red-ui/src/app/services/general-settings.service.ts +++ b/apps/red-ui/src/app/services/general-settings.service.ts @@ -2,7 +2,6 @@ import { Injectable, Injector } from '@angular/core'; import { GenericService, RequiredParam, Validate } from '@iqser/common-ui'; import { IGeneralConfiguration } from '@red/domain'; import { UserService } from '@services/user.service'; -import { of } from 'rxjs'; @Injectable({ providedIn: 'root', @@ -13,7 +12,7 @@ export class GeneralSettingsService extends GenericService { } reload(): void { + console.log('here'); this.getAll() .toPromise() .then(attributes => { diff --git a/apps/red-ui/src/app/utils/configuration.initializer.ts b/apps/red-ui/src/app/utils/configuration.initializer.ts index 228994ec0..7350337e9 100644 --- a/apps/red-ui/src/app/utils/configuration.initializer.ts +++ b/apps/red-ui/src/app/utils/configuration.initializer.ts @@ -1,7 +1,7 @@ -import { catchError, filter, mergeMapTo, take, tap } from 'rxjs/operators'; +import { catchError, filter, mergeMapTo, switchMap, take, tap } from 'rxjs/operators'; import { ConfigService } from '@services/config.service'; import { Title } from '@angular/platform-browser'; -import { of } from 'rxjs'; +import { from, of, throwError } from 'rxjs'; import { KeycloakEventType, KeycloakService } from 'keycloak-angular'; import { GeneralSettingsService } from '@services/general-settings.service'; import { LanguageService } from '@i18n/language.service'; @@ -19,14 +19,16 @@ export function configurationInitializer( keycloakService.keycloakEvents$ .pipe( filter(event => event.type === KeycloakEventType.OnReady), + switchMap(() => from(keycloakService.isLoggedIn())), + switchMap(loggedIn => (!loggedIn ? throwError('Not Logged In') : of({}))), mergeMapTo(generalSettingsService.getGeneralConfigurations()), tap(configuration => configService.updateDisplayName(configuration.displayName)), + tap(() => userPreferenceService.reload()), + tap(() => languageService.chooseAndSetInitialLanguage()), catchError(() => { title.setTitle('RedactManager'); return of({}); }), - tap(() => userPreferenceService.reload()), - tap(() => languageService.chooseAndSetInitialLanguage()), take(1), ) .toPromise(); From 0f00cafae3813b6d753bf0b4ed444a6336218319 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 23:07:12 +0200 Subject: [PATCH 16/19] Fixed OCR INC6158219 / RED-2813 --- angular.json | 3 +++ .../file-preview-screen/file-preview-screen.component.ts | 7 +++++-- .../modules/dossier/services/annotation-actions.service.ts | 2 +- .../modules/dossier/services/annotation-draw.service.ts | 2 +- apps/red-ui/src/app/services/config.service.ts | 1 - .../src/app/services/entity-services/files-map.service.ts | 7 +++++-- apps/red-ui/src/app/services/user-preference.service.ts | 1 - 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/angular.json b/angular.json index 700f0f37e..bef6f9183 100644 --- a/angular.json +++ b/angular.json @@ -1,4 +1,7 @@ { + "cli": { + "analytics": "4b8eed12-a1e6-4b7a-9ea2-925b27941271" + }, "version": 1, "projects": { "common-ui": { diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 4f1bbc0ae..ec3849327 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -167,13 +167,16 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni } async updateViewMode(): Promise { - const annotations = this._getAnnotations(a => a.getCustomData('redacto-manager')); + const ocrAnnotationIds = this.annotationData.allAnnotations.filter(a => a.isOCR).map(a => a.id); + const annotations = this._getAnnotations(a => a.getCustomData('redact-manager')); const redactions = annotations.filter(a => a.getCustomData('redaction')); switch (this.viewModeService.viewMode) { case 'STANDARD': { this._setAnnotationsColor(redactions, 'annotationColor'); - const standardEntries = annotations.filter(a => a.getCustomData('changeLogRemoved') === 'false'); + const standardEntries = annotations + .filter(a => a.getCustomData('changeLogRemoved') === 'false') + .filter(a => !ocrAnnotationIds.includes(a.Id)); const nonStandardEntries = annotations.filter(a => a.getCustomData('changeLogRemoved') === 'true'); this._show(standardEntries); this._hide(nonStandardEntries); diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts index d9b5c3945..87f773043 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts @@ -390,7 +390,7 @@ export class AnnotationActionsService { } updateHiddenAnnotation(annotations: AnnotationWrapper[], viewerAnnotations: Annotation[], hidden: boolean) { - const annotationId = (viewerAnnotations[0] as any).Dx; + const annotationId = viewerAnnotations[0].Id; const annotationToBeUpdated = annotations.find((a: AnnotationWrapper) => a.annotationId === annotationId); annotationToBeUpdated.hidden = hidden; } diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts index f777317a6..ecdccdbc9 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts @@ -180,7 +180,7 @@ export class AnnotationDrawService { (hideSkipped && annotationWrapper.isSkipped) || annotationWrapper.isOCR || annotationWrapper.hidden; - annotation.setCustomData('redacto-manager', 'true'); + annotation.setCustomData('redact-manager', 'true'); annotation.setCustomData('redaction', String(annotationWrapper.isRedacted)); annotation.setCustomData('skipped', String(annotationWrapper.isSkipped)); annotation.setCustomData('changeLog', String(annotationWrapper.isChangeLogEntry)); diff --git a/apps/red-ui/src/app/services/config.service.ts b/apps/red-ui/src/app/services/config.service.ts index d22af1396..c50b4c3b9 100644 --- a/apps/red-ui/src/app/services/config.service.ts +++ b/apps/red-ui/src/app/services/config.service.ts @@ -48,7 +48,6 @@ export class ConfigService { } updateDisplayName(name: string): void { - console.log('got name', name); this._values = { ...this._values, APP_NAME: name } as const; this._titleService.setTitle(this._values.APP_NAME || 'RedactManager'); } diff --git a/apps/red-ui/src/app/services/entity-services/files-map.service.ts b/apps/red-ui/src/app/services/entity-services/files-map.service.ts index a8f69b6a4..b861090da 100644 --- a/apps/red-ui/src/app/services/entity-services/files-map.service.ts +++ b/apps/red-ui/src/app/services/entity-services/files-map.service.ts @@ -70,8 +70,11 @@ export class FilesMapService { } replace(entity: File) { - const all = this.get(entity.dossierId).filter(file => file.fileId !== entity.fileId); - this.set(entity.dossierId, [...all, entity]); + const existingFile = this.get(entity.dossierId).find(file => file.fileId === entity.fileId); + if (existingFile.lastUpdated !== entity.lastUpdated) { + const all = this.get(entity.dossierId).filter(file => file.fileId !== entity.fileId); + this.set(entity.dossierId, [...all, entity]); + } } watch$(key: string, entityId: string): Observable { diff --git a/apps/red-ui/src/app/services/user-preference.service.ts b/apps/red-ui/src/app/services/user-preference.service.ts index 3cad19c8b..e2ac56f9e 100644 --- a/apps/red-ui/src/app/services/user-preference.service.ts +++ b/apps/red-ui/src/app/services/user-preference.service.ts @@ -69,7 +69,6 @@ export class UserPreferenceService extends GenericService { } reload(): void { - console.log('here'); this.getAll() .toPromise() .then(attributes => { From 77859e9216bd6ace5efb6d45ee839dc124d0040c Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 23:15:30 +0200 Subject: [PATCH 17/19] RED-2943 --- .../components/document-info/document-info.component.html | 2 +- apps/red-ui/src/app/services/permissions.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html index d4b4d65fd..6d6f693e2 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/document-info/document-info.component.html @@ -2,7 +2,7 @@
Date: Tue, 14 Dec 2021 23:17:26 +0200 Subject: [PATCH 18/19] app module --- apps/red-ui/src/app/app.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 1ae19dd51..a1d31741d 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -7,7 +7,6 @@ import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common import { BaseScreenComponent } from '@components/base-screen/base-screen.component'; import { ApiPathInterceptor } from '@utils/api-path-interceptor'; import { MissingTranslationHandler, TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; -import { languageInitializer } from '@i18n/language.initializer'; import { LanguageService } from '@i18n/language.service'; import { ToastrModule } from 'ngx-toastr'; import { ServiceWorkerModule } from '@angular/service-worker'; From 9a478d960a37baf4de181be6c70dc74d5091a423 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 14 Dec 2021 23:17:45 +0200 Subject: [PATCH 19/19] lint --- libs/common-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common-ui b/libs/common-ui index 6bd54f11a..caf4838be 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 6bd54f11ab7a6cdfec3edddbef2af3d3c437066a +Subproject commit caf4838be63574740e5380c74ad96fe21f7a456b