Ajout du préfixe du type de produit dans l'affichage des produits dans l'éditeur de mélange
This commit is contained in:
parent
84c4cb9179
commit
08dfd83b66
|
@ -72,13 +72,12 @@
|
|||
<td mat-cell *matCellDef="let mixMaterial">
|
||||
<mat-form-field *ngIf="materials">
|
||||
<mat-select
|
||||
#select
|
||||
[value]="mixMaterial.materialId"
|
||||
(valueChange)="setMixMaterialMaterial(mixMaterial, $event)">
|
||||
<mat-option
|
||||
*ngFor="let material of getAvailableMaterials(mixMaterial)"
|
||||
[value]="material.id">
|
||||
{{material.name}}
|
||||
{{materialDisplayName(material)}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
|
|
@ -21,7 +21,6 @@ import {ConfirmBoxComponent} from '../../../shared/components/confirm-box/confir
|
|||
import {AccountService} from '../../../accounts/services/account.service'
|
||||
import {EmployeePermission} from '../../../shared/model/employee'
|
||||
import {ErrorService} from '../../../shared/service/error.service'
|
||||
import {MatSelect} from '@angular/material/select'
|
||||
|
||||
@Component({
|
||||
selector: 'cre-mix-editor',
|
||||
|
@ -156,6 +155,13 @@ export class MixEditorComponent extends ErrorHandlingComponent {
|
|||
return this.materials.filter(m => mixMaterial.materialId === m.id || this.mixMaterials.filter(mm => mm.materialId === m.id).length === 0)
|
||||
}
|
||||
|
||||
materialDisplayName(material: Material): string {
|
||||
if (material.materialType.prefix) {
|
||||
return `[${material.materialType.prefix}] ${material.name}`
|
||||
}
|
||||
return material.name
|
||||
}
|
||||
|
||||
get canDeleteMix() {
|
||||
return this.accountService.hasPermission(EmployeePermission.REMOVE_RECIPES)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue