RED-9944 - Action Items don't appear in document area in webviewer when bulk-select is still unintenionally active
This commit is contained in:
parent
aa171f992b
commit
1fcc95b138
@ -69,6 +69,7 @@ export class AnnotationsListComponent extends HasScrollbarDirective {
|
|||||||
this._multiSelectService.activate();
|
this._multiSelectService.activate();
|
||||||
}
|
}
|
||||||
this._listingService.selectAnnotations(annotation);
|
this._listingService.selectAnnotations(annotation);
|
||||||
|
this._annotationManager.setSelectedFromWorkload();
|
||||||
}
|
}
|
||||||
|
|
||||||
referenceClicked(annotation: AnnotationWrapper): void {
|
referenceClicked(annotation: AnnotationWrapper): void {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { computed, effect, inject, Injectable, NgZone } from '@angular/core';
|
import { computed, effect, inject, Injectable, NgZone, untracked } from '@angular/core';
|
||||||
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { isJustOne, shareDistinctLast, UI_ROOT_PATH_FN } from '@iqser/common-ui/lib/utils';
|
import { isJustOne, shareDistinctLast, UI_ROOT_PATH_FN } from '@iqser/common-ui/lib/utils';
|
||||||
@ -402,11 +402,14 @@ export class PdfProxyService {
|
|||||||
|
|
||||||
const annotationChangesAllowed = !this.#isDocumine || !this._state.file().excludedFromAutomaticAnalysis;
|
const annotationChangesAllowed = !this.#isDocumine || !this._state.file().excludedFromAutomaticAnalysis;
|
||||||
const somePending = annotationWrappers.some(a => a.pending);
|
const somePending = annotationWrappers.some(a => a.pending);
|
||||||
|
const selectedFromWorkload = untracked(this._annotationManager.selectedFromWorkload);
|
||||||
|
|
||||||
actions =
|
actions =
|
||||||
this._multiSelectService.inactive() && !this._documentViewer.selectedText.length && !somePending
|
(this._multiSelectService.inactive() || !selectedFromWorkload) && !this._documentViewer.selectedText.length && !somePending
|
||||||
? [...actions, ...this._pdfAnnotationActionsService.get(annotationWrappers, annotationChangesAllowed)]
|
? [...actions, ...this._pdfAnnotationActionsService.get(annotationWrappers, annotationChangesAllowed)]
|
||||||
: [];
|
: [];
|
||||||
this._pdf.instance.UI.annotationPopup.update(actions);
|
this._pdf.instance.UI.annotationPopup.update(actions);
|
||||||
|
this._annotationManager.resetSelectedFromWorkload();
|
||||||
}
|
}
|
||||||
|
|
||||||
#getTitle(type: ManualRedactionEntryType) {
|
#getTitle(type: ManualRedactionEntryType) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { inject, Injectable, signal } from '@angular/core';
|
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 { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
import { Core } from '@pdftron/webviewer';
|
import { Core } from '@pdftron/webviewer';
|
||||||
import { getLast, urlFileId } from '@utils/functions';
|
import { getLast, urlFileId } from '@utils/functions';
|
||||||
@ -20,6 +20,7 @@ const MOVE_OPTION = 'move';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class REDAnnotationManager {
|
export class REDAnnotationManager {
|
||||||
readonly #hidden = signal(new Set<string>());
|
readonly #hidden = signal(new Set<string>());
|
||||||
|
readonly #selectedFromWorkload = signal(false);
|
||||||
#manager: AnnotationManager;
|
#manager: AnnotationManager;
|
||||||
readonly #logger = inject(NGXLogger);
|
readonly #logger = inject(NGXLogger);
|
||||||
readonly #annotationSelected$ = new Subject<[Annotation[], string]>();
|
readonly #annotationSelected$ = new Subject<[Annotation[], string]>();
|
||||||
@ -27,6 +28,7 @@ export class REDAnnotationManager {
|
|||||||
resizingAnnotationId?: string = undefined;
|
resizingAnnotationId?: string = undefined;
|
||||||
annotationHasBeenResized?: boolean = false;
|
annotationHasBeenResized?: boolean = false;
|
||||||
readonly hidden = this.#hidden.asReadonly();
|
readonly hidden = this.#hidden.asReadonly();
|
||||||
|
readonly selectedFromWorkload = this.#selectedFromWorkload.asReadonly();
|
||||||
|
|
||||||
get selected() {
|
get selected() {
|
||||||
return this.#manager.getSelectedAnnotations();
|
return this.#manager.getSelectedAnnotations();
|
||||||
@ -161,6 +163,15 @@ export class REDAnnotationManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSelectedFromWorkload() {
|
||||||
|
this.#selectedFromWorkload.set(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Debounce()
|
||||||
|
resetSelectedFromWorkload() {
|
||||||
|
this.#selectedFromWorkload.set(false);
|
||||||
|
}
|
||||||
|
|
||||||
#getById(annotation: AnnotationWrapper | string) {
|
#getById(annotation: AnnotationWrapper | string) {
|
||||||
return this.#manager.getAnnotationById(getId(annotation));
|
return this.#manager.getAnnotationById(getId(annotation));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user