RED-7673 - Resize accept and decline actions not available in the document viewer
This commit is contained in:
parent
092b8c2b28
commit
6923a00caf
@ -58,7 +58,6 @@ export class PdfProxyService {
|
|||||||
readonly currentUser = getCurrentUser<User>();
|
readonly currentUser = getCurrentUser<User>();
|
||||||
readonly pageChanged$ = this._pdf.pageChanged$.pipe(
|
readonly pageChanged$ = this._pdf.pageChanged$.pipe(
|
||||||
tap(() => this.#handleExcludedPageActions()),
|
tap(() => this.#handleExcludedPageActions()),
|
||||||
tap(() => this._pdf.resetAnnotationActions()),
|
|
||||||
shareDistinctLast(),
|
shareDistinctLast(),
|
||||||
);
|
);
|
||||||
readonly canPerformActions = computed(() => {
|
readonly canPerformActions = computed(() => {
|
||||||
@ -143,7 +142,7 @@ export class PdfProxyService {
|
|||||||
onClick: () => this._ngZone.run(() => this.#addRectangleManualRedaction()),
|
onClick: () => this._ngZone.run(() => this.#addRectangleManualRedaction()),
|
||||||
};
|
};
|
||||||
|
|
||||||
this._pdf.instance.UI.annotationPopup.add([addRectangleButton]);
|
this._pdf.instance.UI.annotationPopup.update([addRectangleButton]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +279,6 @@ export class PdfProxyService {
|
|||||||
|
|
||||||
#processSelectedAnnotations(annotations: Annotation[], action: string) {
|
#processSelectedAnnotations(annotations: Annotation[], action: string) {
|
||||||
let nextAnnotations: Annotation[];
|
let nextAnnotations: Annotation[];
|
||||||
this._pdf.resetAnnotationActions();
|
|
||||||
|
|
||||||
if (action === 'deselected') {
|
if (action === 'deselected') {
|
||||||
this.#cancelResizeIfIsResizing(annotations);
|
this.#cancelResizeIfIsResizing(annotations);
|
||||||
@ -360,6 +358,7 @@ export class PdfProxyService {
|
|||||||
return this.#configureRectangleAnnotationPopup(viewerAnnotations[0]);
|
return this.#configureRectangleAnnotationPopup(viewerAnnotations[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let actions = [];
|
||||||
// Add hide action as last item
|
// Add hide action as last item
|
||||||
const allAreImage = annotationWrappers.reduce((acc, next) => acc && next.isImage, true);
|
const allAreImage = annotationWrappers.reduce((acc, next) => acc && next.isImage, true);
|
||||||
if (allAreImage && !this._annotationManager.resizingAnnotationId) {
|
if (allAreImage && !this._annotationManager.resizingAnnotationId) {
|
||||||
@ -383,11 +382,11 @@ export class PdfProxyService {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
this._pdf.instance.UI.annotationPopup.add([visibilityButton]);
|
actions.push(visibilityButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
const actions = this._pdfAnnotationActionsService.get(annotationWrappers);
|
actions = [...actions, ...this._pdfAnnotationActionsService.get(annotationWrappers)];
|
||||||
this._pdf.instance.UI.annotationPopup.add(actions);
|
this._pdf.instance.UI.annotationPopup.update(actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
#getTitle(type: ManualRedactionEntryType) {
|
#getTitle(type: ManualRedactionEntryType) {
|
||||||
|
|||||||
@ -124,13 +124,6 @@ export class PdfViewer {
|
|||||||
this.#instance.UI.closeElements(['searchPanel']);
|
this.#instance.UI.closeElements(['searchPanel']);
|
||||||
}
|
}
|
||||||
|
|
||||||
resetAnnotationActions() {
|
|
||||||
if (this.#instance.UI.annotationPopup.getItems().length) {
|
|
||||||
this.#logger.info('[PDF] Reset annotation actions');
|
|
||||||
this.#instance.UI.annotationPopup.update([]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
navigateTo(page: string | number) {
|
navigateTo(page: string | number) {
|
||||||
const parsedNumber = typeof page === 'string' ? parseInt(page, 10) : page;
|
const parsedNumber = typeof page === 'string' ? parseInt(page, 10) : page;
|
||||||
const paginationOffset = this.#paginationOffset;
|
const paginationOffset = this.#paginationOffset;
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
"@ngx-translate/core": "15.0.0",
|
"@ngx-translate/core": "15.0.0",
|
||||||
"@ngx-translate/http-loader": "8.0.0",
|
"@ngx-translate/http-loader": "8.0.0",
|
||||||
"@nx/angular": "16.10.0",
|
"@nx/angular": "16.10.0",
|
||||||
"@pdftron/webviewer": "10.3.0",
|
"@pdftron/webviewer": "10.5.0",
|
||||||
"chart.js": "4.4.0",
|
"chart.js": "4.4.0",
|
||||||
"dayjs": "1.11.10",
|
"dayjs": "1.11.10",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user