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 { Correspondent } from 'src/app/data/correspondent'
6 import { DEFAULT_MATCHING_ALGORITHM } from 'src/app/data/matching-model'
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'
12 selector: 'pngx-correspondent-edit-dialog',
13 templateUrl: './correspondent-edit-dialog.component.html',
14 styleUrls: ['./correspondent-edit-dialog.component.scss'],
16 export class CorrespondentEditDialogComponent extends EditDialogComponent<Correspondent> {
18 service: CorrespondentService,
19 activeModal: NgbActiveModal,
20 userService: UserService,
21 settingsService: SettingsService
23 super(service, activeModal, userService, settingsService)
27 return $localize`Create new correspondent`
31 return $localize`Edit correspondent`
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),