Oublie de rajouter le composant mixes-card dans le VCS

This commit is contained in:
FyloZ 2021-02-08 18:16:41 -05:00
parent 17e056544d
commit b2461bfe55
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<mat-card>
<mat-card-header>
<mat-card-title>Mélanges</mat-card-title>
</mat-card-header>
<mat-card-content [class.no-action]="!editionMode">
<ng-container *ngFor="let mix of recipe.mixes; let i = index">
<cre-mix-table
[class.no-top-margin]="i == 0"
[recipe]="recipe"
[mix]="mix"
[units$]="units$"
[deductErrorBody]="deductErrorBody"
[editionMode]="editionMode"
(quantityChange)="quantityChange.emit($event)"
(locationChange)="locationChange.emit($event)"
(deduct)="deduct.emit(mix.id)"
[(printingError)]="printingError">>
</cre-mix-table>
</ng-container>
</mat-card-content>
<mat-card-actions *ngIf="editionMode">
<button
mat-raised-button
color="accent"
routerLink="/color/add/mix/{{recipe.id}}">
Ajouter
</button>
</mat-card-actions>
</mat-card>

View File

@ -0,0 +1,3 @@
mat-card
background-color: rgba(255, 255, 255, 0.5)
min-width: 20rem

View File

@ -0,0 +1,21 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {Recipe} from "../../../shared/model/recipe.model";
import {Subject} from "rxjs";
@Component({
selector: 'cre-mixes-card',
templateUrl: './mixes-card.component.html',
styleUrls: ['./mixes-card.component.sass']
})
export class MixesCardComponent {
@Input() recipe: Recipe
@Input() units$: Subject<string>
@Input() deductErrorBody: any
@Input() printingError = 2
@Input() editionMode = false
@Output() locationChange = new EventEmitter<{ id: number, location: string }>()
@Output() quantityChange = new EventEmitter<{ id: number, materialId: number, quantity: number }>()
@Output() deduct = new EventEmitter<number>()
@Output() printingErrorChange = new EventEmitter<number>()
}