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 0f239074a..4788f33e9 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -48,7 +48,6 @@ export class AnnotationWrapper implements IListable, Record { recommendationType: string; legalBasisValue: string; legalBasisChangeValue?: string; - resizing = false; rectangle?: boolean; section?: string; reference: List; diff --git a/apps/red-ui/src/app/modules/admin/base-admin-screen/base-admin-screen.component.ts b/apps/red-ui/src/app/modules/admin/base-admin-screen/base-admin-screen.component.ts index f15acbbb4..6da915279 100644 --- a/apps/red-ui/src/app/modules/admin/base-admin-screen/base-admin-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/base-admin-screen/base-admin-screen.component.ts @@ -1,8 +1,7 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ templateUrl: './base-admin-screen.component.html', styleUrls: ['./base-admin-screen.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, }) export class BaseAdminScreenComponent {} diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html index 43fe510a5..686875d6a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component.html @@ -29,6 +29,7 @@
diff --git a/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.html b/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.html index 6d79cc2f8..a707dd9ed 100644 --- a/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.html +++ b/apps/red-ui/src/app/modules/admin/shared/components/dossier-template-actions/dossier-template-actions.component.html @@ -1,6 +1,7 @@
- {{ 'dossier-overview.dossier-details.stats.documents' | translate: { count: stats.numberOfFiles } }} + {{ 'dossier-overview.dossier-details.stats.documents' | translate : { count: stats.numberOfFiles } }}
{{ - 'dossier-overview.dossier-details.stats.processing-documents' | translate: { count: stats.numberOfProcessingFiles } + 'dossier-overview.dossier-details.stats.processing-documents' | translate : { count: stats.numberOfProcessingFiles } }}
- {{ 'dossier-overview.dossier-details.stats.people' | translate: { count: dossier.memberIds.length } }} + {{ 'dossier-overview.dossier-details.stats.people' | translate : { count: dossier.memberIds.length } }}
- {{ 'dossier-overview.dossier-details.stats.analysed-pages' | translate: { count: stats.numberOfPages | number } }} + {{ 'dossier-overview.dossier-details.stats.analysed-pages' | translate : { count: stats.numberOfPages | number } }}
-
+
- {{ 'dossier-overview.dossier-details.stats.created-on' | translate: { date: date } }} +
-
+
- {{ 'dossier-overview.dossier-details.stats.due-date' | translate: { date: dueDate } }} +
@@ -44,7 +44,7 @@
- {{ 'dossier-overview.dossier-details.stats.deleted' | translate: { count: stats.numberOfSoftDeletedFiles } }} + {{ 'dossier-overview.dossier-details.stats.deleted' | translate : { count: stats.numberOfSoftDeletedFiles } }}
@@ -55,14 +55,14 @@ [iqserHelpMode]="'edit_dossier_dossier_attributes'" class="all-caps-label show-attributes" > - {{ 'dossier-overview.dossier-details.attributes.expand' | translate: { count: dossierAttributes.length } }} + {{ 'dossier-overview.dossier-details.attributes.expand' | translate : { count: dossierAttributes.length } }}
-
+
diff --git a/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.ts b/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.ts index 866bc3c9a..95c8c4f8a 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; +import { Component, Inject } from '@angular/core'; import { ViewMode, ViewModes } from '@red/domain'; import { ViewModeService } from '../../services/view-mode.service'; import { FilePreviewStateService } from '../../services/file-preview-state.service'; @@ -15,7 +15,6 @@ import { ROLES } from '@users/roles'; selector: 'redaction-view-switch', templateUrl: './view-switch.component.html', styleUrls: ['./view-switch.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, }) export class ViewSwitchComponent { readonly viewModes = ViewModes; @@ -54,40 +53,45 @@ export class ViewSwitchComponent { async #switchToRedactedView() { const unapprovedSuggestionsWarning = this._userPreferenceService.getUnapprovedSuggestionsWarning(); - if (!unapprovedSuggestionsWarning) { - const suggestions = (await this._fileDataService.annotations).filter(a => a.isSuggestion); - if (suggestions.length) { - const displaySuggestionsInPreview = this._userPreferenceService.getDisplaySuggestionsInPreview(); - const question = displaySuggestionsInPreview - ? _('unapproved-suggestions.confirmation-dialog.displayed-question') - : _('unapproved-suggestions.confirmation-dialog.not-displayed-question'); - const data = new ConfirmationDialogInput({ - title: _('unapproved-suggestions.confirmation-dialog.title'), - question: question, - confirmationText: _('unapproved-suggestions.confirmation-dialog.confirmation-text'), - denyText: _('unapproved-suggestions.confirmation-dialog.deny-text'), - checkboxes: [ - { - label: _('unapproved-suggestions.confirmation-dialog.checkbox-text'), - value: false, - }, - ], - checkboxesValidation: false, - }); + if (unapprovedSuggestionsWarning) { + return this.viewModeService.switchToRedacted(); + } - return this._dialogService.openDialog('confirm', null, data, result => { - if (result) { - if (result === ConfirmOptions.SECOND_CONFIRM) { - this._userPreferenceService.toggleUnapprovedSuggestionsWarning(); - this._toaster.success(_('unapproved-suggestions.confirmation-dialog.success-confirmation-text'), { - params: { settingsUrl: `${this._baseHref}/main/account/warnings-preferences` }, - }); - } - this.viewModeService.switchToRedacted(); - } + const suggestions = (await this._fileDataService.annotations).filter(a => a.isSuggestion); + if (!suggestions.length) { + return this.viewModeService.switchToRedacted(); + } + + const displaySuggestionsInPreview = this._userPreferenceService.getDisplaySuggestionsInPreview(); + const question = displaySuggestionsInPreview + ? _('unapproved-suggestions.confirmation-dialog.displayed-question') + : _('unapproved-suggestions.confirmation-dialog.not-displayed-question'); + const data = new ConfirmationDialogInput({ + title: _('unapproved-suggestions.confirmation-dialog.title'), + question: question, + confirmationText: _('unapproved-suggestions.confirmation-dialog.confirmation-text'), + denyText: _('unapproved-suggestions.confirmation-dialog.deny-text'), + checkboxes: [ + { + label: _('unapproved-suggestions.confirmation-dialog.checkbox-text'), + value: false, + }, + ], + checkboxesValidation: false, + }); + + return this._dialogService.openDialog('confirm', null, data, result => { + if (!result) { + return; + } + + if (result === ConfirmOptions.SECOND_CONFIRM) { + this._userPreferenceService.toggleUnapprovedSuggestionsWarning(); + this._toaster.success(_('unapproved-suggestions.confirmation-dialog.success-confirmation-text'), { + params: { settingsUrl: `${this._baseHref}/main/account/warnings-preferences` }, }); } - } - return this.viewModeService.switchToRedacted(); + this.viewModeService.switchToRedacted(); + }); } } diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts index bdbf06f1c..134622ea8 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts @@ -22,7 +22,7 @@ import { AcceptRecommendationDialogComponent, AcceptRecommendationReturnType, } from '../dialogs/accept-recommendation-dialog/accept-recommendation-dialog.component'; -import { defaultDialogConfig, List } from '@iqser/common-ui'; +import { defaultDialogConfig, isJustOne, List } from '@iqser/common-ui'; import { filter } from 'rxjs/operators'; import { MatDialog } from '@angular/material/dialog'; import { FilePreviewStateService } from './file-preview-state.service'; @@ -175,8 +175,12 @@ export class AnnotationActionsService { AcceptRecommendationDialogComponent, { ...defaultDialogConfig, autoFocus: true, data: { annotations: recommendations, dossierId } }, ); + // TODO: remove observables const dialogClosed = dialogRef.afterClosed().pipe(filter(value => !!value && !!value.annotations)); dialogClosed.subscribe(({ annotations, comment: commentText }) => { + if (isJustOne(annotations) && this._annotationManager.resizingAnnotationId === annotations[0].id) { + this.cancelResize(null, annotations[0]).then(); + } const comment = commentText ? { text: commentText } : undefined; this.#processObsAndEmit(this._manualRedactionService.addRecommendation(annotations, dossierId, fileId, comment)); }); @@ -185,7 +189,7 @@ export class AnnotationActionsService { async resize($event: MouseEvent, annotationWrapper: AnnotationWrapper) { $event?.stopPropagation(); - annotationWrapper.resizing = true; + this._annotationManager.resizingAnnotationId = annotationWrapper.id; const viewerAnnotation = this._annotationManager.get(annotationWrapper); if (annotationWrapper.rectangle || annotationWrapper.imported || annotationWrapper.isImage) { @@ -226,6 +230,8 @@ export class AnnotationActionsService { updateDictionary: result.updateDictionary, }; + this.cancelResize(null, annotation).then(); + const { fileId, dossierId } = this._state; const request = this._manualRedactionService.resizeOrSuggestResize([resizeRequest], dossierId, fileId); this.#processObsAndEmit(request); @@ -235,7 +241,7 @@ export class AnnotationActionsService { async cancelResize($event: MouseEvent, annotationWrapper: AnnotationWrapper) { $event?.stopPropagation(); - annotationWrapper.resizing = false; + this._annotationManager.resizingAnnotationId = undefined; this._annotationManager.delete(annotationWrapper); await this._annotationDrawService.draw([annotationWrapper], this._skippedService.hideSkipped, this._state.dossierTemplateId); diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts index 569ccfa20..f1bc826ef 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts @@ -9,6 +9,7 @@ import { BASE_HREF_FN, IqserPermissionsService } from '@iqser/common-ui'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { IHeaderElement } from '@red/domain'; import { ROLES } from '@users/roles'; +import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service'; @Injectable() export class PdfAnnotationActionsService { @@ -19,6 +20,7 @@ export class PdfAnnotationActionsService { readonly #convertPath = inject(BASE_HREF_FN); readonly #annotationActionsService = inject(AnnotationActionsService); readonly #iqserPermissionsService = inject(IqserPermissionsService); + readonly #annotationManager = inject(REDAnnotationManager); get(annotations: AnnotationWrapper[]): IHeaderElement[] { const availableActions: IHeaderElement[] = []; @@ -28,7 +30,7 @@ export class PdfAnnotationActionsService { if (permissions.canResize) { const firstAnnotation = annotations[0]; // if we already entered resize-mode previously - if (firstAnnotation.resizing) { + if (firstAnnotation.id === this.#annotationManager.resizingAnnotationId) { const acceptResizeButton = this.#getButton('check', _('annotation-actions.resize-accept.label'), () => this.#annotationActionsService.acceptResize(null, firstAnnotation), ); diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts index ece3bf308..f3b47a5bb 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts @@ -9,7 +9,7 @@ import { } from '@models/file/manual-redaction-entry.wrapper'; import { AnnotationDrawService } from '../../pdf-viewer/services/annotation-draw.service'; import { UserPreferenceService } from '@users/user-preference.service'; -import { BASE_HREF_FN, BaseHrefFn, IqserPermissionsService, shareDistinctLast } from '@iqser/common-ui'; +import { BASE_HREF_FN, BaseHrefFn, IqserPermissionsService, isJustOne, shareDistinctLast } from '@iqser/common-ui'; import { toPosition } from '../utils/pdf-calculation.utils'; import { MultiSelectService } from './multi-select.service'; import { FilePreviewStateService } from './file-preview-state.service'; @@ -161,19 +161,24 @@ export class PdfProxyService { } #cancelResizeIfIsResizing(annotations: Annotation[]) { - if (annotations.length !== 1) { + if (!isJustOne(annotations)) { return; } const annotation = annotations[0]; - const wrapper = this._fileDataService.find(annotation.Id); - if (!wrapper?.resizing) { + const isResizing = this._annotationManager.resizingAnnotationId === annotation.Id; + + if (!isResizing) { return; } // When resizing a rectangle, the original annotation is removed and triggers a deselect event and a new one is created // So we want to skip the first deselect event. - if ((wrapper.isImage || wrapper.rectangle) && annotation.ToolName !== AnnotationToolNames.AnnotationCreateRectangle) { + const wrapper = this._fileDataService.find(annotation.Id); + if ( + (wrapper.rectangle || wrapper.isImage || wrapper.imported) && + annotation.ToolName !== AnnotationToolNames.AnnotationCreateRectangle + ) { return; } diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts index d17a81d54..74cff5ed2 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts @@ -15,6 +15,7 @@ import Annotation = Core.Annotations.Annotation; export class REDAnnotationManager { annotationSelected$: Observable<[Annotation[], string]>; readonly hidden = new Set(); + resizingAnnotationId?: string = undefined; #manager: AnnotationManager; diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html index 418984d6f..b4f5db284 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html @@ -58,13 +58,13 @@ [disabled]="disabled || !valid || !changed" [label]="'edit-dossier-dialog.actions.save' | translate" [type]="iconButtonTypes.primary" - id="editDossierSaveButton" + buttonId="editDossierSaveButton" > @@ -76,5 +76,5 @@
- + diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html index 13006ca6f..6836a8104 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html @@ -79,9 +79,9 @@ diff --git a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html index 1ece80983..40857cf4e 100644 --- a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html +++ b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.html @@ -2,8 +2,8 @@ diff --git a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html index 121c9ab13..3c9be07e8 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.html @@ -101,13 +101,13 @@ [disabled]="disabled" [label]="'add-dossier-dialog.actions.save' | translate" [type]="iconButtonTypes.primary" - id="createDossierSaveButton" + buttonId="createDossierSaveButton" >
- {{ 'upload-status.dialog.title' | translate: { len: uploadService.files.length } }} + {{ 'upload-status.dialog.title' | translate : { len: uploadService.files.length } }}
- + - +
@@ -31,9 +34,7 @@
{{ model.progress }}%
-
- {{ model.error?.message }} -
+
diff --git a/package.json b/package.json index a7393983f..b6a74fdc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redaction", - "version": "3.924.0", + "version": "3.927.0", "private": true, "license": "MIT", "scripts": { diff --git a/paligo-theme.tar.gz b/paligo-theme.tar.gz index 81e3b33d5..a56a27291 100644 Binary files a/paligo-theme.tar.gz and b/paligo-theme.tar.gz differ