]> git.ipfire.org Git - thirdparty/paperless-ngx.git/blob
bce1eb75997e72121b851a177f37fb5b3940d0d5
[thirdparty/paperless-ngx.git] /
1 import { Component } from '@angular/core'
2 import { FormControl, FormGroup } from '@angular/forms'
3 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
4 import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component'
5 import { DEFAULT_MATCHING_ALGORITHM } from 'src/app/data/matching-model'
6 import { DocumentType } from 'src/app/data/document-type'
7 import { DocumentTypeService } from 'src/app/services/rest/document-type.service'
8 import { UserService } from 'src/app/services/rest/user.service'
9 import { SettingsService } from 'src/app/services/settings.service'
10
11 @Component({
12 selector: 'pngx-document-type-edit-dialog',
13 templateUrl: './document-type-edit-dialog.component.html',
14 styleUrls: ['./document-type-edit-dialog.component.scss'],
15 })
16 export class DocumentTypeEditDialogComponent extends EditDialogComponent<DocumentType> {
17 constructor(
18 service: DocumentTypeService,
19 activeModal: NgbActiveModal,
20 userService: UserService,
21 settingsService: SettingsService
22 ) {
23 super(service, activeModal, userService, settingsService)
24 }
25
26 getCreateTitle() {
27 return $localize`Create new document type`
28 }
29
30 getEditTitle() {
31 return $localize`Edit document type`
32 }
33
34 getForm(): FormGroup {
35 return new FormGroup({
36 name: new FormControl(''),
37 matching_algorithm: new FormControl(DEFAULT_MATCHING_ALGORITHM),
38 match: new FormControl(''),
39 is_insensitive: new FormControl(true),
40 permissions_form: new FormControl(null),
41 })
42 }
43 }