mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Enhancement: add layout options for email conversion (#8907)
--------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
@@ -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>
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,14 @@ export enum MailRuleConsumptionScope {
|
||||
Everything = 3,
|
||||
}
|
||||
|
||||
export enum MailRulePdfLayout {
|
||||
Default = 0,
|
||||
TextHtml = 1,
|
||||
HtmlText = 2,
|
||||
HtmlOnly = 3,
|
||||
TextOnly = 4,
|
||||
}
|
||||
|
||||
export enum MailAction {
|
||||
Delete = 1,
|
||||
Move = 2,
|
||||
@@ -59,6 +67,8 @@ export interface MailRule extends ObjectWithPermissions {
|
||||
|
||||
attachment_type: MailFilterAttachmentType
|
||||
|
||||
pdf_layout: MailRulePdfLayout
|
||||
|
||||
action: MailAction
|
||||
|
||||
action_parameter?: string
|
||||
|
Reference in New Issue
Block a user