From 26e9943f9c38e80e05be9cdb5a684259c5143662 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Fri, 8 Jan 2021 14:36:52 +0100 Subject: [PATCH 01/65] fix: update logo --- src/assets/logos/ram_logo.svg | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/src/assets/logos/ram_logo.svg b/src/assets/logos/ram_logo.svg index a2a1b8765..48c8f1d64 100644 --- a/src/assets/logos/ram_logo.svg +++ b/src/assets/logos/ram_logo.svg @@ -1,25 +1,10 @@ -<svg width="118" height="22" viewBox="0 0 118 22" fill="none" xmlns="http://www.w3.org/2000/svg"> -<g clip-path="url(#clip0)"> -<rect x="32.2148" y="20.4286" width="11.7857" height="1.57143" rx="0.785714" fill="black"/> -<rect x="66" y="20.4286" width="11.7857" height="1.57143" rx="0.785714" fill="black"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M24.3583 17.2857V11.7857C24.3583 10.4839 25.4136 9.42855 26.7154 9.42855C28.0172 9.42855 29.0725 10.4839 29.0725 11.7857V17.2857C29.0725 18.5875 28.0172 19.6428 26.7154 19.6428C25.4136 19.6428 24.3583 18.5875 24.3583 17.2857ZM26.7154 7.07141C29.319 7.07141 31.4297 9.18207 31.4297 11.7857V17.2857C31.4297 19.8893 29.319 22 26.7154 22C24.1118 22 22.0011 19.8893 22.0011 17.2857V11.7857C22.0011 9.18207 24.1118 7.07141 26.7154 7.07141Z" fill="#D50000"/> -<rect width="2.35714" height="16.5" transform="matrix(-1 0 0 1 24.3555 0)" fill="#D50000"/> -<rect width="2.35714" height="16.5" transform="matrix(-1 0 0 1 2.35547 0)" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M7.07143 22H9.42857V11.7857C9.42857 9.18207 7.31791 7.07141 4.71429 7.07141C2.11066 7.07141 0 9.18207 0 11.7857V22H2.35714V11.7857C2.35714 10.4839 3.41247 9.42855 4.71429 9.42855C6.0161 9.42855 7.07143 10.4839 7.07143 11.7857V22Z" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M18.0714 7.85714H20.4286V17.2857C20.4286 19.8893 18.3179 22 15.7143 22C13.1107 22 11 19.8893 11 17.2857V7.85714H13.3571V17.2857C13.3571 18.5875 14.4125 19.6429 15.7143 19.6429C17.0161 19.6429 18.0714 18.5875 18.0714 17.2857V7.85714Z" fill="#D50000"/> -<rect width="2.35715" height="11" transform="matrix(-1 0 0 1 80.9258 7.07141)" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M85.6417 22H87.9989V11.7857C87.9989 9.18207 85.8882 7.07141 83.2846 7.07141C80.681 7.07141 78.5703 9.18207 78.5703 11.7857V22H80.9275V11.7857C80.9275 10.4839 81.9828 9.42855 83.2846 9.42855C84.5864 9.42855 85.6417 10.4839 85.6417 11.7857V22Z" fill="#D50000"/> -<rect width="2.35714" height="11" transform="matrix(-1 0 0 1 102.926 7.07141)" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M107.642 22H109.999V11.7857C109.999 9.18207 107.888 7.07141 105.285 7.07141C102.681 7.07141 100.57 9.18207 100.57 11.7857V22H102.927V11.7857C102.927 10.4839 103.983 9.42855 105.285 9.42855C106.586 9.42855 107.642 10.4839 107.642 11.7857V22Z" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M114.712 22H117.069V11.7857C117.069 9.18207 114.959 7.07141 112.355 7.07141C109.751 7.07141 107.641 9.18207 107.641 11.7857V22H109.998V11.7857C109.998 10.4839 111.053 9.42855 112.355 9.42855C113.657 9.42855 114.712 10.4839 114.712 11.7857V22Z" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M96.6417 7.85714H98.9989V17.2857C98.9989 19.8893 96.8882 22 94.2846 22C91.681 22 89.5703 19.8893 89.5703 17.2857V7.85714H91.9275V17.2857C91.9275 18.5875 92.9828 19.6429 94.2846 19.6429C95.5864 19.6429 96.6417 18.5875 96.6417 17.2857V7.85714Z" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M51.8566 17.2857V11.7857C51.8566 10.4839 50.8013 9.42855 49.4994 9.42855C48.1976 9.42855 47.1423 10.4839 47.1423 11.7857V17.2857C47.1423 18.5875 48.1976 19.6428 49.4994 19.6428C50.8013 19.6428 51.8566 18.5875 51.8566 17.2857ZM49.4994 7.07141C46.8958 7.07141 44.7852 9.18207 44.7852 11.7857V17.2857C44.7852 19.8893 46.8958 22 49.4994 22C52.1031 22 54.2137 19.8893 54.2137 17.2857V11.7857C54.2137 9.18207 52.1031 7.07141 49.4994 7.07141Z" fill="#D50000"/> -<rect x="51.8594" width="2.35714" height="16.5" fill="#D50000"/> -<path fill-rule="evenodd" clip-rule="evenodd" d="M62.8566 7.85714H65.2137V17.2857C65.2137 19.8893 63.1031 22 60.4994 22C57.8958 22 55.7852 19.8893 55.7852 17.2857V7.85714H58.1423V17.2857C58.1423 18.5875 59.1976 19.6429 60.4994 19.6429C61.8013 19.6429 62.8566 18.5875 62.8566 17.2857V7.85714Z" fill="#D50000"/> -</g> -<defs> -<clipPath id="clip0"> -<rect width="117.071" height="22" fill="white"/> -</clipPath> -</defs> +<svg width="121" height="29" viewBox="0 0 121 29" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M54 27.5C54 26.6716 54.6716 26 55.5 26H67.5C68.3284 26 69 26.6716 69 27.5V27.5C69 28.3284 68.3284 29 67.5 29H55.5C54.6716 29 54 28.3284 54 27.5V27.5Z" fill="#ED3939"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M71 8H74V8.80269C74.8825 8.29218 75.9071 8 77 8C80.3137 8 83 10.6863 83 14V27.5C83 28.3284 82.3284 29 81.5 29C80.6716 29 80 28.3284 80 27.5V14C80 12.3431 78.6569 11 77 11C75.3431 11 74 12.3431 74 14V22V27.5C74 28.3284 73.3284 29 72.5 29C71.6716 29 71 28.3284 71 27.5V22V14V8Z" fill="#4F4F4F"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M103 8H100V14V22V27.5C100 28.3284 100.672 29 101.5 29C102.328 29 103 28.3284 103 27.5V22V14C103 12.3431 104.343 11 106 11C107.657 11 109 12.3431 109 14V27.5C109 28.3284 109.672 29 110.5 29C111.328 29 112 28.3284 112 27.5V14C112 12.3431 113.343 11 115 11C116.657 11 118 12.3431 118 14V27.5C118 28.3284 118.672 29 119.5 29C120.328 29 121 28.3284 121 27.5V14C121 10.6863 118.314 8 115 8C113.208 8 111.599 8.78563 110.5 10.0313C109.401 8.78563 107.792 8 106 8C104.907 8 103.883 8.29218 103 8.80269V8Z" fill="#4F4F4F"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M85.5 23C85.5 26.3137 88.1863 29 91.5 29C94.8137 29 97.5 26.3137 97.5 23V9.5C97.5 8.67157 96.8284 8 96 8C95.1716 8 94.5 8.67157 94.5 9.5V23C94.5 24.6569 93.1569 26 91.5 26C89.8431 26 88.5 24.6569 88.5 23V9.5C88.5 8.67157 87.8284 8 87 8C86.1716 8 85.5 8.67157 85.5 9.5V23Z" fill="#4F4F4F"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M34 11C32.3115 11 30.5 12.747 30.5 15.5C30.5 16.3284 31.1716 17 32 17H34.75C37.2353 17 39.25 19.0147 39.25 21.5H39.2268C39.2268 25.3744 36.5611 29 32.7268 29C30.6938 29 28.9456 27.9361 27.7976 26.3968C27.3023 25.7327 27.4391 24.7929 28.1032 24.2976C28.7672 23.8023 29.7071 23.9391 30.2024 24.6032C30.8854 25.5189 31.7982 26 32.7268 26C34.4154 26 36.2268 24.253 36.2268 21.5C36.2268 21.4365 36.2308 21.374 36.2384 21.3126C36.1462 20.5726 35.515 20 34.75 20H32C29.5147 20 27.5 17.9853 27.5 15.5C27.5 11.6256 30.1657 8 34 8C36.0331 8 37.7812 9.06393 38.9292 10.6032C39.4245 11.2673 39.2877 12.2071 38.6237 12.7024C37.9596 13.1977 37.0198 13.0609 36.5245 12.3968C35.8415 11.4811 34.9286 11 34 11Z" fill="#4F4F4F"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M3 3H6C7.65685 3 9 4.34315 9 6V13C9 14.6569 7.65685 16 6 16H4.5H3V3ZM0 17.5V0H6C9.31371 0 12 2.68629 12 6V13C12 15.0173 11.0044 16.8022 9.47774 17.8899C11.025 19.2638 12 21.268 12 23.5V27.5C12 28.3284 11.3284 29 10.5 29C9.67157 29 9 28.3284 9 27.5V23.5C9 21.0147 6.98528 19 4.5 19H3V27.5C3 28.3284 2.32843 29 1.5 29C0.671573 29 0 28.3284 0 27.5V19V17.5Z" fill="#4F4F4F"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M50 23V14C50 12.3431 48.6569 11 47 11C45.3431 11 44 12.3431 44 14V23C44 24.6569 45.3431 26 47 26C48.6569 26 50 24.6569 50 23ZM47 8C43.6863 8 41 10.6863 41 14V23C41 26.3137 43.6863 29 47 29C50.3137 29 53 26.3137 53 23V14C53 10.6863 50.3137 8 47 8Z" fill="#4F4F4F"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M23 14V14.5C23 16.1569 21.6569 17.5 20 17.5H18C17.4477 17.5 17 17.0523 17 16.5V14.5V14C17 12.3431 18.3431 11 20 11C21.6569 11 23 12.3431 23 14ZM17 20.374C17.3196 20.4562 17.6547 20.5 18 20.5H20C23.3137 20.5 26 17.8137 26 14.5V14C26 10.6863 23.3137 8 20 8C16.6863 8 14 10.6863 14 14V14.5V16.5V23.5C14 26.5376 16.4624 29 19.5 29H24C24.8284 29 25.5 28.3284 25.5 27.5C25.5 26.6716 24.8284 26 24 26H19.5C18.1193 26 17 24.8807 17 23.5V20.374Z" fill="#4F4F4F"/> </svg> -- GitLab From 012a5f0f17dbc28d5d57d8f80c4fd8746ad353ca Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Fri, 26 Feb 2021 11:36:52 +0100 Subject: [PATCH 02/65] fix: filter chevron margin + add structure link width --- src/app/structure-list/components/search/search.component.html | 2 +- src/app/structure-list/components/search/search.component.scss | 1 - src/assets/scss/_buttons.scss | 2 +- src/styles.scss | 3 +++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/structure-list/components/search/search.component.html b/src/app/structure-list/components/search/search.component.html index 5294bc019..6e7814eb8 100644 --- a/src/app/structure-list/components/search/search.component.html +++ b/src/app/structure-list/components/search/search.component.html @@ -91,7 +91,7 @@ </div> </div> <div class="footerSearchSection isntPhoneContent" fxLayout="row" fxLayoutAlign="space-between center"> - <div class="checkbox"> + <div class="checkbox no-width"> <div class="checkboxItem"> <label> <input diff --git a/src/app/structure-list/components/search/search.component.scss b/src/app/structure-list/components/search/search.component.scss index 657eeeffe..ec415e896 100644 --- a/src/app/structure-list/components/search/search.component.scss +++ b/src/app/structure-list/components/search/search.component.scss @@ -118,7 +118,6 @@ } a { @include hyperlink; - width: 100%; text-align: right; } diff --git a/src/assets/scss/_buttons.scss b/src/assets/scss/_buttons.scss index e17ec875c..3c972d529 100644 --- a/src/assets/scss/_buttons.scss +++ b/src/assets/scss/_buttons.scss @@ -7,7 +7,7 @@ height: 40px; width: 190px; border: 1px solid $grey-4; - padding: 3px 16px 3px 16px; + padding: 3px 8px 3px 16px; outline: none; border-radius: 4px; cursor: pointer; diff --git a/src/styles.scss b/src/styles.scss index 747d5da15..1b7004107 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -159,6 +159,9 @@ button { -ms-transform: rotate(45deg); } } + &.no-width { + width: unset; + } } // Layout -- GitLab From ed121d347a961e0780ae365ecd1282d8aa5eb528 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 26 Feb 2021 11:49:17 +0100 Subject: [PATCH 03/65] feat(post) : init lazy loading --- src/app/app-routing.module.ts | 4 ++++ src/app/posts/posts-routing.module.ts | 11 +++++++++++ src/app/posts/posts.component.html | 1 + src/app/posts/posts.component.scss | 0 src/app/posts/posts.component.spec.ts | 25 +++++++++++++++++++++++++ src/app/posts/posts.component.ts | 15 +++++++++++++++ src/app/posts/posts.module.ts | 10 ++++++++++ 7 files changed, 66 insertions(+) create mode 100644 src/app/posts/posts-routing.module.ts create mode 100644 src/app/posts/posts.component.html create mode 100644 src/app/posts/posts.component.scss create mode 100644 src/app/posts/posts.component.spec.ts create mode 100644 src/app/posts/posts.component.ts create mode 100644 src/app/posts/posts.module.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 045be83e7..556fb1eff 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -87,6 +87,10 @@ const routes: Routes = [ component: FormComponent, canDeactivate: [DeactivateGuard], }, + { + path: 'posts', + loadChildren: () => import('./posts/posts.module').then((m) => m.PostsModule), + }, { path: '**', redirectTo: 'home', diff --git a/src/app/posts/posts-routing.module.ts b/src/app/posts/posts-routing.module.ts new file mode 100644 index 000000000..80b37d9e9 --- /dev/null +++ b/src/app/posts/posts-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { PostsComponent } from './posts.component'; + +const routes: Routes = [{ path: '', component: PostsComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class PostsRoutingModule {} diff --git a/src/app/posts/posts.component.html b/src/app/posts/posts.component.html new file mode 100644 index 000000000..2c30d2067 --- /dev/null +++ b/src/app/posts/posts.component.html @@ -0,0 +1 @@ +<p>posts works!</p> diff --git a/src/app/posts/posts.component.scss b/src/app/posts/posts.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/posts/posts.component.spec.ts b/src/app/posts/posts.component.spec.ts new file mode 100644 index 000000000..9702efa6e --- /dev/null +++ b/src/app/posts/posts.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostsComponent } from './posts.component'; + +describe('PostsComponent', () => { + let component: PostsComponent; + let fixture: ComponentFixture<PostsComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostsComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/posts/posts.component.ts b/src/app/posts/posts.component.ts new file mode 100644 index 000000000..73d77fc55 --- /dev/null +++ b/src/app/posts/posts.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-posts', + templateUrl: './posts.component.html', + styleUrls: ['./posts.component.scss'] +}) +export class PostsComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/posts/posts.module.ts b/src/app/posts/posts.module.ts new file mode 100644 index 000000000..32e4a4b79 --- /dev/null +++ b/src/app/posts/posts.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { PostsComponent } from './posts.component'; +import { PostsRoutingModule } from './posts-routing.module'; + +@NgModule({ + declarations: [PostsComponent], + imports: [CommonModule, PostsRoutingModule], +}) +export class PostsModule {} -- GitLab From 05a578b79e3194e78b8ec6536a038c1775a3615d Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Fri, 26 Feb 2021 14:36:39 +0100 Subject: [PATCH 04/65] fix: bug on admin validation --- .../claim-structure.component.ts | 16 ++++++++----- src/app/admin/services/admin.service.ts | 24 +++++++++++++++---- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/app/admin/components/claim-structure/claim-structure.component.ts b/src/app/admin/components/claim-structure/claim-structure.component.ts index e6e8f1338..28e1701d0 100644 --- a/src/app/admin/components/claim-structure/claim-structure.component.ts +++ b/src/app/admin/components/claim-structure/claim-structure.component.ts @@ -17,14 +17,18 @@ export class ClaimStructureComponent implements OnInit { } public acceptDemand(demand: DemandAttachment): void { - this.adminService.acceptStructureClaim(demand.userEmail, demand.structureId).subscribe((data) => { - this.demandsAttachment = data; - }); + this.adminService + .acceptStructureClaim(demand.userEmail, demand.structureId, demand.structureName) + .subscribe((data) => { + this.demandsAttachment = data; + }); } public refuseDemand(demand: DemandAttachment): void { - this.adminService.refuseStructureClaim(demand.userEmail, demand.structureId).subscribe((data) => { - this.demandsAttachment = data; - }); + this.adminService + .refuseStructureClaim(demand.userEmail, demand.structureId, demand.structureName) + .subscribe((data) => { + this.demandsAttachment = data; + }); } } diff --git a/src/app/admin/services/admin.service.ts b/src/app/admin/services/admin.service.ts index 0167109c5..cdea9a41b 100644 --- a/src/app/admin/services/admin.service.ts +++ b/src/app/admin/services/admin.service.ts @@ -15,11 +15,27 @@ export class AdminService { return this.http.get<DemandAttachment[]>(`${this.baseUrl}/pendingStructures`); } - public acceptStructureClaim(userEmail: string, structureId: number): Observable<DemandAttachment[]> { - return this.http.post<DemandAttachment[]>(`${this.baseUrl}/validatePendingStructure`, { userEmail, structureId }); + public acceptStructureClaim( + userEmail: string, + structureId: number, + structureName: string + ): Observable<DemandAttachment[]> { + return this.http.post<DemandAttachment[]>(`${this.baseUrl}/validatePendingStructure`, { + userEmail, + structureId, + structureName, + }); } - public refuseStructureClaim(userEmail: string, structureId: number): Observable<DemandAttachment[]> { - return this.http.post<DemandAttachment[]>(`${this.baseUrl}/rejectPendingStructure`, { userEmail, structureId }); + public refuseStructureClaim( + userEmail: string, + structureId: number, + structureName: string + ): Observable<DemandAttachment[]> { + return this.http.post<DemandAttachment[]>(`${this.baseUrl}/rejectPendingStructure`, { + userEmail, + structureId, + structureName, + }); } } -- GitLab From c0f5d8279f727fc3320b7339b0cf709da994011f Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 26 Feb 2021 15:01:54 +0100 Subject: [PATCH 05/65] feat(posts) : init --- src/app/app-routing.module.ts | 2 +- .../post-details/post-details.component.html | 1 + .../post-details/post-details.component.scss} | 0 .../post-details.component.spec.ts | 25 +++++++++++++++++++ .../post-details/post-details.component.ts | 15 +++++++++++ .../post-header/post-header.component.html | 1 + .../post-header/post-header.component.scss | 6 +++++ .../post-header/post-header.component.spec.ts | 25 +++++++++++++++++++ .../post-header/post-header.component.ts | 15 +++++++++++ .../post-list/post-list.component.html | 17 +++++++++++++ .../post-list/post-list.component.scss | 12 +++++++++ .../post-list/post-list.component.spec.ts | 25 +++++++++++++++++++ .../post-list/post-list.component.ts | 15 +++++++++++ .../post-routing.module.ts} | 6 ++--- src/app/post/post.component.html | 4 +++ src/app/post/post.component.scss | 0 .../post.component.spec.ts} | 13 +++++----- src/app/post/post.component.ts | 12 +++++++++ src/app/post/post.module.ts | 14 +++++++++++ .../post/services/post/post.component.html | 1 + .../post/services/post/post.component.scss | 0 .../post/services/post/post.component.spec.ts | 25 +++++++++++++++++++ src/app/post/services/post/post.component.ts | 15 +++++++++++ src/app/posts/posts.component.html | 1 - src/app/posts/posts.component.ts | 15 ----------- src/app/posts/posts.module.ts | 10 -------- 26 files changed, 238 insertions(+), 37 deletions(-) create mode 100644 src/app/post/components/post-details/post-details.component.html rename src/app/{posts/posts.component.scss => post/components/post-details/post-details.component.scss} (100%) create mode 100644 src/app/post/components/post-details/post-details.component.spec.ts create mode 100644 src/app/post/components/post-details/post-details.component.ts create mode 100644 src/app/post/components/post-header/post-header.component.html create mode 100644 src/app/post/components/post-header/post-header.component.scss create mode 100644 src/app/post/components/post-header/post-header.component.spec.ts create mode 100644 src/app/post/components/post-header/post-header.component.ts create mode 100644 src/app/post/components/post-list/post-list.component.html create mode 100644 src/app/post/components/post-list/post-list.component.scss create mode 100644 src/app/post/components/post-list/post-list.component.spec.ts create mode 100644 src/app/post/components/post-list/post-list.component.ts rename src/app/{posts/posts-routing.module.ts => post/post-routing.module.ts} (54%) create mode 100644 src/app/post/post.component.html create mode 100644 src/app/post/post.component.scss rename src/app/{posts/posts.component.spec.ts => post/post.component.spec.ts} (57%) create mode 100644 src/app/post/post.component.ts create mode 100644 src/app/post/post.module.ts create mode 100644 src/app/post/services/post/post.component.html create mode 100644 src/app/post/services/post/post.component.scss create mode 100644 src/app/post/services/post/post.component.spec.ts create mode 100644 src/app/post/services/post/post.component.ts delete mode 100644 src/app/posts/posts.component.html delete mode 100644 src/app/posts/posts.component.ts delete mode 100644 src/app/posts/posts.module.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 556fb1eff..9b85e5e1b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -89,7 +89,7 @@ const routes: Routes = [ }, { path: 'posts', - loadChildren: () => import('./posts/posts.module').then((m) => m.PostsModule), + loadChildren: () => import('./post/post.module').then((m) => m.PostModule), }, { path: '**', diff --git a/src/app/post/components/post-details/post-details.component.html b/src/app/post/components/post-details/post-details.component.html new file mode 100644 index 000000000..11f24be81 --- /dev/null +++ b/src/app/post/components/post-details/post-details.component.html @@ -0,0 +1 @@ +<p>post-details works!</p> diff --git a/src/app/posts/posts.component.scss b/src/app/post/components/post-details/post-details.component.scss similarity index 100% rename from src/app/posts/posts.component.scss rename to src/app/post/components/post-details/post-details.component.scss diff --git a/src/app/post/components/post-details/post-details.component.spec.ts b/src/app/post/components/post-details/post-details.component.spec.ts new file mode 100644 index 000000000..90f92b94c --- /dev/null +++ b/src/app/post/components/post-details/post-details.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostDetailsComponent } from './post-details.component'; + +describe('PostDetailsComponent', () => { + let component: PostDetailsComponent; + let fixture: ComponentFixture<PostDetailsComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostDetailsComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/post/components/post-details/post-details.component.ts b/src/app/post/components/post-details/post-details.component.ts new file mode 100644 index 000000000..adf283aa1 --- /dev/null +++ b/src/app/post/components/post-details/post-details.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-post-details', + templateUrl: './post-details.component.html', + styleUrls: ['./post-details.component.scss'] +}) +export class PostDetailsComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/post/components/post-header/post-header.component.html b/src/app/post/components/post-header/post-header.component.html new file mode 100644 index 000000000..6d9a4faab --- /dev/null +++ b/src/app/post/components/post-header/post-header.component.html @@ -0,0 +1 @@ +<div class="header-container">post-header works!</div> diff --git a/src/app/post/components/post-header/post-header.component.scss b/src/app/post/components/post-header/post-header.component.scss new file mode 100644 index 000000000..e24dbb9e6 --- /dev/null +++ b/src/app/post/components/post-header/post-header.component.scss @@ -0,0 +1,6 @@ +@import '../../../../assets/scss/color'; + +.header-container { + height: 180px; + background: $white; +} diff --git a/src/app/post/components/post-header/post-header.component.spec.ts b/src/app/post/components/post-header/post-header.component.spec.ts new file mode 100644 index 000000000..a2ba8e0b6 --- /dev/null +++ b/src/app/post/components/post-header/post-header.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostHeaderComponent } from './post-header.component'; + +describe('PostHeaderComponent', () => { + let component: PostHeaderComponent; + let fixture: ComponentFixture<PostHeaderComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostHeaderComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostHeaderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/post/components/post-header/post-header.component.ts b/src/app/post/components/post-header/post-header.component.ts new file mode 100644 index 000000000..4927d262b --- /dev/null +++ b/src/app/post/components/post-header/post-header.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-post-header', + templateUrl: './post-header.component.html', + styleUrls: ['./post-header.component.scss'] +}) +export class PostHeaderComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/post/components/post-list/post-list.component.html b/src/app/post/components/post-list/post-list.component.html new file mode 100644 index 000000000..0c1d36f47 --- /dev/null +++ b/src/app/post/components/post-list/post-list.component.html @@ -0,0 +1,17 @@ +<div class="section-container" fxLayout="row"> + <div fxLayout="column" class="list-container"> + <div fxLayout="column"> + <div fxLayout="row" fxLayoutAlign="space-between center"> + <h2>A la une</h2> + <button>Publier votre actu</button> + </div> + </div> + + <div fxLayout="column"> + <div fxLayout="row"> + <h2>Autres actualités</h2> + </div> + </div> + </div> + <div fxLayout="column" fxLayoutAlign=" center" class="project-container">Appels ap rojets</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 new file mode 100644 index 000000000..6d3bff0c2 --- /dev/null +++ b/src/app/post/components/post-list/post-list.component.scss @@ -0,0 +1,12 @@ +@import '../../../../assets/scss/color'; + +.section-container { + background: $grey-6; +} + +.list-container { + width: 80%; +} +.project-container { + width: 20%; +} diff --git a/src/app/post/components/post-list/post-list.component.spec.ts b/src/app/post/components/post-list/post-list.component.spec.ts new file mode 100644 index 000000000..2d39c2494 --- /dev/null +++ b/src/app/post/components/post-list/post-list.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostListComponent } from './post-list.component'; + +describe('PostListComponent', () => { + let component: PostListComponent; + let fixture: ComponentFixture<PostListComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostListComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts new file mode 100644 index 000000000..b8742d722 --- /dev/null +++ b/src/app/post/components/post-list/post-list.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-post-list', + templateUrl: './post-list.component.html', + styleUrls: ['./post-list.component.scss'] +}) +export class PostListComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/posts/posts-routing.module.ts b/src/app/post/post-routing.module.ts similarity index 54% rename from src/app/posts/posts-routing.module.ts rename to src/app/post/post-routing.module.ts index 80b37d9e9..2ec94d598 100644 --- a/src/app/posts/posts-routing.module.ts +++ b/src/app/post/post-routing.module.ts @@ -1,11 +1,11 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { PostsComponent } from './posts.component'; +import { PostComponent } from './post.component'; -const routes: Routes = [{ path: '', component: PostsComponent }]; +const routes: Routes = [{ path: '', component: PostComponent }]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class PostsRoutingModule {} +export class PostRoutingModule {} diff --git a/src/app/post/post.component.html b/src/app/post/post.component.html new file mode 100644 index 000000000..eaa0bc1a6 --- /dev/null +++ b/src/app/post/post.component.html @@ -0,0 +1,4 @@ +<app-post-header></app-post-header> +<app-post-list></app-post-list> +<app-post-details></app-post-details> +<p>posts works!</p> diff --git a/src/app/post/post.component.scss b/src/app/post/post.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/posts/posts.component.spec.ts b/src/app/post/post.component.spec.ts similarity index 57% rename from src/app/posts/posts.component.spec.ts rename to src/app/post/post.component.spec.ts index 9702efa6e..5716f2398 100644 --- a/src/app/posts/posts.component.spec.ts +++ b/src/app/post/post.component.spec.ts @@ -1,20 +1,19 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { PostsComponent } from './posts.component'; +import { PostComponent } from './post.component'; describe('PostsComponent', () => { - let component: PostsComponent; - let fixture: ComponentFixture<PostsComponent>; + let component: PostComponent; + let fixture: ComponentFixture<PostComponent>; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ PostsComponent ] - }) - .compileComponents(); + declarations: [PostComponent], + }).compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(PostsComponent); + fixture = TestBed.createComponent(PostComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/post/post.component.ts b/src/app/post/post.component.ts new file mode 100644 index 000000000..075daa3b5 --- /dev/null +++ b/src/app/post/post.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-post', + templateUrl: './post.component.html', + styleUrls: ['./post.component.scss'], +}) +export class PostComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/post/post.module.ts b/src/app/post/post.module.ts new file mode 100644 index 000000000..a18cc43dd --- /dev/null +++ b/src/app/post/post.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { PostComponent } from './post.component'; +import { PostRoutingModule } from './post-routing.module'; +import { PostHeaderComponent } from './components/post-header/post-header.component'; +import { PostListComponent } from './components/post-list/post-list.component'; +import { PostDetailsComponent } from './components/post-details/post-details.component'; +import { SharedModule } from '../shared/shared.module'; + +@NgModule({ + declarations: [PostComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent], + imports: [CommonModule, PostRoutingModule, SharedModule], +}) +export class PostModule {} diff --git a/src/app/post/services/post/post.component.html b/src/app/post/services/post/post.component.html new file mode 100644 index 000000000..71b500c4d --- /dev/null +++ b/src/app/post/services/post/post.component.html @@ -0,0 +1 @@ +<p>post works!</p> diff --git a/src/app/post/services/post/post.component.scss b/src/app/post/services/post/post.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/post/services/post/post.component.spec.ts b/src/app/post/services/post/post.component.spec.ts new file mode 100644 index 000000000..b941a2fe1 --- /dev/null +++ b/src/app/post/services/post/post.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostComponent } from './post.component'; + +describe('PostComponent', () => { + let component: PostComponent; + let fixture: ComponentFixture<PostComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/post/services/post/post.component.ts b/src/app/post/services/post/post.component.ts new file mode 100644 index 000000000..ae2acfc6e --- /dev/null +++ b/src/app/post/services/post/post.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-post', + templateUrl: './post.component.html', + styleUrls: ['./post.component.scss'] +}) +export class PostComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/posts/posts.component.html b/src/app/posts/posts.component.html deleted file mode 100644 index 2c30d2067..000000000 --- a/src/app/posts/posts.component.html +++ /dev/null @@ -1 +0,0 @@ -<p>posts works!</p> diff --git a/src/app/posts/posts.component.ts b/src/app/posts/posts.component.ts deleted file mode 100644 index 73d77fc55..000000000 --- a/src/app/posts/posts.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-posts', - templateUrl: './posts.component.html', - styleUrls: ['./posts.component.scss'] -}) -export class PostsComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/posts/posts.module.ts b/src/app/posts/posts.module.ts deleted file mode 100644 index 32e4a4b79..000000000 --- a/src/app/posts/posts.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { PostsComponent } from './posts.component'; -import { PostsRoutingModule } from './posts-routing.module'; - -@NgModule({ - declarations: [PostsComponent], - imports: [CommonModule, PostsRoutingModule], -}) -export class PostsModule {} -- GitLab From c2310d5a5628a841115729f65c3d7cb320e94311 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 26 Feb 2021 15:44:24 +0100 Subject: [PATCH 06/65] =?UTF-8?q?feat(post)=20:=20add=20design=20"appel=20?= =?UTF-8?q?=C3=A0=20projet"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../post-list/post-list.component.html | 26 ++++++++++---- .../post-list/post-list.component.scss | 34 +++++++++++++++++++ .../post-list/post-list.component.ts | 9 +++-- src/app/post/post.component.html | 2 -- .../svg-icon/svg-icon.component.scss | 4 +++ src/assets/post/sprite.svg | 11 ++++++ src/assets/scss/_typography.scss | 8 +++++ 7 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 src/assets/post/sprite.svg 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 0c1d36f47..c9e22c225 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -1,17 +1,29 @@ -<div class="section-container" fxLayout="row"> +<div class="section-container" fxLayout="row" fxLayoutGap="32px"> <div fxLayout="column" class="list-container"> <div fxLayout="column"> - <div fxLayout="row" fxLayoutAlign="space-between center"> - <h2>A la une</h2> - <button>Publier votre actu</button> + <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> + <h2>à la une</h2> + <app-button + [type]="'button'" + [style]="'buttonWithHash'" + [text]="'Publier votre actu'" + (action)="publishNews()" + ></app-button> </div> </div> <div fxLayout="column"> - <div fxLayout="row"> - <h2>Autres actualités</h2> + <div fxLayout="row" class="row-border"> + <h2>autres actualités</h2> + </div> + </div> + </div> + <div fxLayout="column" fxLayoutAlign=" center" class="project-container"> + <div class="background-project-container"> + <div class="project-content" fxLayout="column"> + <app-svg-icon [iconClass]="'icon-80'" [iconColor]="'inherit'" [type]="'post'" [icon]="'project'"></app-svg-icon> + <h2>appels à projets</h2> </div> </div> </div> - <div fxLayout="column" fxLayoutAlign=" center" class="project-container">Appels ap rojets</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 6d3bff0c2..b3cf207d9 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -1,12 +1,46 @@ @import '../../../../assets/scss/color'; +@import '../../../../assets/scss/typography'; +@import '../../../../assets/scss/shapes'; .section-container { background: $grey-6; + .row-border { + border-bottom: 1px dashed $grey-4; + margin: 16px 0; + } + h2 { + font-style: italic !important; + text-transform: uppercase; + } } .list-container { width: 80%; + h2 { + @include cn-bold-28; + color: $grey-2; + } } .project-container { width: 20%; + min-width: 306px; + @include background-hash($secondary-color); + border: 1px solid $secondary-color; + border-radius: 6px; + .background-project-container { + width: 100%; + height: 100%; + background: $white; + border-radius: 6px; + .project-content { + padding: 18px 32px 62px 36px; + fill: $secondary-color; + stroke: $secondary-color; + text-align: center; + h2 { + @include cn-bold-26; + color: $secondary-color; + } + } + } } 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 b8742d722..52014ff68 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -3,13 +3,12 @@ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-post-list', templateUrl: './post-list.component.html', - styleUrls: ['./post-list.component.scss'] + styleUrls: ['./post-list.component.scss'], }) export class PostListComponent implements OnInit { + constructor() {} - constructor() { } - - ngOnInit(): void { - } + ngOnInit(): void {} + public publishNews(): void {} } diff --git a/src/app/post/post.component.html b/src/app/post/post.component.html index eaa0bc1a6..2ea36328d 100644 --- a/src/app/post/post.component.html +++ b/src/app/post/post.component.html @@ -1,4 +1,2 @@ <app-post-header></app-post-header> <app-post-list></app-post-list> -<app-post-details></app-post-details> -<p>posts works!</p> diff --git a/src/app/shared/components/svg-icon/svg-icon.component.scss b/src/app/shared/components/svg-icon/svg-icon.component.scss index e688256ea..0d40e293b 100644 --- a/src/app/shared/components/svg-icon/svg-icon.component.scss +++ b/src/app/shared/components/svg-icon/svg-icon.component.scss @@ -9,6 +9,10 @@ &.icon-75 { width: 4.688em; } + &.icon-80 { + height: 80px; + width: 80px; + } &.validation { height: 100%; width: 26px; diff --git a/src/assets/post/sprite.svg b/src/assets/post/sprite.svg new file mode 100644 index 000000000..9c8181e25 --- /dev/null +++ b/src/assets/post/sprite.svg @@ -0,0 +1,11 @@ +<svg xmlns="http://www.w3.org/2000/svg"> + +<symbol id="project" viewBox="0 0 80 60" xmlns="http://www.w3.org/2000/svg"> +<path d="M1.66016 23.2006C4.67429 23.0597 8.52282 22.3132 12.7892 21.1547C17.5608 19.8591 22.9197 18.0302 28.3314 15.8906C38.369 11.9223 48.6614 6.85659 55.7703 2.08884V2.14843V2.22928V2.31051V2.39211V2.47407V2.5564V2.6391V2.72216V2.80559V2.88938V2.97352V3.05802V3.14288V3.2281V3.31367V3.39959V3.48586V3.57248V3.65944V3.74676V3.83441V3.92241V4.01075V4.09943V4.18845V4.27781V4.3675V4.45752V4.54788V4.63856V4.72958V4.82092V4.91259V5.00458V5.0969V5.18954V5.2825V5.37577V5.46937V5.56327V5.6575V5.75203V5.84688V5.94203V6.03749V6.13326V6.22933V6.32571V6.42239V6.51937V6.61664V6.71422V6.81209V6.91025V7.0087V7.10745V7.20649V7.30581V7.40542V7.50532V7.6055V7.70596V7.8067V7.90772V8.00901V8.11059V8.21243V8.31455V8.41694V8.5196V8.62253V8.72573V8.82918V8.93291V9.03689V9.14114V9.24565V9.35041V9.45543V9.5607V9.66622V9.772V9.87803V9.9843V10.0908V10.1976V10.3046V10.4119V10.5194V10.6271V10.7351V10.8433V10.9517V11.0604V11.1693V11.2784V11.3878V11.4974V11.6072V11.7172V11.8275V11.938V12.0487V12.1596V12.2708V12.3821V12.4937V12.6054V12.7174V12.8296V12.942V13.0546V13.1675V13.2805V13.3937V13.5071V13.6207V13.7345V13.8485V13.9628V14.0771V14.1917V14.3065V14.4215V14.5366V14.6519V14.7674V14.8831V14.999V15.1151V15.2313V15.3477V15.4643V15.581V15.6979V15.815V15.9323V16.0497V16.1673V16.2851V16.403V16.521V16.6393V16.7577V16.8762V16.9949V17.1137V17.2327V17.3519V17.4712V17.5906V17.7102V17.83V17.9498V18.0698V18.19V18.3103V18.4307V18.5513V18.672V18.7928V18.9137V19.0348V19.156V19.2774V19.3988V19.5204V19.6421V19.7639V19.8858V20.0079V20.1301V20.2523V20.3747V20.4972V20.6198V20.7425V20.8654V20.9883V21.1113V21.2344V21.3576V21.481V21.6044V21.7279V21.8515V21.9752V22.099V22.2229V22.3468V22.4709V22.595V22.7192V22.8435V22.9679V23.0923V23.2169V23.3415V23.4661V23.5909V23.7157V23.8406V23.9655V24.0905V24.2156V24.3408V24.466V24.5912V24.7166V24.8419V24.9674V25.0929V25.2184V25.344V25.4696V25.5953V25.7211V25.8468V25.9726V26.0985V26.2244V26.3503V26.4763V26.6023V26.7284V26.8544V26.9806V27.1067V27.2328V27.359V27.4852V27.6115V27.7377V27.864V27.9903V28.1166V28.243V28.3693V28.4956V28.622V28.7484V28.8748V29.0012V29.1275V29.2539V29.3803V29.5067V29.6331V29.7595V29.8859V30.0123V30.1387V30.265V30.3914V30.5177V30.6441V30.7704V30.8967V31.023V31.1492V31.2754V31.4017V31.5279V31.654V31.7802V31.9063V32.0323V32.1584V32.2844V32.4104V32.5363V32.6622V32.7881V32.9139V33.0397V33.1654V33.2911V33.4168V33.5424V33.6679V33.7934V33.9188V34.0442V34.1696V34.2948V34.42V34.5452V34.6703V34.7953V34.9203V35.0452V35.17V35.2947V35.4194V35.544V35.6686V35.793V35.9174V36.0417V36.1659V36.2901V36.4141V36.5381V36.662V36.7858V36.9095V37.0331V37.1566V37.2801V37.4034V37.5266V37.6498V37.7728V37.8957V38.0186V38.1413V38.2639V38.3864V38.5088V38.6311V38.7533V38.8754V38.9973V39.1191V39.2408V39.3624V39.4839V39.6053V39.7265V39.8476V39.9685V40.0894V40.2101V40.3307V40.4511V40.5714V40.6916V40.8116V40.9315V41.0512V41.1708V41.2903V41.4096V41.5288V41.6478V41.7667V41.8854V42.004V42.1224V42.2406V42.3587V42.4766V42.5944V42.712V42.8294V42.9467V43.0638V43.1808V43.2975V43.4141V43.5306V43.6468V43.7629V43.8788V43.9945V44.11V44.2254V44.3406V44.4555V44.5703V44.6849V44.7993V44.9136V45.0276V45.1414V45.2551V45.3685V45.4818V45.5948V45.7076V45.8203V45.9327V46.0449V46.1569V46.2687V46.3803V46.4917V46.6029V46.7138V46.8245V46.9351V47.0453V47.1554V47.2653V47.3749V47.4843V47.5934V47.7024V47.8111V47.9195V48.0278V48.1358V48.2435V48.3511V48.4583V48.5654V48.6722V48.7787V48.885V48.9911V49.0969V49.2024V49.3078V49.4128V49.5176V49.6221V49.7264V49.8304V49.9342V50.0377V50.1409V50.2439V50.3465V50.449V50.5511V50.653V50.7546V50.8559V50.957V51.0578V51.1582V51.2585V51.3584V51.458V51.5574V51.6565V51.7552V51.8537V51.9519V52.0498V52.1474V52.2448V52.3418V52.4385V52.5349V52.631V52.7268V52.8223V52.9175V53.0124V53.1069V53.2012V53.2952V53.3888V53.4821V53.5751V53.6678V53.7601V53.8521V53.9439V54.0352V54.1263V54.217V54.3074V54.3975V54.4872V54.5766V54.5932C48.6675 50.7584 38.3441 46.5962 28.2733 43.3173C18.0609 39.9923 7.95384 37.5244 1.66016 37.2769V23.2006Z" fill="none" stroke-width="2"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M56.7703 0.181641C42.7428 10.2013 12.6838 22.2249 0.660156 22.2249V38.2564C3.19182 38.2564 8.06936 39.0833 11.8822 39.8595L6.27117 53.4863C5.78047 56.4517 7.78661 59.2534 10.752 59.7441C13.7174 60.2349 16.5192 58.2287 17.0099 55.2633L19.8979 41.4627L19.6442 39.9086L19.5098 39.51L41.2658 9.45105H45.2737L21.5122 42.2809C34.1261 45.936 48.342 51.4756 56.7703 56.2918V28.5373L42.6898 47.8979H38.682L55.0188 25.106L56.7703 28.386V11.4099L32.9349 43.1831H28.9271L55.4659 7.44562L56.7703 10.1451V0.181641ZM25.4388 18.068H21.4309L12.6838 31.1271V37.1106L25.4388 18.068Z" stroke="none"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M64.9531 28.002C64.9531 29.1368 65.919 30.0566 67.1105 30.0566L77.178 30.0566C78.3695 30.0566 79.3353 29.1368 79.3353 28.002C79.3353 26.8673 78.3695 25.9474 77.178 25.9474L67.1105 25.9474C65.919 25.9474 64.9531 26.8673 64.9531 28.002Z" stroke="none"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M63.6036 16.1736C64.0749 17.2789 65.353 17.7927 66.4582 17.3214L75.7969 13.3389C76.9021 12.8675 77.416 11.5895 76.9447 10.4843C76.4734 9.37908 75.1953 8.86521 74.0901 9.33653L64.7514 13.3191C63.6462 13.7904 63.1323 15.0684 63.6036 16.1736Z" stroke="none"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M63.6036 39.4919C64.0749 38.3867 65.353 37.8728 66.4582 38.3441L75.7969 42.3267C76.9021 42.798 77.416 44.076 76.9447 45.1812C76.4734 46.2864 75.1953 46.8003 74.0901 46.329L64.7514 42.3464C63.6462 41.8751 63.1323 40.5971 63.6036 39.4919Z" stroke="none"/> +</symbol> + +</svg> diff --git a/src/assets/scss/_typography.scss b/src/assets/scss/_typography.scss index d5f92bac1..b340d5a63 100644 --- a/src/assets/scss/_typography.scss +++ b/src/assets/scss/_typography.scss @@ -11,6 +11,7 @@ $font-size-medium: 1.25em; // 20px $font-size-xmedium: 1.375em; // 22px $font-size-large: 1.625em; // 26px +$font-size-xlarge: 1.75em; // 28px html, body, @@ -43,6 +44,13 @@ h6, font-size: $font-size-small; } +@mixin cn-bold-28 { + font-family: $title-font; + font-style: normal; + font-weight: bold; + font-size: $font-size-xlarge; +} + @mixin cn-bold-26 { font-family: $title-font; font-style: normal; -- GitLab From 0df5b30e5522d2f392dc420a866b49732c7e8ab7 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 26 Feb 2021 15:49:45 +0100 Subject: [PATCH 07/65] feat(post) : init card news + fix services --- .../post-card/post-card.component.html | 1 + .../post-card/post-card.component.scss} | 0 .../post-card/post-card.component.spec.ts} | 12 ++++++------ .../components/post-card/post-card.component.ts | 15 +++++++++++++++ .../post-list/post-list.component.html | 3 +++ .../post-list/post-list.component.scss | 1 + .../components/post-list/post-list.component.ts | 2 +- src/app/post/post.module.ts | 3 ++- src/app/post/services/post.service.spec.ts | 16 ++++++++++++++++ src/app/post/services/post.service.ts | 9 +++++++++ src/app/post/services/post/post.component.html | 1 - src/app/post/services/post/post.component.ts | 15 --------------- 12 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 src/app/post/components/post-card/post-card.component.html rename src/app/post/{services/post/post.component.scss => components/post-card/post-card.component.scss} (100%) rename src/app/post/{services/post/post.component.spec.ts => components/post-card/post-card.component.spec.ts} (55%) create mode 100644 src/app/post/components/post-card/post-card.component.ts create mode 100644 src/app/post/services/post.service.spec.ts create mode 100644 src/app/post/services/post.service.ts delete mode 100644 src/app/post/services/post/post.component.html delete mode 100644 src/app/post/services/post/post.component.ts diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html new file mode 100644 index 000000000..8d9923984 --- /dev/null +++ b/src/app/post/components/post-card/post-card.component.html @@ -0,0 +1 @@ +<p>post-card works!</p> diff --git a/src/app/post/services/post/post.component.scss b/src/app/post/components/post-card/post-card.component.scss similarity index 100% rename from src/app/post/services/post/post.component.scss rename to src/app/post/components/post-card/post-card.component.scss diff --git a/src/app/post/services/post/post.component.spec.ts b/src/app/post/components/post-card/post-card.component.spec.ts similarity index 55% rename from src/app/post/services/post/post.component.spec.ts rename to src/app/post/components/post-card/post-card.component.spec.ts index b941a2fe1..d4d019381 100644 --- a/src/app/post/services/post/post.component.spec.ts +++ b/src/app/post/components/post-card/post-card.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { PostComponent } from './post.component'; +import { PostCardComponent } from './post-card.component'; -describe('PostComponent', () => { - let component: PostComponent; - let fixture: ComponentFixture<PostComponent>; +describe('PostCardComponent', () => { + let component: PostCardComponent; + let fixture: ComponentFixture<PostCardComponent>; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ PostComponent ] + declarations: [ PostCardComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(PostComponent); + fixture = TestBed.createComponent(PostCardComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts new file mode 100644 index 000000000..53fa6b42c --- /dev/null +++ b/src/app/post/components/post-card/post-card.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-post-card', + templateUrl: './post-card.component.html', + styleUrls: ['./post-card.component.scss'] +}) +export class PostCardComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} 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 c9e22c225..d0f59b635 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -16,6 +16,9 @@ <div fxLayout="row" class="row-border"> <h2>autres actualités</h2> </div> + <div *ngFor="let new of news"> + <app-post-card></app-post-card> + </div> </div> </div> <div fxLayout="column" fxLayoutAlign=" center" class="project-container"> 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 b3cf207d9..342fced69 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -23,6 +23,7 @@ } .project-container { width: 20%; + height: 100%; min-width: 306px; @include background-hash($secondary-color); border: 1px solid $secondary-color; 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 52014ff68..4a013c29a 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -7,7 +7,7 @@ import { Component, OnInit } from '@angular/core'; }) export class PostListComponent implements OnInit { constructor() {} - + news = ['', '', '', '', '', '', '', '', '', '']; ngOnInit(): void {} public publishNews(): void {} diff --git a/src/app/post/post.module.ts b/src/app/post/post.module.ts index a18cc43dd..af61760cb 100644 --- a/src/app/post/post.module.ts +++ b/src/app/post/post.module.ts @@ -6,9 +6,10 @@ import { PostHeaderComponent } from './components/post-header/post-header.compon import { PostListComponent } from './components/post-list/post-list.component'; import { PostDetailsComponent } from './components/post-details/post-details.component'; import { SharedModule } from '../shared/shared.module'; +import { PostCardComponent } from './components/post-card/post-card.component'; @NgModule({ - declarations: [PostComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent], + declarations: [PostComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent, PostCardComponent], imports: [CommonModule, PostRoutingModule, SharedModule], }) export class PostModule {} diff --git a/src/app/post/services/post.service.spec.ts b/src/app/post/services/post.service.spec.ts new file mode 100644 index 000000000..913642b87 --- /dev/null +++ b/src/app/post/services/post.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { PostService } from './post.service'; + +describe('PostService', () => { + let service: PostService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(PostService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts new file mode 100644 index 000000000..cbadae187 --- /dev/null +++ b/src/app/post/services/post.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class PostService { + + constructor() { } +} diff --git a/src/app/post/services/post/post.component.html b/src/app/post/services/post/post.component.html deleted file mode 100644 index 71b500c4d..000000000 --- a/src/app/post/services/post/post.component.html +++ /dev/null @@ -1 +0,0 @@ -<p>post works!</p> diff --git a/src/app/post/services/post/post.component.ts b/src/app/post/services/post/post.component.ts deleted file mode 100644 index ae2acfc6e..000000000 --- a/src/app/post/services/post/post.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-post', - templateUrl: './post.component.html', - styleUrls: ['./post.component.scss'] -}) -export class PostComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} -- GitLab From 4e081f98eb31eef96214bfb8886d112005484fa7 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 26 Feb 2021 17:27:44 +0100 Subject: [PATCH 08/65] feat(post) : feat design card listPost --- .../post-card/post-card.component.html | 16 +++++++++++- .../post-card/post-card.component.scss | 25 +++++++++++++++++++ .../post-card/post-card.component.ts | 13 +++++----- .../post-list/post-list.component.html | 9 +++++-- .../post-list/post-list.component.scss | 3 +++ .../post-list/post-list.component.ts | 21 +++++++++++++--- src/app/post/models/pagination.model.ts | 8 ++++++ src/app/post/models/post.model.ts | 7 ++++++ src/app/post/models/postWithMeta.model.ts | 11 ++++++++ src/app/post/services/post.service.ts | 12 +++++++-- 10 files changed, 110 insertions(+), 15 deletions(-) create mode 100644 src/app/post/models/pagination.model.ts create mode 100644 src/app/post/models/post.model.ts create mode 100644 src/app/post/models/postWithMeta.model.ts diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html index 8d9923984..c73c0f0fa 100644 --- a/src/app/post/components/post-card/post-card.component.html +++ b/src/app/post/components/post-card/post-card.component.html @@ -1 +1,15 @@ -<p>post-card works!</p> +<div fxLayout="column" *ngIf="post" class="post" fxLayoutGap="12px"> + <div fxLayout="row"></div> + <div fxLayout="row" class="title"> + {{ post.title }} + </div> + <div fxLayout="row" class="description"> + {{ post.custom_excerpt }} + </div> + <div fxLayout="column" class="informations"> + <div fxLayout="row"> + {{ post.published_at | date: 'shortDate' }} + </div> + <div fxLayout="row">par auteurICI</div> + </div> +</div> diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index e69de29bb..5c3546ce8 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -0,0 +1,25 @@ +@import '../../../../assets/scss/color'; +@import '../../../../assets/scss/typography'; + +.post { + padding: 24px 6px; + border-bottom: 1px dashed $grey-3; + .title { + @include cn-bold-20; + color: $grey-1; + } + .description { + @include cn-regular-16; + color: $black; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box !important; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .informations { + @include cn-regular-16; + color: $grey-3; + font-style: italic; + } +} diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index 53fa6b42c..a5067fe2c 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -1,15 +1,14 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { Post } from '../../models/post.model'; @Component({ selector: 'app-post-card', templateUrl: './post-card.component.html', - styleUrls: ['./post-card.component.scss'] + styleUrls: ['./post-card.component.scss'], }) export class PostCardComponent implements OnInit { + @Input() post: Post; + constructor() {} - constructor() { } - - ngOnInit(): void { - } - + ngOnInit(): void {} } 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 d0f59b635..4affb6c0a 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -16,8 +16,13 @@ <div fxLayout="row" class="row-border"> <h2>autres actualités</h2> </div> - <div *ngFor="let new of news"> - <app-post-card></app-post-card> + <div fxLayout="row" fxLayoutGap="33px"> + <div fxLayout="column" class="columnPosts"> + <app-post-card [post]="news" *ngFor="let news of leftColumnPosts"></app-post-card> + </div> + <div fxLayout="column" class="columnPosts"> + <app-post-card [post]="news" *ngFor="let news of rightColumnPosts"></app-post-card> + </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 342fced69..379c78857 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -20,6 +20,9 @@ @include cn-bold-28; color: $grey-2; } + .columnPosts { + width: 50%; + } } .project-container { width: 20%; 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 4a013c29a..9fa76c790 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -1,4 +1,7 @@ import { Component, OnInit } from '@angular/core'; +import { Post } from '../../models/post.model'; +import { PostWithMeta } from '../../models/postWithMeta.model'; +import { PostService } from '../../services/post.service'; @Component({ selector: 'app-post-list', @@ -6,9 +9,21 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./post-list.component.scss'], }) export class PostListComponent implements OnInit { - constructor() {} - news = ['', '', '', '', '', '', '', '', '', '']; - ngOnInit(): void {} + constructor(private postService: PostService) {} + news: PostWithMeta; + leftColumnPosts: Post[] = []; + rightColumnPosts: Post[] = []; + ngOnInit(): void { + this.postService.getAllPosts().subscribe((news) => { + news.posts.forEach((val, index) => { + if (index % 2 == 0) { + this.leftColumnPosts.push(val); + } else { + this.rightColumnPosts.push(val); + } + }); + }); + } public publishNews(): void {} } diff --git a/src/app/post/models/pagination.model.ts b/src/app/post/models/pagination.model.ts new file mode 100644 index 000000000..4f9ecaaec --- /dev/null +++ b/src/app/post/models/pagination.model.ts @@ -0,0 +1,8 @@ +export class Pagination { + limit: number; + next: any; + page: number; + pages: number; + prev: any; + total: number; +} diff --git a/src/app/post/models/post.model.ts b/src/app/post/models/post.model.ts new file mode 100644 index 000000000..4f65d0452 --- /dev/null +++ b/src/app/post/models/post.model.ts @@ -0,0 +1,7 @@ +export class Post { + id: number; + published_at: Date; + title: string; + custom_excerpt: string; + feature_image: string; +} diff --git a/src/app/post/models/postWithMeta.model.ts b/src/app/post/models/postWithMeta.model.ts new file mode 100644 index 000000000..b8dcb3578 --- /dev/null +++ b/src/app/post/models/postWithMeta.model.ts @@ -0,0 +1,11 @@ +import { Pagination } from './pagination.model'; +import { Post } from './post.model'; + +export class PostWithMeta { + posts: Post[]; + meta: { pagination: Pagination }; + + constructor(obj?: any) { + Object.assign(this, obj); + } +} diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index cbadae187..903f655f5 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -1,9 +1,17 @@ +import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { PostWithMeta } from '../models/postWithMeta.model'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class PostService { + private readonly baseUrl = 'api/posts'; + constructor(private http: HttpClient) {} - constructor() { } + public getAllPosts(): Observable<PostWithMeta> { + return this.http.get<PostWithMeta>(`${this.baseUrl}`).pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + } } -- GitLab From e64b31e5ca3c7511398a730b629fd2a32d74decd Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Mon, 1 Mar 2021 14:49:30 +0100 Subject: [PATCH 09/65] feat(post) : add img to post + fix request to include tags/author --- .../post-card/post-card.component.html | 8 ++++--- .../post-card/post-card.component.scss | 17 +++++++++++++ .../post-card/post-card.component.ts | 1 + .../post-list/post-list.component.html | 1 + .../post-list/post-list.component.scss | 6 ++++- .../post-list/post-list.component.ts | 9 ++++++- src/app/post/services/post.service.ts | 24 +++++++++++++++++-- 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html index c73c0f0fa..0733c5981 100644 --- a/src/app/post/components/post-card/post-card.component.html +++ b/src/app/post/components/post-card/post-card.component.html @@ -1,5 +1,7 @@ -<div fxLayout="column" *ngIf="post" class="post" fxLayoutGap="12px"> - <div fxLayout="row"></div> +<div fxLayout="column" *ngIf="post" class="post" [ngClass]="class" fxLayoutGap="12px"> + <div fxLayout="row" class="imageContainer" *ngIf="post.feature_image"> + <img class="image" [src]="post.feature_image" /> + </div> <div fxLayout="row" class="title"> {{ post.title }} </div> @@ -10,6 +12,6 @@ <div fxLayout="row"> {{ post.published_at | date: 'shortDate' }} </div> - <div fxLayout="row">par auteurICI</div> + <div fxLayout="row">par {{ post.primary_author.name }}</div> </div> </div> diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index 5c3546ce8..41c9a24e1 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -4,6 +4,23 @@ .post { padding: 24px 6px; border-bottom: 1px dashed $grey-3; + &.bigNew { + border: 0; + .imageContainer { + .image { + object-fit: cover; + height: 360px; + width: 100%; + } + } + } + .imageContainer { + .image { + object-fit: cover; + height: 88px; + width: 195px; + } + } .title { @include cn-bold-20; color: $grey-1; diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index a5067fe2c..e73dd03b3 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -8,6 +8,7 @@ import { Post } from '../../models/post.model'; }) export class PostCardComponent implements OnInit { @Input() post: Post; + @Input() class: string; constructor() {} ngOnInit(): void {} 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 4affb6c0a..4f9694300 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -10,6 +10,7 @@ (action)="publishNews()" ></app-button> </div> + <app-post-card [class]="'bigNew'" [post]="bigNews"></app-post-card> </div> <div fxLayout="column"> 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 379c78857..1f483aca6 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -13,7 +13,11 @@ text-transform: uppercase; } } - +.test { + div { + border: 0; + } +} .list-container { width: 80%; h2 { 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 9fa76c790..9f85d69fc 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -13,8 +13,11 @@ export class PostListComponent implements OnInit { news: PostWithMeta; leftColumnPosts: Post[] = []; rightColumnPosts: Post[] = []; + projectsNew: Post[] = []; + bigNews: Post; ngOnInit(): void { - this.postService.getAllPosts().subscribe((news) => { + this.postService.getPosts().subscribe((news) => { + console.log(news); news.posts.forEach((val, index) => { if (index % 2 == 0) { this.leftColumnPosts.push(val); @@ -23,6 +26,10 @@ export class PostListComponent implements OnInit { } }); }); + this.postService.getPosts(['bignew']).subscribe((news) => { + this.bigNews = news.posts[0]; + console.log(this.bigNews); + }); } public publishNews(): void {} diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index 903f655f5..f530c8e6f 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -11,7 +11,27 @@ export class PostService { private readonly baseUrl = 'api/posts'; constructor(private http: HttpClient) {} - public getAllPosts(): Observable<PostWithMeta> { - return this.http.get<PostWithMeta>(`${this.baseUrl}`).pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + public getAllPostss(): Observable<PostWithMeta> { + return this.http + .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[getting-started,jeremie]`) + .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + } + public getPosts(tags?: string[]): Observable<PostWithMeta> { + if (!tags) { + return this.http + .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors`) + .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + } + let tagsString = ''; + // Transform tab filters to string filters + tags.forEach((tag, index) => { + tagsString += tag; + if (index != tags.length - 1) { + tagsString += ','; + } + }); + return this.http + .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:[${tagsString}]`) + .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); } } -- GitLab From b722802af30ac56c00ea02698b3bc7059701ff55 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 2 Mar 2021 14:53:04 +0100 Subject: [PATCH 10/65] feat(post) : add author + tag --- .../post-card/post-card.component.html | 25 ++++++--- .../post-card/post-card.component.scss | 14 +++++ .../post-card/post-card.component.ts | 30 ++++++++++- .../post-list/post-list.component.html | 6 +++ .../post-list/post-list.component.scss | 6 +-- .../post-list/post-list.component.ts | 23 ++++++-- src/app/post/enum/tagEnum.enum.ts | 9 ++++ src/app/post/models/post.model.ts | 7 ++- src/app/post/models/tag.model.ts | 4 ++ src/app/post/services/post.service.ts | 7 +-- src/assets/post/sprite.svg | 54 +++++++++++++++++++ 11 files changed, 162 insertions(+), 23 deletions(-) create mode 100644 src/app/post/enum/tagEnum.enum.ts create mode 100644 src/app/post/models/tag.model.ts diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html index 0733c5981..3dc507bda 100644 --- a/src/app/post/components/post-card/post-card.component.html +++ b/src/app/post/components/post-card/post-card.component.html @@ -1,17 +1,28 @@ <div fxLayout="column" *ngIf="post" class="post" [ngClass]="class" fxLayoutGap="12px"> - <div fxLayout="row" class="imageContainer" *ngIf="post.feature_image"> - <img class="image" [src]="post.feature_image" /> - </div> - <div fxLayout="row" class="title"> - {{ post.title }} + <div fxLayout="column" fxLayoutGap="4px"> + <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px" *ngIf="getIconOfTag(post.tags[0].slug)"> + <app-svg-icon + [iconClass]="'icon-32'" + [iconColor]="'inherit'" + [type]="'post'" + [icon]="getIconOfTag(post.tags[0].slug)" + ></app-svg-icon> + <span>{{ post.tags[0].name }}</span> + </div> + <div fxLayout="row" class="imageContainer" *ngIf="post.feature_image"> + <img class="image" [src]="post.feature_image" /> + </div> + <div fxLayout="row" class="title"> + {{ post.title }} + </div> </div> <div fxLayout="row" class="description"> - {{ post.custom_excerpt }} + {{ post.excerpt }} </div> <div fxLayout="column" class="informations"> <div fxLayout="row"> {{ post.published_at | date: 'shortDate' }} </div> - <div fxLayout="row">par {{ post.primary_author.name }}</div> + <div fxLayout="row">par {{ post.author }}</div> </div> </div> diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index 41c9a24e1..fd0d45d24 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -21,6 +21,13 @@ width: 195px; } } + .tag { + @include cn-bold-16; + text-transform: uppercase; + color: $secondary-color; + fill: $secondary-color; + stroke: $secondary-color; + } .title { @include cn-bold-20; color: $grey-1; @@ -40,3 +47,10 @@ font-style: italic; } } +.project { + text-align: left; + .imageContainer, + .informations { + display: none !important; + } +} diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index e73dd03b3..317e19c03 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -1,4 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; +import { TagEnum } from '../../enum/tagEnum.enum'; import { Post } from '../../models/post.model'; @Component({ @@ -9,7 +10,34 @@ import { Post } from '../../models/post.model'; export class PostCardComponent implements OnInit { @Input() post: Post; @Input() class: string; + test: string; constructor() {} - ngOnInit(): void {} + ngOnInit(): void { + /*ùif (this.post) { + console.log(this.post); + this.test = this.post.html.replace(/<[^>]*>/g, ''); + }*/ + } + + getIconOfTag(tag: string): string { + switch (tag) { + case TagEnum.aLaUne: + return 'a-la-une'; + case TagEnum.formation: + return 'formationTag'; + case TagEnum.projet: + return 'projetTag'; + case TagEnum.ressource: + return 'ressourceTag'; + case TagEnum.info: + return 'infoTag'; + case TagEnum.etude: + return 'etudeTag'; + case TagEnum.dossier: + return 'dossierTag'; + default: + return null; + } + } } 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 4f9694300..89aef5777 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -32,6 +32,12 @@ <div class="project-content" fxLayout="column"> <app-svg-icon [iconClass]="'icon-80'" [iconColor]="'inherit'" [type]="'post'" [icon]="'project'"></app-svg-icon> <h2>appels à projets</h2> + <app-post-card + [post]="news" + [class]="'project'" + [ngClass]="{ 'last-child': last }" + *ngFor="let news of projectsNew; let last = last" + ></app-post-card> </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 1f483aca6..cf2195aeb 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -13,8 +13,8 @@ text-transform: uppercase; } } -.test { - div { +.last-child { + ::ng-deep .post { border: 0; } } @@ -41,7 +41,7 @@ background: $white; border-radius: 6px; .project-content { - padding: 18px 32px 62px 36px; + padding: 18px 32px 26px 36px; fill: $secondary-color; stroke: $secondary-color; text-align: center; 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 9f85d69fc..bb399cb45 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -10,15 +10,15 @@ import { PostService } from '../../services/post.service'; }) export class PostListComponent implements OnInit { constructor(private postService: PostService) {} - news: PostWithMeta; leftColumnPosts: Post[] = []; rightColumnPosts: Post[] = []; projectsNew: Post[] = []; bigNews: Post; + projectsNews: Post[]; ngOnInit(): void { this.postService.getPosts().subscribe((news) => { - console.log(news); news.posts.forEach((val, index) => { + val = this.addAuthorToPost(val); if (index % 2 == 0) { this.leftColumnPosts.push(val); } else { @@ -26,11 +26,24 @@ export class PostListComponent implements OnInit { } }); }); - this.postService.getPosts(['bignew']).subscribe((news) => { - this.bigNews = news.posts[0]; - console.log(this.bigNews); + this.postService.getPosts(['a-la-une']).subscribe((news) => { + this.bigNews = this.addAuthorToPost(news.posts[0]); + }); + this.postService.getPosts(['appels']).subscribe((news) => { + let projectNews = news.posts; + projectNews.forEach((news) => { + news = this.addAuthorToPost(news); + }); + this.projectsNew = projectNews; }); } public publishNews(): void {} + + //Transform excerpt post to have a custom author. + private addAuthorToPost(post: Post): Post { + post.author = post.excerpt; + post.excerpt = post.html.replace(/<[^>]*>/g, ''); + return post; + } } diff --git a/src/app/post/enum/tagEnum.enum.ts b/src/app/post/enum/tagEnum.enum.ts new file mode 100644 index 000000000..de26cf710 --- /dev/null +++ b/src/app/post/enum/tagEnum.enum.ts @@ -0,0 +1,9 @@ +export enum TagEnum { + aLaUne = 'a-la-une', + formation = 'formations', + projet = 'projets', + ressource = 'ressources', + info = 'infos', + etude = 'etudes', + dossier = 'dossiers', +} diff --git a/src/app/post/models/post.model.ts b/src/app/post/models/post.model.ts index 4f65d0452..53efadc33 100644 --- a/src/app/post/models/post.model.ts +++ b/src/app/post/models/post.model.ts @@ -1,7 +1,12 @@ +import { Tag } from './tag.model'; + export class Post { id: number; published_at: Date; title: string; - custom_excerpt: string; + excerpt: string; feature_image: string; + html: string; + author: string; + tags: Tag[]; } diff --git a/src/app/post/models/tag.model.ts b/src/app/post/models/tag.model.ts new file mode 100644 index 000000000..df72a66b1 --- /dev/null +++ b/src/app/post/models/tag.model.ts @@ -0,0 +1,4 @@ +export class Tag { + name: string; + slug: string; +} diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index f530c8e6f..848e6a58e 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -11,15 +11,10 @@ export class PostService { private readonly baseUrl = 'api/posts'; constructor(private http: HttpClient) {} - public getAllPostss(): Observable<PostWithMeta> { - return this.http - .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[getting-started,jeremie]`) - .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); - } public getPosts(tags?: string[]): Observable<PostWithMeta> { if (!tags) { return this.http - .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors`) + .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[appels,a-la-une]`) .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); } let tagsString = ''; diff --git a/src/assets/post/sprite.svg b/src/assets/post/sprite.svg index 9c8181e25..5e60b294b 100644 --- a/src/assets/post/sprite.svg +++ b/src/assets/post/sprite.svg @@ -8,4 +8,58 @@ <path fill-rule="evenodd" clip-rule="evenodd" d="M63.6036 39.4919C64.0749 38.3867 65.353 37.8728 66.4582 38.3441L75.7969 42.3267C76.9021 42.798 77.416 44.076 76.9447 45.1812C76.4734 46.2864 75.1953 46.8003 74.0901 46.329L64.7514 42.3464C63.6462 41.8751 63.1323 40.5971 63.6036 39.4919Z" stroke="none"/> </symbol> +<symbol id="projetTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<mask id="path-1-inside-1" fill="white"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M4 7C4 5.34315 5.34315 4 7 4C8.65685 4 10 5.34315 10 7V24C10 25.6569 8.65685 27 7 27C5.34315 27 4 25.6569 4 24V7ZM7 26C8.10457 26 9 25.1046 9 24C9 22.8954 8.10457 22 7 22C5.89543 22 5 22.8954 5 24C5 25.1046 5.89543 26 7 26Z"/> +</mask> +<path d="M7 3C4.79086 3 3 4.79086 3 7H5C5 5.89543 5.89543 5 7 5V3ZM11 7C11 4.79086 9.20914 3 7 3V5C8.10457 5 9 5.89543 9 7H11ZM11 24V7H9V24H11ZM7 28C9.20914 28 11 26.2091 11 24H9C9 25.1046 8.10457 26 7 26V28ZM3 24C3 26.2091 4.79086 28 7 28V26C5.89543 26 5 25.1046 5 24H3ZM3 7V24H5V7H3ZM8 24C8 24.5523 7.55228 25 7 25V27C8.65685 27 10 25.6569 10 24H8ZM7 23C7.55228 23 8 23.4477 8 24H10C10 22.3431 8.65685 21 7 21V23ZM6 24C6 23.4477 6.44771 23 7 23V21C5.34315 21 4 22.3431 4 24H6ZM7 25C6.44772 25 6 24.5523 6 24H4C4 25.6569 5.34315 27 7 27V25Z" stroke="none" mask="url(#path-1-inside-1)"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M7 27H10L24 7H25.5L11.5 27H14L27.5 8L28 9.5L15.5 27H18L27.5 14L28 15.5L19.5 27H22L27.5 19.5L28 21L23.5 27H28V21V15.5V9.5V6H9.82929C9.93985 6.31278 10 6.64936 10 7V9L11.5 7H13L10 11.0909V14.4412L15.5 7H17L10 16.5789V21.0909L20 7H21.5L10 23.56V24C10 25.6569 8.65685 27 7 27Z" stroke="none"/> +<path d="M7 27H28V6.5H9.95852C9.9858 6.6626 10 6.82964 10 7V7.5H27V26H9.23611C8.68679 26.6137 7.8885 27 7 27Z" stroke="none"/> +<path d="M9 24C9 25.1046 8.10457 26 7 26C5.89543 26 5 25.1046 5 24C5 22.8954 5.89543 22 7 22C8.10457 22 9 22.8954 9 24Z" stroke="none"/> +</symbol> + +<symbol id="ressourceTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<path d="M3.5 25V13.0495C7.32281 13.9728 11.7651 14.5 16.5 14.5C20.828 14.5 24.9112 14.0595 28.5 13.2789V25C28.5 25.2761 28.2761 25.5 28 25.5H4C3.72386 25.5 3.5 25.2761 3.5 25Z" fill="none"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M20 6H13V8H20V6ZM13 4C11.8954 4 11 4.89543 11 6V9H22V6C22 4.89543 21.1046 4 20 4H13Z" stroke="none"/> +<path d="M28.5 13.2602C27.6168 13.4803 26.8068 13.7326 26.0024 13.9831L25.9955 13.9852C24.3831 14.4874 22.7659 14.9905 20.5 15.2722V15C20.5 14.1716 19.8284 13.5 19 13.5H14C13.1716 13.5 12.5 14.1716 12.5 15V15.2709C9.84798 14.949 7.85358 14.3349 5.87723 13.7256L5.87212 13.724C5.09326 13.4839 4.31292 13.2433 3.5 13.0242V9C3.5 8.72386 3.72386 8.5 4 8.5H28C28.2761 8.5 28.5 8.72386 28.5 9V13.2602Z"/> +<path d="M3 13.4095C3.7817 13.6107 4.59178 13.795 5.42722 13.9611L3 17.4286V13.4095Z" stroke="none"/> +<path d="M29 13.6541V16L22 26L18.5 26L26.8278 14.1031C27.5713 13.9674 28.296 13.8174 29 13.6541Z" stroke="none"/> +<path d="M29 18.1429V23.1429L27 26H23.5L29 18.1429Z" stroke="none"/> +<path d="M28.7003 25.7138C28.788 25.6278 28.8598 25.5259 28.9112 25.4126L28.7003 25.7138Z" stroke="none"/> +<path d="M21.3318 14.8118C22.6365 14.7087 23.9059 14.5647 25.1318 14.3832L17 26H13.5L19.1037 17.9947C19.6073 17.9428 20 17.5173 20 17V16.7143L21.3318 14.8118Z" stroke="none"/> +<path d="M17.6 18L12 26H8.50001L14.1 18H17.6Z" stroke="none"/> +<path d="M13.0602 17.3426L7.00001 26H4C3.84543 26 3.69905 25.9649 3.56839 25.9023L11.35 14.7858C11.8954 14.8318 12.4472 14.8707 13.0047 14.9022C13.0016 14.9344 13 14.967 13 15V17C13 17.1203 13.0213 17.2357 13.0602 17.3426Z" stroke="none"/> +<path d="M6.75572 14.2061C7.78653 14.3818 8.8514 14.5304 9.94511 14.6498L3 24.5714V19.5714L6.75572 14.2061Z" stroke="none"/> +<rect x="13.5" y="14.5" width="6" height="3" rx="0.5" fill="none"/> +</symbol> + +<symbol id="infoTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<path d="M23 25.5H9.44949C10.0978 24.8647 10.5 23.9793 10.5 23V5.5H25.5V23C25.5 24.3807 24.3807 25.5 23 25.5Z" fill="none"/> +<rect x="12" y="16" width="12" height="1" rx="0.5" stroke="none"/> +<rect x="12" y="19" width="12" height="1" rx="0.5" stroke="none"/> +<rect x="12" y="22" width="12" height="1" rx="0.5" stroke="none"/> +<rect x="12" y="8" width="12" height="6" rx="1" stroke="none"/> +<path d="M11 12V13.5L5.00001 20.5V17.2273L9.60001 12H11Z" stroke="none"/> +<path d="M5.00001 22.5V22.2273L11 15.4091L11 18.5L6 24.5C5.48214 24.0507 5.00001 23.1722 5.00001 22.5Z" stroke="none"/> +<path d="M7.06819 24.8771C7.36151 24.9569 7.67471 25 8.00001 25C9.65686 25 11 23.8807 11 22.5V20.4091L7.06819 24.8771Z" stroke="none"/> +<path d="M8 12H5.00001L5 15.5L8 12Z" stroke="none"/> +<path d="M5.5 12.5H10.5V23C10.5 24.3807 9.38071 25.5 8 25.5C6.61929 25.5 5.5 24.3807 5.5 23V12.5Z" fill="none"/> +</symbol> + +<symbol id="formationTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M3 28V24.4C3 22.1088 4.1007 20.0762 5.79995 18.7998C4.80938 17.7598 4.2 16.3513 4.2 14.8C4.2 11.5967 6.79675 9 10 9C13.2033 9 15.8 11.5967 15.8 14.8C15.8 16.3513 15.1906 17.7598 14.2001 18.7998C15.8993 20.0762 17 22.1088 17 24.4V28H3ZM13.4307 19.4769C13.1256 19.2639 12.7998 19.0785 12.4568 18.9244C12.7774 18.7331 13.0738 18.5054 13.3403 18.2471C14.2405 17.3746 14.8 16.1527 14.8 14.8C14.8 12.149 12.651 10 10 10C7.34903 10 5.2 12.149 5.2 14.8C5.2 16.1527 5.75951 17.3746 6.65971 18.2471C6.92623 18.5054 7.2226 18.7331 7.54316 18.9244C7.20024 19.0785 6.87441 19.2639 6.56931 19.4769C5.01609 20.5613 4 22.362 4 24.4V27H16V24.4C16 22.362 14.9839 20.5613 13.4307 19.4769Z" stroke="none"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M2 6H30V22H16.5777C16.3879 21.4799 16.1381 20.9887 15.8369 20.5348L25.6379 7H24.1379L15.0488 19.5516C14.7868 19.2788 14.503 19.0273 14.2001 18.7998C15.1906 17.7598 15.8 16.3513 15.8 14.8C15.8 14.4589 15.7705 14.1246 15.7141 13.7996L20.6379 7H19.1379L15.2607 12.3543C14.8403 11.4515 14.1943 10.675 13.3952 10.0971L15.6379 7H14.1379L12.3353 9.48933C11.6208 9.17468 10.8308 9 10 9C9.70926 9 9.42352 9.02139 9.14426 9.06269L10.6379 7H9.13793L7.14742 9.74881C5.70291 10.5663 4.64387 11.9856 4.3108 13.666L3 15.4762V17.5476L4.28201 15.7772C4.46929 16.8805 4.96816 17.8775 5.68402 18.6744L5.28319 19.228C4.45784 19.9811 3.81311 20.9293 3.4223 22H2V6ZM29 7.19048V9.2619L20.5 21H19L29 7.19048ZM25.5 21H24L29 14.0952V16.1667L25.5 21ZM5.63793 7L3 10.6429V8.57143L4.13793 7H5.63793Z" stroke="none"/> +</symbol> + +<symbol id="etudeTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<path d="M27.722 26.2329L22.4916 21.0959C24.0154 19.2877 24.9215 16.9452 24.9215 14.4384C24.8803 8.68493 20.2265 4 14.4607 4C8.69498 4 4 8.68493 4 14.4384C4 20.1918 8.69498 24.8767 14.4607 24.8767C16.9318 24.8767 19.2381 24.0137 21.009 22.5753L26.2394 27.7123C26.4453 27.9178 26.6924 28 26.9807 28C27.2278 28 27.5161 27.9178 27.722 27.7123C28.0927 27.3014 28.0927 26.6438 27.722 26.2329ZM6.0592 14.4384C6.0592 9.79452 9.80695 6.05479 14.4607 6.05479C19.1145 6.05479 22.8623 9.79452 22.8623 14.4384C22.8623 19.0822 19.1145 22.8219 14.4607 22.8219C9.80695 22.8219 6.0592 19.0411 6.0592 14.4384Z" stroke="none"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M14.7457 5.3282C14.0022 5.11446 13.2157 5 12.4015 5C12.2296 5 12.0588 5.00511 11.8895 5.01518L10.4509 6.97689C11.5862 6.37483 12.878 6.02499 14.2521 6.00129L14.7457 5.3282ZM13.0585 7.62894C9.87909 8.24863 7.5 11.0292 7.5 14.3836C7.5 14.6426 7.51448 14.8985 7.5427 15.1504L13.0585 7.62894ZM7.97683 16.8961L14.8566 7.51456C15.8686 7.57953 16.8194 7.85975 17.6638 8.30994L9.59266 19.316C8.89414 18.6378 8.33923 17.8141 7.97683 16.8961ZM6.34942 16.7776C6.12204 16.018 6 15.2141 6 14.3836C6 13.8626 6.04717 13.353 6.13749 12.8588L4.25314 15.4284C4.49144 16.3727 4.89089 17.2551 5.42099 18.0437L6.34942 16.7776ZM6.96335 18.2781C7.41071 19.1257 7.99942 19.8888 8.69862 20.5352L8.49887 20.8076C7.68288 20.3787 6.94656 19.8199 6.31708 19.1594L6.96335 18.2781ZM17.141 6.45253C16.8055 6.22416 16.4523 6.01946 16.084 5.84081L15.874 6.12727C16.3089 6.20341 16.7322 6.31273 17.141 6.45253ZM13.3275 21.1841C12.3621 21.0332 11.464 20.6823 10.6762 20.1762L18.8131 9.08041C19.5054 9.65324 20.0826 10.359 20.5064 11.159C20.5221 11.2167 20.5373 11.2746 20.5518 11.3328L13.3275 21.1841ZM21.157 12.9614C21.2528 13.4201 21.3031 13.8957 21.3031 14.3836C21.3031 17.9947 18.5458 20.9409 15.0011 21.2418L21.157 12.9614ZM9.9145 5.37067C6.48201 6.42403 4 9.60441 4 13.3836L4.00016 13.4357L9.9145 5.37067Z" stroke="none"/> +</symbol> + +<symbol id="dossierTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M2 9C2 7.89543 2.89543 7 4 7H8C9.10457 7 10 7.89543 10 9V10H27C27.5523 10 28 10.4477 28 11V13H6.32973C5.84861 13 5.43568 13.3426 5.34691 13.8155L3.28171 24.8155C3.16616 25.431 3.63831 26 4.26454 26H3C2.44772 26 2 25.5523 2 25V9Z" stroke="none"/> +<path d="M5.72708 13.8721C5.78513 13.6528 5.98357 13.5 6.21044 13.5H29.1416C29.4697 13.5 29.7089 13.8107 29.6249 14.1279L26.7136 25.1279C26.6555 25.3472 26.4571 25.5 26.2302 25.5H3.2991C2.97097 25.5 2.73179 25.1893 2.81574 24.8721L5.72708 13.8721Z" fill="none"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M29.2607 17.2341L30.049 14.2559C30.1737 13.7846 29.9418 13.3205 29.5453 13.113L20.8378 26H23.3378L29.2607 17.2341ZM24.8378 26H26.1709C26.6247 26 27.0215 25.6945 27.1376 25.2559L28.2948 20.8837L24.8378 26ZM25.6216 13H28.1216L19.3378 26H16.8378L25.6216 13ZM24.1216 13H21.6216L12.8378 26H15.3378L24.1216 13ZM17.6216 13H20.1216L11.3378 26H8.83784L17.6216 13ZM16.1216 13H13.6216L4.83784 26H7.33784L16.1216 13ZM9.62162 13H12.1216L3.33784 26H3.20521C2.57898 26 2.10683 25.431 2.22239 24.8155L2.44717 23.6182L9.62162 13ZM8.12162 13H5.27041C5.26124 13 5.2521 13.0001 5.24299 13.0004L4.13187 14.6448L3.02434 20.544L8.12162 13Z" stroke="none"/> +</symbol> + </svg> -- GitLab From 2a63fd5752ad2ff88cb13f2122d6c1dabd8ccddd Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 2 Mar 2021 15:35:40 +0100 Subject: [PATCH 11/65] feat(post) : clean code --- src/app/post/components/post-card/post-card.component.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index 317e19c03..2233a51ae 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -13,12 +13,7 @@ export class PostCardComponent implements OnInit { test: string; constructor() {} - ngOnInit(): void { - /*ùif (this.post) { - console.log(this.post); - this.test = this.post.html.replace(/<[^>]*>/g, ''); - }*/ - } + ngOnInit(): void {} getIconOfTag(tag: string): string { switch (tag) { -- GitLab From e13b299a239c03e0c9a5f6006c9a07dc3f59aefe Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 2 Mar 2021 16:12:42 +0100 Subject: [PATCH 12/65] feat(post) : fix responsive mobile --- .../post-card/post-card.component.scss | 15 +++++++- .../post-list/post-list.component.html | 19 +++++++++- .../post-list/post-list.component.scss | 38 +++++++++++++++++++ .../post-list/post-list.component.ts | 5 ++- 4 files changed, 73 insertions(+), 4 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index fd0d45d24..59ab4c38b 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -1,8 +1,9 @@ @import '../../../../assets/scss/color'; @import '../../../../assets/scss/typography'; +@import '../../../../assets/scss/breakpoint'; .post { - padding: 24px 6px; + padding: 16px 0px; border-bottom: 1px dashed $grey-3; &.bigNew { border: 0; @@ -11,6 +12,9 @@ object-fit: cover; height: 360px; width: 100%; + @media #{$large-phone} { + height: 147px; + } } } } @@ -19,6 +23,9 @@ object-fit: cover; height: 88px; width: 195px; + @media #{$large-phone} { + height: 70px; + } } } .tag { @@ -29,10 +36,16 @@ stroke: $secondary-color; } .title { + @media #{$large-phone} { + @include cn-bold-18; + } @include cn-bold-20; color: $grey-1; } .description { + @media #{$large-phone} { + display: none !important; + } @include cn-regular-16; color: $black; overflow: hidden; 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 89aef5777..c6dda1250 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -12,7 +12,19 @@ </div> <app-post-card [class]="'bigNew'" [post]="bigNews"></app-post-card> </div> - + <div fxLayout="column" fxLayoutAlign=" center" class="project-container mobile"> + <div class="background-project-container"> + <div class="project-content mobile" fxLayout="column"> + <h2>appels à projets</h2> + <app-post-card + [post]="news" + [class]="'project'" + [ngClass]="{ 'last-child': last }" + *ngFor="let news of projectsNew; let last = last" + ></app-post-card> + </div> + </div> + </div> <div fxLayout="column"> <div fxLayout="row" class="row-border"> <h2>autres actualités</h2> @@ -24,10 +36,13 @@ <div fxLayout="column" class="columnPosts"> <app-post-card [post]="news" *ngFor="let news of rightColumnPosts"></app-post-card> </div> + <div fxLayout="column" class="columnPostsMobile"> + <app-post-card [post]="news" *ngFor="let news of postsMobileView"></app-post-card> + </div> </div> </div> </div> - <div fxLayout="column" fxLayoutAlign=" center" class="project-container"> + <div fxLayout="column" fxLayoutAlign=" center" class="project-container desktop"> <div class="background-project-container"> <div class="project-content" fxLayout="column"> <app-svg-icon [iconClass]="'icon-80'" [iconColor]="'inherit'" [type]="'post'" [icon]="'project'"></app-svg-icon> 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 cf2195aeb..1a579dc6f 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -1,6 +1,7 @@ @import '../../../../assets/scss/color'; @import '../../../../assets/scss/typography'; @import '../../../../assets/scss/shapes'; +@import '../../../../assets/scss/breakpoint'; .section-container { background: $grey-6; @@ -19,16 +20,43 @@ } } .list-container { + @media #{$tablet} { + width: 100%; + } width: 80%; h2 { + @media #{$large-phone} { + @include cn-bold-22; + } @include cn-bold-28; color: $grey-2; } .columnPosts { + @media #{$large-phone} { + display: none !important; + } width: 50%; } + .columnPostsMobile { + display: none !important; + @media #{$large-phone} { + display: flex !important; + } + } } .project-container { + &.desktop { + @media #{$tablet} { + display: none !important; + } + } + &.mobile { + display: none !important; + @media #{$tablet} { + display: flex !important; + width: 100%; + } + } width: 20%; height: 100%; min-width: 306px; @@ -41,13 +69,23 @@ background: $white; border-radius: 6px; .project-content { + @media #{$large-phone} { + padding: 10px 32px 0px 36px; + } padding: 18px 32px 26px 36px; fill: $secondary-color; stroke: $secondary-color; + &.mobile { + text-align: left; + } text-align: center; h2 { + @media #{$large-phone} { + @include cn-bold-22; + } @include cn-bold-26; color: $secondary-color; + margin-bottom: 0; } } } 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 bb399cb45..5b95ba4f8 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -10,15 +10,18 @@ import { PostService } from '../../services/post.service'; }) export class PostListComponent implements OnInit { constructor(private postService: PostService) {} + postsMobileView: Post[] = []; leftColumnPosts: Post[] = []; rightColumnPosts: Post[] = []; projectsNew: Post[] = []; bigNews: Post; - projectsNews: Post[]; + ngOnInit(): void { this.postService.getPosts().subscribe((news) => { news.posts.forEach((val, index) => { val = this.addAuthorToPost(val); + this.postsMobileView.push(val); + if (index % 2 == 0) { this.leftColumnPosts.push(val); } else { -- GitLab From 7a46b6ae5c789b1b84c95256b50e509493143e9e Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 2 Mar 2021 16:58:01 +0100 Subject: [PATCH 13/65] fix(post) : fix routing lazy --- .../post-card/post-card.component.html | 2 +- .../post-card/post-card.component.scss | 3 ++- .../post-card/post-card.component.ts | 13 ++++++------- .../post-details/post-details.component.ts | 11 ++++++----- src/app/post/post-routing.module.ts | 19 ++++++++++++++++++- src/app/post/post.component.html | 2 +- src/assets/scss/_color.scss | 2 +- 7 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html index 3dc507bda..1f223f021 100644 --- a/src/app/post/components/post-card/post-card.component.html +++ b/src/app/post/components/post-card/post-card.component.html @@ -1,4 +1,4 @@ -<div fxLayout="column" *ngIf="post" class="post" [ngClass]="class" fxLayoutGap="12px"> +<div fxLayout="column" *ngIf="post" class="post" [ngClass]="class" fxLayoutGap="12px" (click)="showDetails(post)"> <div fxLayout="column" fxLayoutGap="4px"> <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px" *ngIf="getIconOfTag(post.tags[0].slug)"> <app-svg-icon diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index fd0d45d24..c4213f621 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -2,7 +2,8 @@ @import '../../../../assets/scss/typography'; .post { - padding: 24px 6px; + cursor: pointer; + margin: 24px 6px; border-bottom: 1px dashed $grey-3; &.bigNew { border: 0; diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index 317e19c03..24d4c1787 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -1,4 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; import { TagEnum } from '../../enum/tagEnum.enum'; import { Post } from '../../models/post.model'; @@ -11,14 +12,9 @@ export class PostCardComponent implements OnInit { @Input() post: Post; @Input() class: string; test: string; - constructor() {} + constructor(private router: Router) {} - ngOnInit(): void { - /*ùif (this.post) { - console.log(this.post); - this.test = this.post.html.replace(/<[^>]*>/g, ''); - }*/ - } + ngOnInit(): void {} getIconOfTag(tag: string): string { switch (tag) { @@ -40,4 +36,7 @@ export class PostCardComponent implements OnInit { return null; } } + public showDetails(post: Post): void { + this.router.navigateByUrl('posts/details/' + post.id); + } } diff --git a/src/app/post/components/post-details/post-details.component.ts b/src/app/post/components/post-details/post-details.component.ts index adf283aa1..4cfba29e6 100644 --- a/src/app/post/components/post-details/post-details.component.ts +++ b/src/app/post/components/post-details/post-details.component.ts @@ -1,15 +1,16 @@ import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-post-details', templateUrl: './post-details.component.html', - styleUrls: ['./post-details.component.scss'] + styleUrls: ['./post-details.component.scss'], }) export class PostDetailsComponent implements OnInit { - - constructor() { } - + constructor(private activatedRoute: ActivatedRoute) {} + postId: string; ngOnInit(): void { + this.postId = this.activatedRoute.snapshot.paramMap.get('id'); + console.log(this.postId); } - } diff --git a/src/app/post/post-routing.module.ts b/src/app/post/post-routing.module.ts index 2ec94d598..f8f06e2dd 100644 --- a/src/app/post/post-routing.module.ts +++ b/src/app/post/post-routing.module.ts @@ -1,8 +1,25 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; +import { PostDetailsComponent } from './components/post-details/post-details.component'; +import { PostListComponent } from './components/post-list/post-list.component'; import { PostComponent } from './post.component'; -const routes: Routes = [{ path: '', component: PostComponent }]; +const routes: Routes = [ + { + path: '', + component: PostComponent, + children: [ + { + path: '', + component: PostListComponent, + }, + { + path: 'details/:id', + component: PostDetailsComponent, + }, + ], + }, +]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/post/post.component.html b/src/app/post/post.component.html index 2ea36328d..8fe7258a1 100644 --- a/src/app/post/post.component.html +++ b/src/app/post/post.component.html @@ -1,2 +1,2 @@ <app-post-header></app-post-header> -<app-post-list></app-post-list> +<router-outlet></router-outlet> diff --git a/src/assets/scss/_color.scss b/src/assets/scss/_color.scss index 75dd41e99..7b72d6a99 100644 --- a/src/assets/scss/_color.scss +++ b/src/assets/scss/_color.scss @@ -7,7 +7,7 @@ $grey-1: #333333; $grey-2: #4f4f4f; $grey-3: #828282; $grey-4: #bdbdbd; -$grey-6: #f2f2f2; +$grey-6: #f8f8f8; /* form colors */ $green-1: #47c562; /* Status colors */ -- GitLab From f5cdd44439315da01cb40c310be7a10b7519fe2a Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 2 Mar 2021 17:46:01 +0100 Subject: [PATCH 14/65] feat(post) : add service + logic call api + display post details --- .../post-card/post-card.component.ts | 2 +- .../post-details/post-details.component.html | 6 ++++- .../post-details/post-details.component.ts | 23 +++++++++++++++---- src/app/post/models/post.model.ts | 4 ++++ src/app/post/services/post.service.ts | 7 ++++++ 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index 24d4c1787..b571eff00 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -37,6 +37,6 @@ export class PostCardComponent implements OnInit { } } public showDetails(post: Post): void { - this.router.navigateByUrl('posts/details/' + post.id); + this.router.navigateByUrl('posts/details/' + post.id, { state: { data: post } }); } } diff --git a/src/app/post/components/post-details/post-details.component.html b/src/app/post/components/post-details/post-details.component.html index 11f24be81..4f39ba1e6 100644 --- a/src/app/post/components/post-details/post-details.component.html +++ b/src/app/post/components/post-details/post-details.component.html @@ -1 +1,5 @@ -<p>post-details works!</p> +<div *ngIf="post"> + <h2>{{ post.title }}</h2> +</div> + +<button (click)="backToPosts()">Retour</button> diff --git a/src/app/post/components/post-details/post-details.component.ts b/src/app/post/components/post-details/post-details.component.ts index 4cfba29e6..ce30a2537 100644 --- a/src/app/post/components/post-details/post-details.component.ts +++ b/src/app/post/components/post-details/post-details.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Post } from '../../models/post.model'; +import { PostService } from '../../services/post.service'; @Component({ selector: 'app-post-details', @@ -7,10 +9,21 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./post-details.component.scss'], }) export class PostDetailsComponent implements OnInit { - constructor(private activatedRoute: ActivatedRoute) {} - postId: string; + constructor(private activatedRoute: ActivatedRoute, private router: Router, private postService: PostService) {} + post: Post; ngOnInit(): void { - this.postId = this.activatedRoute.snapshot.paramMap.get('id'); - console.log(this.postId); + if (history.state.data) { + this.post = new Post(history.state.data); + } else { + const postId = this.activatedRoute.snapshot.paramMap.get('id'); + this.postService.getPost(postId).subscribe((post) => { + this.post = post.posts[0]; + console.log(this.post); + }); + } + } + + public backToPosts(): void { + this.router.navigateByUrl('/posts'); } } diff --git a/src/app/post/models/post.model.ts b/src/app/post/models/post.model.ts index 53efadc33..604f43995 100644 --- a/src/app/post/models/post.model.ts +++ b/src/app/post/models/post.model.ts @@ -9,4 +9,8 @@ export class Post { html: string; author: string; tags: Tag[]; + + constructor(obj?: any) { + Object.assign(this, obj); + } } diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index 848e6a58e..c5f3841bc 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { Post } from '../models/post.model'; import { PostWithMeta } from '../models/postWithMeta.model'; @Injectable({ @@ -11,6 +12,12 @@ export class PostService { private readonly baseUrl = 'api/posts'; constructor(private http: HttpClient) {} + public getPost(idPost: string): Observable<PostWithMeta> { + return this.http + .get<PostWithMeta>(`${this.baseUrl}/` + idPost) + .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + } + public getPosts(tags?: string[]): Observable<PostWithMeta> { if (!tags) { return this.http -- GitLab From 0986af8d32a606cd2aa171b2837e9a69d3f1b259 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 13:47:03 +0100 Subject: [PATCH 15/65] feat(post) : fix margin --- .../components/post-details/post-details.component.html | 8 ++++---- .../post/components/post-list/post-list.component.html | 2 +- src/app/post/post.component.html | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/post/components/post-details/post-details.component.html b/src/app/post/components/post-details/post-details.component.html index 4f39ba1e6..6e675f19f 100644 --- a/src/app/post/components/post-details/post-details.component.html +++ b/src/app/post/components/post-details/post-details.component.html @@ -1,5 +1,5 @@ -<div *ngIf="post"> - <h2>{{ post.title }}</h2> +<div *ngIf="post" fxLayout="column"> + <div fxLayout="row" (click)="backToPosts()"> + <span>Retour à la liste d'acutalités</span> + </div> </div> - -<button (click)="backToPosts()">Retour</button> 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 89aef5777..ced43f84e 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -1,4 +1,4 @@ -<div class="section-container" fxLayout="row" fxLayoutGap="32px"> +<div fxLayout="row" fxLayoutGap="32px"> <div fxLayout="column" class="list-container"> <div fxLayout="column"> <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> diff --git a/src/app/post/post.component.html b/src/app/post/post.component.html index 8fe7258a1..ba58f058b 100644 --- a/src/app/post/post.component.html +++ b/src/app/post/post.component.html @@ -1,2 +1,4 @@ <app-post-header></app-post-header> -<router-outlet></router-outlet> +<div class="section-container"> + <router-outlet></router-outlet> +</div> -- GitLab From 27a44d05a22a14f6a16405d8705145c800484fde Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 13:51:38 +0100 Subject: [PATCH 16/65] Merge branch 'feat/posts-list' into feat/post-details --- .../post-card/post-card.component.scss | 15 ++++- .../post-details/post-details.component.html | 6 ++ .../post-list/post-list.component.html | 19 ++++++- .../post-list/post-list.component.scss | 56 +++++++++++++++---- .../post-list/post-list.component.ts | 5 +- 5 files changed, 87 insertions(+), 14 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index c4213f621..3a3b82358 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -1,9 +1,10 @@ @import '../../../../assets/scss/color'; @import '../../../../assets/scss/typography'; +@import '../../../../assets/scss/breakpoint'; .post { cursor: pointer; - margin: 24px 6px; + padding: 16px 0px; border-bottom: 1px dashed $grey-3; &.bigNew { border: 0; @@ -12,6 +13,9 @@ object-fit: cover; height: 360px; width: 100%; + @media #{$large-phone} { + height: 147px; + } } } } @@ -20,6 +24,9 @@ object-fit: cover; height: 88px; width: 195px; + @media #{$large-phone} { + height: 70px; + } } } .tag { @@ -30,10 +37,16 @@ stroke: $secondary-color; } .title { + @media #{$large-phone} { + @include cn-bold-18; + } @include cn-bold-20; color: $grey-1; } .description { + @media #{$large-phone} { + display: none !important; + } @include cn-regular-16; color: $black; overflow: hidden; diff --git a/src/app/post/components/post-details/post-details.component.html b/src/app/post/components/post-details/post-details.component.html index 6e675f19f..61ca17c2f 100644 --- a/src/app/post/components/post-details/post-details.component.html +++ b/src/app/post/components/post-details/post-details.component.html @@ -2,4 +2,10 @@ <div fxLayout="row" (click)="backToPosts()"> <span>Retour à la liste d'acutalités</span> </div> + <app-post-card + [post]="news" + [class]="'project'" + [ngClass]="{ 'last-child': last }" + *ngFor="let news of projectsNew; let last = last" + ></app-post-card> </div> 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 ced43f84e..7667e30b4 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -12,7 +12,19 @@ </div> <app-post-card [class]="'bigNew'" [post]="bigNews"></app-post-card> </div> - + <div fxLayout="column" fxLayoutAlign=" center" class="project-container mobile"> + <div class="background-project-container"> + <div class="project-content mobile" fxLayout="column"> + <h2>appels à projets</h2> + <app-post-card + [post]="news" + [class]="'project'" + [ngClass]="{ 'last-child': last }" + *ngFor="let news of projectsNew; let last = last" + ></app-post-card> + </div> + </div> + </div> <div fxLayout="column"> <div fxLayout="row" class="row-border"> <h2>autres actualités</h2> @@ -24,10 +36,13 @@ <div fxLayout="column" class="columnPosts"> <app-post-card [post]="news" *ngFor="let news of rightColumnPosts"></app-post-card> </div> + <div fxLayout="column" class="columnPostsMobile"> + <app-post-card [post]="news" *ngFor="let news of postsMobileView"></app-post-card> + </div> </div> </div> </div> - <div fxLayout="column" fxLayoutAlign=" center" class="project-container"> + <div fxLayout="column" fxLayoutAlign=" center" class="project-container desktop"> <div class="background-project-container"> <div class="project-content" fxLayout="column"> <app-svg-icon [iconClass]="'icon-80'" [iconColor]="'inherit'" [type]="'post'" [icon]="'project'"></app-svg-icon> 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 cf2195aeb..92e3cf584 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -1,34 +1,60 @@ @import '../../../../assets/scss/color'; @import '../../../../assets/scss/typography'; @import '../../../../assets/scss/shapes'; +@import '../../../../assets/scss/breakpoint'; -.section-container { - background: $grey-6; - .row-border { - border-bottom: 1px dashed $grey-4; - margin: 16px 0; - } - h2 { - font-style: italic !important; - text-transform: uppercase; - } +.row-border { + border-bottom: 1px dashed $grey-4; + margin: 16px 0; } +h2 { + font-style: italic !important; + text-transform: uppercase; +} + .last-child { ::ng-deep .post { border: 0; } } .list-container { + @media #{$tablet} { + width: 100%; + } width: 80%; h2 { + @media #{$large-phone} { + @include cn-bold-22; + } @include cn-bold-28; color: $grey-2; } .columnPosts { + @media #{$large-phone} { + display: none !important; + } width: 50%; } + .columnPostsMobile { + display: none !important; + @media #{$large-phone} { + display: flex !important; + } + } } .project-container { + &.desktop { + @media #{$tablet} { + display: none !important; + } + } + &.mobile { + display: none !important; + @media #{$tablet} { + display: flex !important; + width: 100%; + } + } width: 20%; height: 100%; min-width: 306px; @@ -41,13 +67,23 @@ background: $white; border-radius: 6px; .project-content { + @media #{$large-phone} { + padding: 10px 32px 0px 36px; + } padding: 18px 32px 26px 36px; fill: $secondary-color; stroke: $secondary-color; + &.mobile { + text-align: left; + } text-align: center; h2 { + @media #{$large-phone} { + @include cn-bold-22; + } @include cn-bold-26; color: $secondary-color; + margin-bottom: 0; } } } 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 bb399cb45..5b95ba4f8 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -10,15 +10,18 @@ import { PostService } from '../../services/post.service'; }) export class PostListComponent implements OnInit { constructor(private postService: PostService) {} + postsMobileView: Post[] = []; leftColumnPosts: Post[] = []; rightColumnPosts: Post[] = []; projectsNew: Post[] = []; bigNews: Post; - projectsNews: Post[]; + ngOnInit(): void { this.postService.getPosts().subscribe((news) => { news.posts.forEach((val, index) => { val = this.addAuthorToPost(val); + this.postsMobileView.push(val); + if (index % 2 == 0) { this.leftColumnPosts.push(val); } else { -- GitLab From 6bce4fe40970b696a6df81c3863b736d790def9b Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 14:53:35 +0100 Subject: [PATCH 17/65] feat(post) : fix tag logic --- .../post-card/post-card.component.html | 4 ++-- .../post-card/post-card.component.ts | 23 ------------------- .../post-list/post-list.component.html | 7 +++++- src/app/post/enum/tagEnum.enum.ts | 9 -------- src/assets/post/sprite.svg | 14 +++++------ 5 files changed, 15 insertions(+), 42 deletions(-) delete mode 100644 src/app/post/enum/tagEnum.enum.ts diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html index 3dc507bda..272aac44e 100644 --- a/src/app/post/components/post-card/post-card.component.html +++ b/src/app/post/components/post-card/post-card.component.html @@ -1,11 +1,11 @@ <div fxLayout="column" *ngIf="post" class="post" [ngClass]="class" fxLayoutGap="12px"> <div fxLayout="column" fxLayoutGap="4px"> - <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px" *ngIf="getIconOfTag(post.tags[0].slug)"> + <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px" *ngIf="post.tags[0].slug != 'appels'"> <app-svg-icon [iconClass]="'icon-32'" [iconColor]="'inherit'" [type]="'post'" - [icon]="getIconOfTag(post.tags[0].slug)" + [icon]="post.tags[0].slug" ></app-svg-icon> <span>{{ post.tags[0].name }}</span> </div> diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index 2233a51ae..e73dd03b3 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -1,5 +1,4 @@ import { Component, Input, OnInit } from '@angular/core'; -import { TagEnum } from '../../enum/tagEnum.enum'; import { Post } from '../../models/post.model'; @Component({ @@ -10,29 +9,7 @@ import { Post } from '../../models/post.model'; export class PostCardComponent implements OnInit { @Input() post: Post; @Input() class: string; - test: string; constructor() {} ngOnInit(): void {} - - getIconOfTag(tag: string): string { - switch (tag) { - case TagEnum.aLaUne: - return 'a-la-une'; - case TagEnum.formation: - return 'formationTag'; - case TagEnum.projet: - return 'projetTag'; - case TagEnum.ressource: - return 'ressourceTag'; - case TagEnum.info: - return 'infoTag'; - case TagEnum.etude: - return 'etudeTag'; - case TagEnum.dossier: - return 'dossierTag'; - default: - return null; - } - } } 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 c6dda1250..bf80827f2 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -45,7 +45,12 @@ <div fxLayout="column" fxLayoutAlign=" center" class="project-container desktop"> <div class="background-project-container"> <div class="project-content" fxLayout="column"> - <app-svg-icon [iconClass]="'icon-80'" [iconColor]="'inherit'" [type]="'post'" [icon]="'project'"></app-svg-icon> + <app-svg-icon + [iconClass]="'icon-80'" + [iconColor]="'inherit'" + [type]="'post'" + [icon]="'appel-a-projet'" + ></app-svg-icon> <h2>appels à projets</h2> <app-post-card [post]="news" diff --git a/src/app/post/enum/tagEnum.enum.ts b/src/app/post/enum/tagEnum.enum.ts deleted file mode 100644 index de26cf710..000000000 --- a/src/app/post/enum/tagEnum.enum.ts +++ /dev/null @@ -1,9 +0,0 @@ -export enum TagEnum { - aLaUne = 'a-la-une', - formation = 'formations', - projet = 'projets', - ressource = 'ressources', - info = 'infos', - etude = 'etudes', - dossier = 'dossiers', -} diff --git a/src/assets/post/sprite.svg b/src/assets/post/sprite.svg index 5e60b294b..7632091da 100644 --- a/src/assets/post/sprite.svg +++ b/src/assets/post/sprite.svg @@ -1,6 +1,6 @@ <svg xmlns="http://www.w3.org/2000/svg"> -<symbol id="project" viewBox="0 0 80 60" xmlns="http://www.w3.org/2000/svg"> +<symbol id="appel-a-projet" viewBox="0 0 80 60" xmlns="http://www.w3.org/2000/svg"> <path d="M1.66016 23.2006C4.67429 23.0597 8.52282 22.3132 12.7892 21.1547C17.5608 19.8591 22.9197 18.0302 28.3314 15.8906C38.369 11.9223 48.6614 6.85659 55.7703 2.08884V2.14843V2.22928V2.31051V2.39211V2.47407V2.5564V2.6391V2.72216V2.80559V2.88938V2.97352V3.05802V3.14288V3.2281V3.31367V3.39959V3.48586V3.57248V3.65944V3.74676V3.83441V3.92241V4.01075V4.09943V4.18845V4.27781V4.3675V4.45752V4.54788V4.63856V4.72958V4.82092V4.91259V5.00458V5.0969V5.18954V5.2825V5.37577V5.46937V5.56327V5.6575V5.75203V5.84688V5.94203V6.03749V6.13326V6.22933V6.32571V6.42239V6.51937V6.61664V6.71422V6.81209V6.91025V7.0087V7.10745V7.20649V7.30581V7.40542V7.50532V7.6055V7.70596V7.8067V7.90772V8.00901V8.11059V8.21243V8.31455V8.41694V8.5196V8.62253V8.72573V8.82918V8.93291V9.03689V9.14114V9.24565V9.35041V9.45543V9.5607V9.66622V9.772V9.87803V9.9843V10.0908V10.1976V10.3046V10.4119V10.5194V10.6271V10.7351V10.8433V10.9517V11.0604V11.1693V11.2784V11.3878V11.4974V11.6072V11.7172V11.8275V11.938V12.0487V12.1596V12.2708V12.3821V12.4937V12.6054V12.7174V12.8296V12.942V13.0546V13.1675V13.2805V13.3937V13.5071V13.6207V13.7345V13.8485V13.9628V14.0771V14.1917V14.3065V14.4215V14.5366V14.6519V14.7674V14.8831V14.999V15.1151V15.2313V15.3477V15.4643V15.581V15.6979V15.815V15.9323V16.0497V16.1673V16.2851V16.403V16.521V16.6393V16.7577V16.8762V16.9949V17.1137V17.2327V17.3519V17.4712V17.5906V17.7102V17.83V17.9498V18.0698V18.19V18.3103V18.4307V18.5513V18.672V18.7928V18.9137V19.0348V19.156V19.2774V19.3988V19.5204V19.6421V19.7639V19.8858V20.0079V20.1301V20.2523V20.3747V20.4972V20.6198V20.7425V20.8654V20.9883V21.1113V21.2344V21.3576V21.481V21.6044V21.7279V21.8515V21.9752V22.099V22.2229V22.3468V22.4709V22.595V22.7192V22.8435V22.9679V23.0923V23.2169V23.3415V23.4661V23.5909V23.7157V23.8406V23.9655V24.0905V24.2156V24.3408V24.466V24.5912V24.7166V24.8419V24.9674V25.0929V25.2184V25.344V25.4696V25.5953V25.7211V25.8468V25.9726V26.0985V26.2244V26.3503V26.4763V26.6023V26.7284V26.8544V26.9806V27.1067V27.2328V27.359V27.4852V27.6115V27.7377V27.864V27.9903V28.1166V28.243V28.3693V28.4956V28.622V28.7484V28.8748V29.0012V29.1275V29.2539V29.3803V29.5067V29.6331V29.7595V29.8859V30.0123V30.1387V30.265V30.3914V30.5177V30.6441V30.7704V30.8967V31.023V31.1492V31.2754V31.4017V31.5279V31.654V31.7802V31.9063V32.0323V32.1584V32.2844V32.4104V32.5363V32.6622V32.7881V32.9139V33.0397V33.1654V33.2911V33.4168V33.5424V33.6679V33.7934V33.9188V34.0442V34.1696V34.2948V34.42V34.5452V34.6703V34.7953V34.9203V35.0452V35.17V35.2947V35.4194V35.544V35.6686V35.793V35.9174V36.0417V36.1659V36.2901V36.4141V36.5381V36.662V36.7858V36.9095V37.0331V37.1566V37.2801V37.4034V37.5266V37.6498V37.7728V37.8957V38.0186V38.1413V38.2639V38.3864V38.5088V38.6311V38.7533V38.8754V38.9973V39.1191V39.2408V39.3624V39.4839V39.6053V39.7265V39.8476V39.9685V40.0894V40.2101V40.3307V40.4511V40.5714V40.6916V40.8116V40.9315V41.0512V41.1708V41.2903V41.4096V41.5288V41.6478V41.7667V41.8854V42.004V42.1224V42.2406V42.3587V42.4766V42.5944V42.712V42.8294V42.9467V43.0638V43.1808V43.2975V43.4141V43.5306V43.6468V43.7629V43.8788V43.9945V44.11V44.2254V44.3406V44.4555V44.5703V44.6849V44.7993V44.9136V45.0276V45.1414V45.2551V45.3685V45.4818V45.5948V45.7076V45.8203V45.9327V46.0449V46.1569V46.2687V46.3803V46.4917V46.6029V46.7138V46.8245V46.9351V47.0453V47.1554V47.2653V47.3749V47.4843V47.5934V47.7024V47.8111V47.9195V48.0278V48.1358V48.2435V48.3511V48.4583V48.5654V48.6722V48.7787V48.885V48.9911V49.0969V49.2024V49.3078V49.4128V49.5176V49.6221V49.7264V49.8304V49.9342V50.0377V50.1409V50.2439V50.3465V50.449V50.5511V50.653V50.7546V50.8559V50.957V51.0578V51.1582V51.2585V51.3584V51.458V51.5574V51.6565V51.7552V51.8537V51.9519V52.0498V52.1474V52.2448V52.3418V52.4385V52.5349V52.631V52.7268V52.8223V52.9175V53.0124V53.1069V53.2012V53.2952V53.3888V53.4821V53.5751V53.6678V53.7601V53.8521V53.9439V54.0352V54.1263V54.217V54.3074V54.3975V54.4872V54.5766V54.5932C48.6675 50.7584 38.3441 46.5962 28.2733 43.3173C18.0609 39.9923 7.95384 37.5244 1.66016 37.2769V23.2006Z" fill="none" stroke-width="2"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M56.7703 0.181641C42.7428 10.2013 12.6838 22.2249 0.660156 22.2249V38.2564C3.19182 38.2564 8.06936 39.0833 11.8822 39.8595L6.27117 53.4863C5.78047 56.4517 7.78661 59.2534 10.752 59.7441C13.7174 60.2349 16.5192 58.2287 17.0099 55.2633L19.8979 41.4627L19.6442 39.9086L19.5098 39.51L41.2658 9.45105H45.2737L21.5122 42.2809C34.1261 45.936 48.342 51.4756 56.7703 56.2918V28.5373L42.6898 47.8979H38.682L55.0188 25.106L56.7703 28.386V11.4099L32.9349 43.1831H28.9271L55.4659 7.44562L56.7703 10.1451V0.181641ZM25.4388 18.068H21.4309L12.6838 31.1271V37.1106L25.4388 18.068Z" stroke="none"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M64.9531 28.002C64.9531 29.1368 65.919 30.0566 67.1105 30.0566L77.178 30.0566C78.3695 30.0566 79.3353 29.1368 79.3353 28.002C79.3353 26.8673 78.3695 25.9474 77.178 25.9474L67.1105 25.9474C65.919 25.9474 64.9531 26.8673 64.9531 28.002Z" stroke="none"/> @@ -8,7 +8,7 @@ <path fill-rule="evenodd" clip-rule="evenodd" d="M63.6036 39.4919C64.0749 38.3867 65.353 37.8728 66.4582 38.3441L75.7969 42.3267C76.9021 42.798 77.416 44.076 76.9447 45.1812C76.4734 46.2864 75.1953 46.8003 74.0901 46.329L64.7514 42.3464C63.6462 41.8751 63.1323 40.5971 63.6036 39.4919Z" stroke="none"/> </symbol> -<symbol id="projetTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<symbol id="projets" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <mask id="path-1-inside-1" fill="white"> <path fill-rule="evenodd" clip-rule="evenodd" d="M4 7C4 5.34315 5.34315 4 7 4C8.65685 4 10 5.34315 10 7V24C10 25.6569 8.65685 27 7 27C5.34315 27 4 25.6569 4 24V7ZM7 26C8.10457 26 9 25.1046 9 24C9 22.8954 8.10457 22 7 22C5.89543 22 5 22.8954 5 24C5 25.1046 5.89543 26 7 26Z"/> </mask> @@ -18,7 +18,7 @@ <path d="M9 24C9 25.1046 8.10457 26 7 26C5.89543 26 5 25.1046 5 24C5 22.8954 5.89543 22 7 22C8.10457 22 9 22.8954 9 24Z" stroke="none"/> </symbol> -<symbol id="ressourceTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<symbol id="ressources" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M3.5 25V13.0495C7.32281 13.9728 11.7651 14.5 16.5 14.5C20.828 14.5 24.9112 14.0595 28.5 13.2789V25C28.5 25.2761 28.2761 25.5 28 25.5H4C3.72386 25.5 3.5 25.2761 3.5 25Z" fill="none"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M20 6H13V8H20V6ZM13 4C11.8954 4 11 4.89543 11 6V9H22V6C22 4.89543 21.1046 4 20 4H13Z" stroke="none"/> <path d="M28.5 13.2602C27.6168 13.4803 26.8068 13.7326 26.0024 13.9831L25.9955 13.9852C24.3831 14.4874 22.7659 14.9905 20.5 15.2722V15C20.5 14.1716 19.8284 13.5 19 13.5H14C13.1716 13.5 12.5 14.1716 12.5 15V15.2709C9.84798 14.949 7.85358 14.3349 5.87723 13.7256L5.87212 13.724C5.09326 13.4839 4.31292 13.2433 3.5 13.0242V9C3.5 8.72386 3.72386 8.5 4 8.5H28C28.2761 8.5 28.5 8.72386 28.5 9V13.2602Z"/> @@ -33,7 +33,7 @@ <rect x="13.5" y="14.5" width="6" height="3" rx="0.5" fill="none"/> </symbol> -<symbol id="infoTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<symbol id="infos" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M23 25.5H9.44949C10.0978 24.8647 10.5 23.9793 10.5 23V5.5H25.5V23C25.5 24.3807 24.3807 25.5 23 25.5Z" fill="none"/> <rect x="12" y="16" width="12" height="1" rx="0.5" stroke="none"/> <rect x="12" y="19" width="12" height="1" rx="0.5" stroke="none"/> @@ -46,17 +46,17 @@ <path d="M5.5 12.5H10.5V23C10.5 24.3807 9.38071 25.5 8 25.5C6.61929 25.5 5.5 24.3807 5.5 23V12.5Z" fill="none"/> </symbol> -<symbol id="formationTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<symbol id="formations" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M3 28V24.4C3 22.1088 4.1007 20.0762 5.79995 18.7998C4.80938 17.7598 4.2 16.3513 4.2 14.8C4.2 11.5967 6.79675 9 10 9C13.2033 9 15.8 11.5967 15.8 14.8C15.8 16.3513 15.1906 17.7598 14.2001 18.7998C15.8993 20.0762 17 22.1088 17 24.4V28H3ZM13.4307 19.4769C13.1256 19.2639 12.7998 19.0785 12.4568 18.9244C12.7774 18.7331 13.0738 18.5054 13.3403 18.2471C14.2405 17.3746 14.8 16.1527 14.8 14.8C14.8 12.149 12.651 10 10 10C7.34903 10 5.2 12.149 5.2 14.8C5.2 16.1527 5.75951 17.3746 6.65971 18.2471C6.92623 18.5054 7.2226 18.7331 7.54316 18.9244C7.20024 19.0785 6.87441 19.2639 6.56931 19.4769C5.01609 20.5613 4 22.362 4 24.4V27H16V24.4C16 22.362 14.9839 20.5613 13.4307 19.4769Z" stroke="none"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M2 6H30V22H16.5777C16.3879 21.4799 16.1381 20.9887 15.8369 20.5348L25.6379 7H24.1379L15.0488 19.5516C14.7868 19.2788 14.503 19.0273 14.2001 18.7998C15.1906 17.7598 15.8 16.3513 15.8 14.8C15.8 14.4589 15.7705 14.1246 15.7141 13.7996L20.6379 7H19.1379L15.2607 12.3543C14.8403 11.4515 14.1943 10.675 13.3952 10.0971L15.6379 7H14.1379L12.3353 9.48933C11.6208 9.17468 10.8308 9 10 9C9.70926 9 9.42352 9.02139 9.14426 9.06269L10.6379 7H9.13793L7.14742 9.74881C5.70291 10.5663 4.64387 11.9856 4.3108 13.666L3 15.4762V17.5476L4.28201 15.7772C4.46929 16.8805 4.96816 17.8775 5.68402 18.6744L5.28319 19.228C4.45784 19.9811 3.81311 20.9293 3.4223 22H2V6ZM29 7.19048V9.2619L20.5 21H19L29 7.19048ZM25.5 21H24L29 14.0952V16.1667L25.5 21ZM5.63793 7L3 10.6429V8.57143L4.13793 7H5.63793Z" stroke="none"/> </symbol> -<symbol id="etudeTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<symbol id="etudes" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M27.722 26.2329L22.4916 21.0959C24.0154 19.2877 24.9215 16.9452 24.9215 14.4384C24.8803 8.68493 20.2265 4 14.4607 4C8.69498 4 4 8.68493 4 14.4384C4 20.1918 8.69498 24.8767 14.4607 24.8767C16.9318 24.8767 19.2381 24.0137 21.009 22.5753L26.2394 27.7123C26.4453 27.9178 26.6924 28 26.9807 28C27.2278 28 27.5161 27.9178 27.722 27.7123C28.0927 27.3014 28.0927 26.6438 27.722 26.2329ZM6.0592 14.4384C6.0592 9.79452 9.80695 6.05479 14.4607 6.05479C19.1145 6.05479 22.8623 9.79452 22.8623 14.4384C22.8623 19.0822 19.1145 22.8219 14.4607 22.8219C9.80695 22.8219 6.0592 19.0411 6.0592 14.4384Z" stroke="none"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M14.7457 5.3282C14.0022 5.11446 13.2157 5 12.4015 5C12.2296 5 12.0588 5.00511 11.8895 5.01518L10.4509 6.97689C11.5862 6.37483 12.878 6.02499 14.2521 6.00129L14.7457 5.3282ZM13.0585 7.62894C9.87909 8.24863 7.5 11.0292 7.5 14.3836C7.5 14.6426 7.51448 14.8985 7.5427 15.1504L13.0585 7.62894ZM7.97683 16.8961L14.8566 7.51456C15.8686 7.57953 16.8194 7.85975 17.6638 8.30994L9.59266 19.316C8.89414 18.6378 8.33923 17.8141 7.97683 16.8961ZM6.34942 16.7776C6.12204 16.018 6 15.2141 6 14.3836C6 13.8626 6.04717 13.353 6.13749 12.8588L4.25314 15.4284C4.49144 16.3727 4.89089 17.2551 5.42099 18.0437L6.34942 16.7776ZM6.96335 18.2781C7.41071 19.1257 7.99942 19.8888 8.69862 20.5352L8.49887 20.8076C7.68288 20.3787 6.94656 19.8199 6.31708 19.1594L6.96335 18.2781ZM17.141 6.45253C16.8055 6.22416 16.4523 6.01946 16.084 5.84081L15.874 6.12727C16.3089 6.20341 16.7322 6.31273 17.141 6.45253ZM13.3275 21.1841C12.3621 21.0332 11.464 20.6823 10.6762 20.1762L18.8131 9.08041C19.5054 9.65324 20.0826 10.359 20.5064 11.159C20.5221 11.2167 20.5373 11.2746 20.5518 11.3328L13.3275 21.1841ZM21.157 12.9614C21.2528 13.4201 21.3031 13.8957 21.3031 14.3836C21.3031 17.9947 18.5458 20.9409 15.0011 21.2418L21.157 12.9614ZM9.9145 5.37067C6.48201 6.42403 4 9.60441 4 13.3836L4.00016 13.4357L9.9145 5.37067Z" stroke="none"/> </symbol> -<symbol id="dossierTag" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<symbol id="dossiers" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2 9C2 7.89543 2.89543 7 4 7H8C9.10457 7 10 7.89543 10 9V10H27C27.5523 10 28 10.4477 28 11V13H6.32973C5.84861 13 5.43568 13.3426 5.34691 13.8155L3.28171 24.8155C3.16616 25.431 3.63831 26 4.26454 26H3C2.44772 26 2 25.5523 2 25V9Z" stroke="none"/> <path d="M5.72708 13.8721C5.78513 13.6528 5.98357 13.5 6.21044 13.5H29.1416C29.4697 13.5 29.7089 13.8107 29.6249 14.1279L26.7136 25.1279C26.6555 25.3472 26.4571 25.5 26.2302 25.5H3.2991C2.97097 25.5 2.73179 25.1893 2.81574 24.8721L5.72708 13.8721Z" fill="none"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M29.2607 17.2341L30.049 14.2559C30.1737 13.7846 29.9418 13.3205 29.5453 13.113L20.8378 26H23.3378L29.2607 17.2341ZM24.8378 26H26.1709C26.6247 26 27.0215 25.6945 27.1376 25.2559L28.2948 20.8837L24.8378 26ZM25.6216 13H28.1216L19.3378 26H16.8378L25.6216 13ZM24.1216 13H21.6216L12.8378 26H15.3378L24.1216 13ZM17.6216 13H20.1216L11.3378 26H8.83784L17.6216 13ZM16.1216 13H13.6216L4.83784 26H7.33784L16.1216 13ZM9.62162 13H12.1216L3.33784 26H3.20521C2.57898 26 2.10683 25.431 2.22239 24.8155L2.44717 23.6182L9.62162 13ZM8.12162 13H5.27041C5.26124 13 5.2521 13.0001 5.24299 13.0004L4.13187 14.6448L3.02434 20.544L8.12162 13Z" stroke="none"/> -- GitLab From 78d7e6c50e4ceac4e2a902bb5747ee78db1db151 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 17:48:39 +0100 Subject: [PATCH 18/65] feat(post): fix design html --- .../post-card/post-card.component.scss | 7 +++ .../post-details/post-details.component.html | 46 +++++++++++--- .../post-details/post-details.component.scss | 63 +++++++++++++++++++ .../post-details/post-details.component.ts | 11 +++- .../post-header/post-header.component.scss | 3 +- .../post-list/post-list.component.ts | 17 +---- src/app/post/models/post.model.ts | 2 + src/app/post/services/post.service.ts | 39 +++++++++--- src/assets/scss/_layout.scss | 1 + src/assets/scss/_typography.scss | 8 +++ 10 files changed, 160 insertions(+), 37 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index 3a3b82358..aaf3133af 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -18,6 +18,13 @@ } } } + .title { + @include cn-bold-30; + } + .description { + @include cn-regular-18; + color: $grey-1; + } } .imageContainer { .image { diff --git a/src/app/post/components/post-details/post-details.component.html b/src/app/post/components/post-details/post-details.component.html index 61ca17c2f..d31d90812 100644 --- a/src/app/post/components/post-details/post-details.component.html +++ b/src/app/post/components/post-details/post-details.component.html @@ -1,11 +1,37 @@ -<div *ngIf="post" fxLayout="column"> - <div fxLayout="row" (click)="backToPosts()"> - <span>Retour à la liste d'acutalités</span> - </div> - <app-post-card - [post]="news" - [class]="'project'" - [ngClass]="{ 'last-child': last }" - *ngFor="let news of projectsNew; let last = last" - ></app-post-card> +<div class="postContainer" *ngIf="post" fxLayout="column" fxLayoutGap="8px"> + <div fxLayout="row"> + <div class="backLink" fxLayout="row" fxLayoutAlign=" center" (click)="backToPosts()"> + <svg class="chevronLeft" aria-hidden="true"> + <use [attr.xlink:href]="'assets/form/sprite.svg#chevronLeft'"></use> + </svg> + <span>Retour à la liste d'acutalités</span> + </div> + </div> + <div fxLayout="column"> + <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px" *ngIf="post.tags[0].slug != 'appels'"> + <app-svg-icon + [iconClass]="'icon-32'" + [iconColor]="'inherit'" + [type]="'post'" + [icon]="post.tags[0].slug" + ></app-svg-icon> + <span>{{ post.tags[0].name }}</span> + </div> + <div fxLayout="row" class="title"> + {{ post.title }} + </div> + </div> + + <div fxLayout="column" class="informations"> + <div fxLayout="row"> + {{ post.published_at | date: 'shortDate' }} + </div> + <div fxLayout="row">par {{ post.author }}</div> + </div> + <div fxLayout="row" class="imageContainer" *ngIf="post.feature_image"> + <img class="image" [src]="post.feature_image" /> + </div> + <div fxLayout="row" class="description"> + <div [innerHtml]="post.safeHtml"></div> + </div> </div> diff --git a/src/app/post/components/post-details/post-details.component.scss b/src/app/post/components/post-details/post-details.component.scss index e69de29bb..273483989 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -0,0 +1,63 @@ +@import '../../../../assets/scss/color'; +@import '../../../../assets/scss/typography'; +@import '../../../../assets/scss/layout'; + +$margin-post: 20px; + +.postContainer { + max-width: 832px; + margin: $margin-post auto; + height: calc( + 100vh - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post} - #{$margin-post}* 2 + ); + .chevronLeft { + height: 24px; + width: 24px; + stroke: $black; + margin-right: 10px; + } + .backLink { + cursor: pointer; + color: $grey-2; + @include cn-bold-16; + &:hover { + opacity: 0.4; + } + } +} +.tag { + @include cn-bold-16; + text-transform: uppercase; + color: $secondary-color; + fill: $secondary-color; + stroke: $secondary-color; +} +.title { + @include cn-bold-30; + color: $grey-1; +} +.informations { + @include cn-regular-16; + color: $grey-3; + font-style: italic; +} +.imageContainer { + .image { + object-fit: cover; + height: 360px; + width: 100%; + } +} +.description { + div { + width: 100%; + } + ::ng-deep figure { + margin: 0; + img { + object-fit: cover; + max-height: 360px; + max-width: 100%; + } + } +} diff --git a/src/app/post/components/post-details/post-details.component.ts b/src/app/post/components/post-details/post-details.component.ts index ce30a2537..31f7b0f62 100644 --- a/src/app/post/components/post-details/post-details.component.ts +++ b/src/app/post/components/post-details/post-details.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { DomSanitizer } from '@angular/platform-browser'; import { ActivatedRoute, Router } from '@angular/router'; import { Post } from '../../models/post.model'; import { PostService } from '../../services/post.service'; @@ -9,16 +10,22 @@ import { PostService } from '../../services/post.service'; styleUrls: ['./post-details.component.scss'], }) export class PostDetailsComponent implements OnInit { - constructor(private activatedRoute: ActivatedRoute, private router: Router, private postService: PostService) {} + constructor( + private activatedRoute: ActivatedRoute, + private router: Router, + private postService: PostService, + private sanitizer: DomSanitizer + ) {} post: Post; ngOnInit(): void { if (history.state.data) { this.post = new Post(history.state.data); + this.post.safeHtml = this.sanitizer.bypassSecurityTrustHtml(this.post.html); } else { const postId = this.activatedRoute.snapshot.paramMap.get('id'); this.postService.getPost(postId).subscribe((post) => { this.post = post.posts[0]; - console.log(this.post); + this.post.safeHtml = this.sanitizer.bypassSecurityTrustHtml(this.post.html); }); } } diff --git a/src/app/post/components/post-header/post-header.component.scss b/src/app/post/components/post-header/post-header.component.scss index e24dbb9e6..526d11201 100644 --- a/src/app/post/components/post-header/post-header.component.scss +++ b/src/app/post/components/post-header/post-header.component.scss @@ -1,6 +1,7 @@ @import '../../../../assets/scss/color'; +@import '../../../../assets/scss/layout'; .header-container { - height: 180px; + height: #{$header-post-height}; background: $white; } 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 5b95ba4f8..4b5c8ae38 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -19,9 +19,7 @@ export class PostListComponent implements OnInit { ngOnInit(): void { this.postService.getPosts().subscribe((news) => { news.posts.forEach((val, index) => { - val = this.addAuthorToPost(val); this.postsMobileView.push(val); - if (index % 2 == 0) { this.leftColumnPosts.push(val); } else { @@ -30,23 +28,12 @@ export class PostListComponent implements OnInit { }); }); this.postService.getPosts(['a-la-une']).subscribe((news) => { - this.bigNews = this.addAuthorToPost(news.posts[0]); + this.bigNews = news.posts[0]; }); this.postService.getPosts(['appels']).subscribe((news) => { - let projectNews = news.posts; - projectNews.forEach((news) => { - news = this.addAuthorToPost(news); - }); - this.projectsNew = projectNews; + this.projectsNew = news.posts; }); } public publishNews(): void {} - - //Transform excerpt post to have a custom author. - private addAuthorToPost(post: Post): Post { - post.author = post.excerpt; - post.excerpt = post.html.replace(/<[^>]*>/g, ''); - return post; - } } diff --git a/src/app/post/models/post.model.ts b/src/app/post/models/post.model.ts index 604f43995..eb13ecef2 100644 --- a/src/app/post/models/post.model.ts +++ b/src/app/post/models/post.model.ts @@ -1,3 +1,4 @@ +import { SafeHtml } from '@angular/platform-browser'; import { Tag } from './tag.model'; export class Post { @@ -9,6 +10,7 @@ export class Post { html: string; author: string; tags: Tag[]; + safeHtml: SafeHtml; constructor(obj?: any) { Object.assign(this, obj); diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index c5f3841bc..a8554c59a 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -13,16 +13,26 @@ export class PostService { constructor(private http: HttpClient) {} public getPost(idPost: string): Observable<PostWithMeta> { - return this.http - .get<PostWithMeta>(`${this.baseUrl}/` + idPost) - .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + return this.http.get<PostWithMeta>(`${this.baseUrl}/` + idPost).pipe( + map((item: PostWithMeta) => { + item.posts.forEach((post) => { + post = this.addAuthorToPost(post); + }); + return new PostWithMeta(item); + }) + ); } public getPosts(tags?: string[]): Observable<PostWithMeta> { if (!tags) { - return this.http - .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[appels,a-la-une]`) - .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + return this.http.get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[appels,a-la-une]`).pipe( + map((item: PostWithMeta) => { + item.posts.forEach((post) => { + post = this.addAuthorToPost(post); + }); + return new PostWithMeta(item); + }) + ); } let tagsString = ''; // Transform tab filters to string filters @@ -32,8 +42,19 @@ export class PostService { tagsString += ','; } }); - return this.http - .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:[${tagsString}]`) - .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); + return this.http.get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:[${tagsString}]`).pipe( + map((item: PostWithMeta) => { + item.posts.forEach((post) => { + post = this.addAuthorToPost(post); + }); + return new PostWithMeta(item); + }) + ); + } + + private addAuthorToPost(post: Post): Post { + post.author = post.excerpt; + post.excerpt = post.html.replace(/<[^>]*>/g, ''); + return post; } } diff --git a/src/assets/scss/_layout.scss b/src/assets/scss/_layout.scss index 94ebedd43..2a4a34f6e 100644 --- a/src/assets/scss/_layout.scss +++ b/src/assets/scss/_layout.scss @@ -3,3 +3,4 @@ $footer-height: 56px; $header-height-phone: 70px; $footer-height-phone: 75px; $progressBar-height: 50px; +$header-post-height: 180px; diff --git a/src/assets/scss/_typography.scss b/src/assets/scss/_typography.scss index b340d5a63..b4067a794 100644 --- a/src/assets/scss/_typography.scss +++ b/src/assets/scss/_typography.scss @@ -12,6 +12,7 @@ $font-size-xmedium: 1.375em; // 22px $font-size-large: 1.625em; // 26px $font-size-xlarge: 1.75em; // 28px +$font-size-xxlarge: 1.875em; // 28px html, body, @@ -44,6 +45,13 @@ h6, font-size: $font-size-small; } +@mixin cn-bold-30 { + font-family: $title-font; + font-style: normal; + font-weight: bold; + font-size: $font-size-xxlarge; +} + @mixin cn-bold-28 { font-family: $title-font; font-style: normal; -- GitLab From 82d24d4903f96e78cd69a8d074d268d79958f9fb Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 18:01:07 +0100 Subject: [PATCH 19/65] fix(mobile) : fix responsive mobile --- src/app/app.component.ts | 9 +++++++++ src/app/form/form.component.scss | 5 ++--- src/app/header/header.component.scss | 2 +- src/styles.scss | 3 --- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 13fba3cf1..78f22a979 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -21,5 +21,14 @@ export class AppComponent { if (this.authService.isLoggedIn()) { this.profilService.getProfile(); } + this.setHeightApp(); + window.addEventListener('resize', () => { + this.setHeightApp(); + }); + } + + private setHeightApp(): void { + const vh = window.innerHeight * 0.01; + document.documentElement.style.setProperty('--vh', `${vh}px`); } } diff --git a/src/app/form/form.component.scss b/src/app/form/form.component.scss index d32ba5a2c..d969088b4 100644 --- a/src/app/form/form.component.scss +++ b/src/app/form/form.component.scss @@ -16,11 +16,11 @@ h3 { .form { background: white; width: 100vw; - height: calc(100vh - #{$header-height} - #{$footer-height}); + height: calc(var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height}); top: #{$header-height}; z-index: $structure-details-z-index; @media #{$tablet} { - height: calc(100vh - #{$header-height}); + height: calc(var(--vh, 1vh) * 100 - #{$header-height}); position: fixed; //Hide default header app. } } @@ -137,7 +137,6 @@ h3 { height: auto; color: $grey-1; &.home { - height: 100%; .btnStart { margin-top: 90px; margin-bottom: 10px; diff --git a/src/app/header/header.component.scss b/src/app/header/header.component.scss index 7470c080a..8369791d6 100644 --- a/src/app/header/header.component.scss +++ b/src/app/header/header.component.scss @@ -101,7 +101,7 @@ a { animation: slideMenu 0.5s; .menu-content { background-color: $white; - height: 100vh; + height: calc(var(--vh, 1vh) * 100); width: 350px; padding: 27px 25px; } diff --git a/src/styles.scss b/src/styles.scss index 1b7004107..3e61ddf25 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -74,9 +74,6 @@ a { &.full-screen { min-height: calc(100vh - #{$header-height} - #{$footer-height}); } - @media #{$phone} { - padding-top: 30px; - } } .section-container { width: 80%; -- GitLab From 28d489600edea204c8c9a0afbd40cd9b0a13bf08 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 18:11:53 +0100 Subject: [PATCH 20/65] feat(post) : fix height when post is poor of text --- .../post/components/post-details/post-details.component.scss | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/post/components/post-details/post-details.component.scss b/src/app/post/components/post-details/post-details.component.scss index 273483989..597202384 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -7,9 +7,7 @@ $margin-post: 20px; .postContainer { max-width: 832px; margin: $margin-post auto; - height: calc( - 100vh - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post} - #{$margin-post}* 2 - ); + min-height: calc(100vh - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post}* 3); .chevronLeft { height: 24px; width: 24px; -- GitLab From 4d2fd1ea38a900d7f207ad77eb745ac0b25e0521 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 18:22:09 +0100 Subject: [PATCH 21/65] fix(mobile) : fix responsive join/claim structure --- src/app/form/form.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index 2bea200b7..a3d85c2a6 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -62,7 +62,7 @@ fxLayoutAlign="space-between center" fxLayoutAlign.lt-sm="center" > - <h2 class="no-wrap"> + <h2> {{ isJoinMode ? 'Rejoindre' : 'Revendiquer' }} la structure <span>{{ claimStructure.structureName }}</span> </h2> <div> -- GitLab From 6bdf76dcad3a76f9f5075070070d9322cd9be01e Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 18:23:59 +0100 Subject: [PATCH 22/65] fix(mobile) : clean unused css --- src/app/form/form.component.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/form/form.component.scss b/src/app/form/form.component.scss index d969088b4..0bc3f7704 100644 --- a/src/app/form/form.component.scss +++ b/src/app/form/form.component.scss @@ -115,9 +115,6 @@ h3 { span { color: $secondary-color; } - &.no-wrap { - white-space: nowrap; - } } h3 { @include cn-bold-26; -- GitLab From ec6041320999eeefc6a3232ce3f6f456c79f34e3 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 18:32:00 +0100 Subject: [PATCH 23/65] fix(post) : fix review ENUM logic + type properties --- .../post-card/post-card.component.html | 8 +++++++- .../components/post-card/post-card.component.ts | 2 ++ .../components/post-list/post-list.component.ts | 17 ++++++++--------- src/app/post/enum/tag.enum.ts | 4 ++++ src/app/post/services/post.service.ts | 3 ++- 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 src/app/post/enum/tag.enum.ts diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html index 272aac44e..4ba85dbbe 100644 --- a/src/app/post/components/post-card/post-card.component.html +++ b/src/app/post/components/post-card/post-card.component.html @@ -1,6 +1,12 @@ <div fxLayout="column" *ngIf="post" class="post" [ngClass]="class" fxLayoutGap="12px"> <div fxLayout="column" fxLayoutGap="4px"> - <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px" *ngIf="post.tags[0].slug != 'appels'"> + <div + fxLayout="row" + class="tag" + fxLayoutAlign=" center" + fxLayoutGap="12px" + *ngIf="post.tags[0].slug != tagEnum.appels" + > <app-svg-icon [iconClass]="'icon-32'" [iconColor]="'inherit'" diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index e73dd03b3..a7d648e31 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -1,4 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; +import { TagEnum } from '../../enum/tag.enum'; import { Post } from '../../models/post.model'; @Component({ @@ -9,6 +10,7 @@ import { Post } from '../../models/post.model'; export class PostCardComponent implements OnInit { @Input() post: Post; @Input() class: string; + public tagEnum = TagEnum; constructor() {} ngOnInit(): void {} 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 5b95ba4f8..8a3a96883 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { TagEnum } from '../../enum/tag.enum'; import { Post } from '../../models/post.model'; -import { PostWithMeta } from '../../models/postWithMeta.model'; import { PostService } from '../../services/post.service'; @Component({ @@ -10,18 +10,17 @@ import { PostService } from '../../services/post.service'; }) export class PostListComponent implements OnInit { constructor(private postService: PostService) {} - postsMobileView: Post[] = []; - leftColumnPosts: Post[] = []; - rightColumnPosts: Post[] = []; - projectsNew: Post[] = []; - bigNews: Post; + public postsMobileView: Post[] = []; + public leftColumnPosts: Post[] = []; + public rightColumnPosts: Post[] = []; + public projectsNew: Post[] = []; + public bigNews: Post; ngOnInit(): void { this.postService.getPosts().subscribe((news) => { news.posts.forEach((val, index) => { val = this.addAuthorToPost(val); this.postsMobileView.push(val); - if (index % 2 == 0) { this.leftColumnPosts.push(val); } else { @@ -29,10 +28,10 @@ export class PostListComponent implements OnInit { } }); }); - this.postService.getPosts(['a-la-une']).subscribe((news) => { + this.postService.getPosts([TagEnum.aLaUne]).subscribe((news) => { this.bigNews = this.addAuthorToPost(news.posts[0]); }); - this.postService.getPosts(['appels']).subscribe((news) => { + this.postService.getPosts([TagEnum.appels]).subscribe((news) => { let projectNews = news.posts; projectNews.forEach((news) => { news = this.addAuthorToPost(news); diff --git a/src/app/post/enum/tag.enum.ts b/src/app/post/enum/tag.enum.ts new file mode 100644 index 000000000..0b6c049d9 --- /dev/null +++ b/src/app/post/enum/tag.enum.ts @@ -0,0 +1,4 @@ +export enum TagEnum { + aLaUne = 'a-la-une', + appels = 'appels', +} diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index 848e6a58e..688b9c31b 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { TagEnum } from '../enum/tag.enum'; import { PostWithMeta } from '../models/postWithMeta.model'; @Injectable({ @@ -14,7 +15,7 @@ export class PostService { public getPosts(tags?: string[]): Observable<PostWithMeta> { if (!tags) { return this.http - .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[appels,a-la-une]`) + .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[${TagEnum.aLaUne},${TagEnum.appels}]`) .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); } let tagsString = ''; -- GitLab From d23156750356ebd3216a88e77b140fa6a7e916a0 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 3 Mar 2021 18:36:45 +0100 Subject: [PATCH 24/65] fix(post) : fix review --- .../post/components/post-list/post-list.component.ts | 5 +---- .../{post.component.html => news.component.html} | 0 .../{post.component.scss => news.component.scss} | 0 ...post.component.spec.ts => news.component.spec.ts} | 10 +++++----- src/app/post/news.component.ts | 12 ++++++++++++ src/app/post/post-routing.module.ts | 4 ++-- src/app/post/post.component.ts | 12 ------------ src/app/post/post.module.ts | 4 ++-- 8 files changed, 22 insertions(+), 25 deletions(-) rename src/app/post/{post.component.html => news.component.html} (100%) rename src/app/post/{post.component.scss => news.component.scss} (100%) rename src/app/post/{post.component.spec.ts => news.component.spec.ts} (63%) create mode 100644 src/app/post/news.component.ts delete mode 100644 src/app/post/post.component.ts 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 8a3a96883..f7c373650 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -32,10 +32,7 @@ export class PostListComponent implements OnInit { this.bigNews = this.addAuthorToPost(news.posts[0]); }); this.postService.getPosts([TagEnum.appels]).subscribe((news) => { - let projectNews = news.posts; - projectNews.forEach((news) => { - news = this.addAuthorToPost(news); - }); + let projectNews = news.posts.map((news) => (news = this.addAuthorToPost(news))); this.projectsNew = projectNews; }); } diff --git a/src/app/post/post.component.html b/src/app/post/news.component.html similarity index 100% rename from src/app/post/post.component.html rename to src/app/post/news.component.html diff --git a/src/app/post/post.component.scss b/src/app/post/news.component.scss similarity index 100% rename from src/app/post/post.component.scss rename to src/app/post/news.component.scss diff --git a/src/app/post/post.component.spec.ts b/src/app/post/news.component.spec.ts similarity index 63% rename from src/app/post/post.component.spec.ts rename to src/app/post/news.component.spec.ts index 5716f2398..4ce0f0228 100644 --- a/src/app/post/post.component.spec.ts +++ b/src/app/post/news.component.spec.ts @@ -1,19 +1,19 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { PostComponent } from './post.component'; +import { NewsComponent } from './news.component'; describe('PostsComponent', () => { - let component: PostComponent; - let fixture: ComponentFixture<PostComponent>; + let component: NewsComponent; + let fixture: ComponentFixture<NewsComponent>; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [PostComponent], + declarations: [NewsComponent], }).compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(PostComponent); + fixture = TestBed.createComponent(NewsComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/post/news.component.ts b/src/app/post/news.component.ts new file mode 100644 index 000000000..ce2f45998 --- /dev/null +++ b/src/app/post/news.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-news', + templateUrl: './news.component.html', + styleUrls: ['./news.component.scss'], +}) +export class NewsComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/post/post-routing.module.ts b/src/app/post/post-routing.module.ts index 2ec94d598..841c89d45 100644 --- a/src/app/post/post-routing.module.ts +++ b/src/app/post/post-routing.module.ts @@ -1,8 +1,8 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { PostComponent } from './post.component'; +import { NewsComponent } from './news.component'; -const routes: Routes = [{ path: '', component: PostComponent }]; +const routes: Routes = [{ path: '', component: NewsComponent }]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/post/post.component.ts b/src/app/post/post.component.ts deleted file mode 100644 index 075daa3b5..000000000 --- a/src/app/post/post.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-post', - templateUrl: './post.component.html', - styleUrls: ['./post.component.scss'], -}) -export class PostComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} diff --git a/src/app/post/post.module.ts b/src/app/post/post.module.ts index af61760cb..d51f1291c 100644 --- a/src/app/post/post.module.ts +++ b/src/app/post/post.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { PostComponent } from './post.component'; +import { NewsComponent } from './news.component'; import { PostRoutingModule } from './post-routing.module'; import { PostHeaderComponent } from './components/post-header/post-header.component'; import { PostListComponent } from './components/post-list/post-list.component'; @@ -9,7 +9,7 @@ import { SharedModule } from '../shared/shared.module'; import { PostCardComponent } from './components/post-card/post-card.component'; @NgModule({ - declarations: [PostComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent, PostCardComponent], + declarations: [NewsComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent, PostCardComponent], imports: [CommonModule, PostRoutingModule, SharedModule], }) export class PostModule {} -- GitLab From f6a47b11babc48ae2dfbb96e18e8460ddcf88648 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Mar 2021 15:16:07 +0100 Subject: [PATCH 25/65] feat(post-details) : fix css ghost --- .../post-details/post-details.component.html | 6 +++--- .../post-details/post-details.component.scss | 14 +++++++++++++- .../components/post-list/post-list.component.html | 7 +------ src/assets/post/sprite.svg | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/app/post/components/post-details/post-details.component.html b/src/app/post/components/post-details/post-details.component.html index d31d90812..2e2136a31 100644 --- a/src/app/post/components/post-details/post-details.component.html +++ b/src/app/post/components/post-details/post-details.component.html @@ -1,4 +1,4 @@ -<div class="postContainer" *ngIf="post" fxLayout="column" fxLayoutGap="8px"> +<div class="postContainer" *ngIf="post" fxLayout="column" fxLayoutGap="16px"> <div fxLayout="row"> <div class="backLink" fxLayout="row" fxLayoutAlign=" center" (click)="backToPosts()"> <svg class="chevronLeft" aria-hidden="true"> @@ -8,7 +8,7 @@ </div> </div> <div fxLayout="column"> - <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px" *ngIf="post.tags[0].slug != 'appels'"> + <div fxLayout="row" class="tag" fxLayoutAlign=" center" fxLayoutGap="12px"> <app-svg-icon [iconClass]="'icon-32'" [iconColor]="'inherit'" @@ -22,7 +22,7 @@ </div> </div> - <div fxLayout="column" class="informations"> + <div fxLayout="column" class="informations" *ngIf="post.tags[0].slug != 'appels'"> <div fxLayout="row"> {{ post.published_at | date: 'shortDate' }} </div> diff --git a/src/app/post/components/post-details/post-details.component.scss b/src/app/post/components/post-details/post-details.component.scss index 597202384..63845f23b 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -1,13 +1,17 @@ @import '../../../../assets/scss/color'; @import '../../../../assets/scss/typography'; @import '../../../../assets/scss/layout'; +@import '../../../../assets/scss/breakpoint'; +@import '../../../../assets/scss/hyperlink'; $margin-post: 20px; .postContainer { max-width: 832px; margin: $margin-post auto; - min-height: calc(100vh - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post}* 3); + min-height: calc( + var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post}* 3 + ); .chevronLeft { height: 24px; width: 24px; @@ -44,6 +48,9 @@ $margin-post: 20px; object-fit: cover; height: 360px; width: 100%; + @media #{$large-phone} { + height: 147px; + } } } .description { @@ -58,4 +65,9 @@ $margin-post: 20px; max-width: 100%; } } + ::ng-deep a { + @include hyperlink; + padding: 0; + font-size: 18px; + } } 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 542eacd15..2af9cad48 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -45,12 +45,7 @@ <div fxLayout="column" fxLayoutAlign=" center" class="project-container desktop"> <div class="background-project-container"> <div class="project-content" fxLayout="column"> - <app-svg-icon - [iconClass]="'icon-80'" - [iconColor]="'inherit'" - [type]="'post'" - [icon]="'appel-a-projet'" - ></app-svg-icon> + <app-svg-icon [iconClass]="'icon-80'" [iconColor]="'inherit'" [type]="'post'" [icon]="'appels'"></app-svg-icon> <h2>appels à projets</h2> <app-post-card [post]="news" diff --git a/src/assets/post/sprite.svg b/src/assets/post/sprite.svg index 7632091da..fe3e4e45a 100644 --- a/src/assets/post/sprite.svg +++ b/src/assets/post/sprite.svg @@ -1,6 +1,6 @@ <svg xmlns="http://www.w3.org/2000/svg"> -<symbol id="appel-a-projet" viewBox="0 0 80 60" xmlns="http://www.w3.org/2000/svg"> +<symbol id="appels" viewBox="0 0 80 60" xmlns="http://www.w3.org/2000/svg"> <path d="M1.66016 23.2006C4.67429 23.0597 8.52282 22.3132 12.7892 21.1547C17.5608 19.8591 22.9197 18.0302 28.3314 15.8906C38.369 11.9223 48.6614 6.85659 55.7703 2.08884V2.14843V2.22928V2.31051V2.39211V2.47407V2.5564V2.6391V2.72216V2.80559V2.88938V2.97352V3.05802V3.14288V3.2281V3.31367V3.39959V3.48586V3.57248V3.65944V3.74676V3.83441V3.92241V4.01075V4.09943V4.18845V4.27781V4.3675V4.45752V4.54788V4.63856V4.72958V4.82092V4.91259V5.00458V5.0969V5.18954V5.2825V5.37577V5.46937V5.56327V5.6575V5.75203V5.84688V5.94203V6.03749V6.13326V6.22933V6.32571V6.42239V6.51937V6.61664V6.71422V6.81209V6.91025V7.0087V7.10745V7.20649V7.30581V7.40542V7.50532V7.6055V7.70596V7.8067V7.90772V8.00901V8.11059V8.21243V8.31455V8.41694V8.5196V8.62253V8.72573V8.82918V8.93291V9.03689V9.14114V9.24565V9.35041V9.45543V9.5607V9.66622V9.772V9.87803V9.9843V10.0908V10.1976V10.3046V10.4119V10.5194V10.6271V10.7351V10.8433V10.9517V11.0604V11.1693V11.2784V11.3878V11.4974V11.6072V11.7172V11.8275V11.938V12.0487V12.1596V12.2708V12.3821V12.4937V12.6054V12.7174V12.8296V12.942V13.0546V13.1675V13.2805V13.3937V13.5071V13.6207V13.7345V13.8485V13.9628V14.0771V14.1917V14.3065V14.4215V14.5366V14.6519V14.7674V14.8831V14.999V15.1151V15.2313V15.3477V15.4643V15.581V15.6979V15.815V15.9323V16.0497V16.1673V16.2851V16.403V16.521V16.6393V16.7577V16.8762V16.9949V17.1137V17.2327V17.3519V17.4712V17.5906V17.7102V17.83V17.9498V18.0698V18.19V18.3103V18.4307V18.5513V18.672V18.7928V18.9137V19.0348V19.156V19.2774V19.3988V19.5204V19.6421V19.7639V19.8858V20.0079V20.1301V20.2523V20.3747V20.4972V20.6198V20.7425V20.8654V20.9883V21.1113V21.2344V21.3576V21.481V21.6044V21.7279V21.8515V21.9752V22.099V22.2229V22.3468V22.4709V22.595V22.7192V22.8435V22.9679V23.0923V23.2169V23.3415V23.4661V23.5909V23.7157V23.8406V23.9655V24.0905V24.2156V24.3408V24.466V24.5912V24.7166V24.8419V24.9674V25.0929V25.2184V25.344V25.4696V25.5953V25.7211V25.8468V25.9726V26.0985V26.2244V26.3503V26.4763V26.6023V26.7284V26.8544V26.9806V27.1067V27.2328V27.359V27.4852V27.6115V27.7377V27.864V27.9903V28.1166V28.243V28.3693V28.4956V28.622V28.7484V28.8748V29.0012V29.1275V29.2539V29.3803V29.5067V29.6331V29.7595V29.8859V30.0123V30.1387V30.265V30.3914V30.5177V30.6441V30.7704V30.8967V31.023V31.1492V31.2754V31.4017V31.5279V31.654V31.7802V31.9063V32.0323V32.1584V32.2844V32.4104V32.5363V32.6622V32.7881V32.9139V33.0397V33.1654V33.2911V33.4168V33.5424V33.6679V33.7934V33.9188V34.0442V34.1696V34.2948V34.42V34.5452V34.6703V34.7953V34.9203V35.0452V35.17V35.2947V35.4194V35.544V35.6686V35.793V35.9174V36.0417V36.1659V36.2901V36.4141V36.5381V36.662V36.7858V36.9095V37.0331V37.1566V37.2801V37.4034V37.5266V37.6498V37.7728V37.8957V38.0186V38.1413V38.2639V38.3864V38.5088V38.6311V38.7533V38.8754V38.9973V39.1191V39.2408V39.3624V39.4839V39.6053V39.7265V39.8476V39.9685V40.0894V40.2101V40.3307V40.4511V40.5714V40.6916V40.8116V40.9315V41.0512V41.1708V41.2903V41.4096V41.5288V41.6478V41.7667V41.8854V42.004V42.1224V42.2406V42.3587V42.4766V42.5944V42.712V42.8294V42.9467V43.0638V43.1808V43.2975V43.4141V43.5306V43.6468V43.7629V43.8788V43.9945V44.11V44.2254V44.3406V44.4555V44.5703V44.6849V44.7993V44.9136V45.0276V45.1414V45.2551V45.3685V45.4818V45.5948V45.7076V45.8203V45.9327V46.0449V46.1569V46.2687V46.3803V46.4917V46.6029V46.7138V46.8245V46.9351V47.0453V47.1554V47.2653V47.3749V47.4843V47.5934V47.7024V47.8111V47.9195V48.0278V48.1358V48.2435V48.3511V48.4583V48.5654V48.6722V48.7787V48.885V48.9911V49.0969V49.2024V49.3078V49.4128V49.5176V49.6221V49.7264V49.8304V49.9342V50.0377V50.1409V50.2439V50.3465V50.449V50.5511V50.653V50.7546V50.8559V50.957V51.0578V51.1582V51.2585V51.3584V51.458V51.5574V51.6565V51.7552V51.8537V51.9519V52.0498V52.1474V52.2448V52.3418V52.4385V52.5349V52.631V52.7268V52.8223V52.9175V53.0124V53.1069V53.2012V53.2952V53.3888V53.4821V53.5751V53.6678V53.7601V53.8521V53.9439V54.0352V54.1263V54.217V54.3074V54.3975V54.4872V54.5766V54.5932C48.6675 50.7584 38.3441 46.5962 28.2733 43.3173C18.0609 39.9923 7.95384 37.5244 1.66016 37.2769V23.2006Z" fill="none" stroke-width="2"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M56.7703 0.181641C42.7428 10.2013 12.6838 22.2249 0.660156 22.2249V38.2564C3.19182 38.2564 8.06936 39.0833 11.8822 39.8595L6.27117 53.4863C5.78047 56.4517 7.78661 59.2534 10.752 59.7441C13.7174 60.2349 16.5192 58.2287 17.0099 55.2633L19.8979 41.4627L19.6442 39.9086L19.5098 39.51L41.2658 9.45105H45.2737L21.5122 42.2809C34.1261 45.936 48.342 51.4756 56.7703 56.2918V28.5373L42.6898 47.8979H38.682L55.0188 25.106L56.7703 28.386V11.4099L32.9349 43.1831H28.9271L55.4659 7.44562L56.7703 10.1451V0.181641ZM25.4388 18.068H21.4309L12.6838 31.1271V37.1106L25.4388 18.068Z" stroke="none"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M64.9531 28.002C64.9531 29.1368 65.919 30.0566 67.1105 30.0566L77.178 30.0566C78.3695 30.0566 79.3353 29.1368 79.3353 28.002C79.3353 26.8673 78.3695 25.9474 77.178 25.9474L67.1105 25.9474C65.919 25.9474 64.9531 26.8673 64.9531 28.002Z" stroke="none"/> -- GitLab From 93d33c0592074b7a78b89aef4ff1a315e430cd86 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Mar 2021 17:23:05 +0100 Subject: [PATCH 26/65] fix(task) : fix orthographe --- src/app/form/form.component.html | 2 +- .../structure-details/structure-details.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index a3d85c2a6..aa2263591 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -331,7 +331,7 @@ </div> <div *ngIf="currentPage == pageTypeEnum.structurePhone" class="page"> <div class="title"> - <h3>Quel numéro appelé pour joindre votre structure ?</h3> + <h3>Quel numéro appeler pour joindre votre structure ?</h3> </div> <div class="form-group" fxLayout="column"> <label for="contactPhone">Téléphone de la structure</label> diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index 2e865d93f..fc3993a6c 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.html +++ b/src/app/structure-list/components/structure-details/structure-details.component.html @@ -328,7 +328,7 @@ <app-modal-confirmation [openned]="claimModalOpenned" [content]=" - 'Voulez-vous vraiment revendiquer cette structure ? Une demande sera envoyée a l\'administrateur pour validation' + 'Voulez-vous vraiment revendiquer cette structure ? Une demande sera envoyée à l\'administrateur pour validation' " (closed)="claimStructure($event)" ></app-modal-confirmation> -- GitLab From 5a29be5d857b9899af3532bed57cc4ac240ea153 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Mar 2021 17:54:57 +0100 Subject: [PATCH 27/65] fix(task): fix only first letter Upper on structure name --- src/app/structure-list/components/card/card.component.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/structure-list/components/card/card.component.scss b/src/app/structure-list/components/card/card.component.scss index 687abf098..6deabb870 100644 --- a/src/app/structure-list/components/card/card.component.scss +++ b/src/app/structure-list/components/card/card.component.scss @@ -21,7 +21,10 @@ @include cn-bold-18; padding-bottom: 5px; width: 100%; - text-transform: capitalize; + text-transform: lowercase; + &::first-letter { + text-transform: uppercase; + } } .distanceStructure { @include cn-regular-16; -- GitLab From 284c0024c7682acb4d40eb8fa34a5f09b033d29f Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Mar 2021 17:55:16 +0100 Subject: [PATCH 28/65] fix(task): fix public name --- .../components/structure-details/structure-details.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/structure-list/components/structure-details/structure-details.component.ts b/src/app/structure-list/components/structure-details/structure-details.component.ts index 9604623b9..215f44fa9 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.ts +++ b/src/app/structure-list/components/structure-details/structure-details.component.ts @@ -202,7 +202,7 @@ export class StructureDetailsComponent implements OnInit { case PublicCategorie.young: return 'Jeunes (16 - 25 ans)'; case PublicCategorie.adult: - return 'Adultes (25 - 65 ans)'; + return 'Adultes'; case PublicCategorie.elderly: return 'Séniors (+ de 65 ans)'; case PublicCategorie.all: -- GitLab From 166e07a9c7b61bdfa60f60c3ca8dbf601220839f Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 5 Mar 2021 15:26:44 +0100 Subject: [PATCH 29/65] feat(post) : load more news on scroll --- src/app/app.component.html | 4 +- src/app/app.component.scss | 5 +- src/app/app.component.ts | 7 ++- .../post-list/post-list.component.scss | 2 +- .../post-list/post-list.component.ts | 59 +++++++++++++++---- src/app/post/services/post.service.ts | 6 +- .../shared/service/windowScroll.service.ts | 16 +++++ src/styles.scss | 1 - 8 files changed, 77 insertions(+), 23 deletions(-) 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 f4d4b7c94..aa331e09e 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,8 +1,8 @@ <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> </div> - <app-footer></app-footer> </div> diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 29e32a153..d79408e4e 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -3,17 +3,16 @@ @import '../assets/scss/layout'; .app-container { - height: 100%; display: block; flex-direction: column; - overflow-y: auto; } .app-body { flex: 1 1 auto; - overflow-y: hidden; + overflow-y: auto; overflow-x: hidden; position: relative; + height: calc(100vh - #{$header-height}); } .motif { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 13fba3cf1..20dbe35a7 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,6 +3,7 @@ import { ProfileService } from './profile/services/profile.service'; import { AuthService } from './services/auth.service'; import { RouterListenerService } from './services/routerListener.service'; import { PrintService } from './shared/service/print.service'; +import { WindowScrollService } from './shared/service/windowscroll.service'; @Component({ selector: 'app-root', @@ -16,10 +17,14 @@ export class AppComponent { public printService: PrintService, private authService: AuthService, private profilService: ProfileService, - private routerListenerService: RouterListenerService + private routerListenerService: RouterListenerService, + private windowScrollService: WindowScrollService ) { if (this.authService.isLoggedIn()) { this.profilService.getProfile(); } } + public onScrollDown(event): void { + this.windowScrollService.scrollY.next(event); + } } 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 1a579dc6f..dd33d0cf9 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -23,7 +23,7 @@ @media #{$tablet} { width: 100%; } - width: 80%; + width: 70%; h2 { @media #{$large-phone} { @include cn-bold-22; 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 f7c373650..8aa7a320a 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -1,6 +1,9 @@ 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'; +import { PostWithMeta } from '../../models/postWithMeta.model'; import { PostService } from '../../services/post.service'; @Component({ @@ -9,29 +12,32 @@ import { PostService } from '../../services/post.service'; styleUrls: ['./post-list.component.scss'], }) export class PostListComponent implements OnInit { - constructor(private postService: PostService) {} + constructor(private postService: PostService, private windowScrollService: WindowScrollService) { + this.windowScrollService.scrollY$.subscribe((evt: any) => { + if (evt && evt.target.offsetHeight + evt.target.scrollTop >= evt.target.scrollHeight - 200) { + if (!this.isLoading) { + this.loadMore(); + } + } + }); + } public postsMobileView: Post[] = []; public leftColumnPosts: Post[] = []; public rightColumnPosts: Post[] = []; public projectsNew: Post[] = []; public bigNews: Post; + public pagination: Pagination; + public isLoading = false; ngOnInit(): void { - this.postService.getPosts().subscribe((news) => { - news.posts.forEach((val, index) => { - val = this.addAuthorToPost(val); - this.postsMobileView.push(val); - if (index % 2 == 0) { - this.leftColumnPosts.push(val); - } else { - this.rightColumnPosts.push(val); - } - }); + this.isLoading = true; + this.postService.getPosts(1).subscribe((news) => { + this.setNews(news); }); - this.postService.getPosts([TagEnum.aLaUne]).subscribe((news) => { + this.postService.getPosts(1, [TagEnum.aLaUne]).subscribe((news) => { this.bigNews = this.addAuthorToPost(news.posts[0]); }); - this.postService.getPosts([TagEnum.appels]).subscribe((news) => { + this.postService.getPosts(1, [TagEnum.appels]).subscribe((news) => { let projectNews = news.posts.map((news) => (news = this.addAuthorToPost(news))); this.projectsNew = projectNews; }); @@ -45,4 +51,31 @@ export class PostListComponent implements OnInit { post.excerpt = post.html.replace(/<[^>]*>/g, ''); return post; } + + // Load more news on scroll event. + private loadMore(): void { + if (this.pagination.page < this.pagination.pages) { + this.isLoading = true; + this.postService.getPosts(this.pagination.next).subscribe((news) => { + this.setNews(news); + }); + } + } + + // 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.postsMobileView.length; // For scroll loading, start with previous index. + news.posts.forEach((val, index) => { + val = this.addAuthorToPost(val); + index += customIndex; + if (index % 2 == 0) { + this.leftColumnPosts.push(val); + } else { + this.rightColumnPosts.push(val); + } + this.postsMobileView.push(val); + }); + this.isLoading = false; + } } diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index 688b9c31b..38d9346d0 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -12,10 +12,12 @@ export class PostService { private readonly baseUrl = 'api/posts'; constructor(private http: HttpClient) {} - public getPosts(tags?: string[]): Observable<PostWithMeta> { + public getPosts(page: number, tags?: string[]): Observable<PostWithMeta> { if (!tags) { return this.http - .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[${TagEnum.aLaUne},${TagEnum.appels}]`) + .get<PostWithMeta>( + `${this.baseUrl}?page=${page}&include=tags,authors&filter=tag:-[${TagEnum.aLaUne},${TagEnum.appels}]` + ) .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); } let tagsString = ''; 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); + } +} diff --git a/src/styles.scss b/src/styles.scss index 747d5da15..f68783050 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -61,7 +61,6 @@ a { margin: 0; padding-top: 30px; width: 100%; - height: 100%; &.medium-pt { padding: 25px 0 30px 0; } -- GitLab From a098bd342380f847d0c3f956ef7d13265e96973b Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 5 Mar 2021 15:29:05 +0100 Subject: [PATCH 30/65] fix(post) : fix responsive on mobile --- src/app/app.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.scss b/src/app/app.component.scss index d79408e4e..ba93e485c 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -12,7 +12,7 @@ overflow-y: auto; overflow-x: hidden; position: relative; - height: calc(100vh - #{$header-height}); + height: calc(var(--vh, 1vh) * 100 - #{$header-height}); } .motif { -- GitLab From 3f8c136fe02d9e003c2c11b0d0dc10af06dda520 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 5 Mar 2021 16:10:39 +0100 Subject: [PATCH 31/65] fix(post) : fix img size --- src/app/post/components/post-details/post-details.component.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/post/components/post-details/post-details.component.scss b/src/app/post/components/post-details/post-details.component.scss index 63845f23b..496864352 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -61,7 +61,6 @@ $margin-post: 20px; margin: 0; img { object-fit: cover; - max-height: 360px; max-width: 100%; } } -- GitLab From 1d288f7d73090167fa9a00360afb48f8fe58feb3 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 5 Mar 2021 16:23:05 +0100 Subject: [PATCH 32/65] fix(post) : fix mr failed --- src/app/app.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5f66a4eab..9457205bd 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -17,7 +17,6 @@ export class AppComponent { public printService: PrintService, private authService: AuthService, private profilService: ProfileService, - private routerListenerService: RouterListenerService, private windowScrollService: WindowScrollService ) { if (this.authService.isLoggedIn()) { -- GitLab From 69aca5547a36b9b5418769b0b4a8c03cecc1605d Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 5 Mar 2021 16:38:29 +0100 Subject: [PATCH 33/65] fix(post) : fix import problem --- src/app/app.component.ts | 3 +-- src/app/post/components/post-list/post-list.component.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9457205bd..b2a85d16f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,8 @@ import { Component } from '@angular/core'; import { ProfileService } from './profile/services/profile.service'; import { AuthService } from './services/auth.service'; -import { RouterListenerService } from './services/routerListener.service'; import { PrintService } from './shared/service/print.service'; -import { WindowScrollService } from './shared/service/windowscroll.service'; +import { WindowScrollService } from './shared/service/windowScroll.service'; @Component({ selector: 'app-root', 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 8aa7a320a..807c2b9c2 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,5 @@ import { Component, OnInit } from '@angular/core'; -import { WindowScrollService } from '../../../shared/service/windowscroll.service'; +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'; -- GitLab From cca4a383a4f270b19827625367c9c95f8a17a2a9 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 5 Mar 2021 17:44:35 +0100 Subject: [PATCH 34/65] feat(post-publish) : add + design component --- .../post-list/post-list.component.html | 5 +- .../post-list/post-list.component.ts | 5 +- .../post-publish/post-publish.component.html | 31 ++++++++++ .../post-publish/post-publish.component.scss | 58 +++++++++++++++++++ .../post-publish.component.spec.ts | 25 ++++++++ .../post-publish/post-publish.component.ts | 17 ++++++ src/app/post/post.module.ts | 3 +- src/assets/post/publishNews.svg | 41 +++++++++++++ src/assets/scss/_layout.scss | 1 + 9 files changed, 182 insertions(+), 4 deletions(-) create mode 100644 src/app/post/components/post-publish/post-publish.component.html create mode 100644 src/app/post/components/post-publish/post-publish.component.scss create mode 100644 src/app/post/components/post-publish/post-publish.component.spec.ts create mode 100644 src/app/post/components/post-publish/post-publish.component.ts create mode 100644 src/assets/post/publishNews.svg 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 bf80827f2..491f94237 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -1,4 +1,4 @@ -<div class="section-container" fxLayout="row" fxLayoutGap="32px"> +<div *ngIf="!isPublishMode" class="section-container" fxLayout="row" fxLayoutGap="32px"> <div fxLayout="column" class="list-container"> <div fxLayout="column"> <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> @@ -7,7 +7,7 @@ [type]="'button'" [style]="'buttonWithHash'" [text]="'Publier votre actu'" - (action)="publishNews()" + (action)="togglePublishNews()" ></app-button> </div> <app-post-card [class]="'bigNew'" [post]="bigNews"></app-post-card> @@ -62,3 +62,4 @@ </div> </div> </div> +<app-post-publish *ngIf="isPublishMode" (closePublish)="togglePublishNews()"></app-post-publish> 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 807c2b9c2..fa03da7f2 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -28,6 +28,7 @@ export class PostListComponent implements OnInit { public bigNews: Post; public pagination: Pagination; public isLoading = false; + public isPublishMode = false; ngOnInit(): void { this.isLoading = true; @@ -43,7 +44,9 @@ export class PostListComponent implements OnInit { }); } - public publishNews(): void {} + public togglePublishNews(): void { + this.isPublishMode = !this.isPublishMode; + } //Transform excerpt post to have a custom author. private addAuthorToPost(post: Post): Post { diff --git a/src/app/post/components/post-publish/post-publish.component.html b/src/app/post/components/post-publish/post-publish.component.html new file mode 100644 index 000000000..88dc63d5e --- /dev/null +++ b/src/app/post/components/post-publish/post-publish.component.html @@ -0,0 +1,31 @@ +<div class="container" fxLayout="column" fxLayoutGap="16px"> + <div fxLayout="row"> + <div class="backLink" fxLayout="row" fxLayoutAlign=" center" (click)="backToPosts()"> + <svg class="chevronLeft" aria-hidden="true"> + <use [attr.xlink:href]="'assets/form/sprite.svg#chevronLeft'"></use> + </svg> + <span>Retour à la liste d'acutalités</span> + </div> + </div> + <div fxLayout="column" class="content" fxLayoutGap="16px"> + <h2>Publier votre actualité</h2> + <div class="image"> + <img src="../../assets/post/publishNews.svg" alt="logo publishNews" /> + </div> + <div> + <p>Vous pouvez nous envoyer votre actualité en distinguant ces 4 éléments :</p> + <ul> + <li>- le titre</li> + <li>- le texte</li> + <li>- l’auteur</li> + <li>- l’image (facultatif)</li> + </ul> + <br /> + <p>Si votre actualité existe déjà sur un autre site, envoyez-nous simplement son adresse URL</p> + <br /> + </div> + <div> + <a class="btn-primary" href="mailto:inclusionnumerique@grandlyon.com">Envoyer votre actu par mail</a> + </div> + </div> +</div> diff --git a/src/app/post/components/post-publish/post-publish.component.scss b/src/app/post/components/post-publish/post-publish.component.scss new file mode 100644 index 000000000..0b171d787 --- /dev/null +++ b/src/app/post/components/post-publish/post-publish.component.scss @@ -0,0 +1,58 @@ +@import '../../../../assets/scss/color'; +@import '../../../../assets/scss/typography'; +@import '../../../../assets/scss/layout'; + +$margin-post: 20px; + +.container { + max-width: 832px; + width: 95%; + margin: $margin-post auto; + min-height: calc( + var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post}* 2 + ); +} +.chevronLeft { + height: 24px; + width: 24px; + stroke: $black; + margin-right: 10px; +} +.backLink { + cursor: pointer; + color: $grey-2; + @include cn-bold-16; + &:hover { + opacity: 0.4; + } +} +.content { + @include cn-regular-18; + color: $grey-1; + h2 { + margin: 0; + color: $grey-1; + } + .image { + width: 100%; + text-align: center; + img { + max-width: 300px; + } + } + ul { + margin: 0; + padding: 0; + list-style: none; + } + p { + margin: 0; + } + a { + text-decoration: none; + width: auto; + padding: 10.5px 24px; + @include cn-regular-16; + font-size: 16px; + } +} diff --git a/src/app/post/components/post-publish/post-publish.component.spec.ts b/src/app/post/components/post-publish/post-publish.component.spec.ts new file mode 100644 index 000000000..ed2451eff --- /dev/null +++ b/src/app/post/components/post-publish/post-publish.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostPublishComponent } from './post-publish.component'; + +describe('PostPublishComponent', () => { + let component: PostPublishComponent; + let fixture: ComponentFixture<PostPublishComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostPublishComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostPublishComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/post/components/post-publish/post-publish.component.ts b/src/app/post/components/post-publish/post-publish.component.ts new file mode 100644 index 000000000..a1df80d6e --- /dev/null +++ b/src/app/post/components/post-publish/post-publish.component.ts @@ -0,0 +1,17 @@ +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; + +@Component({ + selector: 'app-post-publish', + templateUrl: './post-publish.component.html', + styleUrls: ['./post-publish.component.scss'], +}) +export class PostPublishComponent implements OnInit { + @Output() closePublish = new EventEmitter<boolean>(); + constructor() {} + + ngOnInit(): void {} + + public backToPosts(): void { + this.closePublish.emit(true); + } +} diff --git a/src/app/post/post.module.ts b/src/app/post/post.module.ts index d51f1291c..ef3ed07b9 100644 --- a/src/app/post/post.module.ts +++ b/src/app/post/post.module.ts @@ -7,9 +7,10 @@ import { PostListComponent } from './components/post-list/post-list.component'; import { PostDetailsComponent } from './components/post-details/post-details.component'; import { SharedModule } from '../shared/shared.module'; import { PostCardComponent } from './components/post-card/post-card.component'; +import { PostPublishComponent } from './components/post-publish/post-publish.component'; @NgModule({ - declarations: [NewsComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent, PostCardComponent], + declarations: [NewsComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent, PostCardComponent, PostPublishComponent], imports: [CommonModule, PostRoutingModule, SharedModule], }) export class PostModule {} diff --git a/src/assets/post/publishNews.svg b/src/assets/post/publishNews.svg new file mode 100644 index 000000000..fd89368ae --- /dev/null +++ b/src/assets/post/publishNews.svg @@ -0,0 +1,41 @@ +<svg width="310" height="273" viewBox="0 0 310 273" fill="none" xmlns="http://www.w3.org/2000/svg"> +<g opacity="0.35" filter="url(#filter0_f)"> +<path d="M12 76.7061L181.621 30.7062L283.777 208.44L114.155 254.44L12 76.7061Z" fill="#348899"/> +</g> +<path d="M114.638 253.273L13.5131 77.3318L181.138 31.8732L282.263 207.814L114.638 253.273Z" fill="#EAF8FB" stroke="#79ACB6" stroke-width="2"/> +<path d="M56.0084 117.902C54.7257 115.671 55.8543 112.826 58.3181 112.08L188.148 72.8014C189.929 72.2624 191.847 73.0232 192.774 74.6367L215.093 113.467C216.376 115.699 215.247 118.544 212.783 119.289L82.9533 158.568C81.172 159.107 79.2544 158.346 78.327 156.733L56.0084 117.902Z" fill="#ABE6F2"/> +<path d="M72.5 81.3037L150.685 57.8712L154.671 64.8072L76.4866 88.2397L72.5 81.3037Z" fill="#117083"/> +<path d="M86.5 167.953L139.359 152.241L142.5 157.706L89.6408 173.418L86.5 167.953Z" fill="#117083"/> +<path d="M91.5 176.445L144.359 160.733L147.5 166.198L94.6408 181.91L91.5 176.445Z" fill="#117083"/> +<path d="M96.5 185.445L149.359 169.733L152.5 175.198L99.6408 190.91L96.5 185.445Z" fill="#117083"/> +<path d="M102.5 193.444L155.359 177.732L158.5 183.197L105.641 198.909L102.5 193.444Z" fill="#117083"/> +<path d="M107.5 202.444L160.359 186.732L163.5 192.197L110.641 207.909L107.5 202.444Z" fill="#117083"/> +<path d="M112.5 211.444L165.359 195.732L168.5 201.197L115.641 216.909L112.5 211.444Z" fill="#117083"/> +<path d="M116.5 221.444L169.359 205.732L172.5 211.197L119.641 226.909L116.5 221.444Z" fill="#117083"/> +<path d="M145.5 150.444L198.359 134.732L201.5 140.197L148.641 155.909L145.5 150.444Z" fill="#117083"/> +<path d="M151.5 158.444L204.359 142.732L207.5 148.197L154.641 163.909L151.5 158.444Z" fill="#117083"/> +<path d="M156.5 167.444L178.359 161.241L181.5 166.706L159.641 172.909L156.5 167.444Z" fill="#117083"/> +<path d="M100 84.6553L139.091 72.7225L143.078 79.6584L103.987 91.5912L100 84.6553Z" fill="#117083"/> +<g opacity="0.35" filter="url(#filter1_f)"> +<path d="M252.112 73.7334C249.503 71.652 246.024 71.6753 244.34 73.7856L235.054 85.4249L235.088 85.4519L190.698 141.075L205.252 152.855L190.571 141.242L189.299 142.837C188.606 143.704 188.299 144.837 188.429 146.05L186.205 161.648L185.788 163.604C185.445 165.216 187.089 166.528 188.585 165.835L189.273 165.516C189.436 165.526 189.6 165.521 189.763 165.502L205.18 159.287C206.391 159.144 207.427 158.594 208.12 157.726L209.393 156.131L209.391 156.129L253.778 100.509L253.779 100.51L263.064 88.8704C264.748 86.7602 263.999 83.3622 261.391 81.2807L252.112 73.7334Z" fill="#DC2A59"/> +</g> +<path d="M252.739 72.9577L252.739 72.9576L252.732 72.9518C249.854 70.6558 245.7 70.4733 243.554 73.1618L243.554 73.1619L234.269 84.8012L233.648 85.5792L233.682 85.6061L189.913 140.452L189.293 141.228L189.297 141.231L188.513 142.213C187.666 143.275 187.298 144.626 187.418 146.026L185.216 161.473L184.806 163.395C184.291 165.813 186.758 167.781 189.001 166.743L189.48 166.521C189.612 166.519 189.744 166.511 189.876 166.495L190.009 166.48L190.133 166.43L205.432 160.262C206.819 160.067 208.052 159.409 208.898 158.35L210.17 156.755L210.798 155.969L210.796 155.967L253.929 101.918L253.93 101.918L254.557 101.133L263.842 89.4942C265.986 86.807 264.889 82.7988 262.014 80.5023C262.013 80.5013 262.012 80.5002 262.01 80.4991L252.739 72.9577Z" fill="#E04971" stroke="#E0718E" stroke-width="2"/> +<path d="M244.336 73.7856C246.02 71.6754 249.499 71.652 252.108 73.7335L261.386 81.2808C263.995 83.3622 264.744 86.7602 263.06 88.8705L253.775 100.51L235.05 85.4249L244.336 73.7856Z" fill="#E04971"/> +<path d="M254.161 100.03L235.505 84.9298L190.698 141.076L209.354 156.176L254.161 100.03Z" fill="#E0718E"/> +<path d="M209.393 156.131L190.571 141.242L189.298 142.837C188.606 143.705 188.299 144.838 188.429 146.05L186.075 162.56C186.257 164.27 188.054 165.704 189.762 165.503L205.18 159.288C206.391 159.145 207.427 158.594 208.12 157.727L209.393 156.131Z" fill="#FDECF0"/> +<path d="M185.399 164.08C185.176 165.596 186.672 166.789 188.101 166.236L194.734 163.665C194.734 163.665 194.763 161.501 191.65 159.018C188.537 156.534 186.434 157.041 186.434 157.041L185.399 164.08Z" fill="#E04971"/> +<rect x="190.742" y="140.706" width="24.0099" height="2" transform="rotate(38.3738 190.742 140.706)" fill="white"/> +<rect x="236.152" y="84.0303" width="24.0422" height="2" transform="rotate(38.3738 236.152 84.0303)" fill="white"/> +<defs> +<filter id="filter0_f" x="0" y="18.7061" width="295.777" height="247.734" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> +<feFlood flood-opacity="0" result="BackgroundImageFix"/> +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> +<feGaussianBlur stdDeviation="6" result="effect1_foregroundBlur"/> +</filter> +<filter id="filter1_f" x="173.742" y="60.1875" width="102.221" height="117.837" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> +<feFlood flood-opacity="0" result="BackgroundImageFix"/> +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> +<feGaussianBlur stdDeviation="6" result="effect1_foregroundBlur"/> +</filter> +</defs> +</svg> diff --git a/src/assets/scss/_layout.scss b/src/assets/scss/_layout.scss index 94ebedd43..2a4a34f6e 100644 --- a/src/assets/scss/_layout.scss +++ b/src/assets/scss/_layout.scss @@ -3,3 +3,4 @@ $footer-height: 56px; $header-height-phone: 70px; $footer-height-phone: 75px; $progressBar-height: 50px; +$header-post-height: 180px; -- GitLab From a7317b464a6fa1ca45785f41a319dbd3c00eb0b9 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Mon, 8 Mar 2021 10:18:31 +0100 Subject: [PATCH 35/65] fix(post) : fix alignement --- .../components/post-list/post-list.component.html | 4 ++-- .../components/post-list/post-list.component.scss | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 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 bf80827f2..44514f087 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -1,5 +1,5 @@ <div class="section-container" fxLayout="row" fxLayoutGap="32px"> - <div fxLayout="column" class="list-container"> + <div fxLayout="column" class="list-container" fxLayoutGap="16px"> <div fxLayout="column"> <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> <h2>à la une</h2> @@ -26,7 +26,7 @@ </div> </div> <div fxLayout="column"> - <div fxLayout="row" class="row-border"> + <div fxLayout="row" class="row-border otherNews"> <h2>autres actualités</h2> </div> <div fxLayout="row" fxLayoutGap="33px"> 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 dd33d0cf9..6478796f4 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -5,9 +5,13 @@ .section-container { background: $grey-6; + margin-top: 40px; .row-border { border-bottom: 1px dashed $grey-4; - margin: 16px 0; + padding-bottom: 16px; + &.otherNews { + padding-top: 24px; + } } h2 { font-style: italic !important; @@ -30,6 +34,7 @@ } @include cn-bold-28; color: $grey-2; + margin: 0; } .columnPosts { @media #{$large-phone} { @@ -70,9 +75,9 @@ border-radius: 6px; .project-content { @media #{$large-phone} { - padding: 10px 32px 0px 36px; + padding: 38px 32px 14px 36px; } - padding: 18px 32px 26px 36px; + padding: 39px 32px 26px 36px; fill: $secondary-color; stroke: $secondary-color; &.mobile { -- GitLab From 5b6c51e73c7a9c24f28f5a5a36c829411bca3d5e Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 8 Mar 2021 11:07:58 +0100 Subject: [PATCH 36/65] fix: remove commented code --- src/app/post/services/post.service.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index 4476dbc76..d70e18881 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -24,16 +24,6 @@ export class PostService { ); } - // public getPosts(tags?: string[]): Observable<PostWithMeta> { - // if (!tags) { - // return this.http.get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:-[appels,a-la-une]`).pipe( - // map((item: PostWithMeta) => { - // item.posts.forEach((post) => { - // post = this.addAuthorToPost(post); - // }); - // return new PostWithMeta(item); - // }) - // ); public getPosts(page: number, tags?: string[]): Observable<PostWithMeta> { if (!tags) { return this.http -- GitLab From 84e7757e755f5a1c8e946c4a085b74b68a5c7e77 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Mon, 8 Mar 2021 15:11:13 +0100 Subject: [PATCH 37/65] fix(post) : fix css --- .../post-publish/post-publish.component.html | 2 +- .../post-publish/post-publish.component.scss | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/app/post/components/post-publish/post-publish.component.html b/src/app/post/components/post-publish/post-publish.component.html index 88dc63d5e..5ad24fe1c 100644 --- a/src/app/post/components/post-publish/post-publish.component.html +++ b/src/app/post/components/post-publish/post-publish.component.html @@ -12,7 +12,7 @@ <div class="image"> <img src="../../assets/post/publishNews.svg" alt="logo publishNews" /> </div> - <div> + <div class="informations"> <p>Vous pouvez nous envoyer votre actualité en distinguant ces 4 éléments :</p> <ul> <li>- le titre</li> diff --git a/src/app/post/components/post-publish/post-publish.component.scss b/src/app/post/components/post-publish/post-publish.component.scss index 0b171d787..d9bf65253 100644 --- a/src/app/post/components/post-publish/post-publish.component.scss +++ b/src/app/post/components/post-publish/post-publish.component.scss @@ -27,11 +27,10 @@ $margin-post: 20px; } } .content { - @include cn-regular-18; color: $grey-1; h2 { + @include cn-bold-30; margin: 0; - color: $grey-1; } .image { width: 100%; @@ -40,14 +39,18 @@ $margin-post: 20px; max-width: 300px; } } - ul { - margin: 0; - padding: 0; - list-style: none; - } - p { - margin: 0; + .informations { + @include cn-regular-18; + ul { + margin: 0; + padding: 0; + list-style: none; + } + p { + margin: 0; + } } + a { text-decoration: none; width: auto; -- GitLab From 0422f2bbc4e570fe2f516b1c93046c1f0c000aa0 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Mon, 8 Mar 2021 15:20:51 +0100 Subject: [PATCH 38/65] fix(structure-details) : add public accompaniment section --- .../structure-details/structure-details.component.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index 2e865d93f..f7683fb0c 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.html +++ b/src/app/structure-list/components/structure-details/structure-details.component.html @@ -196,6 +196,14 @@ <div *ngFor="let public of structure.publics" fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="8px"> <p class="no-margin">{{ getPublicLabel(public) }}</p> </div> + <div + *ngFor="let accompaniment of structure.publicsAccompaniment" + fxLayout="row" + fxLayoutAlign="none flex-end" + fxLayoutGap="8px" + > + <p class="no-margin">{{ accompaniment }}</p> + </div> </div> </div> </div> -- GitLab From 1b1dbe850f2ccc489eb04acd0fae2277ba07d939 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Mon, 8 Mar 2021 16:37:23 +0100 Subject: [PATCH 39/65] fix(openGraph) : add description + image --- src/assets/logos/logo_1200.svg | 5 +++++ src/index.html | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/assets/logos/logo_1200.svg diff --git a/src/assets/logos/logo_1200.svg b/src/assets/logos/logo_1200.svg new file mode 100644 index 000000000..91b2e0d3f --- /dev/null +++ b/src/assets/logos/logo_1200.svg @@ -0,0 +1,5 @@ +<svg width="1200" height="1200" viewBox="0 0 1200 1200" fill="none" xmlns="http://www.w3.org/2000/svg"> +<rect width="1200" height="1200" fill="white"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M1081.08 485.317C1088.76 491.865 1095.17 500.125 1100.06 509.914C1104.88 519.765 1107.23 530.889 1107.43 543.279V742.456C1107.43 755.871 1096.57 766.675 1083.24 766.675H1082.8C1069.4 766.675 1058.61 755.803 1058.61 742.456V543.279C1058.48 532.219 1055.18 524.021 1048.51 518.808C1042.17 513.343 1034.23 510.736 1025.35 510.611C1016.46 510.548 1008.84 513.285 1002.24 518.305C995.637 523.325 992.396 531.527 992.464 542.52L992.841 742.334C992.841 755.682 982.049 766.554 968.654 766.554C955.259 766.554 944.467 755.745 944.467 742.334C944.467 722.215 944.521 696.098 944.533 690.574L944.535 689.522L944.153 542.138C944.086 529.302 946.308 517.797 951.07 508.139C955.829 498.413 961.862 490.279 969.731 483.987C977.286 477.69 985.918 472.926 995.821 469.686C1005.73 466.508 1015.38 465.048 1025.28 465.174C1035.18 465.3 1045.08 466.949 1054.8 470.383C1064.51 473.879 1073.14 478.836 1081.08 485.317ZM784.166 503.878C784.166 482.584 766.896 465.3 745.632 465.3C724.368 465.3 707.099 482.584 707.099 503.878V542.452H746.203V542.389C767.22 542.07 784.166 524.979 784.166 503.878ZM857.103 465.3C872.087 465.3 884.212 477.438 884.212 492.436V739.408C884.212 754.41 872.087 766.549 857.103 766.549C842.123 766.549 829.998 754.41 829.998 739.408V492.436C829.998 477.438 842.127 465.3 857.103 465.3Z" fill="#E30613"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M446.65 460.46C452.452 449.493 448.275 435.894 437.321 430.085C426.367 424.276 412.783 428.457 406.981 439.425L406.981 439.425C406.976 439.434 406.887 439.597 406.679 439.92C406.467 440.249 406.171 440.684 405.778 441.22C404.985 442.302 403.912 443.642 402.557 445.183C399.837 448.274 396.282 451.83 392.17 455.353C385.43 461.126 378.253 465.906 371.735 468.791C370.172 469.266 368.626 469.796 367.098 470.383C357.133 473.942 348.626 478.265 340.757 484.62C332.951 491.038 326.536 498.858 321.522 508.835C316.508 518.817 314.411 530.192 314.411 542.327L313.716 689.077V689.522V689.779C313.716 724.223 336.951 753.777 368.562 762.486L369.325 762.869L369.451 762.931C378.151 765.605 386.72 766.747 394.841 766.747C394.978 766.747 395.113 766.729 395.239 766.712C395.349 766.698 395.451 766.684 395.541 766.684C395.576 766.684 395.609 766.685 395.642 766.687C395.685 766.69 395.726 766.694 395.767 766.699C395.808 766.704 395.848 766.71 395.889 766.716C396 766.731 396.111 766.747 396.236 766.747C406.202 766.747 416.167 765.286 425.437 761.727C435.407 758.167 443.909 753.848 451.783 747.489C459.271 741.202 464.985 734.847 469.811 725.184C470.448 723.912 471.081 722.515 471.588 721.117C477.559 705.917 465.623 689.711 449.436 689.711C439.659 689.711 430.582 695.621 427.466 704.902C422.578 719.202 410.332 724.667 395.98 724.667C382.837 724.667 371.601 717.103 366.017 706.173C365.191 704.645 364.558 702.996 363.988 701.279C362.906 697.976 362.21 694.542 362.21 690.916C362.21 690.821 362.227 690.743 362.244 690.664C362.26 690.585 362.277 690.507 362.277 690.412C362.277 690.326 362.27 690.247 362.26 690.17C362.255 690.132 362.249 690.095 362.243 690.058C362.227 689.947 362.21 689.836 362.21 689.711V621.327H395.092C405.569 621.327 415.916 619.358 425.626 615.61C434.833 612.05 444.04 607.794 451.846 601.439C459.72 595.017 466.067 587.202 471.082 577.22C476.096 567.243 478.192 555.868 478.192 543.729V543.028C478.192 542.891 478.173 542.755 478.155 542.629V542.628C478.145 542.558 478.135 542.49 478.13 542.426C478.126 542.392 478.125 542.358 478.125 542.327H478.192C478.192 530.192 476.033 518.817 471.082 508.835C466.067 498.858 459.72 491.038 451.846 484.62C447.062 480.684 441.99 477.3 436.486 474.61C440.777 469.702 444.337 464.833 446.65 460.46ZM277.53 509.981C272.641 500.193 266.226 491.928 258.546 485.384C250.609 478.904 241.981 473.942 232.267 470.45C222.553 467.016 212.65 465.362 202.748 465.237C192.845 465.111 183.198 466.572 173.291 469.749C163.388 472.994 154.756 477.758 147.201 484.05C144.862 485.919 142.686 487.951 140.657 490.138C136.083 486.053 130.913 482.435 125.187 479.34C124.877 479.205 124.505 479.003 124.195 478.8C109.13 471.21 91.3711 482.477 91.03 499.312L91.0031 502.112C90.846 511.262 96.6367 519.069 104.964 522.83C108.968 524.61 112.254 527.257 114.754 530.641C118.392 535.157 120.639 540.387 121.628 546.129L122 689.585L121.998 690.651C121.986 696.204 121.932 722.298 121.932 742.402C121.932 755.808 132.724 766.617 146.124 766.617C159.514 766.617 170.31 755.75 170.31 742.339L169.929 542.524C169.861 531.531 173.102 523.329 179.706 518.309C186.309 513.289 193.927 510.552 202.81 510.615C211.694 510.741 219.631 513.348 225.978 518.813C229.277 521.419 231.823 524.79 233.47 528.853C236.963 537.307 244.581 543.347 253.72 543.473L256.516 543.535C273.337 543.729 285.143 526.314 278.037 510.997C277.844 510.678 277.655 510.296 277.53 509.981ZM419.09 567.881C425.505 562.919 429.055 554.34 429.055 543.661V542.902C429.055 532.223 425.505 523.707 419.09 518.687C411.979 513.667 404.869 510.804 395.603 510.804C386.338 510.804 378.532 513.667 372.117 518.687C365.707 523.644 362.151 532.223 362.151 542.902V575.696H395.603C404.869 575.696 412.675 572.901 419.09 567.881ZM635.244 612.814L583.378 564.96C572.712 555.297 568.654 545.634 568.654 535.468C568.654 519.199 579.823 505.474 597.599 505.474C613.028 505.474 621.979 514.88 627.496 529.877C630.418 537.823 637.717 543.288 646.161 543.288H646.349C659.875 543.288 669.265 530.003 665.014 517.105C655.112 487.043 632.191 465.241 595.566 465.241C549.854 465.241 519.832 491.173 519.832 537.504C519.832 572.074 535.575 591.97 555.887 609.259L606.164 652.476C622.921 666.709 630.032 679.419 630.032 696.201C630.032 715.018 619.366 727.216 600.068 727.216C584.006 727.216 573.278 719.526 566.356 703.953C562.486 695.311 554.294 689.527 544.835 689.527H543.57C526.3 689.527 515.253 707.639 522.745 723.211C535.947 750.604 561.211 767.444 595.494 767.444C643.737 767.444 676.812 742.532 676.812 692.134C676.951 654.566 656.126 632.131 635.244 612.814Z" fill="black"/> +</svg> diff --git a/src/index.html b/src/index.html index 1dfbff37e..17a60d8dc 100644 --- a/src/index.html +++ b/src/index.html @@ -5,6 +5,14 @@ <title>Réseau des Acteurs de la Médiation</title> <base href="/" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta property="og:title" content="Réseau des Acteurs de la Médiation" /> + <meta + property="og:description" + content="Plateforme à destination des acteurs de l'inclusion numérique de la métropole de Lyon" + /> + <meta property="og:image" content="https://resin.grandlyon.com/assets/logos/logo_1200.svg" /> + > + <link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css" /> <link -- GitLab From 13617b91b52a4b7726ea6a0a7bb515e1266e822e Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 11:21:56 +0100 Subject: [PATCH 40/65] fix(autoComplete) : fix adress response --- .../address-autocomplete.component.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts b/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts index 5bfb99bbf..7212396ad 100644 --- a/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts +++ b/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts @@ -28,7 +28,7 @@ export class AddressAutocompleteComponent implements OnInit { if (!this.isAlreadySearching) { this.isAlreadySearching = true; this.addressService.searchAddress(searchString).subscribe((data) => { - this.data = data.hits.hits.slice(0, this.AUTOCOMPLETE_NBR); + this.data = data.features; this.isAlreadySearching = false; }); } @@ -37,9 +37,9 @@ export class AddressAutocompleteComponent implements OnInit { public selectedResult(hit: any): void { const address = new Address(); - address.numero = hit._source['data-fr'].properties.numero_str; - address.street = hit._source['data-fr'].properties.voie_str; - address.commune = hit._source['data-fr'].properties.commune_str; + address.numero = hit.properties.housenumber ? hit.properties.housenumber : 0; + address.street = hit.properties.street; + address.commune = hit.properties.city; const value = this.parseHitToAddress(hit); // Set input value this.searchAddress.nativeElement.value = value; @@ -50,6 +50,9 @@ export class AddressAutocompleteComponent implements OnInit { } public parseHitToAddress(hit: any): string { - return `${hit._source['data-fr'].properties.numero_str} ${hit._source['data-fr'].properties.voie_str} ${hit._source['data-fr'].properties.commune_str}`; + if (hit.properties.housenumber) { + return `${hit.properties.housenumber} ${hit.properties.street} ${hit.properties.city}`; + } + return `${hit.properties.street} ${hit.properties.city}`; } } -- GitLab From 66e1c44802f2cc52177a035e530189bcf71b3027 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 11:27:29 +0100 Subject: [PATCH 41/65] clean code --- src/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.html b/src/index.html index 17a60d8dc..7a2041e97 100644 --- a/src/index.html +++ b/src/index.html @@ -11,8 +11,6 @@ content="Plateforme à destination des acteurs de l'inclusion numérique de la métropole de Lyon" /> <meta property="og:image" content="https://resin.grandlyon.com/assets/logos/logo_1200.svg" /> - > - <link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css" /> <link -- GitLab From f6784bd242c87adab27fdfd839ad6cb2861833fc Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 12:05:29 +0100 Subject: [PATCH 42/65] fix(modal-filter) : fix color --- .../components/search/search.component.scss | 9 +++++---- src/styles.scss | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/structure-list/components/search/search.component.scss b/src/app/structure-list/components/search/search.component.scss index ec415e896..89773e528 100644 --- a/src/app/structure-list/components/search/search.component.scss +++ b/src/app/structure-list/components/search/search.component.scss @@ -60,12 +60,13 @@ } } .selected { - border-color: $primary-color !important; - color: inherit; + background-color: $secondary-color; + border-color: $secondary-color !important; + color: $white; .arrow { background-color: transparent; - border-bottom: 1px solid $primary-color; - border-right: 1px solid $primary-color; + border-bottom: 1px solid $white; + border-right: 1px solid $white; transform: translateY(25%) rotate(-135deg); margin: 0 5px 0 10px; height: 7px; diff --git a/src/styles.scss b/src/styles.scss index af9bc2768..a6fabff7a 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -106,7 +106,7 @@ button { opacity: 0; display: none; &:checked ~ .customCheck { - background-color: $primary-color; + background-color: $green-1; border-color: transparent; } &:checked ~ .customCheck:after { -- GitLab From 1f1ffb94f5b08038fe800bd8df6fb710aa42869f Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 14:21:52 +0100 Subject: [PATCH 43/65] fix(structure-details) : can go back on Home page --- .../components/card/card.component.ts | 9 +++++++- .../structure-details.component.html | 2 +- .../structure-details.component.scss | 2 +- .../structure-details.component.ts | 6 +++-- .../structure-list.component.ts | 22 ++++++++++++++++++- src/index.html | 1 - 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/app/structure-list/components/card/card.component.ts b/src/app/structure-list/components/card/card.component.ts index ed8b3158f..94440ab2d 100644 --- a/src/app/structure-list/components/card/card.component.ts +++ b/src/app/structure-list/components/card/card.component.ts @@ -1,4 +1,5 @@ import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; import { Structure } from '../../../models/structure.model'; import { GeojsonService } from '../../../services/geojson.service'; @@ -12,7 +13,7 @@ export class CardComponent implements OnInit { @Output() public showDetails: EventEmitter<Structure> = new EventEmitter<Structure>(); @Output() public hover: EventEmitter<Structure> = new EventEmitter<Structure>(); - constructor(private geoJsonService: GeojsonService) {} + constructor(private route: ActivatedRoute, private router: Router) {} ngOnInit(): void {} /** @@ -28,6 +29,12 @@ export class CardComponent implements OnInit { public cardClicked(): void { this.showDetails.emit(this.structure); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + id: this.structure._id, + }, + }); } public cardHover(): void { diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index 99d3963e8..160c48a0b 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.html +++ b/src/app/structure-list/components/structure-details/structure-details.component.html @@ -1,7 +1,7 @@ <div class="structrue-details-container" *ngIf="structure && !isLoading"> <!-- Header info --> <div fxLayout="row" fxLayoutAlign="end center"> - <div (click)="close(false)" class="ico-close-details"></div> + <div (click)="close()" class="ico-close-details"></div> </div> <div fxLayout="row" class="structure-details-block" fxLayoutAlign="baseline baseline" fxLayoutGap="8px"> <div fxLayout="column" fxLayoutGap="10px" fxFlex="100%"> diff --git a/src/app/structure-list/components/structure-details/structure-details.component.scss b/src/app/structure-list/components/structure-details/structure-details.component.scss index 19284a7cc..77a9025cc 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.scss +++ b/src/app/structure-list/components/structure-details/structure-details.component.scss @@ -18,7 +18,7 @@ a { left: 0; max-width: 980px; width: 100%; - height: calc(100vh - #{$header-height} - #{$footer-height}); + height: calc(100vh - #{$header-height} - #{$footer-height} - 20px); padding: 10px 24px; overflow: auto; @media #{$tablet} { diff --git a/src/app/structure-list/components/structure-details/structure-details.component.ts b/src/app/structure-list/components/structure-details/structure-details.component.ts index 215f44fa9..2bea610b8 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.ts +++ b/src/app/structure-list/components/structure-details/structure-details.component.ts @@ -107,8 +107,10 @@ export class StructureDetailsComponent implements OnInit { } } - public close(refreshRequired: boolean): void { - this.closeDetails.emit(refreshRequired); + public close(): void { + this.router.navigate([], { + relativeTo: this.route, + }); } public print(): void { diff --git a/src/app/structure-list/structure-list.component.ts b/src/app/structure-list/structure-list.component.ts index 45624ec9e..22404f28f 100644 --- a/src/app/structure-list/structure-list.component.ts +++ b/src/app/structure-list/structure-list.component.ts @@ -3,6 +3,8 @@ import { Filter } from './models/filter.model'; import { Structure } from '../models/structure.model'; import { GeoJson } from '../map/models/geojson.model'; import * as _ from 'lodash'; +import { ActivatedRoute, Router } from '@angular/router'; +import { StructureService } from '../services/structure.service'; @Component({ selector: 'app-structure-list', @@ -28,11 +30,29 @@ export class StructureListComponent implements OnChanges { private arrayChunked: Structure[][] = []; private chunck = 10; - constructor() {} + constructor(private route: ActivatedRoute, private router: Router, private structureService: StructureService) { + this.route.queryParams.subscribe((queryParams) => { + if (queryParams.id) { + if (!this.structure) { + this.structureService.getStructure(queryParams.id).subscribe((s) => { + this.showDetails(new Structure(s)); + }); + } + } else { + this.closeDetails(); + } + }); + } ngOnChanges(changes: SimpleChanges): void { if (changes.selectedStructure && this.selectedStructure) { this.showDetails(this.selectedStructure); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + id: this.selectedStructure._id, + }, + }); } if (changes.structureList) { this.structuresListChunked = this.chunckAnArray(this.structureList); diff --git a/src/index.html b/src/index.html index 17a60d8dc..51427aa9d 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,6 @@ content="Plateforme à destination des acteurs de l'inclusion numérique de la métropole de Lyon" /> <meta property="og:image" content="https://resin.grandlyon.com/assets/logos/logo_1200.svg" /> - > <link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css" /> -- GitLab From dc73fa7de92e8f8de9dbb745eb95dd4b8f0a0b86 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 14:32:54 +0100 Subject: [PATCH 44/65] fix(autocomplete) : fix logic no number --- .../address-autocomplete/address-autocomplete.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts b/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts index 7212396ad..c0dce3bde 100644 --- a/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts +++ b/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts @@ -20,7 +20,9 @@ export class AddressAutocompleteComponent implements OnInit { ngOnInit(): void { if (this.address) { - const address_str = this.address.numero + ' ' + this.address.street + ' ' + this.address.commune; + const address_str = this.address.numero + ? this.address.numero + ' ' + : '' + this.address.street + ' ' + this.address.commune; this.searchAddress.nativeElement.value = address_str; } } @@ -37,7 +39,7 @@ export class AddressAutocompleteComponent implements OnInit { public selectedResult(hit: any): void { const address = new Address(); - address.numero = hit.properties.housenumber ? hit.properties.housenumber : 0; + address.numero = hit.properties.housenumber ? hit.properties.housenumber : null; address.street = hit.properties.street; address.commune = hit.properties.city; const value = this.parseHitToAddress(hit); -- GitLab From d6ae4ccdfdfc05e7adc98f853634f879d52648b8 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 15:00:41 +0100 Subject: [PATCH 45/65] fix(route) : fix routing params with id --- src/app/form/form.component.html | 2 ++ .../user-verification/user-verification.component.html | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index aa2263591..46b374e87 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -1151,6 +1151,7 @@ *ngIf="currentPage == nbPagesForm && profile" class="btn-primary unique" routerLink="/home" + [queryParams]="{ id: createdStructure._id }" [state]="{ data: createdStructure }" > Voir ma structure @@ -1193,6 +1194,7 @@ *ngIf="currentPage == nbPagesForm && profile" class="btn-primary unique" routerLink="/home" + [queryParams]="{ id: createdStructure._id }" [state]="{ data: createdStructure }" > Voir ma structure diff --git a/src/app/user-verification/user-verification.component.html b/src/app/user-verification/user-verification.component.html index 628bb8efe..c1e11207d 100644 --- a/src/app/user-verification/user-verification.component.html +++ b/src/app/user-verification/user-verification.component.html @@ -37,7 +37,13 @@ ></div> </div> <div class="btnSection" fxLayout="row" fxLayoutAlign="space-around center"> - <button *ngIf="structure && verificationSuccess" class="btn" routerLink="/home" [state]="{ data: structure }"> + <button + *ngIf="structure && verificationSuccess" + class="btn" + routerLink="/home" + [queryParams]="{ id: structure._id }" + [state]="{ data: structure }" + > Voir ma structure </button> </div> -- GitLab From d9169d18b312dea3842197fd501084ff605d4522 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Wed, 10 Mar 2021 10:50:40 +0100 Subject: [PATCH 46/65] Feat/post tags --- src/app/app-routing.module.ts | 2 +- src/app/header/header.component.html | 12 +- .../post-card/post-card.component.ts | 2 +- .../post-details/post-details.component.ts | 2 +- .../post-header/post-header.component.html | 76 ++++++++- .../post-header/post-header.component.scss | 150 ++++++++++++++++++ .../post-header/post-header.component.ts | 97 ++++++++++- .../post-list/post-list.component.html | 65 ++++++-- .../post-list/post-list.component.scss | 21 ++- .../post-list/post-list.component.ts | 123 ++++++++++++-- .../post-modal-filters.component.html | 34 ++++ .../post-modal-filters.component.scss | 132 +++++++++++++++ .../post-modal-filters.component.spec.ts | 25 +++ .../post-modal-filters.component.ts | 72 +++++++++ src/app/post/components/utils/NewsUtils.ts | 11 ++ src/app/post/enum/tag.enum.ts | 6 + src/app/post/enum/typeModalNews.enum.ts | 4 + src/app/post/models/tag.model.ts | 6 + src/app/post/models/tagWithMeta.model.ts | 7 + src/app/post/news.component.html | 3 +- src/app/post/news.component.ts | 6 + src/app/post/post-routing.module.ts | 4 + src/app/post/post.module.ts | 12 +- src/app/post/resolvers/tags.resolver.ts | 21 +++ src/app/post/services/post.service.ts | 10 +- src/app/profile/services/profile.service.ts | 1 - .../svg-icon/svg-icon.component.scss | 12 ++ src/assets/ico/sprite.svg | 22 +++ src/assets/scss/_layout.scss | 2 +- src/index.html | 2 - 30 files changed, 888 insertions(+), 54 deletions(-) create mode 100644 src/app/post/components/post-modal-filters/post-modal-filters.component.html create mode 100644 src/app/post/components/post-modal-filters/post-modal-filters.component.scss create mode 100644 src/app/post/components/post-modal-filters/post-modal-filters.component.spec.ts create mode 100644 src/app/post/components/post-modal-filters/post-modal-filters.component.ts create mode 100644 src/app/post/components/utils/NewsUtils.ts create mode 100644 src/app/post/enum/typeModalNews.enum.ts create mode 100644 src/app/post/models/tagWithMeta.model.ts create mode 100644 src/app/post/resolvers/tags.resolver.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 9b85e5e1b..b8a27b65e 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -88,7 +88,7 @@ const routes: Routes = [ canDeactivate: [DeactivateGuard], }, { - path: 'posts', + path: 'news', loadChildren: () => import('./post/post.module').then((m) => m.PostModule), }, { diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html index 9d31ad373..7fc0ea9a6 100644 --- a/src/app/header/header.component.html +++ b/src/app/header/header.component.html @@ -9,14 +9,10 @@ <app-svg-icon (click)="openMenu()" [type]="'ico'" [icon]="'menu'" [iconClass]="'icon-32'"></app-svg-icon> </div> <div fxLayout="row" class="right-header" fxLayoutAlign="center center" fxLayoutGap="3vw"> - <a routerLink="/home" [routerLinkActive]="'active'" i18n>Les acteurs</a> + <a routerLink="/news" [routerLinkActive]="'active'" i18n>Actualités</a> + <a routerLink="/home" [routerLinkActive]="'active'" i18n>Cartographie de acteurs</a> <a routerLink="/about" [routerLinkActive]="'active'" i18n>Qui sommes-nous ?</a> - <!-- <a routerLink="/news" [routerLinkActive]="'active'" i18n>Actualités</a> --> - <!-- <a routerLink="/resources" [routerLinkActive]="'active'" i18n>Ressources</a> --> <a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'">Administration</a> - <!-- <a *ngIf="isLoggedIn" routerLink="/profile" [routerLinkActive]="'active'" fxLayout="row" fxLayoutGap="1.5vh"> - <app-svg-icon [type]="'ico'" [iconClass]="'icon-32'" [icon]="'user'" [iconColor]="'currentColor'"></app-svg-icon> - </a> --> <button *ngIf="isLoggedIn" class="red" routerLink="/profile" [routerLinkActive]="'active'"> {{ displayName }} </button> @@ -32,7 +28,8 @@ <div (click)="closeMenu()" class="ico-close-details"></div> </div> <div fxLayout="column" class="right-header" fxLayoutAlign="none baseline" fxLayoutGap="5vw"> - <a routerLink="/home" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Les acteurs</a> + <a routerLink="/news" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Actualités</a> + <a routerLink="/home" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Cartographie de acteurs</a> <a routerLink="/about" [routerLinkActive]="'active'" i18n>Qui sommes-nous ?</a> <a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'" (click)="closeMenu()">Administration</a> </div> @@ -47,7 +44,6 @@ </div> <app-signup-modal *ngIf="displaySignUp" [openned]="isPopUpOpen" (closed)="closeSignUpModal($event)"></app-signup-modal> -<!-- <app-signin-modal *ngIf="!displaySignUp" [openned]="isPopUpOpen" (closed)="closeSignInModal()"></app-signin-modal> --> <ng-template #customTitle> <img class="desktop-show logo-grand-lyon" src="/assets/logos/resin.svg" alt /> diff --git a/src/app/post/components/post-card/post-card.component.ts b/src/app/post/components/post-card/post-card.component.ts index e97a5fe74..78970f17f 100644 --- a/src/app/post/components/post-card/post-card.component.ts +++ b/src/app/post/components/post-card/post-card.component.ts @@ -16,6 +16,6 @@ export class PostCardComponent implements OnInit { ngOnInit(): void {} public showDetails(post: Post): void { - this.router.navigateByUrl('posts/details/' + post.id, { state: { data: post } }); + this.router.navigateByUrl('news/details/' + post.id, { state: { data: post } }); } } diff --git a/src/app/post/components/post-details/post-details.component.ts b/src/app/post/components/post-details/post-details.component.ts index 31f7b0f62..797763328 100644 --- a/src/app/post/components/post-details/post-details.component.ts +++ b/src/app/post/components/post-details/post-details.component.ts @@ -31,6 +31,6 @@ export class PostDetailsComponent implements OnInit { } public backToPosts(): void { - this.router.navigateByUrl('/posts'); + this.router.navigateByUrl('/news'); } } diff --git a/src/app/post/components/post-header/post-header.component.html b/src/app/post/components/post-header/post-header.component.html index 6d9a4faab..6b48f6d33 100644 --- a/src/app/post/components/post-header/post-header.component.html +++ b/src/app/post/components/post-header/post-header.component.html @@ -1 +1,75 @@ -<div class="header-container">post-header works!</div> +<div class="header-container"> + <div class="section-container" fxLayout="column" fxLayoutAlign="space-between"> + <h1>Actualités</h1> + <div fxLayout="row" fxLayoutGap="5px" fxLayoutAlign="space-between flex-end" class="overflow"> + <div fxLayout="row" class="row-mobile"> + <div fxLayout="row" fxLayoutAlign="center center" *ngFor="let tag of tags.others"> + <span + class="tag-button" + tabindex="0" + (click)="activateTag(tag)" + (keydown.enter)="activateTag(tag)" + [ngClass]="{ active: tag.slug === mainActiveTag.slug }" + >{{ tag.name }}</span + > + </div> + </div> + <div + class="btnSection" + fxLayout="row" + fxLayoutAlign="space-between center" + fxLayoutGap="16px" + (clickOutside)="closeModal()" + > + <button + type="button" + fxLayout="row" + [ngClass]="{ + selected: modalTypeOpened === TypeModal.public, + containCheckedFilters: checkedPublicTags.length > 0 + }" + fxLayoutAlign="space-between center" + (click)="openModal(TypeModal.public)" + > + <span class="text">Tout public</span> + <app-svg-icon + class="icon" + [type]="'ico'" + [iconClass]="modalTypeOpened === TypeModal.public ? 'white' : 'grey-1'" + [icon]="'news-public'" + ></app-svg-icon> + <div class="arrow"></div> + </button> + <button + class="btn-filter-no-margin" + type="button" + fxLayout="row" + [ngClass]="{ + selected: modalTypeOpened === TypeModal.location, + containCheckedFilters: checkedLocationTags.length > 0 + }" + fxLayoutAlign="space-between center" + (click)="openModal(TypeModal.location)" + > + <span class="text">Toutes les communes</span> + <app-svg-icon + class="icon" + [type]="'ico'" + [iconClass]="modalTypeOpened === TypeModal.location ? 'white' : 'grey-1'" + [icon]="'news-location'" + ></app-svg-icon> + <div class="arrow"></div> + </button> + <div *ngIf="modalTypeOpened"> + <app-post-modal-filters + [modalType]="modalTypeOpened" + [tags]="getModalData()" + [inputCheckedTags]="getCheckedModalData()" + (searchEvent)="filter($event)" + (closeEvent)="closeModal()" + ></app-post-modal-filters> + </div> + </div> + </div> + </div> +</div> diff --git a/src/app/post/components/post-header/post-header.component.scss b/src/app/post/components/post-header/post-header.component.scss index 526d11201..46d4f71b1 100644 --- a/src/app/post/components/post-header/post-header.component.scss +++ b/src/app/post/components/post-header/post-header.component.scss @@ -1,7 +1,157 @@ @import '../../../../assets/scss/color'; +@import '../../../../assets/scss/buttons'; +@import '../../../../assets/scss/typography'; +@import '../../../../assets/scss/breakpoint'; @import '../../../../assets/scss/layout'; +h1 { + margin-bottom: 0px; +} + .header-container { height: #{$header-post-height}; background: $white; } + +.section-container { + height: 100%; +} + +.btnSection { + padding: 16px 0 0px 0; + button { + background: $white; + height: 40px; + width: 100%; + border: 1px solid $grey-4; + padding: 3px 16px 3px 16px; + outline: none; + border-radius: 4px; + cursor: pointer; + white-space: nowrap; + @include btn-normal; + .arrow { + background-color: transparent; + border-bottom: 1px solid $grey-2; + border-right: 1px solid $grey-2; + transform: translateY(-25%) rotate(45deg); + margin: 0 5px 0 10px; + height: 7px; + width: 7px; + } + &:focus { + border-color: $blue-hover; + } + } + .selected { + background-color: $secondary-color; + border-color: $secondary-color !important; + color: $white; + .arrow { + background-color: transparent; + border-bottom: 1px solid $white; + border-right: 1px solid $white; + transform: translateY(25%) rotate(-135deg); + margin: 0 5px 0 10px; + height: 7px; + width: 7px; + } + } + .containCheckedFilters { + border-color: $secondary-color; + } + .icon { + display: none !important; + } + @media #{$desktop} { + button { + width: 90px; + } + .text { + display: none !important; + } + .icon { + display: inherit !important; + } + } + @media #{$tablet} { + button { + display: none !important; + } + } +} + +// .btnSection { +// padding: 16px 0 0px 0; +// button { +// background: $white; +// height: 40px; +// width: 210px; +// border: 1px solid $grey-4; +// padding: 3px 16px 3px 16px; +// outline: none; +// border-radius: 4px; +// cursor: pointer; +// white-space: nowrap; +// @include btn-normal; +// .arrow { +// background-color: transparent; +// border-bottom: 1px solid $grey-2; +// border-right: 1px solid $grey-2; +// transform: translateY(-25%) rotate(45deg); +// margin: 0 5px 0 10px; +// height: 7px; +// width: 7px; +// } +// &:focus { +// border-color: $blue-hover; +// } +// } +// .selected { +// border-color: $primary-color !important; +// color: inherit; +// .arrow { +// background-color: transparent; +// border-bottom: 1px solid $primary-color; +// border-right: 1px solid $primary-color; +// transform: translateY(25%) rotate(-135deg); +// margin: 0 5px 0 10px; +// height: 7px; +// width: 7px; +// } +// } +// .containCheckedFilters { +// border-color: $secondary-color; +// } +// } + +.tag-button { + padding: 8px 10px; + @include cn-regular-16; + cursor: pointer; + white-space: nowrap; + &.active { + background-color: $secondary-color; + color: $white; + } + &:focus { + outline-color: $secondary-color; + } +} + +// Remove margin right on filter pop-up trigger +.btn-filter-no-margin { + margin-right: 0 !important; +} + +.row-mobile { + @media #{$tablet} { + width: 100%; + justify-content: space-between; + } +} +.overflow { + @media #{$tablet} { + overflow-y: scroll; + } +} diff --git a/src/app/post/components/post-header/post-header.component.ts b/src/app/post/components/post-header/post-header.component.ts index 4927d262b..1cbc7f338 100644 --- a/src/app/post/components/post-header/post-header.component.ts +++ b/src/app/post/components/post-header/post-header.component.ts @@ -1,15 +1,106 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { Tag } from '../../models/tag.model'; +import { TagWithMeta } from '../../models/tagWithMeta.model'; +import * as _ from 'lodash'; +import { TypeModalNews } from '../../enum/typeModalNews.enum'; +import { ActivatedRoute, Router } from '@angular/router'; +import { TagEnum } from '../../enum/tag.enum'; +import { parseSlugToTag } from '../utils/NewsUtils'; @Component({ selector: 'app-post-header', templateUrl: './post-header.component.html', - styleUrls: ['./post-header.component.scss'] + styleUrls: ['./post-header.component.scss'], }) export class PostHeaderComponent implements OnInit { + public modalTypeOpened: TypeModalNews; + public tags: TagWithMeta; + public mainActiveTag: Tag = new Tag({ slug: TagEnum.aLaUne }); + public tagEnum = TagEnum; - constructor() { } + public checkedPublicTags: Tag[] = []; + public checkedLocationTags: Tag[] = []; + + constructor(private route: ActivatedRoute, private router: Router) {} ngOnInit(): void { + this.route.data.subscribe((data) => { + if (data.tags) { + this.tags = data.tags; + } + }); + + this.route.queryParams.subscribe((queryParams) => { + if (queryParams.mainTag) { + this.mainActiveTag = new Tag({ slug: queryParams.mainTag }); + } + if (queryParams.publicTags) { + this.checkedPublicTags = parseSlugToTag(queryParams.publicTags); + } + if (queryParams.locationTags) { + this.checkedLocationTags = parseSlugToTag(queryParams.locationTags); + } + }); + } + + // Open the modal and display the list according to the right filter button + public openModal(modalType: TypeModalNews): void { + // if modal already opened, reset type + if (this.modalTypeOpened === modalType) { + this.closeModal(); + } else if (this.modalTypeOpened !== modalType) { + this.modalTypeOpened = modalType; + } + } + + public closeModal(): void { + this.modalTypeOpened = undefined; + } + + // Accessor to template angular. + public get TypeModal(): typeof TypeModalNews { + return TypeModalNews; + } + + public getModalData(): Tag[] { + if (this.modalTypeOpened === this.TypeModal.public) { + return this.tags.public; + } + return this.tags.commune; + } + + public getCheckedModalData(): Tag[] { + if (this.modalTypeOpened === this.TypeModal.public) { + return this.checkedPublicTags; + } + return this.checkedLocationTags; + } + + public activateTag(tag: Tag): void { + this.mainActiveTag = tag; + this.setQueryParam(); } + public filter(data: Tag[]): void { + if (this.modalTypeOpened === this.TypeModal.public) { + this.checkedPublicTags = data; + } else { + this.checkedLocationTags = data; + } + + this.setQueryParam(); + this.closeModal(); + } + + private setQueryParam(): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + mainTag: this.mainActiveTag.slug, + publicTags: this.checkedPublicTags.map((tag) => tag.slug), + locationTags: this.checkedLocationTags.map((tag) => tag.slug), + }, + queryParamsHandling: 'merge', + }); + } } 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 190d108eb..edb7da66c 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -1,6 +1,21 @@ <div class="section-container" fxLayout="row" fxLayoutGap="32px"> <div fxLayout="column" class="list-container" fxLayoutGap="16px"> - <div fxLayout="column"> + <div fxLayout="column" *ngIf="displayTags()"> + <div fxLayout="row wrap" fxLayoutAlign="none center" fxLayoutGap="8px"> + <div + fxLayout="row" + fxLayoutAlign="start center" + fxLayoutGap="9px" + *ngFor="let filter of filters | slice: 1" + class="tag" + (click)="removeTag(filter)" + > + <p>{{ filter.slug | titlecase }}</p> + <app-svg-icon [type]="'ico'" [iconColor]="'currentColor'" [icon]="'cancel'"></app-svg-icon> + </div> + </div> + </div> + <div fxLayout="column" *ngIf="isALaUneTag() && !displayTags()"> <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> <h2>à la une</h2> <app-button @@ -16,18 +31,33 @@ <div class="background-project-container"> <div class="project-content mobile" fxLayout="column"> <h2>appels à projets</h2> - <app-post-card - [post]="news" - [class]="'project'" - [ngClass]="{ 'last-child': last }" - *ngFor="let news of projectsNew; let last = last" - ></app-post-card> + <div *ngIf="projectsNew.length !== 0"> + <app-post-card + [post]="news" + [class]="'project'" + [ngClass]="{ 'last-child': last }" + *ngFor="let news of projectsNew; let last = last" + ></app-post-card> + </div> + <div *ngIf="projectsNew.length === 0"> + <p>Aucun appels à projet pour le moment.</p> + </div> </div> </div> </div> <div fxLayout="column"> - <div fxLayout="row" class="row-border otherNews"> - <h2>autres actualités</h2> + <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> + <h2 [ngClass]="{ 'padding-16-Top': isALaUneTag() && !displayTags() }">{{ getDisplayedTag() }}</h2> + <app-button + *ngIf="displayTags() || !isALaUneTag()" + [type]="'button'" + [style]="'buttonWithHash'" + [text]="'Publier votre actu'" + (action)="publishNews()" + ></app-button> + </div> + <div *ngIf="leftColumnPosts.length <= 0" fxLayout="column"> + <p>Aucun résultat ne correspond a votre recherche.</p> </div> <div fxLayout="row" fxLayoutGap="33px"> <div fxLayout="column" class="columnPosts"> @@ -47,12 +77,17 @@ <div class="project-content" fxLayout="column"> <app-svg-icon [iconClass]="'icon-80'" [iconColor]="'inherit'" [type]="'post'" [icon]="'appels'"></app-svg-icon> <h2>appels à projets</h2> - <app-post-card - [post]="news" - [class]="'project'" - [ngClass]="{ 'last-child': last }" - *ngFor="let news of projectsNew; let last = last" - ></app-post-card> + <div *ngIf="projectsNew.length !== 0"> + <app-post-card + [post]="news" + [class]="'project'" + [ngClass]="{ 'last-child': last }" + *ngFor="let news of projectsNew; let last = last" + ></app-post-card> + </div> + <div *ngIf="projectsNew.length === 0"> + <p>Aucun appels à projet pour le moment.</p> + </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 27a518b91..ea2f433a9 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -6,12 +6,11 @@ .section-container { background: $grey-6; margin-top: 40px; + min-height: 68vh; + width: 100%; .row-border { border-bottom: 1px dashed $grey-4; padding-bottom: 16px; - &.otherNews { - padding-top: 24px; - } } h2 { font-style: italic !important; @@ -100,3 +99,19 @@ h2 { } } } +.tag { + background: $grey-3; + color: $white; + border-radius: 20px; + cursor: pointer; + margin-bottom: 10px; + padding: 0 20px; + p { + margin-top: 0; + margin-bottom: 0; + } +} + +.padding-16-Top { + padding-top: 16px; +} 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 807c2b9c2..3ec4088c5 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -3,8 +3,12 @@ import { WindowScrollService } from '../../../shared/service/windowScroll.servic import { TagEnum } from '../../enum/tag.enum'; import { Pagination } from '../../models/pagination.model'; import { Post } from '../../models/post.model'; +import { Tag } from '../../models/tag.model'; import { PostWithMeta } from '../../models/postWithMeta.model'; import { PostService } from '../../services/post.service'; +import { ActivatedRoute, Router } from '@angular/router'; +import * as _ from 'lodash'; +import { parseSlugToTag } from '../utils/NewsUtils'; @Component({ selector: 'app-post-list', @@ -12,7 +16,24 @@ import { PostService } from '../../services/post.service'; styleUrls: ['./post-list.component.scss'], }) export class PostListComponent implements OnInit { - constructor(private postService: PostService, private windowScrollService: WindowScrollService) { + public selectedMainTagSlug = ''; + public selectedLocationTagSlug = []; + public selectedPublicTagsSlug = []; + public filters: Tag[]; + public postsMobileView: Post[] = []; + public leftColumnPosts: Post[] = []; + public rightColumnPosts: Post[] = []; + public projectsNew: Post[] = []; + public bigNews: Post; + public pagination: Pagination; + public isLoading = false; + + 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) { @@ -21,28 +42,86 @@ export class PostListComponent implements OnInit { } }); } - public postsMobileView: Post[] = []; - public leftColumnPosts: Post[] = []; - public rightColumnPosts: Post[] = []; - public projectsNew: Post[] = []; - public bigNews: Post; - public pagination: Pagination; - public isLoading = false; ngOnInit(): void { this.isLoading = true; - this.postService.getPosts(1).subscribe((news) => { - this.setNews(news); + // Init APP news list + this.postService.getPosts(1, [TagEnum.appels]).subscribe((news) => { + let projectNews = news.posts.map((news) => (news = this.addAuthorToPost(news))); + this.projectsNew = projectNews; }); this.postService.getPosts(1, [TagEnum.aLaUne]).subscribe((news) => { this.bigNews = this.addAuthorToPost(news.posts[0]); }); - this.postService.getPosts(1, [TagEnum.appels]).subscribe((news) => { - let projectNews = news.posts.map((news) => (news = this.addAuthorToPost(news))); - this.projectsNew = projectNews; + this.route.queryParams.subscribe((queryParams) => { + // If main tag is in route, set it + if (queryParams.mainTag) { + this.selectedMainTagSlug = queryParams.mainTag; + this.selectedPublicTagsSlug = parseSlugToTag(queryParams.publicTags); + this.selectedLocationTagSlug = parseSlugToTag(queryParams.locationTags); + // Set filters for search and display + this.filters = [ + new Tag({ slug: queryParams.mainTag }), + ...this.selectedLocationTagSlug, + ...this.selectedPublicTagsSlug, + ]; + // Apply search + this.getPosts(this.filters); + } else { + // Init default news list + this.postService.getPosts(1).subscribe((news) => { + this.setNews(news); + }); + } }); } + public getPosts(filters?: Tag[]): void { + // Parse filter + let parsedFilters = null; + if (filters) { + parsedFilters = filters.map((filter) => { + return filter.slug; + }); + + // remove 'a la une' filter + parsedFilters = parsedFilters.filter((item) => { + return item !== TagEnum.aLaUne; + }); + + if (parsedFilters.length <= 0) { + parsedFilters = null; + } + } + + // Reset posts + this.resetPosts(); + + this.postService.getPosts(1, parsedFilters).subscribe((news) => { + this.setNews(news); + }); + } + + public getDisplayedTag(): string { + if (!this.isALaUneTag()) { + return this.selectedMainTagSlug; + } + return 'autres actualités'; + } + + public isALaUneTag(): boolean { + if (!this.filters || this.filters[0].slug === TagEnum.aLaUne) { + return true; + } + return false; + } + + public resetPosts(): void { + this.leftColumnPosts = []; + this.rightColumnPosts = []; + this.postsMobileView = []; + } + public publishNews(): void {} //Transform excerpt post to have a custom author. @@ -78,4 +157,22 @@ export class PostListComponent implements OnInit { }); this.isLoading = false; } + + public removeTag(tagToRemove: Tag): void { + _.remove(this.selectedPublicTagsSlug, { slug: tagToRemove.slug }); + _.remove(this.selectedLocationTagSlug, { slug: tagToRemove.slug }); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + mainTag: this.selectedMainTagSlug, + publicTags: this.selectedPublicTagsSlug.map((tag) => tag.slug), + locationTags: this.selectedLocationTagSlug.map((tag) => tag.slug), + }, + queryParamsHandling: 'merge', + }); + } + + public displayTags(): boolean { + return this.selectedLocationTagSlug.length > 0 || this.selectedPublicTagsSlug.length > 0; + } } diff --git a/src/app/post/components/post-modal-filters/post-modal-filters.component.html b/src/app/post/components/post-modal-filters/post-modal-filters.component.html new file mode 100644 index 000000000..7ee54d56c --- /dev/null +++ b/src/app/post/components/post-modal-filters/post-modal-filters.component.html @@ -0,0 +1,34 @@ +<div *ngIf="modalType" fxLayout="column" fxLayoutAlign="space-between" [ngClass]="['modal', 'modal' + getModalType()]"> + <div class="body-wrap" fxLayout="column" fxLayoutAlign="space-between"> + <div class="titleFilter" fxLayout="row" fxLayoutAlign="space-between"> + <span>Filtres</span> + <div (click)="closeModal()" class="ico-close-details"></div> + </div> + <div class="contentModal" fxLayout="row wrap" fxLayoutAlign="flex-start" *ngIf="tags.length > 0"> + <div class="blockFiltre"> + <ul class="blockLigne"> + <div fxLayout="row" class="ligneFiltre" *ngFor="let tag of tags"> + <li class="checkbox"> + <div class="checkboxItem"> + <label> + <input + type="checkbox" + [checked]="getIndex(checkedTags, tag.slug) > -1" + [value]="tag.id" + (change)="onCheckboxChange($event, tag)" + /> + <span class="customCheck"></span> + <div class="label">{{ tag.name }}</div> + </label> + </div> + </li> + </div> + </ul> + </div> + </div> + <div class="footer" fxLayout="row" fxLayoutAlign="end center" fxLayoutGap="3vw"> + <a (click)="clearFilters()" tabindex="0">Effacer</a> + <app-button [style]="'button'" [text]="'Appliquer'" (click)="emit(checkedTags)"></app-button> + </div> + </div> +</div> diff --git a/src/app/post/components/post-modal-filters/post-modal-filters.component.scss b/src/app/post/components/post-modal-filters/post-modal-filters.component.scss new file mode 100644 index 000000000..c897edd1c --- /dev/null +++ b/src/app/post/components/post-modal-filters/post-modal-filters.component.scss @@ -0,0 +1,132 @@ +@import '../../../../assets/scss/icons'; +@import '../../../../assets/scss/color'; +@import '../../../../assets/scss/typography'; +@import '../../../../assets/scss/breakpoint'; +@import '../../../../assets/scss/shapes'; +@import '../../../../assets/scss/hyperlink'; +@import '../../../../assets/scss/z-index'; + +.modallocation { + margin-left: -341px; +} +.modalpublic { + @media #{$desktop} { + margin-left: -446px; + } + margin-left: -566px; +} +.modal { + max-width: 341px; + width: 94%; + z-index: $modal-z-index !important; + position: absolute; + border-radius: 6px; + margin-top: 24px; + @media #{$large-phone} { + height: 100%; + max-height: auto; + max-width: auto; + width: 100%; + position: fixed; + top: 0; + left: 0; + border: none; + padding: 0; + } + @include background-hash($grey-2); + border: 1px solid $grey-4; + ::-webkit-scrollbar { + width: 16px; + } + ::-webkit-scrollbar-track { + background: $grey-6; + } + ::-webkit-scrollbar-thumb { + background: $grey; + border-radius: 6px; + } + .body-wrap { + @media #{$large-phone} { + height: 100vh; + height: -webkit-fill-available; + } + .titleFilter { + display: none !important; + margin: 27px 25px 0px 25px; + @include cn-bold-26; + @media #{$large-phone} { + display: flex !important; + } + } + } + .contentModal { + overflow-y: auto; + max-width: 1100px; + border-bottom: 1px solid $grey; + margin-bottom: 16px; + max-height: 40vh; + @media #{$large-phone} { + max-height: none; + height: 100%; + } + .blockFiltre { + width: 100%; + margin: 0 32px; + padding: 40px 0; + border-bottom: 1px dashed $grey-4; + + &:last-child { + padding-bottom: 32px; + border-bottom: none; + } + @media #{$large-phone} { + margin: 0 18px; + padding: 25px 0; + } + } + .blockLigne { + padding-left: 0; + -moz-column-count: 1; + -moz-column-gap: 46px; + -webkit-column-count: 1; + -webkit-column-gap: 46px; + column-count: 1; + column-gap: 46px; + margin: 0px; + @media #{$large-phone} { + -moz-column-count: 1; + -webkit-column-count: 1; + column-count: 1; + } + } + .ligneFiltre { + padding: 5px 0; + } + h4 { + @include cn-bold-16; + line-height: 17px; + text-transform: uppercase; + color: $grey-3; + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 9px; + } + .nbResult { + @include cn-regular-14; + line-height: 16px; + color: $grey-3; + padding-top: 3px; + } + label { + @include cn-regular-14; + } + } + .footer { + margin: 0px 20px 16px 0; + height: 32px; + } +} +a { + @include hyperlink; +} diff --git a/src/app/post/components/post-modal-filters/post-modal-filters.component.spec.ts b/src/app/post/components/post-modal-filters/post-modal-filters.component.spec.ts new file mode 100644 index 000000000..601a25abe --- /dev/null +++ b/src/app/post/components/post-modal-filters/post-modal-filters.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostModalFiltersComponent } from './post-modal-filters.component'; + +describe('PostModalFiltersComponent', () => { + let component: PostModalFiltersComponent; + let fixture: ComponentFixture<PostModalFiltersComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostModalFiltersComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostModalFiltersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/post/components/post-modal-filters/post-modal-filters.component.ts b/src/app/post/components/post-modal-filters/post-modal-filters.component.ts new file mode 100644 index 000000000..6624c5d0e --- /dev/null +++ b/src/app/post/components/post-modal-filters/post-modal-filters.component.ts @@ -0,0 +1,72 @@ +import { Component, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core'; +import { Tag } from '../../models/tag.model'; +import { TypeModalNews } from '../../enum/typeModalNews.enum'; +import { OnChanges } from '@angular/core'; + +@Component({ + selector: 'app-post-modal-filters', + templateUrl: './post-modal-filters.component.html', + styleUrls: ['./post-modal-filters.component.scss'], +}) +export class PostModalFiltersComponent implements OnInit, OnChanges { + @Input() public modalType: TypeModalNews; + @Input() public tags: Tag[]; + @Output() searchEvent = new EventEmitter(); + @Output() closeEvent = new EventEmitter(); + // Checkbox variable + @Input() public inputCheckedTags: Tag[] = []; + public checkedTags: Tag[] = []; + + constructor() {} + + ngOnChanges(changes: SimpleChanges): void { + if (changes.inputCheckedTags) { + this.checkedTags = this.inputCheckedTags; + } + } + + ngOnInit(): void { + this.checkedTags = this.inputCheckedTags; + } + + // Management of the checkbox event (Check / Uncheck) + public onCheckboxChange(event, tag: Tag): void { + if (event.target.checked) { + this.checkedTags.push(tag); + } else { + // Check if the module is present in the list and remove it + if (this.getIndex(this.checkedTags, tag.slug) > -1) { + this.checkedTags.splice(this.getIndex(this.checkedTags, tag.slug), 1); + } + } + } + + // Clear only filters in the current modal + public clearFilters(): void { + this.checkedTags = []; + this.searchEvent.emit(this.checkedTags); + } + + public getModalType(): string { + switch (this.modalType) { + case TypeModalNews.location: + return 'location'; + case TypeModalNews.public: + return 'public'; + default: + return ''; + } + } + + public emit(data: Tag[]): void { + this.searchEvent.emit(data); + } + + public getIndex(array: Tag[], slug: string): number { + return array.findIndex((tag: Tag) => tag.slug === slug); + } + + public closeModal(): void { + this.closeEvent.emit(); + } +} diff --git a/src/app/post/components/utils/NewsUtils.ts b/src/app/post/components/utils/NewsUtils.ts new file mode 100644 index 000000000..4bb4eea6b --- /dev/null +++ b/src/app/post/components/utils/NewsUtils.ts @@ -0,0 +1,11 @@ +import { Tag } from '../../models/tag.model'; + +export function parseSlugToTag(data: Tag[] | string): Tag[] { + let otherTags = []; + if (Array.isArray(data)) { + otherTags = data.map((slug) => new Tag({ slug: slug })); + } else if (data) { + otherTags = [new Tag({ slug: data })]; + } + return otherTags; +} diff --git a/src/app/post/enum/tag.enum.ts b/src/app/post/enum/tag.enum.ts index 0b6c049d9..8b95ae41b 100644 --- a/src/app/post/enum/tag.enum.ts +++ b/src/app/post/enum/tag.enum.ts @@ -1,4 +1,10 @@ export enum TagEnum { aLaUne = 'a-la-une', appels = 'appels', + projets = 'projets', + formations = 'formations', + infos = 'infos', + dossiers = 'dossiers', + etudes = 'etudes', + ressources = 'ressources', } diff --git a/src/app/post/enum/typeModalNews.enum.ts b/src/app/post/enum/typeModalNews.enum.ts new file mode 100644 index 000000000..d15c4e702 --- /dev/null +++ b/src/app/post/enum/typeModalNews.enum.ts @@ -0,0 +1,4 @@ +export enum TypeModalNews { + public = 1, + location, +} diff --git a/src/app/post/models/tag.model.ts b/src/app/post/models/tag.model.ts index df72a66b1..53b77b9e0 100644 --- a/src/app/post/models/tag.model.ts +++ b/src/app/post/models/tag.model.ts @@ -1,4 +1,10 @@ export class Tag { + id: string; name: string; slug: string; + description: string; // Description is used to ut categories on tags + + constructor(obj?: any) { + Object.assign(this, obj); + } } diff --git a/src/app/post/models/tagWithMeta.model.ts b/src/app/post/models/tagWithMeta.model.ts new file mode 100644 index 000000000..6b28aa489 --- /dev/null +++ b/src/app/post/models/tagWithMeta.model.ts @@ -0,0 +1,7 @@ +import { Tag } from './tag.model'; + +export class TagWithMeta { + commune: Tag[]; + public: Tag[]; + others: Tag[]; +} diff --git a/src/app/post/news.component.html b/src/app/post/news.component.html index ba58f058b..93d255936 100644 --- a/src/app/post/news.component.html +++ b/src/app/post/news.component.html @@ -1,4 +1,5 @@ -<app-post-header></app-post-header> +<app-post-header (filterTags)="setFilters($event)"></app-post-header> <div class="section-container"> + <!-- <app-post-list [filters]="filters"></app-post-list> --> <router-outlet></router-outlet> </div> diff --git a/src/app/post/news.component.ts b/src/app/post/news.component.ts index ce2f45998..40e237776 100644 --- a/src/app/post/news.component.ts +++ b/src/app/post/news.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Tag } from './models/tag.model'; @Component({ selector: 'app-news', @@ -6,7 +7,12 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./news.component.scss'], }) export class NewsComponent implements OnInit { + public filters: Tag[]; constructor() {} ngOnInit(): void {} + + public setFilters(tags: Tag[]): void { + this.filters = tags; + } } diff --git a/src/app/post/post-routing.module.ts b/src/app/post/post-routing.module.ts index e6f6a3e00..c95c0ba7c 100644 --- a/src/app/post/post-routing.module.ts +++ b/src/app/post/post-routing.module.ts @@ -3,11 +3,15 @@ import { Routes, RouterModule } from '@angular/router'; import { PostDetailsComponent } from './components/post-details/post-details.component'; import { PostListComponent } from './components/post-list/post-list.component'; import { NewsComponent } from './news.component'; +import { TagResolver } from './resolvers/tags.resolver'; const routes: Routes = [ { path: '', component: NewsComponent, + resolve: { + tags: TagResolver, + }, children: [ { path: '', diff --git a/src/app/post/post.module.ts b/src/app/post/post.module.ts index d51f1291c..e259e528b 100644 --- a/src/app/post/post.module.ts +++ b/src/app/post/post.module.ts @@ -7,9 +7,19 @@ import { PostListComponent } from './components/post-list/post-list.component'; import { PostDetailsComponent } from './components/post-details/post-details.component'; import { SharedModule } from '../shared/shared.module'; import { PostCardComponent } from './components/post-card/post-card.component'; +import { PostModalFiltersComponent } from './components/post-modal-filters/post-modal-filters.component'; +import { TagResolver } from './resolvers/tags.resolver'; @NgModule({ - declarations: [NewsComponent, PostHeaderComponent, PostListComponent, PostDetailsComponent, PostCardComponent], + declarations: [ + NewsComponent, + PostHeaderComponent, + PostListComponent, + PostDetailsComponent, + PostCardComponent, + PostModalFiltersComponent, + ], imports: [CommonModule, PostRoutingModule, SharedModule], + providers: [TagResolver], }) export class PostModule {} diff --git a/src/app/post/resolvers/tags.resolver.ts b/src/app/post/resolvers/tags.resolver.ts new file mode 100644 index 000000000..6f92f989e --- /dev/null +++ b/src/app/post/resolvers/tags.resolver.ts @@ -0,0 +1,21 @@ +import { Injectable } from '@angular/core'; +import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router'; +import { Observable } from 'rxjs'; +import { map, catchError } from 'rxjs/operators'; +import { TagWithMeta } from '../models/tagWithMeta.model'; +import { PostService } from '../services/post.service'; + +@Injectable() +export class TagResolver implements Resolve<TagWithMeta> { + constructor(private postService: PostService, private router: Router) {} + + resolve(): Observable<TagWithMeta> { + return this.postService.getTags().pipe( + map((res) => res), + catchError(() => { + this.router.navigate(['/home']); + return new Observable<TagWithMeta>(); + }) + ); + } +} diff --git a/src/app/post/services/post.service.ts b/src/app/post/services/post.service.ts index d70e18881..b0fc02fb2 100644 --- a/src/app/post/services/post.service.ts +++ b/src/app/post/services/post.service.ts @@ -5,6 +5,8 @@ import { map } from 'rxjs/operators'; import { Post } from '../models/post.model'; import { TagEnum } from '../enum/tag.enum'; import { PostWithMeta } from '../models/postWithMeta.model'; +import { Tag } from '../models/tag.model'; +import { TagWithMeta } from '../models/tagWithMeta.model'; @Injectable({ providedIn: 'root', @@ -37,14 +39,18 @@ export class PostService { tags.forEach((tag, index) => { tagsString += tag; if (index != tags.length - 1) { - tagsString += ','; + tagsString += '+tags:'; } }); return this.http - .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tag:[${tagsString}]`) + .get<PostWithMeta>(`${this.baseUrl}?include=tags,authors&filter=tags:${encodeURIComponent(tagsString)}`) .pipe(map((item: PostWithMeta) => new PostWithMeta(item))); } + public getTags(): Observable<TagWithMeta> { + return this.http.get<TagWithMeta>(`${this.baseUrl}/tags`); + } + private addAuthorToPost(post: Post): Post { post.author = post.excerpt; post.excerpt = post.html.replace(/<[^>]*>/g, ''); diff --git a/src/app/profile/services/profile.service.ts b/src/app/profile/services/profile.service.ts index 370137312..2f044a5f5 100644 --- a/src/app/profile/services/profile.service.ts +++ b/src/app/profile/services/profile.service.ts @@ -40,7 +40,6 @@ export class ProfileService { if (!this.currentProfile) { return false; } - console.log(this.currentProfile.pendingStructuresLink); return this.currentProfile.pendingStructuresLink.includes(idStructure); } diff --git a/src/app/shared/components/svg-icon/svg-icon.component.scss b/src/app/shared/components/svg-icon/svg-icon.component.scss index 0d40e293b..ceb7b8dec 100644 --- a/src/app/shared/components/svg-icon/svg-icon.component.scss +++ b/src/app/shared/components/svg-icon/svg-icon.component.scss @@ -3,6 +3,10 @@ display: inline-block; height: 2em; width: 1.5em; + &.icon-28 { + width: 28px; + height: 28px; + } &.icon-32 { width: 2em; } @@ -23,6 +27,14 @@ opacity: 0.8; } } + &.white { + fill: $white; + stroke: $white; + path { + stroke: $white; + fill: $white; + } + } &.grey { fill: $grey-3; stroke: $grey-3; diff --git a/src/assets/ico/sprite.svg b/src/assets/ico/sprite.svg index 748235c0a..08a36d469 100644 --- a/src/assets/ico/sprite.svg +++ b/src/assets/ico/sprite.svg @@ -204,6 +204,28 @@ <rect x="5" y="21" width="23" height="2" rx="1" fill="#333333"/> </symbol> +<symbol id="news-location" viewBox="0 0 29 31" xmlns="http://www.w3.org/2000/svg"> +<path d="M13.8789 7.40777L13.8789 1.18555" stroke-linecap="round" stroke-linejoin="round"/> +<path d="M13.3789 3.44639V1.86578C13.3665 1.85795 13.3533 1.84995 13.3392 1.84189C13.2087 1.76732 13.0017 1.68555 12.7122 1.68555C12.4228 1.68555 12.2158 1.76732 12.0853 1.84189C12.0712 1.84995 12.058 1.85795 12.0456 1.86578V3.44639C12.2373 3.38974 12.4598 3.35221 12.7122 3.35221C12.9647 3.35221 13.1872 3.38974 13.3789 3.44639Z"/> +<path d="M11.0469 2.81338V4.39398C11.0345 4.40181 11.0212 4.40981 11.0071 4.41787C10.8766 4.49245 10.6696 4.57422 10.3802 4.57422C10.0908 4.57422 9.88378 4.49245 9.75328 4.41787C9.73917 4.40981 9.72592 4.40181 9.71354 4.39398V2.81338C9.90529 2.87003 10.1278 2.90755 10.3802 2.90755C10.6326 2.90755 10.8551 2.87003 11.0469 2.81338Z"/> +<path d="M4.34813 13.1299L14.2096 7.21298L24.0711 13.1299H4.34813Z"/> +<path d="M3.04297 14.1299H25.3763V14.1854C25.3763 14.4616 25.1524 14.6854 24.8763 14.6854H3.54297C3.26683 14.6854 3.04297 14.4616 3.04297 14.1854V14.1299Z" stroke-width="0.777778"/> +<path d="M3.04297 27.3521H25.3763V27.9076H3.04297V27.3521Z" stroke-width="0.777778"/> +<path d="M0.710938 29.6855H27.7109V30.2411H0.710938V29.6855Z" stroke-width="0.777778"/> +<rect x="5.37891" y="16.4634" width="1.33333" height="9.11111"/> +<rect x="10.8203" y="16.4634" width="1.33333" height="9.11111"/> +<rect x="16.2656" y="16.4634" width="1.33333" height="9.11111"/> +<rect x="21.7109" y="16.4634" width="1.33333" height="9.11111"/> +</symbol> + +<symbol id="news-public" viewBox="0 0 29 26" xmlns="http://www.w3.org/2000/svg"> +<path d="M15.8488 19.9496C16.7844 19.3911 17.4109 18.3687 17.4109 17.2C17.4109 15.4327 15.9782 14 14.2109 14C12.4436 14 11.0109 15.4327 11.0109 17.2C11.0109 18.3687 11.6375 19.3911 12.573 19.9496C11.1806 20.5754 10.2109 21.9745 10.2109 23.6V26H18.2109V23.6C18.2109 21.9745 17.2413 20.5754 15.8488 19.9496Z" /> +<path d="M5.84883 19.9496C6.78438 19.3911 7.41094 18.3687 7.41094 17.2C7.41094 15.4327 5.97825 14 4.21094 14C2.44363 14 1.01094 15.4327 1.01094 17.2C1.01094 18.3687 1.6375 19.3911 2.57304 19.9496C1.18059 20.5754 0.210938 21.9745 0.210938 23.6V26H8.21094V23.6C8.21094 21.9745 7.24128 20.5754 5.84883 19.9496Z" /> +<path d="M10.8488 5.94963C11.7844 5.39114 12.4109 4.36874 12.4109 3.2C12.4109 1.43269 10.9782 0 9.21094 0C7.44363 0 6.01094 1.43269 6.01094 3.2C6.01094 4.36874 6.6375 5.39114 7.57304 5.94963C6.18059 6.57538 5.21094 7.97445 5.21094 9.6V12H13.2109V9.6C13.2109 7.97445 12.2413 6.57538 10.8488 5.94963Z" /> +<path d="M25.8488 19.9496C26.7844 19.3911 27.4109 18.3687 27.4109 17.2C27.4109 15.4327 25.9782 14 24.2109 14C22.4436 14 21.0109 15.4327 21.0109 17.2C21.0109 18.3687 21.6375 19.3911 22.573 19.9496C21.1806 20.5754 20.2109 21.9745 20.2109 23.6V26H28.2109V23.6C28.2109 21.9745 27.2413 20.5754 25.8488 19.9496Z" /> +<path d="M20.8488 5.94963C21.7844 5.39114 22.4109 4.36874 22.4109 3.2C22.4109 1.43269 20.9782 0 19.2109 0C17.4436 0 16.0109 1.43269 16.0109 3.2C16.0109 4.36874 16.6375 5.39114 17.573 5.94963C16.1806 6.57538 15.2109 7.97445 15.2109 9.6V12H23.2109V9.6C23.2109 7.97445 22.2413 6.57538 20.8488 5.94963Z"/> +</symbol> + <symbol id="calendar" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg"> <path d="M8 10H5V13H8V10Z" fill="#333333"/> diff --git a/src/assets/scss/_layout.scss b/src/assets/scss/_layout.scss index 2a4a34f6e..3da7ec582 100644 --- a/src/assets/scss/_layout.scss +++ b/src/assets/scss/_layout.scss @@ -3,4 +3,4 @@ $footer-height: 56px; $header-height-phone: 70px; $footer-height-phone: 75px; $progressBar-height: 50px; -$header-post-height: 180px; +$header-post-height: 140px; diff --git a/src/index.html b/src/index.html index 17a60d8dc..7a2041e97 100644 --- a/src/index.html +++ b/src/index.html @@ -11,8 +11,6 @@ content="Plateforme à destination des acteurs de l'inclusion numérique de la métropole de Lyon" /> <meta property="og:image" content="https://resin.grandlyon.com/assets/logos/logo_1200.svg" /> - > - <link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css" /> <link -- GitLab From 47a640e8c520088c45031011cae22645fd9be7e3 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 10 Mar 2021 12:18:10 +0100 Subject: [PATCH 47/65] add subject to mail --- .../post/components/post-publish/post-publish.component.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/post/components/post-publish/post-publish.component.html b/src/app/post/components/post-publish/post-publish.component.html index 5ad24fe1c..0a3110f95 100644 --- a/src/app/post/components/post-publish/post-publish.component.html +++ b/src/app/post/components/post-publish/post-publish.component.html @@ -25,7 +25,9 @@ <br /> </div> <div> - <a class="btn-primary" href="mailto:inclusionnumerique@grandlyon.com">Envoyer votre actu par mail</a> + <a class="btn-primary" href="mailto:inclusionnumerique@grandlyon.com?subject=Nouvelle actualité à intégrer" + >Envoyer votre actu par mail</a + > </div> </div> </div> -- GitLab From fb677f38d3e8bccf8e24977ae679fb250771f1c5 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 10 Mar 2021 12:32:34 +0100 Subject: [PATCH 48/65] fix img to sprite svg --- .../post-publish/post-publish.component.html | 4 +- .../post-publish/post-publish.component.scss | 3 +- src/assets/post/publishNews.svg | 41 ------------------ src/assets/post/sprite.svg | 42 +++++++++++++++++++ 4 files changed, 47 insertions(+), 43 deletions(-) delete mode 100644 src/assets/post/publishNews.svg diff --git a/src/app/post/components/post-publish/post-publish.component.html b/src/app/post/components/post-publish/post-publish.component.html index 0a3110f95..1578c1ea9 100644 --- a/src/app/post/components/post-publish/post-publish.component.html +++ b/src/app/post/components/post-publish/post-publish.component.html @@ -10,7 +10,9 @@ <div fxLayout="column" class="content" fxLayoutGap="16px"> <h2>Publier votre actualité</h2> <div class="image"> - <img src="../../assets/post/publishNews.svg" alt="logo publishNews" /> + <svg aria-hidden="true"> + <use [attr.xlink:href]="'../../../../assets/post/sprite.svg#publishLogo'"></use> + </svg> </div> <div class="informations"> <p>Vous pouvez nous envoyer votre actualité en distinguant ces 4 éléments :</p> diff --git a/src/app/post/components/post-publish/post-publish.component.scss b/src/app/post/components/post-publish/post-publish.component.scss index d9bf65253..8c66547d0 100644 --- a/src/app/post/components/post-publish/post-publish.component.scss +++ b/src/app/post/components/post-publish/post-publish.component.scss @@ -35,8 +35,9 @@ $margin-post: 20px; .image { width: 100%; text-align: center; - img { + svg { max-width: 300px; + height: 300px; } } .informations { diff --git a/src/assets/post/publishNews.svg b/src/assets/post/publishNews.svg deleted file mode 100644 index fd89368ae..000000000 --- a/src/assets/post/publishNews.svg +++ /dev/null @@ -1,41 +0,0 @@ -<svg width="310" height="273" viewBox="0 0 310 273" fill="none" xmlns="http://www.w3.org/2000/svg"> -<g opacity="0.35" filter="url(#filter0_f)"> -<path d="M12 76.7061L181.621 30.7062L283.777 208.44L114.155 254.44L12 76.7061Z" fill="#348899"/> -</g> -<path d="M114.638 253.273L13.5131 77.3318L181.138 31.8732L282.263 207.814L114.638 253.273Z" fill="#EAF8FB" stroke="#79ACB6" stroke-width="2"/> -<path d="M56.0084 117.902C54.7257 115.671 55.8543 112.826 58.3181 112.08L188.148 72.8014C189.929 72.2624 191.847 73.0232 192.774 74.6367L215.093 113.467C216.376 115.699 215.247 118.544 212.783 119.289L82.9533 158.568C81.172 159.107 79.2544 158.346 78.327 156.733L56.0084 117.902Z" fill="#ABE6F2"/> -<path d="M72.5 81.3037L150.685 57.8712L154.671 64.8072L76.4866 88.2397L72.5 81.3037Z" fill="#117083"/> -<path d="M86.5 167.953L139.359 152.241L142.5 157.706L89.6408 173.418L86.5 167.953Z" fill="#117083"/> -<path d="M91.5 176.445L144.359 160.733L147.5 166.198L94.6408 181.91L91.5 176.445Z" fill="#117083"/> -<path d="M96.5 185.445L149.359 169.733L152.5 175.198L99.6408 190.91L96.5 185.445Z" fill="#117083"/> -<path d="M102.5 193.444L155.359 177.732L158.5 183.197L105.641 198.909L102.5 193.444Z" fill="#117083"/> -<path d="M107.5 202.444L160.359 186.732L163.5 192.197L110.641 207.909L107.5 202.444Z" fill="#117083"/> -<path d="M112.5 211.444L165.359 195.732L168.5 201.197L115.641 216.909L112.5 211.444Z" fill="#117083"/> -<path d="M116.5 221.444L169.359 205.732L172.5 211.197L119.641 226.909L116.5 221.444Z" fill="#117083"/> -<path d="M145.5 150.444L198.359 134.732L201.5 140.197L148.641 155.909L145.5 150.444Z" fill="#117083"/> -<path d="M151.5 158.444L204.359 142.732L207.5 148.197L154.641 163.909L151.5 158.444Z" fill="#117083"/> -<path d="M156.5 167.444L178.359 161.241L181.5 166.706L159.641 172.909L156.5 167.444Z" fill="#117083"/> -<path d="M100 84.6553L139.091 72.7225L143.078 79.6584L103.987 91.5912L100 84.6553Z" fill="#117083"/> -<g opacity="0.35" filter="url(#filter1_f)"> -<path d="M252.112 73.7334C249.503 71.652 246.024 71.6753 244.34 73.7856L235.054 85.4249L235.088 85.4519L190.698 141.075L205.252 152.855L190.571 141.242L189.299 142.837C188.606 143.704 188.299 144.837 188.429 146.05L186.205 161.648L185.788 163.604C185.445 165.216 187.089 166.528 188.585 165.835L189.273 165.516C189.436 165.526 189.6 165.521 189.763 165.502L205.18 159.287C206.391 159.144 207.427 158.594 208.12 157.726L209.393 156.131L209.391 156.129L253.778 100.509L253.779 100.51L263.064 88.8704C264.748 86.7602 263.999 83.3622 261.391 81.2807L252.112 73.7334Z" fill="#DC2A59"/> -</g> -<path d="M252.739 72.9577L252.739 72.9576L252.732 72.9518C249.854 70.6558 245.7 70.4733 243.554 73.1618L243.554 73.1619L234.269 84.8012L233.648 85.5792L233.682 85.6061L189.913 140.452L189.293 141.228L189.297 141.231L188.513 142.213C187.666 143.275 187.298 144.626 187.418 146.026L185.216 161.473L184.806 163.395C184.291 165.813 186.758 167.781 189.001 166.743L189.48 166.521C189.612 166.519 189.744 166.511 189.876 166.495L190.009 166.48L190.133 166.43L205.432 160.262C206.819 160.067 208.052 159.409 208.898 158.35L210.17 156.755L210.798 155.969L210.796 155.967L253.929 101.918L253.93 101.918L254.557 101.133L263.842 89.4942C265.986 86.807 264.889 82.7988 262.014 80.5023C262.013 80.5013 262.012 80.5002 262.01 80.4991L252.739 72.9577Z" fill="#E04971" stroke="#E0718E" stroke-width="2"/> -<path d="M244.336 73.7856C246.02 71.6754 249.499 71.652 252.108 73.7335L261.386 81.2808C263.995 83.3622 264.744 86.7602 263.06 88.8705L253.775 100.51L235.05 85.4249L244.336 73.7856Z" fill="#E04971"/> -<path d="M254.161 100.03L235.505 84.9298L190.698 141.076L209.354 156.176L254.161 100.03Z" fill="#E0718E"/> -<path d="M209.393 156.131L190.571 141.242L189.298 142.837C188.606 143.705 188.299 144.838 188.429 146.05L186.075 162.56C186.257 164.27 188.054 165.704 189.762 165.503L205.18 159.288C206.391 159.145 207.427 158.594 208.12 157.727L209.393 156.131Z" fill="#FDECF0"/> -<path d="M185.399 164.08C185.176 165.596 186.672 166.789 188.101 166.236L194.734 163.665C194.734 163.665 194.763 161.501 191.65 159.018C188.537 156.534 186.434 157.041 186.434 157.041L185.399 164.08Z" fill="#E04971"/> -<rect x="190.742" y="140.706" width="24.0099" height="2" transform="rotate(38.3738 190.742 140.706)" fill="white"/> -<rect x="236.152" y="84.0303" width="24.0422" height="2" transform="rotate(38.3738 236.152 84.0303)" fill="white"/> -<defs> -<filter id="filter0_f" x="0" y="18.7061" width="295.777" height="247.734" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> -<feFlood flood-opacity="0" result="BackgroundImageFix"/> -<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> -<feGaussianBlur stdDeviation="6" result="effect1_foregroundBlur"/> -</filter> -<filter id="filter1_f" x="173.742" y="60.1875" width="102.221" height="117.837" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> -<feFlood flood-opacity="0" result="BackgroundImageFix"/> -<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> -<feGaussianBlur stdDeviation="6" result="effect1_foregroundBlur"/> -</filter> -</defs> -</svg> diff --git a/src/assets/post/sprite.svg b/src/assets/post/sprite.svg index fe3e4e45a..53003c367 100644 --- a/src/assets/post/sprite.svg +++ b/src/assets/post/sprite.svg @@ -62,4 +62,46 @@ <path fill-rule="evenodd" clip-rule="evenodd" d="M29.2607 17.2341L30.049 14.2559C30.1737 13.7846 29.9418 13.3205 29.5453 13.113L20.8378 26H23.3378L29.2607 17.2341ZM24.8378 26H26.1709C26.6247 26 27.0215 25.6945 27.1376 25.2559L28.2948 20.8837L24.8378 26ZM25.6216 13H28.1216L19.3378 26H16.8378L25.6216 13ZM24.1216 13H21.6216L12.8378 26H15.3378L24.1216 13ZM17.6216 13H20.1216L11.3378 26H8.83784L17.6216 13ZM16.1216 13H13.6216L4.83784 26H7.33784L16.1216 13ZM9.62162 13H12.1216L3.33784 26H3.20521C2.57898 26 2.10683 25.431 2.22239 24.8155L2.44717 23.6182L9.62162 13ZM8.12162 13H5.27041C5.26124 13 5.2521 13.0001 5.24299 13.0004L4.13187 14.6448L3.02434 20.544L8.12162 13Z" stroke="none"/> </symbol> +<symbol id="publishLogo" viewBox="0 0 310 273" fill="none" xmlns="http://www.w3.org/2000/svg"> +<g opacity="0.35" filter="url(#filter0_f)"> +<path d="M12 76.7061L181.621 30.7062L283.777 208.44L114.155 254.44L12 76.7061Z" fill="#348899"/> +</g> +<path d="M114.638 253.273L13.5131 77.3318L181.138 31.8732L282.263 207.814L114.638 253.273Z" fill="#EAF8FB" stroke="#79ACB6" stroke-width="2"/> +<path d="M56.0084 117.902C54.7257 115.671 55.8543 112.826 58.3181 112.08L188.148 72.8014C189.929 72.2624 191.847 73.0232 192.774 74.6367L215.093 113.467C216.376 115.699 215.247 118.544 212.783 119.289L82.9533 158.568C81.172 159.107 79.2544 158.346 78.327 156.733L56.0084 117.902Z" fill="#ABE6F2"/> +<path d="M72.5 81.3037L150.685 57.8712L154.671 64.8072L76.4866 88.2397L72.5 81.3037Z" fill="#117083"/> +<path d="M86.5 167.953L139.359 152.241L142.5 157.706L89.6408 173.418L86.5 167.953Z" fill="#117083"/> +<path d="M91.5 176.445L144.359 160.733L147.5 166.198L94.6408 181.91L91.5 176.445Z" fill="#117083"/> +<path d="M96.5 185.445L149.359 169.733L152.5 175.198L99.6408 190.91L96.5 185.445Z" fill="#117083"/> +<path d="M102.5 193.444L155.359 177.732L158.5 183.197L105.641 198.909L102.5 193.444Z" fill="#117083"/> +<path d="M107.5 202.444L160.359 186.732L163.5 192.197L110.641 207.909L107.5 202.444Z" fill="#117083"/> +<path d="M112.5 211.444L165.359 195.732L168.5 201.197L115.641 216.909L112.5 211.444Z" fill="#117083"/> +<path d="M116.5 221.444L169.359 205.732L172.5 211.197L119.641 226.909L116.5 221.444Z" fill="#117083"/> +<path d="M145.5 150.444L198.359 134.732L201.5 140.197L148.641 155.909L145.5 150.444Z" fill="#117083"/> +<path d="M151.5 158.444L204.359 142.732L207.5 148.197L154.641 163.909L151.5 158.444Z" fill="#117083"/> +<path d="M156.5 167.444L178.359 161.241L181.5 166.706L159.641 172.909L156.5 167.444Z" fill="#117083"/> +<path d="M100 84.6553L139.091 72.7225L143.078 79.6584L103.987 91.5912L100 84.6553Z" fill="#117083"/> +<g opacity="0.35" filter="url(#filter1_f)"> +<path d="M252.112 73.7334C249.503 71.652 246.024 71.6753 244.34 73.7856L235.054 85.4249L235.088 85.4519L190.698 141.075L205.252 152.855L190.571 141.242L189.299 142.837C188.606 143.704 188.299 144.837 188.429 146.05L186.205 161.648L185.788 163.604C185.445 165.216 187.089 166.528 188.585 165.835L189.273 165.516C189.436 165.526 189.6 165.521 189.763 165.502L205.18 159.287C206.391 159.144 207.427 158.594 208.12 157.726L209.393 156.131L209.391 156.129L253.778 100.509L253.779 100.51L263.064 88.8704C264.748 86.7602 263.999 83.3622 261.391 81.2807L252.112 73.7334Z" fill="#DC2A59"/> +</g> +<path d="M252.739 72.9577L252.739 72.9576L252.732 72.9518C249.854 70.6558 245.7 70.4733 243.554 73.1618L243.554 73.1619L234.269 84.8012L233.648 85.5792L233.682 85.6061L189.913 140.452L189.293 141.228L189.297 141.231L188.513 142.213C187.666 143.275 187.298 144.626 187.418 146.026L185.216 161.473L184.806 163.395C184.291 165.813 186.758 167.781 189.001 166.743L189.48 166.521C189.612 166.519 189.744 166.511 189.876 166.495L190.009 166.48L190.133 166.43L205.432 160.262C206.819 160.067 208.052 159.409 208.898 158.35L210.17 156.755L210.798 155.969L210.796 155.967L253.929 101.918L253.93 101.918L254.557 101.133L263.842 89.4942C265.986 86.807 264.889 82.7988 262.014 80.5023C262.013 80.5013 262.012 80.5002 262.01 80.4991L252.739 72.9577Z" fill="#E04971" stroke="#E0718E" stroke-width="2"/> +<path d="M244.336 73.7856C246.02 71.6754 249.499 71.652 252.108 73.7335L261.386 81.2808C263.995 83.3622 264.744 86.7602 263.06 88.8705L253.775 100.51L235.05 85.4249L244.336 73.7856Z" fill="#E04971"/> +<path d="M254.161 100.03L235.505 84.9298L190.698 141.076L209.354 156.176L254.161 100.03Z" fill="#E0718E"/> +<path d="M209.393 156.131L190.571 141.242L189.298 142.837C188.606 143.705 188.299 144.838 188.429 146.05L186.075 162.56C186.257 164.27 188.054 165.704 189.762 165.503L205.18 159.288C206.391 159.145 207.427 158.594 208.12 157.727L209.393 156.131Z" fill="#FDECF0"/> +<path d="M185.399 164.08C185.176 165.596 186.672 166.789 188.101 166.236L194.734 163.665C194.734 163.665 194.763 161.501 191.65 159.018C188.537 156.534 186.434 157.041 186.434 157.041L185.399 164.08Z" fill="#E04971"/> +<rect x="190.742" y="140.706" width="24.0099" height="2" transform="rotate(38.3738 190.742 140.706)" fill="white"/> +<rect x="236.152" y="84.0303" width="24.0422" height="2" transform="rotate(38.3738 236.152 84.0303)" fill="white"/> +<defs> +<filter id="filter0_f" x="0" y="18.7061" width="295.777" height="247.734" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> +<feFlood flood-opacity="0" result="BackgroundImageFix"/> +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> +<feGaussianBlur stdDeviation="6" result="effect1_foregroundBlur"/> +</filter> +<filter id="filter1_f" x="173.742" y="60.1875" width="102.221" height="117.837" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> +<feFlood flood-opacity="0" result="BackgroundImageFix"/> +<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> +<feGaussianBlur stdDeviation="6" result="effect1_foregroundBlur"/> +</filter> +</defs> +</symbol> + </svg> -- GitLab From 3827b09673684feee871b939b4d104c24282052e Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Wed, 10 Mar 2021 17:09:21 +0100 Subject: [PATCH 49/65] fix: header name display + address-autocomplete bug --- src/app/header/header.component.scss | 5 +++++ .../address-autocomplete.component.ts | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/header/header.component.scss b/src/app/header/header.component.scss index 8369791d6..6a991d53b 100644 --- a/src/app/header/header.component.scss +++ b/src/app/header/header.component.scss @@ -41,6 +41,11 @@ button { &.red { @include btn-red; border: none; + // user name ellipsis handling + white-space: nowrap; + width: 100px; + overflow: hidden; + text-overflow: ellipsis; } } diff --git a/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts b/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts index c0dce3bde..e04af8369 100644 --- a/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts +++ b/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts @@ -20,9 +20,12 @@ export class AddressAutocompleteComponent implements OnInit { ngOnInit(): void { if (this.address) { - const address_str = this.address.numero - ? this.address.numero + ' ' - : '' + this.address.street + ' ' + this.address.commune; + let address_str = null; + if (this.address.numero) { + address_str = this.address.numero + ' ' + this.address.street + ' ' + this.address.commune; + } else { + address_str = this.address.street + ' ' + this.address.commune; + } this.searchAddress.nativeElement.value = address_str; } } -- GitLab From ee8e5558a9ac03dbc316605ee700153546190729 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 10 Mar 2021 17:13:08 +0100 Subject: [PATCH 50/65] fix(carto) : fix text + design --- src/app/structure-list/components/search/search.component.html | 2 +- src/app/structure-list/components/search/search.component.scss | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/structure-list/components/search/search.component.html b/src/app/structure-list/components/search/search.component.html index 6e7814eb8..ca0185928 100644 --- a/src/app/structure-list/components/search/search.component.html +++ b/src/app/structure-list/components/search/search.component.html @@ -1,6 +1,6 @@ <div class="block"> <div class="header"> - <span class="title">Acteurs de la médiation numérique</span> + <span class="title">Recherche d’acteur de l’inclusion numérique</span> </div> <div class="content" fxLayout="column"> <div class="searchSection"> diff --git a/src/app/structure-list/components/search/search.component.scss b/src/app/structure-list/components/search/search.component.scss index 89773e528..30116fa01 100644 --- a/src/app/structure-list/components/search/search.component.scss +++ b/src/app/structure-list/components/search/search.component.scss @@ -10,10 +10,9 @@ .header { .title { @include cn-bold-26; - padding: 16px 0 16px 0; + padding-bottom: 16px; display: flex; align-items: center; - text-transform: uppercase; } } .content { -- GitLab From 964b4a67a7e9dd67d2eb9f759cd342f5f73cf822 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 10 Mar 2021 17:25:53 +0100 Subject: [PATCH 51/65] fix(carto) : fix padding map + text search --- src/app/home/home.component.scss | 2 +- src/app/map/components/map.component.scss | 2 +- src/app/structure-list/components/search/search.component.html | 2 +- src/styles.scss | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/home/home.component.scss b/src/app/home/home.component.scss index 82bdfafba..eb5f97b21 100644 --- a/src/app/home/home.component.scss +++ b/src/app/home/home.component.scss @@ -15,7 +15,7 @@ } .right-pane { width: 80%; - padding: 0 40px; + padding: 0 16px; @media #{$tablet} { display: none; &.mapPhone { diff --git a/src/app/map/components/map.component.scss b/src/app/map/components/map.component.scss index cb53c0d90..78bebc227 100644 --- a/src/app/map/components/map.component.scss +++ b/src/app/map/components/map.component.scss @@ -13,7 +13,7 @@ } #map { - height: calc(100vh - #{$header-height} - #{$footer-height} - 87px); + height: calc(100vh - #{$header-height} - #{$footer-height} - 60px); border: 10px solid $white; border-radius: 6px; @media #{$tablet} { diff --git a/src/app/structure-list/components/search/search.component.html b/src/app/structure-list/components/search/search.component.html index ca0185928..44d8b0b6d 100644 --- a/src/app/structure-list/components/search/search.component.html +++ b/src/app/structure-list/components/search/search.component.html @@ -12,7 +12,7 @@ (ngSubmit)="applyFilter(searchForm.value.searchTerm)" > <div class="inputSection" fxLayout="row" fxLayoutAlign="space-between center"> - <input type="text" formControlName="searchTerm" placeholder="Rechercher une commune, une association..." /> + <input type="text" formControlName="searchTerm" placeholder="Une commune, une association..." /> <button (click)="clearInput()" class="icon close" type="button"><div class="ico-close-search"></div></button> </div> <app-button diff --git a/src/styles.scss b/src/styles.scss index a6fabff7a..53df89909 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -59,7 +59,7 @@ a { // Containers .content-container { margin: 0; - padding-top: 30px; + padding-top: 16px; width: 100%; &.medium-pt { padding: 25px 0 30px 0; -- GitLab From 355026c17925689ea855f6e11beffb43f861b9a7 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Wed, 10 Mar 2021 17:28:33 +0100 Subject: [PATCH 52/65] fix(carto) : fix color marker --- src/app/map/components/map.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/map/components/map.component.scss b/src/app/map/components/map.component.scss index 78bebc227..e9ff65087 100644 --- a/src/app/map/components/map.component.scss +++ b/src/app/map/components/map.component.scss @@ -46,7 +46,7 @@ border-radius: 50% 50% 50% 0; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); - background-color: $grey-3; + background-color: $black; margin-left: -8px; margin-top: 4px; &:before { -- GitLab From 431a07fd8324099f0ecf22af102f7b52c1a0f1ff Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Wed, 10 Mar 2021 17:45:17 +0100 Subject: [PATCH 53/65] feat: add jpg logo for mail --- src/assets/logos/resin.jpg | Bin 0 -> 5899 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/assets/logos/resin.jpg diff --git a/src/assets/logos/resin.jpg b/src/assets/logos/resin.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2e7db87ce1a2a1c6359b707d9e8a6bc599f3ad42 GIT binary patch literal 5899 zcmex=<NpH&0WUXCHwH#VMn)Y*9R`N~4;hkND>Bm<7<_#hv=|r|I2c$Ng&3F_7#J8C z7#SECr5ISjYz77|Mrk-Zh*1NohM9qZNf^pzWPpJ(s2(u=|2Bg&0}~@72r)qbGb=L) zu(7Z(v$C_Xvx6`PCpRYt2NwrBI~Ok(7dH<N4-Y#hA3rY-ABYVygprAfiJ6(1jhUH^ zhl8C1q=Gd3{{Vv^2ZI&EN@hkS1|~s9W<kdPM;PQ87#LYWA;Jjv03#DK3o9Et2PYTz z|04`r1sIqZnVFebm|0m_SQr=>YZ;lC8CV2ag%k}P*@OcV*_8@Kj2b5{<WP3ncu+Lx z;s+Juq@pHHE-`TlNhwt|bq!4|6H_yD3rj0!7gslT4^OY)kkGL3h{&kql+?8JjLfX! zlG3vBipr|yme#iRj?S)0lc!9bHhsp-S&J4gS-Ncbij}K2ZQinV+x8thcO5!><mj>E zCr+Nabot8FYu9hwy!G(W<0ns_J%91?)yGetzkL1n{m0K=Ab&A3Fhjh>2=f`5zXTbW z7@1gDm|56C{$gY*XJBMv7Gz;nG-MNU3}jC%6jm~7<PdS1xNze^PG#eu528s$7rDe# zOdhI!1bGeYGvYkfM3&Fs9z*!+76T76BLkBlvmk>#!{0xP_Rsno{g2=6$JHfuSEO2h z{W1O^d;HK1{U=TGeEza$*KPdfI^nH;^)sWT7h~Ae#Cj4M<?6CN?Ej$=|3}vMw`bk8 zeI{4d+R48DF3(ygKg}>Q^PYTaY*fX;pD8=87(VCpw~3xHfr;&!_MV3Nh$-P8y&u;9 z(BA&G@x$WSOJ8sNXUMSc>sDs8o&W84m;P67>!mC*Kh6DBjMn?DIy}GX@528KP3-jt zFGkIOoBq+;`G@*%7hbXJ$8LS;PJOsvBFb%=*{`Q38B~|vQ5JMB)qW?qM^Sm=TqQy6 zsYVQScP_^Gzm@;(QsMs1=ZEB@{*HS#SKofI=d5r#`jyx1Q}Fk|0#Sj|%9JvX$2~RY z-gPb5%ou-${f|iYKfcX>7u9FWi)Tm0ANreA-?X1E?S5`*_Tn6=uV>`-RCio4Na;#) zHV|tQX#6%=G2XDjKB4}>PWcao$6M?lOq1$e-cTdF?4`Vrolz|7yx-oFzN~F;&7JA2 zd~Zv=;k<y5rJJVa>-MZWu}si@Q~g0c`v+?||1+>w|D95*FMYSd|DV8p!HV>VT<(ZX zZRI;Q&kAG-*7@LZitl)2{nc%eTob&R*4#g?-?89oo?hG1)oKeaXT7=Z^y+QQ)|biC zCRZ0dnLO#HrP}`D{|pbV$^X!+Z>bY;e`tTx{g@o@hxaXs*SAV0e|X+ivNU6M#8tg` zZLwvtGfoy7=eAj1Xkfa1_-QL+1N#?qSJNjquP-lt8Gq*bAJP8||M>R)SoyK|vD(fD z_iyfxlVkjmy!gCoOPuo7t?t)q0=IT;J>{vjam)53#?IuB*%^1<asLc#sQ392{&DxR zf0yrn2-G!yI3-?G@#FTlo$3t_+kgAk`06cuB)Nr|A*XV!_2jGz?;fj6c^kiK{)c?? zKQd<@oxe5tv0eWM^>1yvF1`Qb`AGJ|kK|*TJYo7P?(&}77Cv!7M9uM-B|&a0BBv^A zy;mq={5{vTQvdDM-|q4^<-hrU+<zqF&EqS2dyJRQ%++0be!A(Iz6l59S>*N4PBc$w z-fp3A{qyff@jtZq-|{}1FK^zdXJ=UP>3%?_%OP&vAn#aPju(s08R>re&#)<3;rrPN z%l!g@2mDN)i>rOTyy)NlC3P1c);C%1mrl%1-Y_-MYpP{YTzSpqO}Q$QFRIPX-?gdg z_OF;l`=b9dG}-^V6?OgX+23+eKNcVPaA2Rtg|C`hc%vS1xEQ<=c9sd!J+$DV_fZ?y zriV2LemkubsWJY~!20FyK0D1Cv%f1!{xh`O@q8@X`(Q7#=f&KulJ{NqO*;1K-?Oyo z&nh2jt4~`Yz;QTNy;$aH+1svjD*_K5mri@E9a(z))Ary~5BGBx*WB)U^<naq%xjC! zpI5ux6|gBcGWOo<>8|^>UHRL!Xdm}~h9;(eH{{IzuH2u_FA`btK5WNFv84~rMp;|u zhP~V#8*}?4N2%v*$%z-I{%5E-vYAa%rDy)ueHt}B7wvd!Y_IJJedPUO%U<@w--_<v zzk5QmMc~-d8E*q3``Eb_Y?fi*R0vPwm-QEH?^CmKUH$sf?fIHVV^n)jY(909wc2m1 zrN-~+HRn7nKCO=ZthQ!t^=|1a;SZL-o&BGI^}~<7A73AhYF&T$uGiy-{Y{~>tUcCT zGhQ9*V%Vvt=aDSaF1^hmKp}VOl4GAgznlKM?%#!Zg1a_fRsM1GV`k{=+C9_vDec{{ zeNO*3wX#0PH;!^wKZpLf%+2}fa`UA3i+->Fb>r`E^<U~A_0&0~e%x`@5>;8Z;OCNS zvptVS+WlD<x0nCrwyr-*{xdYi)E}%Wo!@z1=u3RNywqj?S>NMl=4_cSddp$kzTC^( zl-oXuFd04*5=`w3V7nn{a8~Kx+Upmd-ki#ltDo)oYx%CP|JKw=ACF<4Q!p*@@7y_# znx++}^ghhV&pvvy^sdR0T}w;q?f)};sHp!VZ2Zvw;QE$%5`P!gNI!gS&-LT>(Ku5n z@lIjC{*zm;-+OiG-TSwbj_@7b5veO(yr@}oXW4|!4B1cOf0$%{%lr`kR`EXrYs9X} z$9D0}f22{v{9yNck(XxMFX$fKQq@vE&1|F3#T{C2rS6`1xkGl6PM*PuC3W-a558)) z|KM%U@Sovk=;i%iF0KiG{{4?+*p2@TP0N3L{=2@ls^dSyscrpnjUUs$^#69RJNu9G z@7jGl+4uSPDOHsFespj7<C*hq`!w^3?D7VRslEHY1S?uEp2|^iH+1UMDN=v3|4#bP z@Zg;2-}(O;^7wgve2)2XX4dn={~4HHU%T~h?y_4i&gQOqm7i~PmUYjkpKTUXtX7ow z7hA1n6%^-{f0ru4_*45o1N*EW*MmQ7|07g<c$=Ad(Cu44CO@*9xjf5o;elP-qh;M* zC|5O_ZqfhR6aKXSkCgsz(;w>J`u;OCt&ZE?yT^X{k4f^3KeWCdm2%zsMca0ZRZICc zv5kHg4K&_L#hyC3Lv|9!6N!`{d%yh;zUKdQo!(IYX4T94zcQ|A|2*(_&VPoi`i}dX z^n3IEcz!s3Y@X5wy}h+bw^EP(>#ex9UFf#S#8Vfh#g&P7sVQG&WvI{n&#=w?kbGOc zjD1?XR7L$`vH1&M$@4C~q?c!U{c00;t=%n)nfKm!+<&Fg>g=&ulV4b&G*ye^pV*gN zzxOUz*XEo2?(UBM?K!DBb3xLi!%7nZC-gb9F*I4Sgzv5R{_W}C<@@ucD{7e6{qgy6 z^rP4P(5WnSQva^(y|U<vN;uEV%}%GawOh5k3|V-R_WSLB(0KntPWh4C_{ZB@{u%wd zC?{Lb`osCq_QGr{_m-`$^0#)qz2chExNhyQ+qaiA7`vLO6w4j!P=2Q%zkC1ou-T8~ z1?mpkORV|A@ibm6zJfWr-LLQVvk7tg=2~>9ul(%Q_#^zI;s@c_5BJ;bEPj{=eVjI5 zZS8}<_OTmxUe8IEtiH{%!)-?gPtWuYtHz1fSFC^Uw12w%4~yV`yf;4jzX|=Qd?a3C zAODNZ+4q@CXD+*{zeY#*bKwI?iRqIhl^oB_<BQUqlB9B`sP)FAbBupYY79Q!Z~bTd zNB`m<$A`Awp4a~<KH}zhS8{u|SY*z7-PpR=89%+IK9=1jz@fBX@sH(y2DZ)&dH($m zmP@%Geb4>J@897c$qRq1;+MGbBkaCc##dgujJ#`4O@8Es1+30nw?JpdXHkRMk<-uG zPyEmD!A<{%-uol{KUCHq(SP$HZ%^un`pDU3TOV?F_i&f1q<uPgTZwz(ALqX@r$6m_ zCwN-?Yvyl}y4(L5c<Uc5lxNs-zEhsN#yNlekMe+ImXrV1z4zJ`u*}<gMe#1l3r3Tc zH?8Yiy11l_Vg2vAy0hZ-+tlAoe)PU=o7L8B?WK<@-cGW9-656n;M2N=bDoMc6)9<7 zZz{em`g8k&{|pD$|5KPA(p&1^6J@)1TCs9eMVV*X@kQ-(-EEEh<=U6l9S)51vsO9y zSW9b1$K9p5w=UQ9mfL$g_|G7=V{z*T<I|gboR<3)6=zQpsyXYXyIkYsThV2=aw@OC zS^Zn@NANexAIeKA*bi>|?7aA;;*7HehrCz6oHK1w<sAk&_vA?q3=FFlhK9O7TK-4I z{y&4J{J#GT8?$}?Gu+zx`(b?Je})eQ{~7))sr&u!=vwpt3|ZIvk6wA~uh*lnX38Y* zQ)m7rzc}1?B-!HII(<=dtErlyQ<mJlJ$Z_B?)RKutN-!V|7VzF`7!<9;cfB1e6GHo z|Dhmlcj1!%3<phWT=Ti#c86Ru*&W^Z_s7vo-u=Jdso1wx%>N_xpW#1)O7Wxff7^5R zf0?=Z#{LHn@Begrx2%5mBVL353{QfC+xGw3_4d!CKR4G4xq2V>(A59gdHA2;vg?oP zlKwLs6sY5?sD2#(N5uQkuKLa`w_}riFTGh`8oGH`XX^G@6^o9zxg<EVrt>jAF4AA7 z{rx|~Blp9+?2p+Sx9ao!SnR#=dX4=Wr`-2C`AS00R`P*2nizQuLK+-dnCv<CKe+eo z_J0Oejf;Q3@OuAea9vyXC-}ju!V1aQeD!);v1j#OYs!>lGMy*oR$CbqZqA<i`Rv{3 z^pdSnFLo>cwExk*K)=bRbbV&nW}lBQcJ-cJVr=>MF~`!BFqPzIKOIlJkKZBx;iG+r z{pZi={}~!S{%81T`eXjb+yA`9d+Xm=uBd<MGWAzsyynD5T0wJNeQ)RPOaD^eGc%0e z=y2-g<Cl8frrdhwdF$2Ox33fDf2itu_n)CDyh8l%{I06P{|u+X*2mAc|Bzap{Eut# z<N4qAiM>+(&!Dx-wXUW9;LH7=y3VuwXSf-7dH<K|tHYl!|09_Jsx(&pxP1R%-6H!> zE0<h<?f!FKeZZ7JSB5%={|pCT?f=xRk6h9GXZRx-`kz75_v81!lh!)_XYl)FTQ|M_ z;Di4RET!+e_kZxX@ikWH_S>-k419lbm;IO?7W(w@=HIqY8%yKXZi{~5oxF%G`OqYL z@&61DZrb1eeIWjWzy1%+@INZ@LhJW$tkHg)&lCH@EjP*G*nRhD*|WV@ESsUV@l*HB zj_zd6=j=(M5e@vW5AX!W8~wXD|3k$7o9n-2{19JN@jL9t$q(<NF28vb_3hMgr;no3 zmafQNlAK~z;HsH9_r|IwJ6HDNO-h^jkL<sZ{*Q0>-=%dH^#|Sm@Gtz)@BLxk+6VF- z`!qLv`2I&}SKXA2-b;^`7t3&~u02<CeWrQa-_M)u<)*IKlW=Jvg=hZ0z!P^Ei~( z7S~JeDK7o6|Dk+Wjc@Xz_=;J-5AU*lwmg6F&HCf#R;viutj-l@|31lxC5~Um!dCm| zy1$d{AAHE~|K<L+a9P%U@#%+V-9J>D^i%h1FTdBtu!~=$!wcjd9SevmpQQM?viPLN z#L&qaXH*^dSNvyquyg;1thWBgz1m?vHvZOqX?9D#W5MVA()sP%UMO$8Dn32aWUGv$ zf#rV&*Z&M54;tmCoKT+r@jt^qPQ(8UtZpB#{}D?6w&C)h^oKv+y|Xc{wF$E`{&0En zlk96;&#R`Wu<q(G-Xiow;?9I}w@=5_zi~eFzn%TyKSS?7?)67<^&ho2=+&@Ys9pN? z^ZID_<p-MIS8m$e+Ob}7>bFf3oEaRMe;oSH&@}Z=<cH<Q=l{^KKXzWaLUhl2j*894 zZf#q=G^R3NVoy`{PT6!$g>Xl`#|mztseFtKJpt_B-am+!$+Q=?5nueH+i_oe@P)6x zB}{d#J_-4hmtA(-<f`?YJzH6uKRN2^qxm0v=QF&P=c<1&_da8d{v&DYUi0`5&kwKX ze>rRFoY&i;t!I?nu6Wwnp5`7F{BG;p5{B>x^+XnVCqGXA-SnS9=+Df*x?h6-GfcV` z|Mk)Ge^Z%Xt^Z;ApW&a!^P}^B^WCg}X&k<({@`Kl`9IXIt*hU?KC}HlgK~H;sEGg1 z@X6gy=Rd=ZveW+=JZJ5l{f|%F;y*)E&TIQ`vX||@)TX!pXP8v_pP?y!wk@B^e}>5~ z`G0dR{LirDvc2X02ltu#e`tnv{%1(g_5aV{s$2Kx`UCYp(l6>Cr&jUrYhT&_r%C(! zyDbmye;5C!{!_XAW$b?j)w%Y+KJx$7TKH%ApYs0<la4-)|IL>r|0__nZcg|!`{VgP zb>d9_Gi-Ra@IS*+q41YSYtn*0Uin$K{HuMJ{JWX;KT>}N+b#Of(DbwZpyAi|KeV2| zk+{!aqrT?lF7s{^-MZ^XZdqQ5e7tGTJc;Fv3ua!7oM2*ZG&N!Q^AL6}PkEXD3<tN$ ze{h)Jz5j!+{4MEY@nUxRaTWQ#d#>!URB!#Vm)&R2@0v54?ndA7E;U)%@i<g$<0_@; z`p<Ue>z@u(fAduI*Ux_mtRjI9lK1pJ^i6;KpMg6oN^a+}m%pxcu8s0eT#@<x+sWeW z`g|>kr)?2)L?@ZMrKTo0vne$3X@5}u$0h!sfi2-xRC`}3zreq<b`}?Nw^+Y?x+9+B z$G*(Rxte^DiCg!%OgXn;ZpU_xH7i!{tBlr-zu+pu_-FAC{eQfye>c_yKeFF&Kl46c zjd}Lu{|v&s?nh3mZhx99bLsPchM3pijQ?@${m;O5>yOQUhNj4hW%eC)O4p?yg&+Nx zm$>z6-1#@V^4o<xPI+w$n3iT_klwpaCHJi4p(Tn-_<u#ZGKl_|{GWlf@IOPd%a`-F z{2$eA{iyt{{G(d?gWBpN=DF3YD*U58l`p2wbKVuXR=rjB?RK;16NY=Lmsm%M1Wf&% z>&j5Cdh$O5+q8eTav#}m_|I@i{GsaB``dpz{8)GT&5iT-j{Rpam;KLh_4&N1zm)$o zu+03=(CoOTKE1x%O8iLvE%l>P{JmT4dGG1|oBNQLRdupkb;pT})IB?9Dp$9L{p{U! zq$5(q`m|)l?e9!o3>u5N7_>jD|KryF&%jdm@%!7xkB9w#O#E=~wd=l}lfApWuY8&7 z^!&{vw$?kxO^gHrr>vfE>L}NYgRI{t%wKjTTr6?=rDK8LMAzqjxoiA-hkEa3JJGYs zv!Ci#yUdB2v?o=3SJumSlP@kW*=pzdpP|Y6Kf^)Wt@D4VKR*zg?f21d<?>f@S|8(< zm`cCc@-2PK2A3Xp5v?~OCm!Ub*RC@9?VxDBzxF=^tHIw1@9XpQZweog=l`<S@4Cme zbx*hNyPTJ|y>|NfrqBs0w?k(ruSmVKV5*KZZ|~aoQ-YRHzt|@JDzkc8_WS$KB+gl! z{b=L*Z%fFmU)Q(vy1ZGlRBUIs-Zf9v^y;N+&!67^LwWxn!TXQQ-%R}NcBjVuM}Og> zm-lb(sy#M$*~?wE?{7WZIVpG5WsiepI*H5-3#REfDmwkSzhX+DTm1Bk2Lr#E<Y(WH zeHSiMcr5+s%-Lr*r^{!aS~Mke(W3P!Q*YnhzB=#CAO9b(|1+?CsEPUL{?>I}{UPhs z6><JdKbk{#>~D|Uvp03Ne^X@SnPLaw;!_P1%u;0<%GDl;f64zRTmNAHFW!pD|NgoD zXE+jmX-l}Au)@KIPc@y)pS@qZXZpQbbD@fhM<cJw*vf>aiaP0O9@5ea-+E{J?wZxv LdM9J&|Gx<U=^=WR literal 0 HcmV?d00001 -- GitLab From 0c417b7a19b1813e884b73e8107f17560927d896 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 11 Mar 2021 10:50:27 +0100 Subject: [PATCH 54/65] fix(carto) : fix color marker --- src/app/map/components/map.component.scss | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/map/components/map.component.scss b/src/app/map/components/map.component.scss index e9ff65087..8134fe5fd 100644 --- a/src/app/map/components/map.component.scss +++ b/src/app/map/components/map.component.scss @@ -46,7 +46,7 @@ border-radius: 50% 50% 50% 0; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); - background-color: $black; + background-color: $grey-3; margin-left: -8px; margin-top: 4px; &:before { @@ -69,6 +69,15 @@ } } +::ng-deep .leaflet-control-zoom { + a { + color: $grey-3; + &:hover { + color: $blue-hover; + } + } +} + ::ng-deep .leaflet-marker-icon { &.leaflet-interactive { circle { -- GitLab From 24a2f9f7a1e7a4e48bfd3a7291d60ee62b6bd1b0 Mon Sep 17 00:00:00 2001 From: Antonin Coquet <ext.sopra.acoquet@grandlyon.com> Date: Thu, 11 Mar 2021 10:50:34 +0100 Subject: [PATCH 55/65] fix: remove profil picture from profil page --- src/app/profile/profile.component.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html index da389cd0f..54ad68b58 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -1,9 +1,6 @@ <div fxLayout="column" class="content-container full-screen" *ngIf="userProfile"> <div class="profileSection"> <div class="section-container" fxLayout="row"> - <svg class="cameraProfile" aria-hidden="true"> - <use [attr.xlink:href]="'assets/ico/sprite.svg#camera'"></use> - </svg> <div class="profileInformation" fxLayoutGap="18px" fxLayout="column"> <div fxLayout="row" fxLayoutAlign="space-between center"> <p class="profileName">{{ userProfile.name | titlecase }} {{ userProfile.surname | titlecase }}</p> -- GitLab From 2ada145e733d3e99dd0022bc79028d7bfe76210e Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 11 Mar 2021 10:55:31 +0100 Subject: [PATCH 56/65] fix(print) : remove scroll on print view --- src/app/app.component.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/app.component.scss b/src/app/app.component.scss index ba93e485c..f6a2d3edf 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -7,6 +7,11 @@ flex-direction: column; } +@media print { + .app-body { + height: 100% !important; + } +} .app-body { flex: 1 1 auto; overflow-y: auto; -- GitLab From 70f033363829bb355d636a5e6182082824632567 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 11 Mar 2021 11:10:59 +0100 Subject: [PATCH 57/65] feat(card) : add indicator claim to help admin --- .../components/card/card.component.html | 2 +- .../components/card/card.component.scss | 3 +++ .../components/card/card.component.ts | 21 +++++++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/app/structure-list/components/card/card.component.html b/src/app/structure-list/components/card/card.component.html index 111164435..ca4925051 100644 --- a/src/app/structure-list/components/card/card.component.html +++ b/src/app/structure-list/components/card/card.component.html @@ -1,6 +1,6 @@ <div class="structure" fxLayout="column" (click)="cardClicked()" (mouseenter)="cardHover()"> <div class="headerStructure" fxLayout="row" fxLayoutAlign="space-between center" fxLayoutGap="16px"> - <span class="structure-name">{{ structure.structureName }}</span> + <span class="structure-name" [ngClass]="{ notClaimed: !isClaimed }">{{ structure.structureName }}</span> <div *ngIf="structure.distance" class="distanceStructure" diff --git a/src/app/structure-list/components/card/card.component.scss b/src/app/structure-list/components/card/card.component.scss index 6deabb870..fe17d8734 100644 --- a/src/app/structure-list/components/card/card.component.scss +++ b/src/app/structure-list/components/card/card.component.scss @@ -17,6 +17,9 @@ font-style: italic; } .structure-name { + &.notClaimed { + color: $red-info; + } color: $grey-1; @include cn-bold-18; padding-bottom: 5px; diff --git a/src/app/structure-list/components/card/card.component.ts b/src/app/structure-list/components/card/card.component.ts index 94440ab2d..b3a414f4a 100644 --- a/src/app/structure-list/components/card/card.component.ts +++ b/src/app/structure-list/components/card/card.component.ts @@ -1,7 +1,9 @@ import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Structure } from '../../../models/structure.model'; +import { ProfileService } from '../../../profile/services/profile.service'; import { GeojsonService } from '../../../services/geojson.service'; +import { StructureService } from '../../../services/structure.service'; @Component({ selector: 'app-card', @@ -12,9 +14,24 @@ export class CardComponent implements OnInit { @Input() public structure: Structure; @Output() public showDetails: EventEmitter<Structure> = new EventEmitter<Structure>(); @Output() public hover: EventEmitter<Structure> = new EventEmitter<Structure>(); + public isClaimed = true; - constructor(private route: ActivatedRoute, private router: Router) {} - ngOnInit(): void {} + constructor( + private route: ActivatedRoute, + private router: Router, + private profileService: ProfileService, + private structureService: StructureService + ) {} + ngOnInit(): void { + if (this.profileService.isAdmin()) { + this.setClaimIndicator(); + } + } + + // Check if structure haven't owners to help admin vision. + async setClaimIndicator() { + this.isClaimed = await this.structureService.isClaimed(this.structure._id, null).toPromise(); + } /** * Display distance in m or km according to value -- GitLab From 7ac35111081af41bc95d072956dbe165b6397b07 Mon Sep 17 00:00:00 2001 From: Antonin Coquet <ext.sopra.acoquet@grandlyon.com> Date: Thu, 11 Mar 2021 14:02:42 +0100 Subject: [PATCH 58/65] fix: use profileImage attribute for profile picture --- src/app/models/user.model.ts | 1 + src/app/profile/profile.component.html | 3 +++ src/app/profile/profile.component.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts index d4c4b9a58..ed5b7aa02 100644 --- a/src/app/models/user.model.ts +++ b/src/app/models/user.model.ts @@ -10,6 +10,7 @@ export class User { validationToken: string; structuresLink: string[]; pendingStructuresLink: string[] = []; + profileImage: string; constructor(obj?: any) { Object.assign(this, obj); diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html index 54ad68b58..45f184ad1 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -1,6 +1,9 @@ <div fxLayout="column" class="content-container full-screen" *ngIf="userProfile"> <div class="profileSection"> <div class="section-container" fxLayout="row"> + <ng-container *ngIf="userProfile.profileImage"> + <img class="cameraProfile" src="userProfile.profileImage"> + </ng-container> <div class="profileInformation" fxLayoutGap="18px" fxLayout="column"> <div fxLayout="row" fxLayoutAlign="space-between center"> <p class="profileName">{{ userProfile.name | titlecase }} {{ userProfile.surname | titlecase }}</p> diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts index 0b3b1d36c..4c1c5e758 100644 --- a/src/app/profile/profile.component.ts +++ b/src/app/profile/profile.component.ts @@ -25,6 +25,7 @@ export class ProfileComponent implements OnInit { ngOnInit(): void { this.profileService.getProfile().then((profile) => { this.userProfile = profile; + console.log(this.userProfile.profileImage) this.structures = []; profile.structuresLink.forEach((structureId) => { this.structureService.getStructureWithOwners(structureId, profile).subscribe((s) => { -- GitLab From bf474b7e0afe053b521420cbef63877a187725b3 Mon Sep 17 00:00:00 2001 From: Antonin Coquet <ext.sopra.acoquet@grandlyon.com> Date: Thu, 11 Mar 2021 14:03:42 +0100 Subject: [PATCH 59/65] fix: remove consolelog --- src/app/profile/profile.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts index 4c1c5e758..0b3b1d36c 100644 --- a/src/app/profile/profile.component.ts +++ b/src/app/profile/profile.component.ts @@ -25,7 +25,6 @@ export class ProfileComponent implements OnInit { ngOnInit(): void { this.profileService.getProfile().then((profile) => { this.userProfile = profile; - console.log(this.userProfile.profileImage) this.structures = []; profile.structuresLink.forEach((structureId) => { this.structureService.getStructureWithOwners(structureId, profile).subscribe((s) => { -- GitLab From 49e7d00c1cdd118fee2d5448c77f18b63a569b78 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Fri, 12 Mar 2021 11:40:39 +0100 Subject: [PATCH 60/65] fix(sonar) : fix sonar bug --- src/app/post/components/post-card/post-card.component.html | 2 +- .../post/components/post-details/post-details.component.html | 2 +- .../post/components/post-details/post-details.component.scss | 2 +- .../post/components/post-publish/post-publish.component.scss | 2 +- src/app/profile/profile.component.html | 2 +- src/app/shared/components/button/button.component.scss | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.html b/src/app/post/components/post-card/post-card.component.html index 1db7cd7e0..78a4c3ef0 100644 --- a/src/app/post/components/post-card/post-card.component.html +++ b/src/app/post/components/post-card/post-card.component.html @@ -16,7 +16,7 @@ <span>{{ post.tags[0].name }}</span> </div> <div fxLayout="row" class="imageContainer" *ngIf="post.feature_image"> - <img class="image" [src]="post.feature_image" /> + <img class="image" alt="image about the news" [src]="post.feature_image" /> </div> <div fxLayout="row" class="title"> {{ post.title }} diff --git a/src/app/post/components/post-details/post-details.component.html b/src/app/post/components/post-details/post-details.component.html index 2e2136a31..dee0903ee 100644 --- a/src/app/post/components/post-details/post-details.component.html +++ b/src/app/post/components/post-details/post-details.component.html @@ -29,7 +29,7 @@ <div fxLayout="row">par {{ post.author }}</div> </div> <div fxLayout="row" class="imageContainer" *ngIf="post.feature_image"> - <img class="image" [src]="post.feature_image" /> + <img class="image" alt="image about the news" [src]="post.feature_image" /> </div> <div fxLayout="row" class="description"> <div [innerHtml]="post.safeHtml"></div> diff --git a/src/app/post/components/post-details/post-details.component.scss b/src/app/post/components/post-details/post-details.component.scss index 496864352..1adbe3606 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -10,7 +10,7 @@ $margin-post: 20px; max-width: 832px; margin: $margin-post auto; min-height: calc( - var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post}* 3 + var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post} * 3 ); .chevronLeft { height: 24px; diff --git a/src/app/post/components/post-publish/post-publish.component.scss b/src/app/post/components/post-publish/post-publish.component.scss index 8c66547d0..05cb307a7 100644 --- a/src/app/post/components/post-publish/post-publish.component.scss +++ b/src/app/post/components/post-publish/post-publish.component.scss @@ -9,7 +9,7 @@ $margin-post: 20px; width: 95%; margin: $margin-post auto; min-height: calc( - var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post}* 2 + var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post} * 2 ); } .chevronLeft { diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html index 45f184ad1..66be72664 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -2,7 +2,7 @@ <div class="profileSection"> <div class="section-container" fxLayout="row"> <ng-container *ngIf="userProfile.profileImage"> - <img class="cameraProfile" src="userProfile.profileImage"> + <img class="cameraProfile" alt="image of profile" src="userProfile.profileImage" /> </ng-container> <div class="profileInformation" fxLayoutGap="18px" fxLayout="column"> <div fxLayout="row" fxLayoutAlign="space-between center"> diff --git a/src/app/shared/components/button/button.component.scss b/src/app/shared/components/button/button.component.scss index 04a71d547..4cea9a735 100644 --- a/src/app/shared/components/button/button.component.scss +++ b/src/app/shared/components/button/button.component.scss @@ -48,7 +48,6 @@ button { border-radius: 4px; @include btn-bold; font-size: 16px; - border-radius: 4px; &.withIcon { color: $black; height: 36px; -- GitLab From e739decf8fa52b3d47304ef2503031afaef1db9f Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Fri, 12 Mar 2021 11:42:42 +0100 Subject: [PATCH 61/65] fix: search title --- .../structure-list/components/search/search.component.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/structure-list/components/search/search.component.html b/src/app/structure-list/components/search/search.component.html index 44d8b0b6d..f333a5f73 100644 --- a/src/app/structure-list/components/search/search.component.html +++ b/src/app/structure-list/components/search/search.component.html @@ -1,6 +1,9 @@ <div class="block"> <div class="header"> - <span class="title">Recherche d’acteur de l’inclusion numérique</span> + <span class="title" + >Recherche d’acteur <br /> + du réseau d’inclusion numérique</span + > </div> <div class="content" fxLayout="column"> <div class="searchSection"> -- GitLab From adc0525737cbe43f2922043067f691a3822c7d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20BRISON?= <ext.sopra.jbrison@grandlyon.com> Date: Fri, 12 Mar 2021 15:05:15 +0100 Subject: [PATCH 62/65] Fix/news --- .../post-card/post-card.component.scss | 4 ++ .../post-details/post-details.component.scss | 8 ++- .../post-details/post-details.component.ts | 6 +- .../post-header/post-header.component.html | 9 ++- .../post-header/post-header.component.scss | 59 +++++-------------- .../post-header/post-header.component.ts | 16 ++++- .../post-list/post-list.component.html | 18 +++--- .../post-list/post-list.component.scss | 7 +-- .../post-list/post-list.component.ts | 5 +- .../post-publish/post-publish.component.html | 4 +- .../post-publish/post-publish.component.scss | 5 +- .../post-publish/post-publish.component.ts | 3 +- src/assets/ico/sprite.svg | 10 ++-- src/assets/scss/_layout.scss | 3 +- 14 files changed, 77 insertions(+), 80 deletions(-) diff --git a/src/app/post/components/post-card/post-card.component.scss b/src/app/post/components/post-card/post-card.component.scss index aaf3133af..8aad13d4b 100644 --- a/src/app/post/components/post-card/post-card.component.scss +++ b/src/app/post/components/post-card/post-card.component.scss @@ -19,6 +19,9 @@ } } .title { + @media #{$large-phone} { + @include cn-bold-22; + } @include cn-bold-30; } .description { @@ -27,6 +30,7 @@ } } .imageContainer { + margin-bottom: 12px !important; .image { object-fit: cover; height: 88px; diff --git a/src/app/post/components/post-details/post-details.component.scss b/src/app/post/components/post-details/post-details.component.scss index 1adbe3606..27e6544e5 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -7,8 +7,8 @@ $margin-post: 20px; .postContainer { - max-width: 832px; - margin: $margin-post auto; + max-width: 860px; + margin: $margin-post 0; min-height: calc( var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post} * 3 ); @@ -67,6 +67,8 @@ $margin-post: 20px; ::ng-deep a { @include hyperlink; padding: 0; - font-size: 18px; + } + ::ng-deep p { + @include cn-regular-18; } } diff --git a/src/app/post/components/post-details/post-details.component.ts b/src/app/post/components/post-details/post-details.component.ts index 797763328..317585f70 100644 --- a/src/app/post/components/post-details/post-details.component.ts +++ b/src/app/post/components/post-details/post-details.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import { ActivatedRoute, Router } from '@angular/router'; +import { RouterListenerService } from '../../../services/routerListener.service'; import { Post } from '../../models/post.model'; import { PostService } from '../../services/post.service'; @@ -14,7 +15,8 @@ export class PostDetailsComponent implements OnInit { private activatedRoute: ActivatedRoute, private router: Router, private postService: PostService, - private sanitizer: DomSanitizer + private sanitizer: DomSanitizer, + private routerListener: RouterListenerService ) {} post: Post; ngOnInit(): void { @@ -31,6 +33,6 @@ export class PostDetailsComponent implements OnInit { } public backToPosts(): void { - this.router.navigateByUrl('/news'); + this.routerListener.goToPreviousUrl(); } } diff --git a/src/app/post/components/post-header/post-header.component.html b/src/app/post/components/post-header/post-header.component.html index 6b48f6d33..ae793b227 100644 --- a/src/app/post/components/post-header/post-header.component.html +++ b/src/app/post/components/post-header/post-header.component.html @@ -1,6 +1,9 @@ <div class="header-container"> <div class="section-container" fxLayout="column" fxLayoutAlign="space-between"> - <h1>Actualités</h1> + <h1> + Fil d’actualité + <p class="onlyOnDesktop">du réseau d’inclusion numérique</p> + </h1> <div fxLayout="row" fxLayoutGap="5px" fxLayoutAlign="space-between flex-end" class="overflow"> <div fxLayout="row" class="row-mobile"> <div fxLayout="row" fxLayoutAlign="center center" *ngFor="let tag of tags.others"> @@ -9,7 +12,7 @@ tabindex="0" (click)="activateTag(tag)" (keydown.enter)="activateTag(tag)" - [ngClass]="{ active: tag.slug === mainActiveTag.slug }" + [ngClass]="{ active: tag.slug === mainActiveTag.slug || tag.name === mainActiveTag.slug }" >{{ tag.name }}</span > </div> @@ -35,7 +38,7 @@ <app-svg-icon class="icon" [type]="'ico'" - [iconClass]="modalTypeOpened === TypeModal.public ? 'white' : 'grey-1'" + [iconClass]="modalTypeOpened === TypeModal.public ? 'white icon-32' : 'grey-1 icon-32'" [icon]="'news-public'" ></app-svg-icon> <div class="arrow"></div> diff --git a/src/app/post/components/post-header/post-header.component.scss b/src/app/post/components/post-header/post-header.component.scss index 46d4f71b1..7a51cec87 100644 --- a/src/app/post/components/post-header/post-header.component.scss +++ b/src/app/post/components/post-header/post-header.component.scss @@ -5,11 +5,24 @@ @import '../../../../assets/scss/layout'; h1 { + margin-top: 25px; margin-bottom: 0px; + .onlyOnDesktop { + margin: 0; + } + @media #{$large-phone} { + @include cn-bold-28; + .onlyOnDesktop { + display: none; + } + } } .header-container { height: #{$header-post-height}; + @media #{$large-phone} { + height: #{$header-post-height-mobile}; + } background: $white; } @@ -22,7 +35,7 @@ h1 { button { background: $white; height: 40px; - width: 100%; + width: 210px; border: 1px solid $grey-4; padding: 3px 16px 3px 16px; outline: none; @@ -81,50 +94,6 @@ h1 { } } -// .btnSection { -// padding: 16px 0 0px 0; -// button { -// background: $white; -// height: 40px; -// width: 210px; -// border: 1px solid $grey-4; -// padding: 3px 16px 3px 16px; -// outline: none; -// border-radius: 4px; -// cursor: pointer; -// white-space: nowrap; -// @include btn-normal; -// .arrow { -// background-color: transparent; -// border-bottom: 1px solid $grey-2; -// border-right: 1px solid $grey-2; -// transform: translateY(-25%) rotate(45deg); -// margin: 0 5px 0 10px; -// height: 7px; -// width: 7px; -// } -// &:focus { -// border-color: $blue-hover; -// } -// } -// .selected { -// border-color: $primary-color !important; -// color: inherit; -// .arrow { -// background-color: transparent; -// border-bottom: 1px solid $primary-color; -// border-right: 1px solid $primary-color; -// transform: translateY(25%) rotate(-135deg); -// margin: 0 5px 0 10px; -// height: 7px; -// width: 7px; -// } -// } -// .containCheckedFilters { -// border-color: $secondary-color; -// } -// } - .tag-button { padding: 8px 10px; @include cn-regular-16; diff --git a/src/app/post/components/post-header/post-header.component.ts b/src/app/post/components/post-header/post-header.component.ts index 1cbc7f338..21ef7a388 100644 --- a/src/app/post/components/post-header/post-header.component.ts +++ b/src/app/post/components/post-header/post-header.component.ts @@ -27,6 +27,12 @@ export class PostHeaderComponent implements OnInit { this.route.data.subscribe((data) => { if (data.tags) { this.tags = data.tags; + this.tags.others.forEach((tag) => { + tag.slug == TagEnum.aLaUne ? (tag.name = 'Les + récentes') : tag.name; + }); + this.tags.commune.sort((tagA, tagB) => { + return this.sortArray(tagA, tagB); + }); } }); @@ -43,6 +49,14 @@ export class PostHeaderComponent implements OnInit { }); } + private sortArray(tagA: Tag, tagB: Tag): number { + const nameTagA = tagA.name.toUpperCase(); + const nameTagB = tagB.name.toUpperCase(); + if (nameTagA < nameTagB) { + return -1; + } + return 1; + } // Open the modal and display the list according to the right filter button public openModal(modalType: TypeModalNews): void { // if modal already opened, reset type @@ -96,7 +110,7 @@ export class PostHeaderComponent implements OnInit { this.router.navigate([], { relativeTo: this.route, queryParams: { - mainTag: this.mainActiveTag.slug, + mainTag: this.mainActiveTag.slug == this.tagEnum.etudes ? this.mainActiveTag.name : this.mainActiveTag.slug, publicTags: this.checkedPublicTags.map((tag) => tag.slug), locationTags: this.checkedLocationTags.map((tag) => tag.slug), }, 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 00642e6c0..2d6c15596 100644 --- a/src/app/post/components/post-list/post-list.component.html +++ b/src/app/post/components/post-list/post-list.component.html @@ -17,7 +17,7 @@ </div> <div fxLayout="column" *ngIf="isALaUneTag() && !displayTags()"> <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> - <h2>à la une</h2> + <h2>dernières actualités</h2> <app-button [type]="'button'" [style]="'buttonWithHash'" @@ -25,7 +25,7 @@ (action)="togglePublishNews()" ></app-button> </div> - <app-post-card [class]="'bigNew'" [post]="bigNews"></app-post-card> + <app-post-card *ngIf="bigNews" [class]="'bigNew'" [post]="bigNews"></app-post-card> </div> <div fxLayout="column" fxLayoutAlign=" center" class="project-container mobile"> <div class="background-project-container"> @@ -46,18 +46,22 @@ </div> </div> <div fxLayout="column"> - <div fxLayout="row" class="row-border" fxLayoutAlign="space-between center"> - <h2 [ngClass]="{ 'padding-16-Top': isALaUneTag() && !displayTags() }">{{ getDisplayedTag() }}</h2> + <div + *ngIf="!isALaUneTag() || displayTags()" + fxLayout="row" + class="row-border" + fxLayoutAlign="space-between center" + > + <h2>{{ getDisplayedTag() }}</h2> <app-button - *ngIf="displayTags() || !isALaUneTag()" [type]="'button'" [style]="'buttonWithHash'" [text]="'Publier votre actu'" - (action)="publishNews()" + (action)="togglePublishNews()" ></app-button> </div> <div *ngIf="leftColumnPosts.length <= 0" fxLayout="column"> - <p>Aucun résultat ne correspond a votre recherche.</p> + <p>Aucun résultat ne correspond à votre recherche.</p> </div> <div fxLayout="row" fxLayoutGap="33px"> <div fxLayout="column" class="columnPosts"> 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 ea2f433a9..38cf7dc00 100644 --- a/src/app/post/components/post-list/post-list.component.scss +++ b/src/app/post/components/post-list/post-list.component.scss @@ -5,7 +5,6 @@ .section-container { background: $grey-6; - margin-top: 40px; min-height: 68vh; width: 100%; .row-border { @@ -31,7 +30,7 @@ h2 { @media #{$tablet} { width: 100%; } - width: 70%; + width: 80%; h2 { @media #{$large-phone} { @include cn-bold-22; @@ -111,7 +110,3 @@ h2 { margin-bottom: 0; } } - -.padding-16-Top { - padding-top: 16px; -} 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 6bba02204..7703df215 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -52,9 +52,12 @@ export class PostListComponent implements OnInit { this.projectsNew = projectNews; }); this.postService.getPosts(1, [TagEnum.aLaUne]).subscribe((news) => { - this.bigNews = this.addAuthorToPost(news.posts[0]); + if (news.posts[0]) { + this.bigNews = this.addAuthorToPost(news.posts[0]); + } }); this.route.queryParams.subscribe((queryParams) => { + this.isPublishMode = false; // If main tag is in route, set it if (queryParams.mainTag) { this.selectedMainTagSlug = queryParams.mainTag; diff --git a/src/app/post/components/post-publish/post-publish.component.html b/src/app/post/components/post-publish/post-publish.component.html index 1578c1ea9..7c28907ac 100644 --- a/src/app/post/components/post-publish/post-publish.component.html +++ b/src/app/post/components/post-publish/post-publish.component.html @@ -27,7 +27,9 @@ <br /> </div> <div> - <a class="btn-primary" href="mailto:inclusionnumerique@grandlyon.com?subject=Nouvelle actualité à intégrer" + <a + class="btn-primary" + [href]="'mailto:inclusionnumerique@grandlyon.com?subject=Nouvelle actualité à intégrer&body=' + bodyMail" >Envoyer votre actu par mail</a > </div> diff --git a/src/app/post/components/post-publish/post-publish.component.scss b/src/app/post/components/post-publish/post-publish.component.scss index 05cb307a7..1868e8d4a 100644 --- a/src/app/post/components/post-publish/post-publish.component.scss +++ b/src/app/post/components/post-publish/post-publish.component.scss @@ -5,9 +5,8 @@ $margin-post: 20px; .container { - max-width: 832px; - width: 95%; - margin: $margin-post auto; + max-width: 860px; + margin: $margin-post 0 100px 0; min-height: calc( var(--vh, 1vh) * 100 - #{$header-height} - #{$footer-height} - #{$header-post-height} - #{$margin-post} * 2 ); diff --git a/src/app/post/components/post-publish/post-publish.component.ts b/src/app/post/components/post-publish/post-publish.component.ts index a1df80d6e..061bc6698 100644 --- a/src/app/post/components/post-publish/post-publish.component.ts +++ b/src/app/post/components/post-publish/post-publish.component.ts @@ -8,7 +8,8 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; export class PostPublishComponent implements OnInit { @Output() closePublish = new EventEmitter<boolean>(); constructor() {} - + public bodyMail = + "Bonjour,%0D Je souhaite ajouter cette publication sur Rés'in :%0D- Titre :%0D- Texte :%0D- Auteur :%0D- Image : à joindre en pièce jointe"; ngOnInit(): void {} public backToPosts(): void { diff --git a/src/assets/ico/sprite.svg b/src/assets/ico/sprite.svg index 08a36d469..a8f21b0b4 100644 --- a/src/assets/ico/sprite.svg +++ b/src/assets/ico/sprite.svg @@ -218,12 +218,10 @@ <rect x="21.7109" y="16.4634" width="1.33333" height="9.11111"/> </symbol> -<symbol id="news-public" viewBox="0 0 29 26" xmlns="http://www.w3.org/2000/svg"> -<path d="M15.8488 19.9496C16.7844 19.3911 17.4109 18.3687 17.4109 17.2C17.4109 15.4327 15.9782 14 14.2109 14C12.4436 14 11.0109 15.4327 11.0109 17.2C11.0109 18.3687 11.6375 19.3911 12.573 19.9496C11.1806 20.5754 10.2109 21.9745 10.2109 23.6V26H18.2109V23.6C18.2109 21.9745 17.2413 20.5754 15.8488 19.9496Z" /> -<path d="M5.84883 19.9496C6.78438 19.3911 7.41094 18.3687 7.41094 17.2C7.41094 15.4327 5.97825 14 4.21094 14C2.44363 14 1.01094 15.4327 1.01094 17.2C1.01094 18.3687 1.6375 19.3911 2.57304 19.9496C1.18059 20.5754 0.210938 21.9745 0.210938 23.6V26H8.21094V23.6C8.21094 21.9745 7.24128 20.5754 5.84883 19.9496Z" /> -<path d="M10.8488 5.94963C11.7844 5.39114 12.4109 4.36874 12.4109 3.2C12.4109 1.43269 10.9782 0 9.21094 0C7.44363 0 6.01094 1.43269 6.01094 3.2C6.01094 4.36874 6.6375 5.39114 7.57304 5.94963C6.18059 6.57538 5.21094 7.97445 5.21094 9.6V12H13.2109V9.6C13.2109 7.97445 12.2413 6.57538 10.8488 5.94963Z" /> -<path d="M25.8488 19.9496C26.7844 19.3911 27.4109 18.3687 27.4109 17.2C27.4109 15.4327 25.9782 14 24.2109 14C22.4436 14 21.0109 15.4327 21.0109 17.2C21.0109 18.3687 21.6375 19.3911 22.573 19.9496C21.1806 20.5754 20.2109 21.9745 20.2109 23.6V26H28.2109V23.6C28.2109 21.9745 27.2413 20.5754 25.8488 19.9496Z" /> -<path d="M20.8488 5.94963C21.7844 5.39114 22.4109 4.36874 22.4109 3.2C22.4109 1.43269 20.9782 0 19.2109 0C17.4436 0 16.0109 1.43269 16.0109 3.2C16.0109 4.36874 16.6375 5.39114 17.573 5.94963C16.1806 6.57538 15.2109 7.97445 15.2109 9.6V12H23.2109V9.6C23.2109 7.97445 22.2413 6.57538 20.8488 5.94963Z"/> +<symbol id="news-public" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> +<path d="M23.5985 23.9446C24.6326 23.3273 25.3251 22.1973 25.3251 20.9055C25.3251 18.9522 23.7416 17.3687 21.7882 17.3687C19.8349 17.3687 18.2514 18.9522 18.2514 20.9055C18.2514 22.1973 18.9439 23.3273 19.9779 23.9446C18.4389 24.6362 17.3672 26.1825 17.3672 27.9792V29.5265H26.2093V27.9792C26.2093 26.1825 25.1376 24.6362 23.5985 23.9446Z" stroke="none"/> +<path d="M11.4423 23.9446C12.4763 23.3273 13.1688 22.1973 13.1688 20.9055C13.1688 18.9522 11.5853 17.3687 9.63199 17.3687C7.67865 17.3687 6.09515 18.9522 6.09515 20.9055C6.09515 22.1973 6.78766 23.3273 7.82169 23.9446C6.28266 24.6362 5.21094 26.1825 5.21094 27.9792V29.5265H14.053V27.9792C14.053 26.1825 12.9813 24.6362 11.4423 23.9446Z" stroke="none"/> +<path d="M16.9696 9.5759C18.0037 8.95863 18.6962 7.82861 18.6962 6.53684C18.6962 4.5835 17.1127 3 15.1593 3C13.206 3 11.6225 4.5835 11.6225 6.53684C11.6225 7.82861 12.315 8.95863 13.349 9.5759C11.81 10.2675 10.7383 11.8139 10.7383 13.6105V15.1579H19.5804V13.6105C19.5804 11.8139 18.5087 10.2675 16.9696 9.5759Z" stroke="none"/> </symbol> diff --git a/src/assets/scss/_layout.scss b/src/assets/scss/_layout.scss index 3da7ec582..d8f402ac2 100644 --- a/src/assets/scss/_layout.scss +++ b/src/assets/scss/_layout.scss @@ -3,4 +3,5 @@ $footer-height: 56px; $header-height-phone: 70px; $footer-height-phone: 75px; $progressBar-height: 50px; -$header-post-height: 140px; +$header-post-height: 180px; +$header-post-height-mobile: 140px; -- GitLab From 0ce9fb5c95a29ea800ccc96b88aaeefbf6504a3b Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 15 Mar 2021 15:54:10 +0100 Subject: [PATCH 63/65] fix: temp hide of news features --- src/app/app-routing.module.ts | 1 + src/app/header/header.component.html | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index b8a27b65e..c0890bbf9 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -89,6 +89,7 @@ const routes: Routes = [ }, { path: 'news', + canActivate: [AdminGuard], loadChildren: () => import('./post/post.module').then((m) => m.PostModule), }, { diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html index 7fc0ea9a6..bffc48257 100644 --- a/src/app/header/header.component.html +++ b/src/app/header/header.component.html @@ -9,7 +9,7 @@ <app-svg-icon (click)="openMenu()" [type]="'ico'" [icon]="'menu'" [iconClass]="'icon-32'"></app-svg-icon> </div> <div fxLayout="row" class="right-header" fxLayoutAlign="center center" fxLayoutGap="3vw"> - <a routerLink="/news" [routerLinkActive]="'active'" i18n>Actualités</a> + <!-- <a routerLink="/news" [routerLinkActive]="'active'" i18n>Actualités</a> --> <a routerLink="/home" [routerLinkActive]="'active'" i18n>Cartographie de acteurs</a> <a routerLink="/about" [routerLinkActive]="'active'" i18n>Qui sommes-nous ?</a> <a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'">Administration</a> @@ -28,7 +28,7 @@ <div (click)="closeMenu()" class="ico-close-details"></div> </div> <div fxLayout="column" class="right-header" fxLayoutAlign="none baseline" fxLayoutGap="5vw"> - <a routerLink="/news" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Actualités</a> + <!-- <a routerLink="/news" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Actualités</a> --> <a routerLink="/home" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Cartographie de acteurs</a> <a routerLink="/about" [routerLinkActive]="'active'" i18n>Qui sommes-nous ?</a> <a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'" (click)="closeMenu()">Administration</a> -- GitLab From cd1ac48abed6b399a365e7169e46e290ee49f59c Mon Sep 17 00:00:00 2001 From: Antonin COQUET <ext.sopra.acoquet@grandlyon.com> Date: Mon, 15 Mar 2021 16:22:08 +0100 Subject: [PATCH 64/65] fix: user-verification feedback form --- src/app/form/form.component.html | 36 ++++--- src/app/form/form.component.scss | 5 + .../user-verification.component.html | 102 +++++++++++------- .../user-verification.component.scss | 60 ++++++++++- src/assets/form/sprite.svg | 6 ++ 5 files changed, 148 insertions(+), 61 deletions(-) diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index 46b374e87..24a36a212 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -1098,25 +1098,27 @@ <svg aria-hidden="true"> <use [attr.xlink:href]="'assets/form/sprite.svg#emailVerification'"></use> </svg> - <h3>Un courriel vous a été envoyé afin de finaliser votre inscription</h3> + <h3>Un courriel vous a été envoyé afin de valider votre inscription</h3> </div> - <div *ngIf="currentPage == nbPagesForm && profile" class="page"> - <div class="title"> - <h3> - Bravo !<br /> - Votre structure a bien été référencée. - </h3> - </div> - - <div class="structureInfoBlock" fxLayout="row" fxLayoutAlign="center"> - <div class="structureInfoContent" fxLayout="column"> - {{ getStructureControl('structureName').value }} - <span>{{ getStructureControl('structureType').value }}</span> + <div *ngIf="currentPage == nbPagesForm && profile" class="lastPage"> + <div class="lastPage"> + <div class="title"> + <h3> + Bravo !<br /> + Votre structure a bien été référencée. + </h3> </div> - <div class="validateSvg"> - <svg class="validate" aria-hidden="true"> - <use [attr.xlink:href]="'assets/form/sprite.svg#checkVector'"></use> - </svg> + + <div class="structureInfoBlock" fxLayout="row" fxLayoutAlign="center"> + <div class="structureInfoContent" fxLayout="column"> + {{ getStructureControl('structureName').value }} + <span>{{ getStructureControl('structureType').value }}</span> + </div> + <div class="validateSvg"> + <svg class="validate" aria-hidden="true"> + <use [attr.xlink:href]="'assets/form/sprite.svg#checkVector'"></use> + </svg> + </div> </div> </div> </div> diff --git a/src/app/form/form.component.scss b/src/app/form/form.component.scss index 0bc3f7704..f8e9ca165 100644 --- a/src/app/form/form.component.scss +++ b/src/app/form/form.component.scss @@ -531,3 +531,8 @@ img { overflow: hidden; } } + +.lastPage { + max-width: 530px; + margin: 0 auto; +} diff --git a/src/app/user-verification/user-verification.component.html b/src/app/user-verification/user-verification.component.html index c1e11207d..63417c23d 100644 --- a/src/app/user-verification/user-verification.component.html +++ b/src/app/user-verification/user-verification.component.html @@ -1,50 +1,74 @@ <div fxLayout="column" class="content-container full-screen"> <p *ngIf="!verificationSuccess && !verificationIssue">Votre email est en cours de vérification ...</p> - <div *ngIf="verificationSuccess"> - <div class="title"> - <h3 *ngIf="structure"> - Bravo !<br /> - Votre compte et votre structure ont bien été référencés. - </h3> - <h3 *ngIf="!structure"> - Bravo !<br /> - Votre compte a bien été créé. - </h3> - </div> - <div *ngIf="structure" class="structureCard"> - <div class="structureInfo" fxLayout="column" fxLayoutGap="14px"> - <div fxLayout="row" fxLayoutAlign="space-between start" fxLayoutGap="20px"> - <a class="structureName" routerLink="/home" [state]="{ data: structure }">{{ structure.structureName }}</a> + <div class="formDiv" *ngIf="verificationSuccess"> + <div *ngIf="structure"> + <div class="title"> + <h1 class="title-form">Bravo, votre compte et votre structure ont bien été référencés !</h1> + </div> + <div class="structureInfoBlock" fxLayout="row" fxLayoutAlign="center"> + <div class="structureInfoContent" fxLayout="column"> + {{ structure.structureName }} + <span>{{ structure.structureType }}</span> + </div> + <div class="validateSvg"> + <svg class="validate" aria-hidden="true"> + <use [attr.xlink:href]="'assets/form/sprite.svg#checkVector'"></use> + </svg> </div> </div> + <div class="btnSection" fxLayout="row" fxLayoutAlign="space-around center"> + <button + *ngIf="verificationSuccess" + class="btn" + routerLink="/home" + [queryParams]="{ id: structure._id }" + [state]="{ data: structure }" + > + Voir ma structure + </button> + </div> + </div> + <div *ngIf="!structure"> + <div> + <h1 class="title-form">Une dernière validation de Rés'in et votre structure vous sera attribuée !</h1> + <div style="font-style: italic">Cela prendra 3 jours maximum si nous ne sommes pas le weekend ;)</div> + <svg class="formClock" aria-hidden="true"> + <use [attr.xlink:href]="'assets/form/sprite.svg#formClock'"></use> + </svg> + </div> </div> </div> <p *ngIf="verificationIssue"> Une erreur est survenue lors de la validation de votre email... Veuillez envoyer un mail au support. </p> - <!-- TypeForm --> - <div *ngIf="!verificationIssue"> - <iframe - *ngIf="structure" - class="typeform-widget custom-form" - title="typeform" - src="https://form.typeform.com/to/m7DV3CdW?typeform-medium=embed-snippet" - ></iframe> - <div - *ngIf="!structure" - class="typeform-widget custom-form" - data-url="https://form.typeform.com/to/ASJH3B7Z?typeform-medium=embed-snippet" - ></div> - </div> - <div class="btnSection" fxLayout="row" fxLayoutAlign="space-around center"> - <button - *ngIf="structure && verificationSuccess" - class="btn" - routerLink="/home" - [queryParams]="{ id: structure._id }" - [state]="{ data: structure }" - > - Voir ma structure - </button> + <!-- formulaire --> + <div class="formDiv" *ngIf="!verificationIssue"> + <div *ngIf="!structure"> + En attendant, vous pouvez participer à l'amélioration de Rés'in en répondant à ces quelques questions + </div> + <div *ngIf="structure"> + Donnez nous votre avis: vous pouvez participer à l'amélioration de Rés'in en répondant à ces quelques questions + </div> + <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="24px" [style.margin-top]="'50px'"> + <button class="button" routerLink="/home">Je passe mon tour</button> + <a + *ngIf="structure" + target="_blank" + class="btn custom-link" + rel="noopener noreferrer" + [href]="'https://form.typeform.com/to/m7DV3CdW?typeform-medium=embed-snippet'" + > + Nous aider + </a> + <a + *ngIf="!structure" + target="_blank" + class="btn custom-link" + rel="noopener noreferrer" + [href]="'https://form.typeform.com/to/ASJH3B7Z?typeform-medium=embed-snippet'" + > + Nous aider + </a> + </div> </div> </div> diff --git a/src/app/user-verification/user-verification.component.scss b/src/app/user-verification/user-verification.component.scss index 8fb73ba43..701ffdf09 100644 --- a/src/app/user-verification/user-verification.component.scss +++ b/src/app/user-verification/user-verification.component.scss @@ -16,8 +16,9 @@ border: 0; color: $white; height: 40px; - width: 192px; - @include btn-bold; + width: 244px; + text-decoration: none; + font-size: 16px !important; } .btnSection { @media #{$large-phone} { @@ -46,9 +47,58 @@ // Override button style to be the same as typeform button button { margin: 0px; + border: none; + background: none; max-width: 100%; - font-size: 24px !important; + cursor: pointer; + text-decoration: underline; + font-size: 16px !important; line-height: 32px !important; - min-height: 48px; - width: 245px !important; + min-height: 40px; + width: 244 !important; +} + +.formDiv { + max-width: 530px; + padding-bottom: 30px; + margin: 0 auto; +} + +.title-form { + font-size: 26px; +} + +.structureInfoBlock { + background: $green-1; + color: $white; + padding: 16px; + border-radius: 6px; + @include cn-bold-18; + .structureInfoContent { + width: 100%; + } + span { + font-style: italic; + @include cn-regular-14; + } + .validateSvg { + stroke: $white; + text-align: right; + svg { + height: 14px; + width: 14px; + } + } +} + +.formClock { + width: 100%; + height: 146px; + margin: 24px; +} + +.custom-link { + display: flex; + align-items: center; + justify-content: center; } diff --git a/src/assets/form/sprite.svg b/src/assets/form/sprite.svg index 1008b4e01..b351b70d1 100644 --- a/src/assets/form/sprite.svg +++ b/src/assets/form/sprite.svg @@ -343,4 +343,10 @@ <path d="M8 13.8182L11.8889 17L18 10" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/> </symbol> +<symbol id="formClock" viewBox="0 0 146 146" fill="none" xmlns="http://www.w3.org/2000/svg"> +<circle cx="73.2273" cy="73.8401" r="67.2273" fill="#EAF8FB" stroke="#348899" stroke-width="12"/> +<path d="M75.2275 24.3398C75.2275 23.2353 74.3321 22.3398 73.2275 22.3398C72.123 22.3398 71.2275 23.2353 71.2275 24.3398H75.2275ZM73.2275 73.8398H71.2275C71.2275 74.4855 71.5392 75.0914 72.0645 75.4669L73.2275 73.8398ZM94.4205 91.4476C95.3191 92.0899 96.5683 91.8822 97.2106 90.9836C97.853 90.085 97.6452 88.8358 96.7466 88.1935L94.4205 91.4476ZM71.2275 24.3398V73.8398H75.2275V24.3398H71.2275ZM72.0645 75.4669L94.4205 91.4476L96.7466 88.1935L74.3906 72.2128L72.0645 75.4669Z" fill="#DC2A59"/> +</symbol> + + </svg> -- GitLab From 33d0af77e4a48338bc92779ccf8a92d09ca66a19 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 15 Mar 2021 16:25:49 +0100 Subject: [PATCH 65/65] chore(release): 1.6.0 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a26c75de..f18a921dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,30 @@ 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.6.0](https://forge.grandlyon.com///compare/v1.5.0...v1.6.0) (2021-03-15) + + +### Features + +* add jpg logo for mail ([431a07f](https://forge.grandlyon.com///commit/431a07fd8324099f0ecf22af102f7b52c1a0f1ff)) +* **post:** fix design html ([78d7e6c](https://forge.grandlyon.com///commit/78d7e6c50e4ceac4e2a902bb5747ee78db1db151)) + + +### Bug Fixes + +* bug on admin validation ([05a578b](https://forge.grandlyon.com///commit/05a578b79e3194e78b8ec6536a038c1775a3615d)) +* filter chevron margin + add structure link width ([012a5f0](https://forge.grandlyon.com///commit/012a5f0f17dbc28d5d57d8f80c4fd8746ad353ca)) +* header name display + address-autocomplete bug ([3827b09](https://forge.grandlyon.com///commit/3827b09673684feee871b939b4d104c24282052e)) +* remove commented code ([5b6c51e](https://forge.grandlyon.com///commit/5b6c51e73c7a9c24f28f5a5a36c829411bca3d5e)) +* remove consolelog ([bf474b7](https://forge.grandlyon.com///commit/bf474b7e0afe053b521420cbef63877a187725b3)) +* remove profil picture from profil page ([24a2f9f](https://forge.grandlyon.com///commit/24a2f9f7a1e7a4e48bfd3a7291d60ee62b6bd1b0)) +* search title ([e739dec](https://forge.grandlyon.com///commit/e739decf8fa52b3d47304ef2503031afaef1db9f)) +* temp hide of news features ([0ce9fb5](https://forge.grandlyon.com///commit/0ce9fb5c95a29ea800ccc96b88aaeefbf6504a3b)) +* update logo ([26e9943](https://forge.grandlyon.com///commit/26e9943f9c38e80e05be9cdb5a684259c5143662)) +* use profileImage attribute for profile picture ([7ac3511](https://forge.grandlyon.com///commit/7ac35111081af41bc95d072956dbe165b6397b07)) +* **task:** fix only first letter Upper on structure name ([5a29be5](https://forge.grandlyon.com///commit/5a29be5d857b9899af3532bed57cc4ac240ea153)) +* **task:** fix public name ([284c002](https://forge.grandlyon.com///commit/284c0024c7682acb4d40eb8fa34a5f09b033d29f)) + ## [1.5.0](https://forge.grandlyon.com///compare/v1.4.0...v1.5.0) (2021-02-25) diff --git a/package-lock.json b/package-lock.json index cb903debf..57417f0b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "1.5.0", + "version": "1.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4f2d1c0ae..17f0aff73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "1.5.0", + "version": "1.6.0", "scripts": { "ng": "ng", "start": "ng serve --configuration=fr --proxy-config proxy.conf.json", -- GitLab