-
-
+
+ (click)="open(confirmDeleteModal)">Delete
= new EventEmitter();
- form = new FormGroup({});
- fields: FormlyFieldConfig[] = [];
+ form = new FormGroup({});
+ fields: FormlyFieldConfig[] = [];
- schemas = JSON.parse(`{}`);
+ schemas = JSON.parse(`{}`);
private _formLoading$ = new BehaviorSubject(true);
private _modelLoading$ = new BehaviorSubject(true);
@@ -55,12 +55,16 @@ export class CardComponent implements OnInit {
return this._modelLoading$.asObservable();
}
- constructor(private crudService: CrudService,
- private formlyJsonschema: CrudFormlyJsonschemaService,
- private router: Router,
- private route: ActivatedRoute,
- private modalService: NgbModal,
- ) { }
+ get submitText() {
+ return this.isCreateForm() ? $localize`Create` : $localize`Update`
+ }
+
+ constructor(private crudService: CrudService,
+ private formlyJsonschema: CrudFormlyJsonschemaService,
+ private router: Router,
+ private route: ActivatedRoute,
+ private modalService: NgbModal,
+ ) { }
ngOnInit(): void {
this._formLoading$.next(true);
@@ -136,9 +140,9 @@ export class CardComponent implements OnInit {
this.modalService.dismissAll();
}
- isCreateForm() {
- return this.resource_id === null;
- }
+ isCreateForm() {
+ return this.resource_id === null;
+ }
open(content: any) {
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then(
diff --git a/front/app/src/common/crud/list/list.component.html b/front/app/src/common/crud/list/list.component.html
index 24530fef..25bf5009 100644
--- a/front/app/src/common/crud/list/list.component.html
+++ b/front/app/src/common/crud/list/list.component.html
@@ -1,10 +1,9 @@