Petits ajustements

This commit is contained in:
FyloZ 2021-03-15 17:09:06 -04:00
parent f78469e853
commit 4cafcf2142
8 changed files with 26 additions and 19 deletions

View File

@ -15,7 +15,7 @@
<button mat-raised-button color="accent" (click)="printingConfirmBox.show()">Imprimer</button>
</div>
<div>
<button mat-raised-button color="accent" (click)="deduct.emit()">Déduire</button>
<button mat-raised-button color="accent" (click)="deduct.emit()" disabled title="WIP">Déduire</button>
</div>
</ng-container>
<ng-container *ngIf="editionMode">
@ -99,7 +99,7 @@
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let mixMaterial; let i = index">
<ng-container
*ngIf="(!hoveredMixMaterial && i === 0) || (hoveredMixMaterial && hoveredMixMaterial === mixMaterial)">
*ngIf="(!hoveredMixMaterial && i === 0) || hoveredMixMaterial === mixMaterial">
<button
mat-raised-button
color="accent"

View File

@ -23,11 +23,13 @@
<button mat-raised-button color="accent" (click)="addStep()">Ajouter</button>
</th>
<td mat-cell *matCellDef="let step; let i = index">
<button mat-raised-button color="warn" (click)="removeStep(i)">Retirer</button>
<ng-container *ngIf="(!hoveredStep && i === 0) || hoveredStep === step">
<button mat-raised-button color="warn" (click)="removeStep(i)">Retirer</button>
</ng-container>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="columns"></tr>
<tr mat-row *matRowDef="let step; columns: columns"></tr>
<tr mat-row *matRowDef="let step; columns: columns" (mouseover)="hoveredStep = step"></tr>
</table>
</mat-expansion-panel>

View File

@ -13,6 +13,8 @@ export class StepTableComponent {
@Input() steps: RecipeStep[]
hoveredStep : RecipeStep | null
addStep() {
this.steps.push({id: null, message: ""})
this.stepTable.renderRows()

View File

@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core'
import {ErrorHandlingComponent, SubscribingComponent} from '../../../shared/components/subscribing.component'
import {ErrorHandlingComponent} from '../../../shared/components/subscribing.component'
import {Recipe} from '../../../shared/model/recipe.model'
import {RecipeService} from '../../services/recipe.service'
import {ActivatedRoute, Router} from '@angular/router'
@ -10,7 +10,7 @@ import {AccountService} from '../../../accounts/services/account.service'
import {EmployeePermission} from '../../../shared/model/employee'
import {EntityEditComponent} from '../../../shared/components/entity-edit/entity-edit.component'
import {ImagesEditorComponent} from '../../components/images-editor/images-editor.component'
import {ErrorHandler, ErrorModel, ErrorService} from '../../../shared/service/error.service'
import {ErrorModel, ErrorService} from '../../../shared/service/error.service'
import {AlertService} from '../../../shared/service/alert.service'
@Component({

View File

@ -5,11 +5,11 @@
<div class="d-flex flex-column">
<div class="mt-1 pb-2">
<button mat-raised-button color="primary" routerLink="/color/list">Retour</button>
<button mat-raised-button color="primary">Version Excel</button>
<button mat-raised-button color="primary" disabled title="WIP">Version Excel</button>
<button mat-raised-button color="accent" (click)="saveModifications()" [disabled]="!hasModifications">
Enregistrer
</button>
<button mat-raised-button color="accent" (click)="deductQuantities()">Déduire</button>
<button mat-raised-button color="accent" (click)="deductQuantities()" disabled title="WIP">Déduire</button>
</div>
<cre-unit-selector (unitChange)="changeUnits($event)"></cre-unit-selector>
</div>

View File

@ -7,7 +7,6 @@ import {Observable, Subject} from 'rxjs'
import {ErrorModel, ErrorService} from '../../../shared/service/error.service'
import {AlertService} from '../../../shared/service/alert.service'
import {GlobalAlertHandlerComponent} from '../../../shared/components/global-alert-handler/global-alert-handler.component'
import {globalLoadingWheel} from '../../../shared/components/loading-wheel/loading-wheel.component'
@Component({
selector: 'cre-explore',

View File

@ -20,18 +20,20 @@
<!-- Buttons -->
<ng-container *ngFor="let button of buttons; let buttonIndex = index" matColumnDef="button{{buttonIndex}}">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell [class.disabled]="!hasPermissionToUseButton(button)" *matCellDef="let entity">
<button
mat-raised-button
color="accent"
[routerLink]="button.link ? button.link.externalLink ? undefined : button.link : button.linkFn(entity).externalLink ? undefined : button.linkFn(entity)"
[disabled]="button.disabledFn && button.disabledFn(entity)"
(click)="openExternalLink(button, entity)">
{{button.text}}
</button>
<td mat-cell [class.disabled]="!hasPermissionToUseButton(button)" *matCellDef="let entity; let i = index">
<ng-container *ngIf="(!hoveredEntity && i === 0) || hoveredEntity === entity">
<button
mat-raised-button
color="accent"
[routerLink]="button.link ? button.link.externalLink ? undefined : button.link : button.linkFn(entity).externalLink ? undefined : button.linkFn(entity)"
[disabled]="button.disabledFn && button.disabledFn(entity)"
(click)="openExternalLink(button, entity)">
{{button.text}}
</button>
</ng-container>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="tableCols"></tr>
<tr mat-row *matRowDef="let row; columns: tableCols"></tr>
<tr mat-row *matRowDef="let row; columns: tableCols" (mouseover)="hoveredEntity = row"></tr>
</table>

View File

@ -16,6 +16,8 @@ export class EntityListComponent<T> {
@Input() addLink: string
@Input() addPermission: EmployeePermission
hoveredEntity: T | null
constructor(
private accountService: AccountService
) {