L'échantillon d'une recette n'est plus obligatoire.

This commit is contained in:
FyloZ 2021-03-09 20:27:16 -05:00
parent 267bf28065
commit 6019b9e718
3 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@ import {Validators} from '@angular/forms'
import {CompanyService} from '../../../company/service/company.service'
import {map} from 'rxjs/operators'
import {ActivatedRoute, Router} from '@angular/router'
import {ErrorModel, ErrorService} from '../../../shared/service/error.service'
import {ErrorService} from '../../../shared/service/error.service'
@Component({
selector: 'cre-add',
@ -40,7 +40,7 @@ export class AddComponent extends ErrorHandlingComponent {
label: 'Échantillon',
icon: 'pound',
type: 'number',
validator: Validators.compose([Validators.required, Validators.min(0)]),
validator: Validators.min(0),
errorMessages: [
{conditionFn: errors => errors.required, message: 'Un numéro d\'échantillon est requis'},
{conditionFn: errors => errors.min, message: 'Le numéro d\'échantillon doit être supérieur ou égal à 0'}

View File

@ -50,7 +50,7 @@ export class EditComponent extends ErrorHandlingComponent {
label: 'Échantillon',
icon: 'pound',
type: 'number',
validator: Validators.compose([Validators.required, Validators.min(0)]),
validator: Validators.min(0),
errorMessages: [
{conditionFn: errors => errors.required, message: 'Un numéro d\'échantillon est requis'},
{conditionFn: errors => errors.min, message: 'Le numéro d\'échantillon doit être supérieur ou égal à 0'}

View File

@ -39,7 +39,9 @@
<ng-container matColumnDef="sample">
<th mat-header-cell *matHeaderCellDef>Échantillon</th>
<td mat-cell *matCellDef="let recipe">#{{recipe.sample}}</td>
<td mat-cell *matCellDef="let recipe">
<ng-container *ngIf="recipe.sample">#{{recipe.sample}}</ng-container>
</td>
</ng-container>
<!-- Icons -->