license information, trash normalization actions for excluded pages

This commit is contained in:
Timo Bejan 2021-10-18 08:12:04 +03:00
parent 915d61fc8b
commit bcab9a0071
7 changed files with 12 additions and 8 deletions

View File

@ -19,11 +19,6 @@
<div>{{ configService.values.BACKEND_APP_VERSION || '-' }}</div>
</div>
<div class="row">
<div translate="license-info-screen.frontend-version"></div>
<div>{{ configService.values.FRONTEND_APP_VERSION || '-' }}</div>
</div>
<div class="row">
<div translate="license-info-screen.custom-app-title"></div>
<div>{{ configService.values.APP_NAME || '-' }}</div>

View File

@ -68,7 +68,7 @@
<div class="cell">
<span class="small-label">
{{ entity.softDeletedTime | date: 'd MMM. yyyy, hh:mm a' }}
{{ entity.softDeletedTime | date: 'exactDate' }}
</span>
</div>

View File

@ -249,6 +249,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
} else {
this._ngZone.run(() => this.pageChanged.emit(pageNumber));
}
this._handleCustomActions();
});
this.instance.Core.documentViewer.on('documentLoaded', this._documentLoaded);
@ -296,7 +297,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
}
private _setSelectionMode(): void {
const textTool = (<unknown> this.instance.Core.Tools.TextTool) as TextTool;
const textTool = (<unknown>this.instance.Core.Tools.TextTool) as TextTool;
textTool.SELECTION_MODE = this._configService.values.SELECTION_MODE;
}
@ -528,7 +529,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
private _handleCustomActions() {
this.instance.UI.setToolMode('AnnotationEdit');
if (this.canPerformActions) {
if (this.canPerformActions && !this.utils.isCurrentPageExcluded) {
this.instance.UI.enableTools(['AnnotationCreateRectangle']);
this.instance.UI.enableElements([
'add-redaction',

View File

@ -544,6 +544,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
private async _doStampExcludedPages(excludedPages: number[]) {
if (excludedPages && excludedPages.length > 0) {
this.viewerComponent.utils.excludedPages = excludedPages;
const pdfNet = this._instance.Core.PDFNet;
const document = await this._instance.Core.documentViewer.getDocument().getPDFDoc();
await clearStamps(document, pdfNet, [...Array(this.fileData.file.numberOfPages).keys()]);

View File

@ -126,6 +126,7 @@ export class AnnotationActionsService {
annotations: AnnotationWrapper[],
annotationsChanged: EventEmitter<AnnotationWrapper>,
): Record<string, unknown>[] {
console.log('============ get actions');
const availableActions = [];
const annotationPermissions = annotations.map(annotation => ({

View File

@ -40,6 +40,7 @@ const DISABLED_HOTKEYS = [
export class PdfViewerUtils {
ready = false;
excludedPages: number[] = [];
constructor(readonly instance: WebViewerInstance, public viewMode: ViewMode, public multiSelectActive: boolean) {}
@ -51,6 +52,11 @@ export class PdfViewerUtils {
return this.isCompareMode ? 2 : 1;
}
get isCurrentPageExcluded() {
const currentPage = this.currentPage;
return !!this.excludedPages?.includes(currentPage);
}
get currentPage() {
try {
return this.isCompareMode ? Math.ceil(this._currentInternalPage / 2) : this._currentInternalPage;

0
package-lock.json generated
View File