First round of internationlization
This commit is contained in:
@@ -9,15 +9,15 @@ import { CrudFormlyJsonschemaService } from "../crud-formly-jsonschema.service";
|
||||
import {NgbModal} from "@ng-bootstrap/ng-bootstrap";
|
||||
|
||||
@Component({
|
||||
selector: 'crud-card',
|
||||
templateUrl: './card.component.html',
|
||||
styleUrls: ['./card.component.css']
|
||||
selector: 'crud-card',
|
||||
templateUrl: './card.component.html',
|
||||
styleUrls: ['./card.component.css']
|
||||
})
|
||||
export class CardComponent implements OnInit {
|
||||
@Input() resource: string | undefined;
|
||||
@Input() resource_id: string | null = null;
|
||||
@Input() schema: string | undefined;
|
||||
@Input() is_modal: Boolean = false;
|
||||
@Input() resource: string | undefined;
|
||||
@Input() resource_id: string | null = null;
|
||||
@Input() schema: string | undefined;
|
||||
@Input() is_modal: Boolean = false;
|
||||
|
||||
private _model: {} = {};
|
||||
|
||||
@@ -39,10 +39,10 @@ export class CardComponent implements OnInit {
|
||||
@Output() error: EventEmitter<string> = new EventEmitter();
|
||||
|
||||
|
||||
form = new FormGroup({});
|
||||
fields: FormlyFieldConfig[] = [];
|
||||
form = new FormGroup({});
|
||||
fields: FormlyFieldConfig[] = [];
|
||||
|
||||
schemas = JSON.parse(`{}`);
|
||||
schemas = JSON.parse(`{}`);
|
||||
|
||||
private _formLoading$ = new BehaviorSubject<boolean>(true);
|
||||
private _modelLoading$ = new BehaviorSubject<boolean>(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(
|
||||
|
||||
Reference in New Issue
Block a user