From cde7ffe2a27f8eca0a4724b4f1b37d671772f496 Mon Sep 17 00:00:00 2001
From: Marlene Simondant <msimondant@grandlyon.com>
Date: Tue, 1 Mar 2022 12:11:40 +0100
Subject: [PATCH 01/12] add : load more posts with button instead of scroll

---
 src/app/app.component.html                    |  2 +-
 src/app/app.component.ts                      |  5 -----
 .../post-list/post-list.component.ts          | 20 ++++---------------
 src/app/post/services/post.service.ts         | 12 ++++++++---
 .../shared/service/windowScroll.service.ts    | 16 ---------------
 5 files changed, 14 insertions(+), 41 deletions(-)
 delete mode 100644 src/app/shared/service/windowScroll.service.ts

diff --git a/src/app/app.component.html b/src/app/app.component.html
index aa331e09e..5ed476324 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,6 +1,6 @@
 <div class="app-container">
   <app-header></app-header>
-  <div (scroll)="onScrollDown($event)" class="app-body">
+  <div class="app-body">
     <router-outlet></router-outlet>
     <router-outlet name="print"></router-outlet>
     <app-footer></app-footer>
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 86273beab..18b020c87 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -5,7 +5,6 @@ import { AuthService } from './services/auth.service';
 import { RouterListenerService } from './services/routerListener.service';
 import { UpdateService } from './services/update.service';
 import { PrintService } from './shared/service/print.service';
-import { WindowScrollService } from './shared/service/windowScroll.service';
 
 @Component({
   selector: 'app-root',
@@ -19,7 +18,6 @@ export class AppComponent implements OnInit {
     public printService: PrintService,
     private authService: AuthService,
     private profilService: ProfileService,
-    private windowScrollService: WindowScrollService,
     private routerListener: RouterListenerService,
     private updateService: UpdateService,
     private router: Router
@@ -52,7 +50,4 @@ export class AppComponent implements OnInit {
     const vh = window.innerHeight * 0.01;
     document.documentElement.style.setProperty('--vh', `${vh}px`);
   }
-  public onScrollDown(event): void {
-    this.windowScrollService.scrollY.next(event);
-  }
 }
diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts
index 38cad37da..41a530499 100644
--- a/src/app/post/components/post-list/post-list.component.ts
+++ b/src/app/post/components/post-list/post-list.component.ts
@@ -1,5 +1,4 @@
 import { Component, OnInit } from '@angular/core';
-import { WindowScrollService } from '../../../shared/service/windowScroll.service';
 import { TagEnum } from '../../enum/tag.enum';
 import { Pagination } from '../../models/pagination.model';
 import { Post } from '../../models/post.model';
@@ -24,21 +23,9 @@ export class PostListComponent implements OnInit {
   public pagination: Pagination;
   public isLoading = false;
   public isPublishMode = false;
+  public lastPage: boolean;
 
-  constructor(
-    private postService: PostService,
-    private windowScrollService: WindowScrollService,
-    private route: ActivatedRoute,
-    private router: Router
-  ) {
-    this.windowScrollService.scrollY$.subscribe((evt: any) => {
-      if (evt && evt.target.offsetHeight + evt.target.scrollTop >= evt.target.scrollHeight - 200) {
-        if (!this.isLoading) {
-          this.loadMore();
-        }
-      }
-    });
-  }
+  constructor(private postService: PostService, private route: ActivatedRoute, private router: Router) {}
 
   ngOnInit(): void {
     this.isLoading = true;
@@ -74,6 +61,7 @@ export class PostListComponent implements OnInit {
    */
   public fillArticles(news: PostWithMeta): void {
     this.setNews(news);
+    news.meta.pagination.pages > news.meta.pagination.page ? (this.lastPage = false) : (this.lastPage = true);
     const headLineTag = this.allPosts.filter((post: Post) =>
       post.tags.some((tag) => tag && tag.slug === TagEnum.aLaUne)
     );
@@ -132,7 +120,7 @@ export class PostListComponent implements OnInit {
   }
 
   // Load more news on scroll event.
-  private loadMore(): void {
+  public loadMore(): void {
     if (this.pagination && this.pagination.page < this.pagination.pages) {
       this.isLoading = true;
       this.postService.getPosts(this.pagination.next).subscribe((news) => {
diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts
index 89020397d..ffc0dec46 100644
--- a/src/app/post/services/post.service.ts
+++ b/src/app/post/services/post.service.ts
@@ -22,10 +22,14 @@ export class PostService {
     );
   }
 
-  public getPosts(page: number, tags?: string[]): Observable<PostWithMeta> {
+  public getPosts(page: number, tags?: string[], limit?: string): Observable<PostWithMeta> {
+    if (!limit) {
+      // 16 posts to fit new design (1 + 3 + 2 + 1 + 3 + 2 + 1 + 3)
+      limit = '16';
+    }
     if (!tags) {
       return this.http
-        .get<PostWithMeta>(`${this.baseUrl}?page=${page}&include=tags,authors`)
+        .get<PostWithMeta>(`${this.baseUrl}?page=${page}&include=tags,authors&limit=${limit}`)
         .pipe(map((item: PostWithMeta) => new PostWithMeta(item)));
     }
     let tagsString = '';
@@ -37,7 +41,9 @@ export class PostService {
       }
     });
     return this.http
-      .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tags:${encodeURIComponent(tagsString)}`)
+      .get<PostWithMeta>(
+        `${this.baseUrl}?include=tags,authors&filter=tags:${encodeURIComponent(tagsString)}&limit=${limit}`
+      )
       .pipe(map((item: PostWithMeta) => new PostWithMeta(item)));
   }
 
diff --git a/src/app/shared/service/windowScroll.service.ts b/src/app/shared/service/windowScroll.service.ts
deleted file mode 100644
index ebdf325b8..000000000
--- a/src/app/shared/service/windowScroll.service.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Injectable } from '@angular/core';
-import { BehaviorSubject } from 'rxjs';
-
-@Injectable({
-  providedIn: 'root',
-})
-export class WindowScrollService {
-  scrollY = new BehaviorSubject(null);
-  scrollY$ = this.scrollY.asObservable();
-
-  constructor() {}
-
-  public updateScrollY(value: Event): void {
-    this.scrollY.next(value);
-  }
-}
-- 
GitLab


From 0211de8fe54ad9c1b494b824ba59183041b9f91f Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Tue, 1 Mar 2022 12:16:35 +0100
Subject: [PATCH 02/12] feat(posts): add button to show more

---
 src/app/post/components/post-list/post-list.component.html | 5 +++++
 src/app/post/components/post-list/post-list.component.scss | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/src/app/post/components/post-list/post-list.component.html b/src/app/post/components/post-list/post-list.component.html
index 01056ea4f..31e1c5dba 100644
--- a/src/app/post/components/post-list/post-list.component.html
+++ b/src/app/post/components/post-list/post-list.component.html
@@ -27,6 +27,11 @@
           <app-post-card [post]="news" class="col" *ngFor="let news of allPosts"></app-post-card>
         </div>
       </div>
+      <div *ngIf="!lastPage" fxLayout="row" fxLayoutAlign="center center">
+        <button class="btn-primary small" (click)="loadMore()">
+          <div class="rowBtn" fxLayout="row" fxLayoutAlign="center center">Voir plus</div>
+        </button>
+      </div>
     </div>
   </div>
 </div>
diff --git a/src/app/post/components/post-list/post-list.component.scss b/src/app/post/components/post-list/post-list.component.scss
index 6e13a5817..dad8b06fa 100644
--- a/src/app/post/components/post-list/post-list.component.scss
+++ b/src/app/post/components/post-list/post-list.component.scss
@@ -239,3 +239,6 @@ h2 {
     margin-bottom: 0;
   }
 }
+.btn-primary {
+  margin-bottom: 20px;
+}
-- 
GitLab


From 35aacb8a5ff7ebe1da0a0f652db56a4016bb90d6 Mon Sep 17 00:00:00 2001
From: Marlene Simondant <msimondant@grandlyon.com>
Date: Tue, 1 Mar 2022 14:14:16 +0100
Subject: [PATCH 03/12] cleanup

---
 src/app/post/components/post-list/post-list.component.ts | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts
index 41a530499..3859d7711 100644
--- a/src/app/post/components/post-list/post-list.component.ts
+++ b/src/app/post/components/post-list/post-list.component.ts
@@ -132,10 +132,8 @@ export class PostListComponent implements OnInit {
   // Split news on two columns on desktop mode or one column in mobile mode.
   private setNews(news: PostWithMeta): void {
     this.pagination = news.meta.pagination;
-    const customIndex = this.allPosts.length; // For scroll loading, start with previous index.
-    const newPosts = news.posts.map((val, index) => {
+    const newPosts = news.posts.map((val) => {
       val = this.addAuthorToPost(val);
-      index += customIndex;
       return val;
     });
     this.allPosts = [...this.allPosts, ...newPosts];
-- 
GitLab


From c2398a48e271cc55e4367e4fd2481c7cd3f16021 Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Tue, 1 Mar 2022 14:44:24 +0100
Subject: [PATCH 04/12] change number of posts

---
 src/app/post/services/post.service.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts
index ffc0dec46..d660626d2 100644
--- a/src/app/post/services/post.service.ts
+++ b/src/app/post/services/post.service.ts
@@ -24,8 +24,8 @@ export class PostService {
 
   public getPosts(page: number, tags?: string[], limit?: string): Observable<PostWithMeta> {
     if (!limit) {
-      // 16 posts to fit new design (1 + 3 + 2 + 1 + 3 + 2 + 1 + 3)
-      limit = '16';
+      // 12 posts to fit new design (1 + 3 + 2 + 1 + 3 + 2)
+      limit = '12';
     }
     if (!tags) {
       return this.http
-- 
GitLab


From cd3034cc8f33c223d3f79bdfe6334596d6655e7d Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Tue, 1 Mar 2022 14:44:57 +0100
Subject: [PATCH 05/12] manage loading with button

---
 .../post/components/post-list/post-list.component.html | 10 +++++-----
 .../post/components/post-list/post-list.component.scss |  4 +---
 .../post/components/post-list/post-list.component.ts   |  4 ++--
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/app/post/components/post-list/post-list.component.html b/src/app/post/components/post-list/post-list.component.html
index 31e1c5dba..cc5dd6778 100644
--- a/src/app/post/components/post-list/post-list.component.html
+++ b/src/app/post/components/post-list/post-list.component.html
@@ -1,8 +1,5 @@
 <div class="section-container no-padding" fxLayout="row" fxLayoutGap="32px">
-  <div *ngIf="isLoading" class="loader">
-    <img class="loader-gif" src="/assets/gif/loader_circle.gif" alt />
-  </div>
-  <div *ngIf="!isLoading" fxLayout="column" class="list-container" fxLayoutGap="16px">
+  <div fxLayout="column" class="list-container" fxLayoutGap="16px">
     <!-- <div fxLayout="column" *ngIf="displayTags()">
       <div fxLayout="row wrap" fxLayoutAlign="none center" fxLayoutGap="8px">
         <div
@@ -27,7 +24,10 @@
           <app-post-card [post]="news" class="col" *ngFor="let news of allPosts"></app-post-card>
         </div>
       </div>
-      <div *ngIf="!lastPage" fxLayout="row" fxLayoutAlign="center center">
+      <div *ngIf="isLoading" class="loader">
+        <img class="loader-gif" src="/assets/gif/loader_circle.gif" alt />
+      </div>
+      <div *ngIf="!isLastPage && !isLoading" fxLayout="row" fxLayoutAlign="center center">
         <button class="btn-primary small" (click)="loadMore()">
           <div class="rowBtn" fxLayout="row" fxLayoutAlign="center center">Voir plus</div>
         </button>
diff --git a/src/app/post/components/post-list/post-list.component.scss b/src/app/post/components/post-list/post-list.component.scss
index dad8b06fa..011bb3a8a 100644
--- a/src/app/post/components/post-list/post-list.component.scss
+++ b/src/app/post/components/post-list/post-list.component.scss
@@ -27,9 +27,7 @@ h2 {
   }
 }
 .list-container {
-  @media #{$tablet} {
-    width: 100%;
-  }
+  width: 100%;
 
   h2 {
     @media #{$large-phone} {
diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts
index 3859d7711..421502dac 100644
--- a/src/app/post/components/post-list/post-list.component.ts
+++ b/src/app/post/components/post-list/post-list.component.ts
@@ -23,7 +23,7 @@ export class PostListComponent implements OnInit {
   public pagination: Pagination;
   public isLoading = false;
   public isPublishMode = false;
-  public lastPage: boolean;
+  public isLastPage: boolean;
 
   constructor(private postService: PostService, private route: ActivatedRoute, private router: Router) {}
 
@@ -61,7 +61,7 @@ export class PostListComponent implements OnInit {
    */
   public fillArticles(news: PostWithMeta): void {
     this.setNews(news);
-    news.meta.pagination.pages > news.meta.pagination.page ? (this.lastPage = false) : (this.lastPage = true);
+    news.meta.pagination.pages > news.meta.pagination.page ? (this.isLastPage = false) : (this.isLastPage = true);
     const headLineTag = this.allPosts.filter((post: Post) =>
       post.tags.some((tag) => tag && tag.slug === TagEnum.aLaUne)
     );
-- 
GitLab


From 548ca4c76592d9137bdff909bfebdd9dc9ac9592 Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Tue, 1 Mar 2022 16:05:08 +0100
Subject: [PATCH 06/12] fix no headline

---
 src/app/post/components/post-list/post-list.component.ts | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts
index 421502dac..b0ced879b 100644
--- a/src/app/post/components/post-list/post-list.component.ts
+++ b/src/app/post/components/post-list/post-list.component.ts
@@ -66,8 +66,10 @@ export class PostListComponent implements OnInit {
       post.tags.some((tag) => tag && tag.slug === TagEnum.aLaUne)
     );
 
-    const headIndex = this.allPosts.findIndex((post) => post.id === headLineTag[0].id);
-    this.allPosts.splice(headIndex, 1);
+    if (headLineTag.length) {
+      const headIndex = this.allPosts.findIndex((post) => post.id === headLineTag[0].id);
+      this.allPosts.splice(headIndex, 1);
+    }
 
     this.allPosts = [...headLineTag, ..._.difference(this.allPosts, headLineTag)];
   }
-- 
GitLab


From 44f089f9819b8d6dedafa39cd470adf38409a67b Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Tue, 1 Mar 2022 16:27:17 +0100
Subject: [PATCH 07/12] fix: no display if empty post

---
 src/app/post/components/post-list/post-list.component.ts | 2 +-
 src/app/post/services/post.service.ts                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts
index b0ced879b..1c6b5ce49 100644
--- a/src/app/post/components/post-list/post-list.component.ts
+++ b/src/app/post/components/post-list/post-list.component.ts
@@ -117,7 +117,7 @@ export class PostListComponent implements OnInit {
   // Transform excerpt post to have a custom author.
   private addAuthorToPost(post: Post): Post {
     post.author = post.excerpt;
-    post.excerpt = post.html.replace(/<[^>]*>/g, '');
+    if (post.html) post.excerpt = post.html.replace(/<[^>]*>/g, '');
     return post;
   }
 
diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts
index d660626d2..36fbe2f46 100644
--- a/src/app/post/services/post.service.ts
+++ b/src/app/post/services/post.service.ts
@@ -53,7 +53,7 @@ export class PostService {
 
   private addAuthorToPost(post: Post): Post {
     post.author = post.excerpt;
-    post.excerpt = post.html.replace(/<[^>]*>/g, '');
+    if (post.html) post.excerpt = post.html.replace(/<[^>]*>/g, '');
     return post;
   }
 }
-- 
GitLab


From 3a4b521cf5106f8175897d2c09a8963d56d279dc Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Mon, 28 Mar 2022 15:55:37 +0200
Subject: [PATCH 08/12] feat(posts): restore window scroll service

---
 src/app/app.component.html                     |  2 +-
 src/app/app.component.ts                       |  5 +++++
 src/app/shared/service/windowScroll.service.ts | 16 ++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 src/app/shared/service/windowScroll.service.ts

diff --git a/src/app/app.component.html b/src/app/app.component.html
index 5ed476324..aa331e09e 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,6 +1,6 @@
 <div class="app-container">
   <app-header></app-header>
-  <div class="app-body">
+  <div (scroll)="onScrollDown($event)" class="app-body">
     <router-outlet></router-outlet>
     <router-outlet name="print"></router-outlet>
     <app-footer></app-footer>
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 18b020c87..86273beab 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -5,6 +5,7 @@ import { AuthService } from './services/auth.service';
 import { RouterListenerService } from './services/routerListener.service';
 import { UpdateService } from './services/update.service';
 import { PrintService } from './shared/service/print.service';
+import { WindowScrollService } from './shared/service/windowScroll.service';
 
 @Component({
   selector: 'app-root',
@@ -18,6 +19,7 @@ export class AppComponent implements OnInit {
     public printService: PrintService,
     private authService: AuthService,
     private profilService: ProfileService,
+    private windowScrollService: WindowScrollService,
     private routerListener: RouterListenerService,
     private updateService: UpdateService,
     private router: Router
@@ -50,4 +52,7 @@ export class AppComponent implements OnInit {
     const vh = window.innerHeight * 0.01;
     document.documentElement.style.setProperty('--vh', `${vh}px`);
   }
+  public onScrollDown(event): void {
+    this.windowScrollService.scrollY.next(event);
+  }
 }
diff --git a/src/app/shared/service/windowScroll.service.ts b/src/app/shared/service/windowScroll.service.ts
new file mode 100644
index 000000000..ebdf325b8
--- /dev/null
+++ b/src/app/shared/service/windowScroll.service.ts
@@ -0,0 +1,16 @@
+import { Injectable } from '@angular/core';
+import { BehaviorSubject } from 'rxjs';
+
+@Injectable({
+  providedIn: 'root',
+})
+export class WindowScrollService {
+  scrollY = new BehaviorSubject(null);
+  scrollY$ = this.scrollY.asObservable();
+
+  constructor() {}
+
+  public updateScrollY(value: Event): void {
+    this.scrollY.next(value);
+  }
+}
-- 
GitLab


From 2721c9e9f86610e43455a1e6ba9d12415c91f29e Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Mon, 28 Mar 2022 16:45:39 +0200
Subject: [PATCH 09/12] fix(posts): load more posts with tag (cf. MR !225 )

---
 .../post-list/post-list.component.ts          | 22 +++++++------
 src/app/post/services/post.service.ts         | 31 +++++++++----------
 2 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts
index 1c6b5ce49..92293f28b 100644
--- a/src/app/post/components/post-list/post-list.component.ts
+++ b/src/app/post/components/post-list/post-list.component.ts
@@ -43,11 +43,14 @@ export class PostListComponent implements OnInit {
           ...this.selectedLocationTagSlug,
           ...this.selectedPublicTagsSlug,
         ];
+        // Reset posts
+        this.resetPosts();
         // Apply search
-        this.getPosts(this.filters);
+        this.getPosts(1, this.filters);
       } else {
         // Init default news list
         this.allPosts = [];
+        this.filters = [];
         this.postService.getPosts(1).subscribe((news) => {
           this.fillArticles(news);
         });
@@ -74,7 +77,7 @@ export class PostListComponent implements OnInit {
     this.allPosts = [...headLineTag, ..._.difference(this.allPosts, headLineTag)];
   }
 
-  public getPosts(filters?: Tag[]): void {
+  public getPosts(page: number, filters?: Tag[]): void {
     // Parse filter
     let parsedFilters = null;
     if (filters) {
@@ -87,11 +90,8 @@ export class PostListComponent implements OnInit {
       }
     }
 
-    // Reset posts
-    this.resetPosts();
-
     this.isLoading = true;
-    this.postService.getPosts(1, parsedFilters).subscribe((news) => {
+    this.postService.getPosts(page, parsedFilters).subscribe((news) => {
       this.fillArticles(news);
     });
   }
@@ -125,9 +125,13 @@ export class PostListComponent implements OnInit {
   public loadMore(): void {
     if (this.pagination && this.pagination.page < this.pagination.pages) {
       this.isLoading = true;
-      this.postService.getPosts(this.pagination.next).subscribe((news) => {
-        this.fillArticles(news);
-      });
+      if (this.filters) {
+        this.getPosts(this.pagination.next, this.filters);
+      } else {
+        this.postService.getPosts(this.pagination.next).subscribe((news) => {
+          this.fillArticles(news);
+        });
+      }
     }
   }
 
diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts
index 36fbe2f46..efc0132fd 100644
--- a/src/app/post/services/post.service.ts
+++ b/src/app/post/services/post.service.ts
@@ -27,24 +27,21 @@ export class PostService {
       // 12 posts to fit new design (1 + 3 + 2 + 1 + 3 + 2)
       limit = '12';
     }
-    if (!tags) {
-      return this.http
-        .get<PostWithMeta>(`${this.baseUrl}?page=${page}&include=tags,authors&limit=${limit}`)
-        .pipe(map((item: PostWithMeta) => new PostWithMeta(item)));
+
+    let tagsFilter = '';
+    if (tags) {
+      let tagsString = '';
+      // Transform tab filters to string filters
+      tags.forEach((tag, index) => {
+        tagsString += tag;
+        if (index != tags.length - 1) {
+          tagsString += '+tags:';
+        }
+      });
+      tagsFilter = `&filter=tags:${encodeURIComponent(tagsString)}`;
     }
-    let tagsString = '';
-    // Transform tab filters to string filters
-    tags.forEach((tag, index) => {
-      tagsString += tag;
-      if (index != tags.length - 1) {
-        tagsString += '+tags:';
-      }
-    });
-    return this.http
-      .get<PostWithMeta>(
-        `${this.baseUrl}?include=tags,authors&filter=tags:${encodeURIComponent(tagsString)}&limit=${limit}`
-      )
-      .pipe(map((item: PostWithMeta) => new PostWithMeta(item)));
+
+    return this.http.get<PostWithMeta>(`${this.baseUrl}?page=${page}&include=tags,authors${tagsFilter}&limit=${limit}`);
   }
 
   public getTags(): Observable<TagWithMeta> {
-- 
GitLab


From 6a7d319061ee4c4ea6e6d4b32a32b86039844e14 Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Mon, 28 Mar 2022 16:52:52 +0200
Subject: [PATCH 10/12] fix(posts): remove scroll service from app component

---
 src/app/app.component.html | 2 +-
 src/app/app.component.ts   | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/app/app.component.html b/src/app/app.component.html
index aa331e09e..5ed476324 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,6 +1,6 @@
 <div class="app-container">
   <app-header></app-header>
-  <div (scroll)="onScrollDown($event)" class="app-body">
+  <div class="app-body">
     <router-outlet></router-outlet>
     <router-outlet name="print"></router-outlet>
     <app-footer></app-footer>
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 86273beab..18b020c87 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -5,7 +5,6 @@ import { AuthService } from './services/auth.service';
 import { RouterListenerService } from './services/routerListener.service';
 import { UpdateService } from './services/update.service';
 import { PrintService } from './shared/service/print.service';
-import { WindowScrollService } from './shared/service/windowScroll.service';
 
 @Component({
   selector: 'app-root',
@@ -19,7 +18,6 @@ export class AppComponent implements OnInit {
     public printService: PrintService,
     private authService: AuthService,
     private profilService: ProfileService,
-    private windowScrollService: WindowScrollService,
     private routerListener: RouterListenerService,
     private updateService: UpdateService,
     private router: Router
@@ -52,7 +50,4 @@ export class AppComponent implements OnInit {
     const vh = window.innerHeight * 0.01;
     document.documentElement.style.setProperty('--vh', `${vh}px`);
   }
-  public onScrollDown(event): void {
-    this.windowScrollService.scrollY.next(event);
-  }
 }
-- 
GitLab


From 2a9a707fc98046d2313b64890485ecaef22439ee Mon Sep 17 00:00:00 2001
From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com>
Date: Tue, 29 Mar 2022 09:23:05 +0200
Subject: [PATCH 11/12] fix: default limit

---
 src/app/post/services/post.service.ts | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts
index efc0132fd..23447f183 100644
--- a/src/app/post/services/post.service.ts
+++ b/src/app/post/services/post.service.ts
@@ -22,12 +22,10 @@ export class PostService {
     );
   }
 
-  public getPosts(page: number, tags?: string[], limit?: string): Observable<PostWithMeta> {
-    if (!limit) {
-      // 12 posts to fit new design (1 + 3 + 2 + 1 + 3 + 2)
-      limit = '12';
-    }
-
+  /**
+   * 12 posts to fit new design (1 + 3 + 2 + 1 + 3 + 2)
+   */
+  public getPosts(page: number, tags?: string[], limit: string = '12'): Observable<PostWithMeta> {
     let tagsFilter = '';
     if (tags) {
       let tagsString = '';
-- 
GitLab


From 3b050b79b9c631fbd73ff175051c510b1e868589 Mon Sep 17 00:00:00 2001
From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com>
Date: Tue, 29 Mar 2022 09:30:44 +0200
Subject: [PATCH 12/12] chore(release): 1.16.1

---
 CHANGELOG.md      | 17 +++++++++++++++++
 package-lock.json |  2 +-
 package.json      |  2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 26164cc72..40fad222e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,23 @@
 
 All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
 
+### [1.16.1](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v1.16.0...v1.16.1) (2022-03-29)
+
+
+### Features
+
+* **cicd:** temp remove of mr jobs ([5c9a74a](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/5c9a74ad2916b986a7626ffb8726db3260d8990a))
+* **posts:** add button to show more ([0211de8](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/0211de8fe54ad9c1b494b824ba59183041b9f91f))
+* **posts:** restore window scroll service ([3a4b521](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/3a4b521cf5106f8175897d2c09a8963d56d279dc))
+
+
+### Bug Fixes
+
+* default limit ([2a9a707](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/2a9a707fc98046d2313b64890485ecaef22439ee))
+* no display if empty post ([44f089f](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/44f089f9819b8d6dedafa39cd470adf38409a67b))
+* **posts:** load more posts with tag (cf. MR !225 ) ([2721c9e](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/2721c9e9f86610e43455a1e6ba9d12415c91f29e))
+* **posts:** remove scroll service from app component ([6a7d319](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/6a7d319061ee4c4ea6e6d4b32a32b86039844e14))
+
 ## [1.16.0](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v1.15.0...v1.16.0) (2022-03-18)
 
 
diff --git a/package-lock.json b/package-lock.json
index ab163b0bd..ba7b9b573 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "pamn",
-  "version": "1.16.0",
+  "version": "1.16.1",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/package.json b/package.json
index 73da33c24..ff023eec4 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "pamn",
-  "version": "1.16.0",
+  "version": "1.16.1",
   "scripts": {
     "ng": "ng",
     "start": "ng serve --configuration=fr --proxy-config proxy.conf.json",
-- 
GitLab