]> git.ipfire.org Git - thirdparty/paperless-ngx.git/blob
fcac0424a97f18e99cbc9da8dcdb661a363d8c69
[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 { Correspondent } from 'src/app/data/correspondent'
7 import { CorrespondentService } from 'src/app/services/rest/correspondent.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-correspondent-edit-dialog',
13 templateUrl: './correspondent-edit-dialog.component.html',
14 styleUrls: ['./correspondent-edit-dialog.component.scss'],
15 })
16 export class CorrespondentEditDialogComponent extends EditDialogComponent<Correspondent> {
17 constructor(
18 service: CorrespondentService,
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 correspondent`
28 }
29
30 getEditTitle() {
31 return $localize`Edit correspondent`
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 }