From 885864fc1ef3681a8fb296970c990709d8684ce4 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Thu, 30 Nov 2023 13:59:49 +0200 Subject: [PATCH] DM-604 hide actions when file is done --- .../services/pdf-proxy.service.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 3718b3f39..dcecc5cca 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 @@ -43,6 +43,15 @@ import Quad = Core.Math.Quad; @Injectable() export class PdfProxyService { + readonly #convertPath = inject(UI_ROOT_PATH_FN); + readonly #visibilityOffIcon = this.#convertPath('/assets/icons/general/visibility-off.svg'); + readonly #visibilityIcon = this.#convertPath('/assets/icons/general/visibility.svg'); + readonly #falsePositiveIcon = this.#convertPath('/assets/icons/general/pdftron-action-false-positive.svg'); + readonly #addRedactionIcon = this._iqserPermissionsService.has(Roles.getRss) + ? this.#convertPath('/assets/icons/general/pdftron-action-add-annotation.svg') + : this.#convertPath('/assets/icons/general/pdftron-action-add-redaction.svg'); + readonly #isDocumine = getConfig().IS_DOCUMINE; + readonly #addHintIcon = this.#convertPath('/assets/icons/general/pdftron-action-add-hint.svg'); readonly annotationSelected$ = this.#annotationSelected$; readonly manualAnnotationRequested$ = new Subject(); readonly redactTextRequested$ = new Subject(); @@ -61,15 +70,6 @@ export class PdfProxyService { const isAllowed = this._permissionsService.canPerformAnnotationActions(this._state.file(), this._state.dossier()); return isAllowed && isStandard; }); - readonly #convertPath = inject(UI_ROOT_PATH_FN); - readonly #visibilityOffIcon = this.#convertPath('/assets/icons/general/visibility-off.svg'); - readonly #visibilityIcon = this.#convertPath('/assets/icons/general/visibility.svg'); - readonly #falsePositiveIcon = this.#convertPath('/assets/icons/general/pdftron-action-false-positive.svg'); - readonly #addRedactionIcon = this._iqserPermissionsService.has(Roles.getRss) - ? this.#convertPath('/assets/icons/general/pdftron-action-add-annotation.svg') - : this.#convertPath('/assets/icons/general/pdftron-action-add-redaction.svg'); - readonly #isDocumine = getConfig().IS_DOCUMINE; - readonly #addHintIcon = this.#convertPath('/assets/icons/general/pdftron-action-add-hint.svg'); constructor( private readonly _translateService: TranslateService, @@ -351,6 +351,7 @@ export class PdfProxyService { #configureAnnotationSpecificActions(viewerAnnotations: Annotation[]) { if (!this.canPerformActions()) { + this._pdf.instance.UI.annotationPopup.update([]); return; }