]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Hide order parameter, fix imap port
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Sat, 19 Nov 2022 01:11:15 +0000 (17:11 -0800)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Sat, 3 Dec 2022 17:31:23 +0000 (09:31 -0800)
src-ui/src/app/components/common/edit-dialog/mail-account-edit-dialog/mail-account-edit-dialog.component.html
src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html
src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts
src-ui/src/app/components/manage/settings/settings.component.html
src-ui/src/app/components/manage/settings/settings.component.ts
src-ui/src/app/data/paperless-mail-rule.ts
src/documents/serialisers.py

index 807df18c532c2acade33a728f343cc86780cf148..8164fca9a1b8c4daccfd44683d0dd0f1b16957b9 100644 (file)
@@ -9,7 +9,7 @@
       <div class="col">
         <app-input-text i18n-title title="Name" formControlName="name" [error]="error?.name"></app-input-text>
         <app-input-text i18n-title title="IMAP Server" formControlName="imap_server" [error]="error?.imap_server"></app-input-text>
-        <app-input-text i18n-title title="IMAP Port" formControlName="imap_server" [error]="error?.imap_port"></app-input-text>
+        <app-input-text i18n-title title="IMAP Port" formControlName="imap_port" [error]="error?.imap_port"></app-input-text>
         <app-input-select i18n-title title="IMAP Security" [items]="imapSecurityOptions" formControlName="imap_security"></app-input-select>
       </div>
       <div class="col">
index 3eb793ae29c23b7837eadbab768677173c97b0e2..dc4260ffd42f6f9b2f204aef0ed722522bab4efc 100644 (file)
@@ -8,7 +8,6 @@
     <div class="row">
       <div class="col">
         <app-input-text i18n-title title="Name" formControlName="name" [error]="error?.name"></app-input-text>
-        <app-input-text i18n-title title="Order" formControlName="order" [error]="error?.order"></app-input-text>
         <app-input-select i18n-title title="Account" [items]="accounts" formControlName="account"></app-input-select>
         <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>
index 22b5df542bb9f5661370c930f08301d181d2bf6b..7644ed353988847a01ba4dab77b37794fac7646e 100644 (file)
@@ -64,7 +64,6 @@ export class MailRuleEditDialogComponent extends EditDialogComponent<PaperlessMa
   getForm(): FormGroup {
     return new FormGroup({
       name: new FormControl(null),
-      order: new FormControl(null),
       account: new FormControl(null),
       folder: new FormControl('INBOX'),
       filter_from: new FormControl(null),
index 61aaf15d86f6f5efad267ac24a6564327d6587c1..138899713b548453d68999d0ef5577cdcd30b407 100644 (file)
         <ng-container *ngIf="mailAccounts && mailRules">
           <h4>
             <ng-container i18n>Mail accounts</ng-container>
-            <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailAccount()" i18n>Add Account</button>
+            <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailAccount()">
+              <svg class="sidebaricon me-1" fill="currentColor">
+                <use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
+              </svg>
+              <ng-container i18n>Add Account</ng-container>
+            </button>
           </h4>
           <ul class="list-group" formGroupName="mailAccounts">
 
 
           <h4 class="mt-4">
             <ng-container i18n>Mail rules</ng-container>
-            <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailRule()" i18n>Add Rule</button>
+            <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailRule()">
+              <svg class="sidebaricon me-1" fill="currentColor">
+                <use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
+              </svg>
+              <ng-container i18n>Add Rule</ng-container>
+            </button>
           </h4>
           <ul class="list-group" formGroupName="mailRules">
 
index fbb41b9720df8885fd33923aa8ad04ba9345974b..3a146fb367b89714399c351b83cdf5ac954bf993 100644 (file)
@@ -266,7 +266,6 @@ export class SettingsComponent
       for (let rule of this.mailRules) {
         storeData.mailRules[rule.id.toString()] = {
           name: rule.name,
-          order: rule.order,
           account: rule.account,
           folder: rule.folder,
           filter_from: rule.filter_from,
@@ -287,7 +286,6 @@ export class SettingsComponent
           rule.id.toString(),
           new FormGroup({
             name: new FormControl(null),
-            order: new FormControl(null),
             account: new FormControl(null),
             folder: new FormControl(null),
             filter_from: new FormControl(null),
@@ -519,6 +517,7 @@ export class SettingsComponent
           this.toastService.showInfo(
             $localize`Saved account "${newMailAccount.name}".`
           )
+          this.mailAccountService.clearCache()
           this.mailAccountService.listAll().subscribe((r) => {
             this.mailAccounts = r.results
             this.initialize()
@@ -576,6 +575,7 @@ export class SettingsComponent
           this.toastService.showInfo(
             $localize`Saved rule "${newMailRule.name}".`
           )
+          this.mailRuleService.clearCache()
           this.mailRuleService.listAll().subscribe((r) => {
             this.mailRules = r.results
 
index ff6654a0b3603f5fb5d4e9555114a32d895302f2..9ff133dab2ef5548fe8fcff6b59ca62867561836 100644 (file)
@@ -28,8 +28,6 @@ export enum MailMetadataCorrespondentOption {
 export interface PaperlessMailRule extends ObjectWithId {
   name: string
 
-  order: number
-
   account: number // PaperlessMailAccount.id
 
   folder: string
index 6b78d1f89fcc0e59a614a44f0c2cc70716520018..44572e8fb8b02bb9900d396cc5cc3236b37bf84d 100644 (file)
@@ -748,6 +748,7 @@ class MailRuleSerializer(serializers.ModelSerializer):
     assign_correspondent = CorrespondentField(allow_null=True, required=False)
     assign_tags = TagsField(many=True, allow_null=True, required=False)
     assign_document_type = DocumentTypeField(allow_null=True, required=False)
+    order = serializers.IntegerField(required=False)
 
     class Meta:
         model = MailRule