RED-7081 & RED-7005 add upload settings for dossier templates
This commit is contained in:
parent
254b7f66ce
commit
bea8e6e8a4
@ -79,22 +79,41 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="!isDocumine">
|
||||
<p class="heading download-includes">{{ 'download-includes' | translate }}</p>
|
||||
<div class="flex">
|
||||
<redaction-select
|
||||
[label]="
|
||||
'download-type.label'
|
||||
| translate
|
||||
: {
|
||||
length: form.controls['downloadFileTypes'].value.length
|
||||
}
|
||||
"
|
||||
[options]="downloadTypes"
|
||||
formControlName="downloadFileTypes"
|
||||
></redaction-select>
|
||||
<div *ngIf="!isDocumine" class="flex">
|
||||
<div class="half-flex-basis">
|
||||
<p class="heading download-includes">{{ 'download-includes' | translate }}</p>
|
||||
|
||||
<div class="flex">
|
||||
<redaction-select
|
||||
[label]="
|
||||
'download-type.label'
|
||||
| translate
|
||||
: {
|
||||
length: form.controls['downloadFileTypes'].value.length
|
||||
}
|
||||
"
|
||||
[options]="downloadTypes"
|
||||
formControlName="downloadFileTypes"
|
||||
></redaction-select>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div class="half-flex-basis w-full px-16">
|
||||
<p class="heading download-includes">
|
||||
{{ 'add-edit-clone-dossier-template.form.upload-settings.heading' | translate }}
|
||||
</p>
|
||||
<div class="iqser-input-group">
|
||||
<mat-checkbox color="primary" formControlName="ocrByDefault">
|
||||
{{ 'add-edit-clone-dossier-template.form.upload-settings.ocr-by-default' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
<div class="iqser-input-group">
|
||||
<mat-checkbox color="primary" formControlName="removeWatermark">
|
||||
{{ 'add-edit-clone-dossier-template.form.upload-settings.remove-watermark' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="!isDocumine">
|
||||
<p class="heading download-includes">{{ 'add-edit-clone-dossier-template.form.hidden-text.heading' | translate }}</p>
|
||||
|
||||
@ -48,3 +48,11 @@ redaction-select {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.half-flex-basis {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
|
||||
.px-16 {
|
||||
padding: 0 16px 0 16px;
|
||||
}
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { AbstractControl, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { applyIntervalConstraints } from '@utils/date-inputs-utils';
|
||||
import { downloadTypesTranslations } from '@translations/download-types-translations';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { BaseDialogComponent, getConfig } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { BaseDialogComponent, getConfig } from '@iqser/common-ui';
|
||||
import { DossierTemplate, IDossierTemplate } from '@red/domain';
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { downloadTypesTranslations } from '@translations/download-types-translations';
|
||||
import { applyIntervalConstraints } from '@utils/date-inputs-utils';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
|
||||
interface EditCloneTemplateData {
|
||||
@ -125,6 +125,8 @@ export class AddEditCloneDossierTemplateDialogComponent extends BaseDialogCompon
|
||||
this.#requiredIfValidator(() => this.hasValidTo),
|
||||
],
|
||||
applyDictionaryUpdatesToAllDossiersByDefault: [this.dossierTemplate?.applyDictionaryUpdatesToAllDossiersByDefault],
|
||||
ocrByDefault: [this.dossierTemplate?.ocrByDefault],
|
||||
removeWatermark: [this.dossierTemplate?.removeWatermark],
|
||||
downloadFileTypes: [this.dossierTemplate?.downloadFileTypes || ['PREVIEW', 'REDACTED']],
|
||||
keepHiddenText: [this.dossierTemplate?.keepHiddenText],
|
||||
keepImageMetadata: [this.dossierTemplate?.keepImageMetadata],
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
import { EntitiesService, Toaster } from '@iqser/common-ui';
|
||||
import { DossierTemplate, IDossierTemplate } from '@red/domain';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { firstValueFrom, forkJoin, Observable, of } from 'rxjs';
|
||||
import { FileAttributesService } from '../entity-services/file-attributes.service';
|
||||
import { catchError, map, mapTo, switchMap, tap } from 'rxjs/operators';
|
||||
import { DossierTemplateStatsService } from '../entity-services/dossier-template-stats.service';
|
||||
import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DictionaryService } from '../entity-services/dictionary.service';
|
||||
import { EntitiesService, Toaster } from '@iqser/common-ui';
|
||||
import { List, mapEach } from '@iqser/common-ui/lib/utils';
|
||||
import { DossierTemplate, IDossierTemplate } from '@red/domain';
|
||||
import { DefaultColorsService } from '@services/entity-services/default-colors.service';
|
||||
import { WatermarkService } from '@services/entity-services/watermark.service';
|
||||
import { List, mapEach } from '@iqser/common-ui/lib/utils';
|
||||
import { firstValueFrom, forkJoin, Observable, of } from 'rxjs';
|
||||
import { catchError, map, mapTo, switchMap, tap } from 'rxjs/operators';
|
||||
import { DictionaryService } from '../entity-services/dictionary.service';
|
||||
import { DossierTemplateStatsService } from '../entity-services/dossier-template-stats.service';
|
||||
import { FileAttributesService } from '../entity-services/file-attributes.service';
|
||||
|
||||
const DOSSIER_TEMPLATE_CONFLICT_MSG = _('dossier-templates-listing.error.conflict');
|
||||
const GENERIC_MSG = _('dossier-templates-listing.error.generic');
|
||||
|
||||
@ -80,6 +80,11 @@
|
||||
"description": "",
|
||||
"title": ""
|
||||
},
|
||||
"upload-settings": {
|
||||
"heading": "",
|
||||
"ocr-by-default": "",
|
||||
"remove-watermark": ""
|
||||
},
|
||||
"valid-from": "Gültig ab",
|
||||
"valid-to": "Gültig bis"
|
||||
},
|
||||
|
||||
@ -80,6 +80,11 @@
|
||||
"description": "Overlapping elements in the document can potentially contain hidden sensitive information. Removing overlapping elements may result in a bigger file size and an increased processing duration.",
|
||||
"title": "Keep overlapping elements"
|
||||
},
|
||||
"upload-settings": {
|
||||
"heading": "Upload settings",
|
||||
"ocr-by-default": "Automatically perform OCR on document upload",
|
||||
"remove-watermark": "Remove watermarks before processing OCR"
|
||||
},
|
||||
"valid-from": "Valid from",
|
||||
"valid-to": "Valid to"
|
||||
},
|
||||
|
||||
@ -80,6 +80,11 @@
|
||||
"description": "",
|
||||
"title": ""
|
||||
},
|
||||
"upload-settings": {
|
||||
"heading": "",
|
||||
"ocr-by-default": "",
|
||||
"remove-watermark": ""
|
||||
},
|
||||
"valid-from": "Gültig ab",
|
||||
"valid-to": "Gültig bis"
|
||||
},
|
||||
|
||||
@ -80,6 +80,11 @@
|
||||
"description": "Overlapping elements in the document can potentially contain hidden sensitive information. Removing overlapping elements may result in a bigger file size and an increased processing duration.",
|
||||
"title": "Keep overlapping elements"
|
||||
},
|
||||
"upload-settings": {
|
||||
"heading": "",
|
||||
"ocr-by-default": "",
|
||||
"remove-watermark": ""
|
||||
},
|
||||
"valid-from": "Valid from",
|
||||
"valid-to": "Valid to"
|
||||
},
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit a52f55b5d4b7a18c8e921a193b34619f85912a1b
|
||||
Subproject commit ed00a87a7a2dd1331d7bb097ee031f8ab63ec1cb
|
||||
@ -1,8 +1,8 @@
|
||||
import { IListable } from '@iqser/common-ui';
|
||||
import { IDossierTemplate } from './dossier-template';
|
||||
import { List } from '@iqser/common-ui/lib/utils';
|
||||
import { DownloadFileType } from '../shared';
|
||||
import { DossierTemplateStatus, DossierTemplateStatuses } from './constants';
|
||||
import { List } from '@iqser/common-ui/lib/utils';
|
||||
import { IDossierTemplate } from './dossier-template';
|
||||
|
||||
export class DossierTemplate implements IDossierTemplate, IListable {
|
||||
readonly createdBy: string;
|
||||
@ -21,6 +21,8 @@ export class DossierTemplate implements IDossierTemplate, IListable {
|
||||
readonly keepImageMetadata: boolean;
|
||||
readonly keepOverlappingObjects: boolean;
|
||||
readonly applyDictionaryUpdatesToAllDossiersByDefault: boolean;
|
||||
readonly ocrByDefault: boolean;
|
||||
readonly removeWatermark: boolean;
|
||||
|
||||
constructor(dossierTemplate: IDossierTemplate) {
|
||||
this.createdBy = dossierTemplate.createdBy;
|
||||
@ -39,6 +41,8 @@ export class DossierTemplate implements IDossierTemplate, IListable {
|
||||
this.keepImageMetadata = dossierTemplate.keepImageMetadata;
|
||||
this.keepOverlappingObjects = dossierTemplate.keepOverlappingObjects;
|
||||
this.applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault;
|
||||
this.ocrByDefault = dossierTemplate.ocrByDefault;
|
||||
this.removeWatermark = dossierTemplate.removeWatermark;
|
||||
}
|
||||
|
||||
get isActive(): boolean {
|
||||
|
||||
@ -61,4 +61,6 @@ export interface IDossierTemplate {
|
||||
*/
|
||||
readonly keepOverlappingObjects: boolean;
|
||||
readonly applyDictionaryUpdatesToAllDossiersByDefault: boolean;
|
||||
readonly ocrByDefault: boolean;
|
||||
readonly removeWatermark: boolean;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user