RED-9944 - Action Items don't appear in document area in webviewer when bulk-select is still unintenionally active

This commit is contained in:
Valentin Mihai 2024-10-10 16:48:06 +03:00
parent 686f390b1a
commit 287b95a538
3 changed files with 17 additions and 2 deletions

View File

@ -79,6 +79,7 @@ export class AnnotationsListComponent extends HasScrollbarDirective {
this._multiSelectService.activate();
}
this._listingService.selectAnnotations(annotation);
this._annotationManager.setSelectedFromWorkload();
}
referenceClicked(annotation: AnnotationWrapper): void {

View File

@ -404,11 +404,14 @@ export class PdfProxyService {
const annotationChangesAllowed = !this.#isDocumine || !this._state.file().excludedFromAutomaticAnalysis;
const somePending = annotationWrappers.some(a => a.pending);
const selectedFromWorkload = untracked(this._annotationManager.selectedFromWorkload);
actions =
this._multiSelectService.inactive() && !this._documentViewer.selectedText.length && !somePending
(this._multiSelectService.inactive() || !selectedFromWorkload) && !this._documentViewer.selectedText.length && !somePending
? [...actions, ...this._pdfAnnotationActionsService.get(annotationWrappers, annotationChangesAllowed)]
: [];
this._pdf.instance.UI.annotationPopup.update(actions);
this._annotationManager.resetSelectedFromWorkload();
}
#getTitle(type: ManualRedactionEntryType) {

View File

@ -1,5 +1,5 @@
import { inject, Injectable, signal } from '@angular/core';
import { bool, List } from '@iqser/common-ui/lib/utils';
import { bool, Debounce, List } from '@iqser/common-ui/lib/utils';
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
import { Core } from '@pdftron/webviewer';
import { getLast, urlFileId } from '@utils/functions';
@ -23,6 +23,8 @@ export class REDAnnotationManager {
annotationHasBeenResized?: boolean = false;
readonly #hidden = signal(new Set<string>());
readonly hidden = this.#hidden.asReadonly();
readonly #selectedFromWorkload = signal(false);
readonly selectedFromWorkload = this.#selectedFromWorkload.asReadonly();
#manager: AnnotationManager;
readonly #logger = inject(NGXLogger);
readonly #annotationSelected$ = new Subject<[Annotation[], string]>();
@ -155,6 +157,15 @@ export class REDAnnotationManager {
});
}
setSelectedFromWorkload() {
this.#selectedFromWorkload.set(true);
}
@Debounce()
resetSelectedFromWorkload() {
this.#selectedFromWorkload.set(false);
}
#getById(annotation: AnnotationWrapper | string) {
return this.#manager.getAnnotationById(getId(annotation));
}