Merge branch 'features' into 'master'

Ajout de quelques fonctionnalités

See merge request color-recipes-explorer/frontend!16
This commit is contained in:
William Nolin 2021-04-12 13:01:51 +00:00
commit 75f6e3f0b9
4 changed files with 24 additions and 5 deletions

View File

@ -72,8 +72,19 @@
<!-- Icons -->
<ng-container matColumnDef="iconNotApproved">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let recipe" [class.disabled]="recipe.approbationDate">
<mat-icon svgIcon="alert" class="color-warning" title="Cette recette n'est pas approuvée"></mat-icon>
<td mat-cell *matCellDef="let recipe">
<mat-icon
*ngIf="!recipe.approbationDate"
svgIcon="alert"
class="color-warning"
title="Cette recette n'est pas approuvée">
</mat-icon>
<mat-icon
*ngIf="isRecipeApprobationExpired(recipe)"
svgIcon="clock-alert"
class="color-warning"
title="L'approbation de cette recette est expirée (il y a plus de 4 ans)">
</mat-icon>
</td>
</ng-container>

View File

@ -3,7 +3,7 @@ import {ErrorHandlingComponent} from '../../../shared/components/subscribing.com
import {RecipeService} from '../../services/recipe.service'
import {EmployeePermission} from '../../../shared/model/employee'
import {AccountService} from '../../../accounts/services/account.service'
import {getRecipeLuma, Recipe} from '../../../shared/model/recipe.model'
import {getRecipeLuma, isRecipeApprobationExpired, Recipe} from '../../../shared/model/recipe.model'
import {ActivatedRoute, Router} from '@angular/router'
import {ErrorModel, ErrorService} from '../../../shared/service/error.service'
@ -52,6 +52,10 @@ export class ListComponent extends ErrorHandlingComponent {
.forEach(r => this.recipeMatchesSearchQuery(r))
}
isRecipeApprobationExpired(recipe: Recipe): boolean {
return isRecipeApprobationExpired(recipe)
}
isCompanyHidden(companyRecipes: Recipe[]): boolean {
return (this.searchQuery && this.searchQuery.length > 0) && companyRecipes.map(r => this.hiddenRecipes[r.id]).filter(r => !r).length <= 0
}

View File

@ -17,5 +17,9 @@
</nav>
<cre-employee-info></cre-employee-info>
<img src="assets/logo.png" alt="Logo" class="flex-grow-0"/>
<img
class="flex-grow-0"
src="assets/logo.png"
alt="Color Recipes Explorer"
title="Color Recipes Explorer"/>
</header>

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>ColorRecipesExplorerFrontend</title>
<title>Color Recipes Explorer</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/favicon.png">