From ce2eb6fceffd2ad6b89e91d1f2596ea9171eee96 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Tue, 9 Mar 2021 15:57:45 -0500 Subject: [PATCH] =?UTF-8?q?Les=20produits=20sont=20maintenant=20filtr?= =?UTF-8?q?=C3=A9s=20dans=20l'=C3=A9diteur=20de=20m=C3=A9lange=20pour=20em?= =?UTF-8?q?p=C3=AAcher=20les=20duplications.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colors/components/mix-editor/mix-editor.component.html | 4 ++-- .../colors/components/mix-editor/mix-editor.component.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 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 0378e9d..7187bb3 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 @@ -46,8 +46,8 @@ Produit - - + {{material.name}} 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 e3e212d..6420169 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 @@ -16,6 +16,7 @@ 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', @@ -131,6 +132,10 @@ export class MixEditorComponent extends SubscribingComponent { return id ? this.materials.filter(m => m.id === id)[0] : null } + getAvailableMaterials(selector: MatSelect): Material[] { + return this.materials.filter(m => selector.value === m.id || this.mixMaterials.filter(mm => mm.materialId === m.id).length === 0) + } + get canDeleteMix() { return this.accountService.hasPermission(EmployeePermission.REMOVE_RECIPE) }