From ce2eb6fceffd2ad6b89e91d1f2596ea9171eee96 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Tue, 9 Mar 2021 15:57:45 -0500 Subject: [PATCH 1/3] =?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) } From 62ebafb0492e201ffe799ba1da992bf77bbea45a Mon Sep 17 00:00:00 2001 From: FyloZ Date: Tue, 9 Mar 2021 16:01:33 -0500 Subject: [PATCH 2/3] =?UTF-8?q?Correction=20d'un=20erreur=20qui=20disait?= =?UTF-8?q?=20que=20mixType=20n'=C3=A9tait=20pas=20d=C3=A9fini=20dans=20l'?= =?UTF-8?q?=C3=A9diteur=20de=20m=C3=A9lange.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colors/components/mix-editor/mix-editor.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7187bb3..3c5f35e 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 @@ -99,7 +99,7 @@ From 982c00874c8b6d95f2b666554d7d96d167b24c6c Mon Sep 17 00:00:00 2001 From: FyloZ Date: Tue, 9 Mar 2021 16:05:54 -0500 Subject: [PATCH 3/3] =?UTF-8?q?L'identifiant=20des=20employ=C3=A9es=20n'es?= =?UTF-8?q?t=20plus=20modifiable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/modules/employees/pages/edit/edit.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/employees/pages/edit/edit.component.ts b/src/app/modules/employees/pages/edit/edit.component.ts index ad45c80..27d8478 100644 --- a/src/app/modules/employees/pages/edit/edit.component.ts +++ b/src/app/modules/employees/pages/edit/edit.component.ts @@ -97,7 +97,7 @@ export class EditComponent extends ErrorHandlingComponent { } get idControl(): FormControl { - this._idControl = this.lazyControl(this._idControl, () => new FormControl(this.employee.id, Validators.compose([Validators.required, Validators.pattern(new RegExp('^[0-9]+$')), Validators.min(0)]))) + this._idControl = this.lazyControl(this._idControl, () => new FormControl({value: this.employee.id, disabled: true}, Validators.compose([Validators.required, Validators.pattern(new RegExp('^[0-9]+$')), Validators.min(0)]))) return this._idControl }