From 08dfd83b66ca2a6eef2cd9d7e7def8675e7f5870 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Tue, 6 Apr 2021 09:26:59 -0400 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20pr=C3=A9fixe=20du=20type=20de=20pr?= =?UTF-8?q?oduit=20dans=20l'affichage=20des=20produits=20dans=20l'=C3=A9di?= =?UTF-8?q?teur=20de=20m=C3=A9lange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mix-editor/mix-editor.component.html | 3 +-- .../colors/components/mix-editor/mix-editor.component.ts | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/modules/colors/components/mix-editor/mix-editor.component.html b/src/app/modules/colors/components/mix-editor/mix-editor.component.html index 7a356dc..34a267b 100644 --- a/src/app/modules/colors/components/mix-editor/mix-editor.component.html +++ b/src/app/modules/colors/components/mix-editor/mix-editor.component.html @@ -72,13 +72,12 @@ - {{material.name}} + {{materialDisplayName(material)}} diff --git a/src/app/modules/colors/components/mix-editor/mix-editor.component.ts b/src/app/modules/colors/components/mix-editor/mix-editor.component.ts index 41c9fd9..961e3dc 100644 --- a/src/app/modules/colors/components/mix-editor/mix-editor.component.ts +++ b/src/app/modules/colors/components/mix-editor/mix-editor.component.ts @@ -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) }