Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Merge 9cac6d5 into 5612ad0
Browse files Browse the repository at this point in the history
  • Loading branch information
MacWale authored Mar 1, 2022
2 parents 5612ad0 + 9cac6d5 commit f4227a8
Show file tree
Hide file tree
Showing 31 changed files with 252 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<app-input-select [items]="documentTypes" i18n-title title="Document type" formControlName="document_type" [allowNull]="true"
(createNew)="createDocumentType($event)" [suggestions]="suggestions?.document_types"></app-input-select>
<app-input-tags formControlName="tags" [suggestions]="suggestions?.tags"></app-input-tags>

<app-input-date i18n-title title="Expiry date" formControlName="expired" [error]="error?.expired"></app-input-date>
</ng-template>
</li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { TextComponent } from '../common/input/text/text.component';
import { SettingsService, SETTINGS_KEYS } from 'src/app/services/settings.service';
import { PaperlessDocumentSuggestions } from 'src/app/data/paperless-document-suggestions';
import { FILTER_FULLTEXT_MORELIKE } from 'src/app/data/filter-rule-type';
import { expiryDateValidator } from 'src/app/directives/expiryDate.directive';

@Component({
selector: 'app-document-detail',
Expand Down Expand Up @@ -56,11 +57,12 @@ export class DocumentDetailComponent implements OnInit {
title: new FormControl(''),
content: new FormControl(''),
created: new FormControl(),
expired: new FormControl(),
correspondent: new FormControl(),
document_type: new FormControl(),
archive_serial_number: new FormControl(),
tags: new FormControl([])
})
}, { validators: expiryDateValidator })

previewCurrentPage: number = 1
previewNumPages: number = 1
Expand Down
2 changes: 2 additions & 0 deletions src-ui/src/app/data/paperless-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export interface PaperlessDocument extends ObjectWithId {

created?: Date

expired?: Date

modified?: Date

added?: Date
Expand Down
9 changes: 9 additions & 0 deletions src-ui/src/app/directives/expiryDate.directive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AbstractControl, ValidationErrors, ValidatorFn } from "@angular/forms";

export const expiryDateValidator: ValidatorFn = (control: AbstractControl): ValidationErrors | null => {
const created = control.get('created');
const expired = control.get('expired');
let expiredDate = new Date(expired.value);
let createdDate = new Date(created.value);
return createdDate >= expiredDate ? { expiredDateInvalid: true } : null;
};
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.cs_CZ.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="needs-translation">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Datum vypršení platnosti</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.de_DE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Ausgestellt am</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="translated">Verfallsdatum</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.en_GB.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="translated">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.es_ES.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Fecha de creación</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Fecha de caducidad</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.fr_FR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Date de création</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Date d'expiration</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.he_IL.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="needs-translation">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.hu_HU.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Létrehozás dátuma</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.it_IT.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Data creazione</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Data di scadenza</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.la_LA.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="needs-translation">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.lb_LU.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Erstellungsdatum</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.nb_NO.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Dato opprettet</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.nl_NL.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Aanmaakdatum</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.no_NO.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="needs-translation">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.pl_PL.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Data utworzenia</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.pt_BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Data de criação</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.pt_PT.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Data de criação</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.ro_RO.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Data creării</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.ru_RU.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Дата создания</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.sv_SE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="translated">Datum skapad</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.th_TH.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="needs-translation">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.xh_ZA.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target>crwdns2926:0crwdne2926:0</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.zh_CN.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="needs-translation">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
8 changes: 8 additions & 0 deletions src-ui/src/locale/messages.zh_TW.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@
</context-group>
<target state="needs-translation">Date created</target>
</trans-unit>
<trans-unit id="5cfc9ab90d19d79c71a60644be816f1b4e974a1b" datatype="html">
<source>Expiry date</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/document-detail/document-detail.component.html</context>
<context context-type="linenumber">67</context>
</context-group>
<target state="needs-translation">Expiry date</target>
</trans-unit>
<trans-unit id="6e58f1baf7acb6a0cfe3636b9c2a61b4d1183720" datatype="html">
<source>Date modified</source>
<context-group purpose="location">
Expand Down
Loading

0 comments on commit f4227a8

Please sign in to comment.