diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 83fc5a0b6c3e5f44dcc865c2b7c8aea63e6cb21c..4fce8137e2c5d0f363eda55e1963035a8f52a375 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,16 @@ stages: - build - deploy +build_branch: + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 + services: + - docker:18.09-dind + stage: build + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --build-arg conf=prod . + - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" + build: image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 services: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f6e3c6be131d30d1f76d11768430618ff579fff..9ec95edb12782182a02ab8bdafa4eee53463f75f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ 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.13.0](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v1.12.0...v1.13.0) (2022-02-07) + + +### ⚠ BREAKING CHANGES + +* app is now working with PWA handling + +### Features + +* add pwa handling ([d951ced](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/d951ced8a2641fa42b441da47fe1304b05e78c15)) +* **pages:** display pages from ghost (eg. : about page and accessibility page) ([64ce8ca](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/64ce8ca54ea67210436a267242435c25d5987609)) + + +### Bug Fixes + +* **footer:** temporarily hide accessibility link in footer until page is ready ([5cd7490](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/5cd7490c5b2b1b656f13b39c01c125a03247dc13)) +* **pwa:** ghost caching in pwa was making ui unavailable ([d845a32](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/d845a32a3abf1e4d269c79c59cc01f9744687721)) +* **pwa:** typo in update notification ([6734cfe](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/6734cfec748b3952a417c6809200bf7f64b49430)) + ## [1.12.0](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v1.11.1...v1.12.0) (2022-02-01) diff --git a/package-lock.json b/package-lock.json index fca33e92ca85c01f93491f1342b261e0f3838ad7..820b6fdb1a25c7f3d1ccd6f5d36c8ecbc23fb10b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "1.12.0", + "version": "1.13.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3211e38a6862b30bf01241b923a55e1e3e3b1b57..8356afdb9b0672272ce72f8d60b45a17967451a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "1.12.0", + "version": "1.13.0", "scripts": { "ng": "ng", "start": "ng serve --configuration=fr --proxy-config proxy.conf.json", 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 77a3b17dae26ccf3d7035ecfeeefcfa2836215d4..e0e7f0e46066abf99f8aade78cd5ad8cf5553245 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -60,15 +60,24 @@ export class PostListComponent implements OnInit { this.getPosts(this.filters); } else { // Init default news list + this.allPosts = []; this.postService.getPosts(1).subscribe((news) => { - this.setNews(news); - const headLineTag = this.allPosts.find((post: Post) => post.tags.some((tag) => tag.slug === TagEnum.aLaUne)); - this.allPosts.unshift(headLineTag); + this.fillArticles(news); }); } }); } + public fillArticles(news: PostWithMeta): void { + this.setNews(news); + const headLineTag = this.allPosts.filter((post: Post) => post.tags.some((tag) => tag.slug === TagEnum.aLaUne)); + + const headIndex = this.allPosts.findIndex((post) => post.id === headLineTag[0].id); + this.allPosts.splice(headIndex, 1); + + this.allPosts = [...headLineTag, ...this.allPosts]; + } + public getPosts(filters?: Tag[]): void { // Parse filter let parsedFilters = null; @@ -87,7 +96,7 @@ export class PostListComponent implements OnInit { this.isLoading = true; this.postService.getPosts(1, parsedFilters).subscribe((news) => { - this.setNews(news); + this.fillArticles(news); }); } @@ -121,7 +130,7 @@ export class PostListComponent implements OnInit { if (this.pagination && this.pagination.page < this.pagination.pages) { this.isLoading = true; this.postService.getPosts(this.pagination.next).subscribe((news) => { - this.setNews(news); + this.fillArticles(news); }); } } @@ -130,11 +139,12 @@ export class PostListComponent implements OnInit { private setNews(news: PostWithMeta): void { this.pagination = news.meta.pagination; const customIndex = this.allPosts.length; // For scroll loading, start with previous index. - this.allPosts = news.posts.map((val, index) => { + const newPosts = news.posts.map((val, index) => { val = this.addAuthorToPost(val); index += customIndex; return val; }); + this.allPosts = [...this.allPosts, ...newPosts]; this.isLoading = false; }