Merge branch 'dev' into feature-permissions

This commit is contained in:
Michael Shamoon
2023-01-01 17:51:41 -08:00
49 changed files with 2587 additions and 1172 deletions

View File

@@ -12,6 +12,7 @@
<app-input-text i18n-title title="Folder" formControlName="folder" i18n-hint hint="Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server." [error]="error?.folder"></app-input-text>
<app-input-number i18n-title title="Maximum age (days)" formControlName="maximum_age" [showAdd]="false" [error]="error?.maximum_age"></app-input-number>
<app-input-select i18n-title title="Attachment type" [items]="attachmentTypeOptions" formControlName="attachment_type"></app-input-select>
<app-input-select i18n-title title="Consumption scope" [items]="consumptionScopeOptions" formControlName="consumption_scope" i18n-hint hint="See docs for .eml processing requirements"></app-input-select>
</div>
<div class="col">
<p class="small" i18n>Paperless will only process mails that match <em>all</em> of the filters specified below.</p>

View File

@@ -12,6 +12,7 @@ import {
MailMetadataCorrespondentOption,
MailMetadataTitleOption,
PaperlessMailRule,
MailRuleConsumptionScope,
} from 'src/app/data/paperless-mail-rule'
import { CorrespondentService } from 'src/app/services/rest/correspondent.service'
import { DocumentTypeService } from 'src/app/services/rest/document-type.service'
@@ -22,11 +23,26 @@ import { UserService } from 'src/app/services/rest/user.service'
const ATTACHMENT_TYPE_OPTIONS = [
{
id: MailFilterAttachmentType.Attachments,
name: $localize`Only process attachments.`,
name: $localize`Only process attachments`,
},
{
id: MailFilterAttachmentType.Everything,
name: $localize`Process all files, including 'inline' attachments.`,
name: $localize`Process all files, including 'inline' attachments`,
},
]
const CONSUMPTION_SCOPE_OPTIONS = [
{
id: MailRuleConsumptionScope.Attachments,
name: $localize`Only process attachments`,
},
{
id: MailRuleConsumptionScope.Email_Only,
name: $localize`Process message as .eml`,
},
{
id: MailRuleConsumptionScope.Everything,
name: $localize`Process message as .eml and attachments separately`,
},
]
@@ -138,6 +154,7 @@ export class MailRuleEditDialogComponent extends EditDialogComponent<PaperlessMa
filter_attachment_filename: new FormControl(null),
maximum_age: new FormControl(null),
attachment_type: new FormControl(MailFilterAttachmentType.Attachments),
consumption_scope: new FormControl(MailRuleConsumptionScope.Attachments),
action: new FormControl(MailAction.MarkRead),
action_parameter: new FormControl(null),
assign_title_from: new FormControl(MailMetadataTitleOption.FromSubject),
@@ -179,4 +196,8 @@ export class MailRuleEditDialogComponent extends EditDialogComponent<PaperlessMa
get metadataCorrespondentOptions() {
return METADATA_CORRESPONDENT_OPTIONS
}
get consumptionScopeOptions() {
return CONSUMPTION_SCOPE_OPTIONS
}
}