mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Merge branch 'dev' into feature-permissions
This commit is contained in:
@@ -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>
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
if (name) modal.componentInstance.object = { name: name }
|
||||
else if (this._lastSearchTerm)
|
||||
modal.componentInstance.object = { name: this._lastSearchTerm }
|
||||
modal.componentInstance.success.subscribe((newTag) => {
|
||||
modal.componentInstance.succeeded.subscribe((newTag) => {
|
||||
this.tagService.listAll().subscribe((tags) => {
|
||||
this.tags = tags.results
|
||||
this.value = [...this.value, newTag.id]
|
||||
|
@@ -320,7 +320,7 @@ export class DocumentDetailComponent
|
||||
})
|
||||
modal.componentInstance.dialogMode = 'create'
|
||||
if (newName) modal.componentInstance.object = { name: newName }
|
||||
modal.componentInstance.success
|
||||
modal.componentInstance.succeeded
|
||||
.pipe(
|
||||
switchMap((newDocumentType) => {
|
||||
return this.documentTypeService
|
||||
@@ -341,7 +341,7 @@ export class DocumentDetailComponent
|
||||
})
|
||||
modal.componentInstance.dialogMode = 'create'
|
||||
if (newName) modal.componentInstance.object = { name: newName }
|
||||
modal.componentInstance.success
|
||||
modal.componentInstance.succeeded
|
||||
.pipe(
|
||||
switchMap((newCorrespondent) => {
|
||||
return this.correspondentService
|
||||
@@ -364,7 +364,7 @@ export class DocumentDetailComponent
|
||||
})
|
||||
modal.componentInstance.dialogMode = 'create'
|
||||
if (newName) modal.componentInstance.object = { name: newName }
|
||||
modal.componentInstance.success
|
||||
modal.componentInstance.succeeded
|
||||
.pipe(
|
||||
switchMap((newStoragePath) => {
|
||||
return this.storagePathService
|
||||
|
@@ -32,7 +32,7 @@
|
||||
[editing]="true"
|
||||
[multiple]="true"
|
||||
[applyOnClose]="applyOnClose"
|
||||
(open)="openTagsDropdown()"
|
||||
(opened)="openTagsDropdown()"
|
||||
[(selectionModel)]="tagSelectionModel"
|
||||
(apply)="setTags($event)">
|
||||
</app-filterable-dropdown>
|
||||
@@ -42,7 +42,7 @@
|
||||
[disabled]="!userCanEditAll"
|
||||
[editing]="true"
|
||||
[applyOnClose]="applyOnClose"
|
||||
(open)="openCorrespondentDropdown()"
|
||||
(opened)="openCorrespondentDropdown()"
|
||||
[(selectionModel)]="correspondentSelectionModel"
|
||||
(apply)="setCorrespondents($event)">
|
||||
</app-filterable-dropdown>
|
||||
@@ -52,7 +52,7 @@
|
||||
[disabled]="!userCanEditAll"
|
||||
[editing]="true"
|
||||
[applyOnClose]="applyOnClose"
|
||||
(open)="openDocumentTypeDropdown()"
|
||||
(opened)="openDocumentTypeDropdown()"
|
||||
[(selectionModel)]="documentTypeSelectionModel"
|
||||
(apply)="setDocumentTypes($event)">
|
||||
</app-filterable-dropdown>
|
||||
@@ -62,7 +62,7 @@
|
||||
[disabled]="!userCanEditAll"
|
||||
[editing]="true"
|
||||
[applyOnClose]="applyOnClose"
|
||||
(open)="openStoragePathDropdown()"
|
||||
(opened)="openStoragePathDropdown()"
|
||||
[(selectionModel)]="storagePathsSelectionModel"
|
||||
(apply)="setStoragePaths($event)">
|
||||
</app-filterable-dropdown>
|
||||
|
@@ -30,27 +30,27 @@
|
||||
[(selectionModel)]="tagSelectionModel"
|
||||
(selectionModelChange)="updateRules()"
|
||||
[multiple]="true"
|
||||
(open)="onTagsDropdownOpen()"
|
||||
(opened)="onTagsDropdownOpen()"
|
||||
[allowSelectNone]="true"></app-filterable-dropdown>
|
||||
<app-filterable-dropdown class="flex-fill" title="Correspondent" icon="person-fill" i18n-title
|
||||
filterPlaceholder="Filter correspondents" i18n-filterPlaceholder
|
||||
[items]="correspondents"
|
||||
[(selectionModel)]="correspondentSelectionModel"
|
||||
(selectionModelChange)="updateRules()"
|
||||
(open)="onCorrespondentDropdownOpen()"
|
||||
(opened)="onCorrespondentDropdownOpen()"
|
||||
[allowSelectNone]="true"></app-filterable-dropdown>
|
||||
<app-filterable-dropdown class="flex-fill" title="Document type" icon="file-earmark-fill" i18n-title
|
||||
filterPlaceholder="Filter document types" i18n-filterPlaceholder
|
||||
[items]="documentTypes"
|
||||
[(selectionModel)]="documentTypeSelectionModel"
|
||||
(open)="onDocumentTypeDropdownOpen()"
|
||||
(opened)="onDocumentTypeDropdownOpen()"
|
||||
(selectionModelChange)="updateRules()"
|
||||
[allowSelectNone]="true"></app-filterable-dropdown>
|
||||
<app-filterable-dropdown class="me-2 flex-fill" title="Storage path" icon="folder-fill" i18n-title
|
||||
filterPlaceholder="Filter storage paths" i18n-filterPlaceholder
|
||||
[items]="storagePaths"
|
||||
[(selectionModel)]="storagePathSelectionModel"
|
||||
(open)="onStoragePathDropdownOpen()"
|
||||
(opened)="onStoragePathDropdownOpen()"
|
||||
(selectionModelChange)="updateRules()"
|
||||
[allowSelectNone]="true"></app-filterable-dropdown>
|
||||
</div>
|
||||
|
@@ -131,7 +131,7 @@ export abstract class ManagementListComponent<T extends ObjectWithId>
|
||||
backdrop: 'static',
|
||||
})
|
||||
activeModal.componentInstance.dialogMode = 'create'
|
||||
activeModal.componentInstance.success.subscribe({
|
||||
activeModal.componentInstance.succeeded.subscribe({
|
||||
next: () => {
|
||||
this.reloadData()
|
||||
this.toastService.showInfo(
|
||||
@@ -154,7 +154,7 @@ export abstract class ManagementListComponent<T extends ObjectWithId>
|
||||
})
|
||||
activeModal.componentInstance.object = object
|
||||
activeModal.componentInstance.dialogMode = 'edit'
|
||||
activeModal.componentInstance.success.subscribe({
|
||||
activeModal.componentInstance.succeeded.subscribe({
|
||||
next: () => {
|
||||
this.reloadData()
|
||||
this.toastService.showInfo(
|
||||
|
@@ -734,7 +734,7 @@ export class SettingsComponent
|
||||
})
|
||||
modal.componentInstance.dialogMode = account ? 'edit' : 'create'
|
||||
modal.componentInstance.object = account
|
||||
modal.componentInstance.success
|
||||
modal.componentInstance.succeeded
|
||||
.pipe(takeUntil(this.unsubscribeNotifier))
|
||||
.subscribe({
|
||||
next: (newMailAccount) => {
|
||||
@@ -792,7 +792,7 @@ export class SettingsComponent
|
||||
})
|
||||
modal.componentInstance.dialogMode = rule ? 'edit' : 'create'
|
||||
modal.componentInstance.object = rule
|
||||
modal.componentInstance.success
|
||||
modal.componentInstance.succeeded
|
||||
.pipe(takeUntil(this.unsubscribeNotifier))
|
||||
.subscribe({
|
||||
next: (newMailRule) => {
|
||||
|
Reference in New Issue
Block a user