Enhancement: add layout options for email conversion (#8907)

---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Silvia Bigler
2025-02-07 19:32:35 +01:00
committed by GitHub
parent 7f36163c3b
commit 71472a6a82
16 changed files with 421 additions and 89 deletions

View File

@@ -41,6 +41,7 @@
<div class="col-md-6">
<pngx-input-select [horizontal]="true" i18n-title title="Consumption scope" [items]="consumptionScopeOptions" formControlName="consumption_scope" i18n-hint hint="See docs for .eml processing requirements"></pngx-input-select>
<pngx-input-select [horizontal]="true" i18n-title title="Attachment type" [items]="attachmentTypeOptions" formControlName="attachment_type"></pngx-input-select>
<pngx-input-select [horizontal]="true" i18n-title title="PDF layout" [items]="pdfLayoutOptions" formControlName="pdf_layout"></pngx-input-select>
</div>
<div class="col-md-6">
<pngx-input-text [horizontal]="true" i18n-title title="Include only files matching" formControlName="filter_attachment_filename_include" i18n-hint hint="Optional. Wildcards e.g. *.pdf or *invoice* allowed. Can be comma-separated list. Case insensitive." [error]="error?.filter_attachment_filename_include"></pngx-input-text>

View File

@@ -18,6 +18,7 @@ import {
MailMetadataTitleOption,
MailRule,
MailRuleConsumptionScope,
MailRulePdfLayout,
} from 'src/app/data/mail-rule'
import { CorrespondentService } from 'src/app/services/rest/correspondent.service'
import { DocumentTypeService } from 'src/app/services/rest/document-type.service'
@@ -58,6 +59,29 @@ const CONSUMPTION_SCOPE_OPTIONS = [
},
]
const PDF_LAYOUT_OPTIONS = [
{
id: MailRulePdfLayout.Default,
name: $localize`System default`,
},
{
id: MailRulePdfLayout.TextHtml,
name: $localize`Text, then HTML`,
},
{
id: MailRulePdfLayout.HtmlText,
name: $localize`HTML, then text`,
},
{
id: MailRulePdfLayout.HtmlOnly,
name: $localize`HTML only`,
},
{
id: MailRulePdfLayout.TextOnly,
name: $localize`Text only`,
},
]
const ACTION_OPTIONS = [
{
id: MailAction.Delete,
@@ -184,6 +208,7 @@ export class MailRuleEditDialogComponent extends EditDialogComponent<MailRule> {
filter_attachment_filename_exclude: new FormControl(null),
maximum_age: new FormControl(null),
attachment_type: new FormControl(MailFilterAttachmentType.Attachments),
pdf_layout: new FormControl(MailRulePdfLayout.Default),
consumption_scope: new FormControl(MailRuleConsumptionScope.Attachments),
order: new FormControl(null),
action: new FormControl(MailAction.MarkRead),
@@ -232,4 +257,8 @@ export class MailRuleEditDialogComponent extends EditDialogComponent<MailRule> {
get consumptionScopeOptions() {
return CONSUMPTION_SCOPE_OPTIONS
}
get pdfLayoutOptions() {
return PDF_LAYOUT_OPTIONS
}
}