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'
12 selector: 'pngx-document-type-edit-dialog',
13 templateUrl: './document-type-edit-dialog.component.html',
14 styleUrls: ['./document-type-edit-dialog.component.scss'],
16 export class DocumentTypeEditDialogComponent extends EditDialogComponent<DocumentType> {
18 service: DocumentTypeService,
19 activeModal: NgbActiveModal,
20 userService: UserService,
21 settingsService: SettingsService
23 super(service, activeModal, userService, settingsService)
27 return $localize`Create new document type`
31 return $localize`Edit document type`
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),