UI: Fixed the inability to edit resource type in resource library when created resource

This commit is contained in:
Vladyslav_Prykhodko 2024-10-03 15:21:10 +03:00
parent 7aa77faf78
commit 8c0fbbc69b

View File

@ -92,7 +92,7 @@ export class ResourcesLibraryComponent extends EntityComponent<Resource> impleme
override updateFormState(): void { override updateFormState(): void {
super.updateFormState(); super.updateFormState();
if (this.isEdit && this.entityForm) { if (this.isEdit && this.entityForm && !this.isAdd) {
this.entityForm.get('resourceType').disable({ emitEvent: false }); this.entityForm.get('resourceType').disable({ emitEvent: false });
if (this.entityForm.get('resourceType').value !== ResourceType.JS_MODULE) { if (this.entityForm.get('resourceType').value !== ResourceType.JS_MODULE) {
this.entityForm.get('fileName').disable({ emitEvent: false }); this.entityForm.get('fileName').disable({ emitEvent: false });