Merge pull request #14120 from ArtemDzhereleiko/AD/bug-fix/resources-general
General resources show resources type on add dialog
This commit is contained in:
commit
395f262573
@ -30,7 +30,7 @@
|
||||
</button>
|
||||
<button mat-raised-button color="primary"
|
||||
[disabled]="(isLoading$ | async)"
|
||||
(click)="onEntityAction($event, 'delete')"
|
||||
(click)="onEntityAction($event, 'deleteResource')"
|
||||
[class.!hidden]="hideDelete() || isEdit">
|
||||
{{ 'resource.delete' | translate }}
|
||||
</button>
|
||||
@ -48,7 +48,6 @@
|
||||
<div class="mat-padding flex flex-col">
|
||||
<form [formGroup]="entityForm">
|
||||
<fieldset [disabled]="(isLoading$ | async) || !isEdit">
|
||||
@if (resourceTypes.length > 1) {
|
||||
<mat-form-field class="mat-block">
|
||||
<mat-label translate>resource.resource-type</mat-label>
|
||||
<mat-select formControlName="resourceType" required>
|
||||
@ -57,7 +56,6 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
}
|
||||
<mat-form-field class="mat-block" *ngIf="entityForm.get('resourceType').value !== resourceType.LWM2M_MODEL || !isAdd">
|
||||
<mat-label translate>resource.title</mat-label>
|
||||
<input matInput formControlName="title" required>
|
||||
|
||||
@ -112,6 +112,10 @@ export class ResourcesLibraryComponent extends EntityComponent<Resource> impleme
|
||||
if (this.isEdit && this.entityForm && !this.isAdd) {
|
||||
this.entityForm.get('resourceType').disable({ emitEvent: false });
|
||||
this.entityForm.get('fileName').disable({ emitEvent: false });
|
||||
this.entityForm.get('data').disable({ emitEvent: false });
|
||||
}
|
||||
if (this.isAdd && this.resourceTypes.length === 1) {
|
||||
this.entityForm.get('resourceType').disable({ emitEvent: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ export class ResourcesLibraryTableConfigResolver {
|
||||
case 'downloadResource':
|
||||
this.downloadResource(action.event, action.entity);
|
||||
return true;
|
||||
case 'deleteLibrary':
|
||||
case 'deleteResource':
|
||||
this.deleteResource(action.event, action.entity);
|
||||
}
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user