Merge branch 'dev' into Julian

This commit is contained in:
Julian 2022-01-11 20:23:48 +01:00 committed by GitHub
commit 5b700ae7bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 39 deletions

View File

@ -6049,4 +6049,5 @@
"product_web_only": "oui"
}
]
}
}

View File

@ -1,13 +1,13 @@
<div class="custom-side-bar flex-shrink-0 bg-white border-end">
<div class="p-3">
<span class="fs-5 fw-semibold">Filtres</span>
</div>
<ul class="list-unstyled ps-0 border-top">
<div class="p-3">
<p class="mb-1 fs-5 fw-semibold">Catégories</p>
<div *ngFor="let category of listCategories; let indexCat = index" class="form-check">
<div class="p-3">
<span class="fs-5 fw-semibold">Filtres</span>
</div>
<ul class="list-unstyled ps-0 border-top">
<div class="p-3">
<p class="mb-1 fs-5 fw-semibold">Catégories</p>
<div *ngFor="let category of listCategories; let indexCat = index" class="form-check">
<input class="form-check-input" type="checkbox" value="testcategory" id="checkBoxCategory{{indexCat}}">
<input class="form-check-input" type="checkbox" value="testcategory" id="checkBoxCategory{{indexCat}}">
<label class="form-check-label" for="checkBoxCategory{{indexCat}}">
{{ category }}

View File

@ -31,5 +31,4 @@ export class FilterSideBarComponent implements OnInit {
console.log(typeof(rangeArray[0]));
this.rangeNumber.emit(rangeArray);
}
}

View File

@ -1,26 +1,25 @@
<div class="d-flex align-items-stretch">
<app-filter-side-bar [listCategories]="listCategoriesFilter" (stateNumber)="onRatingFilter($event)" (rangeNumber)="onPriceFilter($event)"></app-filter-side-bar>
<div class="custom-main container p-3">
<input class="form-control"
type="text"
placeholder="Recherche ta belle plante"
aria-label="Input Recherche ta belle plante">
<div class="custom-main container p-3">
<input class="form-control"
type="text"
placeholder="Recherche ta belle plante"
aria-label="Input Recherche ta belle plante">
<div class="py-3">
Trier par :
<button class="btn btn-outline-success btn-sm me-2" (click)="onPriceTri()">Prix</button>
<button class="btn btn-outline-success btn-sm me-2"(click)="onAlphaTri()">Ordre Alpha</button>
<button class="btn btn-outline-success btn-sm me-2" (click)="onRatingTri()">Avis</button>
</div>
<div class="py-3">
Trier par :
<button class="btn btn-outline-success btn-sm me-2">Prix</button>
<button class="btn btn-outline-success btn-sm me-2">Ordre Alpha</button>
<button class="btn btn-outline-success btn-sm me-2">Avis</button>
</div>
<div class="row">
<div class="col" *ngFor="let product of listData">
<app-card-plante [plant]="product"
(clickLike)="onEventLike()">
</app-card-plante>
</div>
</div>
</div>
<div class="row">
<div class="col" *ngFor="let product of listData">
<app-card-plante [plant]="product"
(clickLike)="onEventLike()">
</app-card-plante>
</div>
</div>
</div>
</div>

View File

@ -2,6 +2,9 @@ import { Component, OnInit } from '@angular/core';
import { PlantouneService } from 'src/app/services/plantoune.service';
import * as _ from 'underscore';
@Component({
selector: 'app-page-accueil',
templateUrl: './page-accueil.component.html',
@ -33,10 +36,10 @@ export class PageAccueilComponent implements OnInit {
}
/**
* equivalent de la ligne du dessus
*
* equivalent de la ligne du dessus
*
* plantouneService;
*
*
* constructor(plantouneService: PlantouneService) {
* this.plantouneService = plantouneService;
* }
@ -57,11 +60,12 @@ export class PageAccueilComponent implements OnInit {
* Technique avec Underscore JS pour recupérer les catégories uniques de nos plantes
*/
const listAllCategories = listPlant.map(product => product.product_breadcrumb_label);
console.log(listAllCategories);
const listUniqCategories = _.uniq(listAllCategories)
console.log(listUniqCategories);
// console.log(listAllCategories);
const listUniqCategories = _.uniq(listAllCategories)
// console.log(listUniqCategories);
/**
* Technique native JS pour recupérer les catégories uniques de nos plantes
@ -73,6 +77,7 @@ export class PageAccueilComponent implements OnInit {
this.listCategoriesFilter = listUniqJsCategories;
this.listData = listPlant;
this.listData.length = 9;
console.log(this.listData);
}
)
@ -133,5 +138,4 @@ export class PageAccueilComponent implements OnInit {
if(this.listData.length >= 9) this.listData.length = 9;
}
}