From d6cc737407427dffaf9811dc24b9ae6381232bb5 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Wed, 7 Jun 2023 14:01:15 +0000 Subject: [PATCH 01/11] fix(loader): double loader --- src/app/app.component.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 4c6df103e..945174e47 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -4,10 +4,11 @@ <div *ngIf="loading" class="loader" aria-busy="true"> <img class="loader-gif" src="/assets/gif/loader_circle_grey.gif" alt /> </div> - <ng-container></ng-container> - <router-outlet name="left-pane"></router-outlet> - <router-outlet></router-outlet> - <router-outlet name="print"></router-outlet> - <router-outlet *ngIf="!loading" name="footer"></router-outlet> + <ng-container *ngIf="!loading"> + <router-outlet name="left-pane"></router-outlet> + <router-outlet></router-outlet> + <router-outlet name="print"></router-outlet> + <router-outlet *ngIf="!loading" name="footer"></router-outlet> + </ng-container> </div> </div> -- GitLab From 8549aa72c48ffa28508c1c7e29798dd7bde83bc4 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Wed, 7 Jun 2023 14:11:44 +0000 Subject: [PATCH 02/11] fix(edit-structure): missing information on structure contact --- .../structure-contact.component.html | 2 +- src/app/utils/formUtils.ts | 20 ++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/app/form/form-view/structure-form/structure-contact/structure-contact.component.html b/src/app/form/form-view/structure-form/structure-contact/structure-contact.component.html index a76082ac7..2cd50fd09 100644 --- a/src/app/form/form-view/structure-form/structure-contact/structure-contact.component.html +++ b/src/app/form/form-view/structure-form/structure-contact/structure-contact.component.html @@ -44,7 +44,7 @@ (input)="utils.modifyPhoneInput(structureForm, 'contactPhone', $event.target); setValidationsForm()" /> <app-svg-icon - *ngIf="structureForm.get('contactPhone').valid && structureForm.get('contactPhone').value" + *ngIf="structureForm.get('contactPhone').valid" [iconClass]="'icon-26'" [type]="'form'" [icon]="'validate'" diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts index 700bfca13..a9decacb9 100644 --- a/src/app/utils/formUtils.ts +++ b/src/app/utils/formUtils.ts @@ -80,18 +80,14 @@ export class formUtils { street: new UntypedFormControl(structure.address.street, Validators.required), commune: new UntypedFormControl(structure.address.commune, Validators.required), }), - contactMail: new UntypedFormControl( - structure.contactMail === '' ? null : structure.contactMail, - !isEditMode - ? [Validators.required, Validators.pattern(CustomRegExp.EMAIL)] - : [Validators.pattern(CustomRegExp.EMAIL)] - ), - contactPhone: new UntypedFormControl( - structure.contactPhone, - !isEditMode - ? [Validators.required, Validators.pattern(CustomRegExp.PHONE)] - : [Validators.pattern(CustomRegExp.PHONE)] - ), + contactMail: new UntypedFormControl(structure.contactMail === '' ? null : structure.contactMail, [ + Validators.required, + Validators.pattern(CustomRegExp.EMAIL), + ]), + contactPhone: new UntypedFormControl(structure.contactPhone, [ + Validators.required, + Validators.pattern(CustomRegExp.PHONE), + ]), contactPersonFirstname: new UntypedFormControl( structure.contactPersonLastName, !isEditMode && Validators.required -- GitLab From 16161efa1caf72a9be050e687060673d413bec55 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Wed, 7 Jun 2023 14:31:20 +0000 Subject: [PATCH 03/11] fix(edit structure): add condition to display missing information on freeWorkshops --- .../structure-edition-summary.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/profile/structure-edition-summary/structure-edition-summary.component.html b/src/app/profile/structure-edition-summary/structure-edition-summary.component.html index 022bd153d..a40d19511 100644 --- a/src/app/profile/structure-edition-summary/structure-edition-summary.component.html +++ b/src/app/profile/structure-edition-summary/structure-edition-summary.component.html @@ -497,7 +497,7 @@ </div> </div> - <div class="section learningPrice"> + <div *ngIf="containsDigitalLearning()" class="section learningPrice"> <div class="sectionHeader"> <p>Gratuité des ateliers</p> <app-button -- GitLab From eef76575e04a8ba5b30add117df98dda94b349b7 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Wed, 7 Jun 2023 15:35:49 +0000 Subject: [PATCH 04/11] feat(mobile): footer links in burger menu --- src/app/header/header.component.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html index 184e0fba4..3e09a53f0 100644 --- a/src/app/header/header.component.html +++ b/src/app/header/header.component.html @@ -78,6 +78,9 @@ >Qui sommes-nous ?</a > <a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'" (click)="closeMenu()">Administration</a> + <a routerLink="/legal-notice" i18n [routerLinkActive]="'active'" (click)="closeMenu()">Mentions légales</a> + <a routerLink="/newsletter" i18n [routerLinkActive]="'active'" (click)="closeMenu()">Newsletter</a> + <a routerLink="/contact" i18n [routerLinkActive]="'active'" (click)="closeMenu()">Contact</a> </div> </div> </div> -- GitLab From 49bac59ebcfee5d45852e27c785c83c03c901300 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Mon, 12 Jun 2023 08:57:06 +0000 Subject: [PATCH 05/11] feat(mediation): update recap meeting --- .../orientation-recap.component.html | 50 +++++------ .../orientation-recap.component.scss | 86 +++++++------------ .../orientation-recap.component.ts | 16 ++-- .../print-header/print-header.component.scss | 12 ++- .../orientation-form-view.component.ts | 2 +- src/app/utils/orientationUtils.ts | 2 +- src/assets/ico/sprite.svg | 38 -------- 7 files changed, 74 insertions(+), 132 deletions(-) diff --git a/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.html b/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.html index 9545982e8..3c4c192a4 100644 --- a/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.html +++ b/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.html @@ -1,12 +1,12 @@ <app-print-header></app-print-header> -<div class="container" [ngClass]="{ onlineMediation: date }"> +<div class="container" [ngClass]="{ onlineMediation: recap }"> <div class="main"> - <div class="orientator header" *ngIf="isOrientator()"> + <div *ngIf="isOrientator()" class="orientator header"> <h3>Orienté par</h3> <div class="content"> <div class="infos structureName">{{ orientator.structureName }}</div> - <div class="infos" *ngIf="orientator.structureMail">{{ orientator.structureMail }}</div> - <div class="infos" *ngIf="orientator.structurePhone">{{ orientator.structurePhone }}</div> + <div *ngIf="orientator.structureMail" class="infos">{{ orientator.structureMail }}</div> + <div *ngIf="orientator.structurePhone" class="infos">{{ orientator.structurePhone }}</div> </div> </div> <div class="beneficiary header"> @@ -22,10 +22,10 @@ <div *ngFor="let need of needs">{{ need.displayText }}</div> </div> </div> - <div fxLayout="row" *ngIf="language"> + <div *ngIf="recap.language" fxLayout="row"> <div class="label">Langue souhaitée</div> <div class="info"> - <div>{{ language }}</div> + <div>{{ recap.language }}</div> </div> </div> <div *ngIf="comment" fxLayout="row"> @@ -38,36 +38,28 @@ </div> </div> <!-- Date display --> - <div class="date" *ngIf="date"> - <div>Informations du rendez-vous :</div> - <div>{{ date.day }} prochain</div> - <div>entre {{ date.hours }}</div> + <div *ngIf="recap" class="date"> + <div class="bold">Informations du rendez-vous :</div> + <hr /> + <div class="bold reminder">Le rappel se fera</div> + <span class="red bold">{{ recap.day }}</span + > <span class="red bold month">{{ recap.month }}</span + > <span>entre {{ recap.hours }}</span> </div> - <div class="structure" *ngFor="let structure of structuresToPrint"> + <div *ngFor="let structure of structuresToPrint" class="structure"> <!-- Structure list --> <div class="title">Informations du rendez-vous :</div> <app-structure-detail-print [structure]="structure"></app-structure-detail-print> </div> <!-- footer --> - <div class="service-info" *ngIf="date"> - <div class="img"> - <img src="../../../../../assets/ico/mediation1.svg" alt="Image Mediation" /> - </div> - <div class="content"> - <div class="txt1">Besoin d’aide avec vos outils numériques ?</div> - <div class="txt2"> - Votre numéro <span>gratuit</span> <br /> - d’assistance numérique : - </div> - <div class="txt3">04 83 43 90 40</div> - <div class="txt4"> - Appel gratuit de 15h à 17h du lundi au vendredi,<br />le jeudi jusqu’à 19h et le samedi matin de 10h à 12h. - </div> - </div> - <div class="logo"> - <div class="text">Service gratuit</div> - <img src="../../../../../assets/logos/metropoleGrandLyon-red.svg" alt="logo métropole" /> + <div *ngIf="recap" class="service-info"> + <hr /> + <div>Besoin d'autres aides avec vos outils numériques ?</div> + <div class="digitalAssistance">Votre numéro <span class="red">gratuit</span> d’assistance numérique</div> + <div class="number">04 83 43 90 40</div> + <div> + Appel gratuit de 15h à 17h du lundi au vendredi,<br />le jeudi jusqu’à 19h et le samedi matin de 10h à 12h. </div> </div> </div> diff --git a/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.scss b/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.scss index 1252081e3..c70bdcd1b 100644 --- a/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.scss +++ b/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.scss @@ -86,65 +86,43 @@ } } .date { - max-width: 680px; width: 100%; box-sizing: border-box; - margin: 1rem auto 2rem auto; - @include lato-bold-18; + :first-child { + margin-bottom: 1rem; + } + .reminder { + margin-bottom: 0.5rem; + } + .bold { + font-weight: 700; + } + .month { + text-transform: capitalize; + } } + .service-info { - break-inside: avoid-page; - max-width: 680px; - width: 100%; - box-sizing: border-box; - border-radius: 24px; - border: 1.5px solid $black; + color: $grey-3; + font-weight: 400; + display: flex; - justify-content: space-evenly; - align-items: center; - padding: 1.5rem 1rem; - margin: auto; - gap: 1.5rem; - @media #{$tablet} { - flex-direction: column; - width: auto; - } - .content { - .txt1 { - @include lato-regular-14; - color: $grey-2; - margin-bottom: 1rem; - } - .txt2 { - color: $black; - @include lato-bold-18; - span { - color: $red; - } - } - .txt3 { - @include lato-bold-24; - color: $red; - } - .txt4 { - @include lato-regular-15; - margin-top: 1rem; - color: $grey-2; - } + flex-direction: column; + gap: 0.5rem; + + .digitalAssistance { + @include lato-bold-18; } - .logo { - width: 120px; - height: 65px; - border: 1px solid; - border-radius: 3px; - padding: 0.25rem; - .text { - @include lato-regular-10; - text-align: center; - } - img { - width: 120px; - margin-top: 0.2rem; - } + .number { + @include lato-bold-24; + color: $red; } } + +hr { + border: 1px solid $grey-6; + width: 100%; +} +.red { + color: $red; +} diff --git a/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.ts b/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.ts index 96de55cde..949c26c85 100644 --- a/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.ts +++ b/src/app/form/orientation-form-view/global-components/orientation-recap/orientation-recap.component.ts @@ -1,3 +1,4 @@ +import { DatePipe } from '@angular/common'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { Structure } from '../../../../models/structure.model'; @@ -19,8 +20,9 @@ export class OrientationRecapComponent implements OnInit { public orientator: { structureName: string; structureMail: string; structurePhone: string }; public comment: string; public beneficiary: any; - public date: any; - public language: string; + public recap: { day: string; hours: string; month: string; language: string }; + + constructor(private datePipe: DatePipe) {} ngOnInit(): void { this.checkValidation.emit(); @@ -52,10 +54,14 @@ export class OrientationRecapComponent implements OnInit { } public handleOnlineOrientationRecap(): void { - this.date = { - day: this.form.get('dateSlot').value.day.slice(0, -6), + const monthNumber = parseInt(this.form.get('dateSlot').value.day.slice(-2)); + const monthName = this.datePipe.transform(`2000-${monthNumber}-01`, 'MMMM', 'fr'); + + this.recap = { + day: this.form.get('dateSlot').value.day.slice(0, -3), hours: this.form.get('dateSlot').value.hours.replace('-', ' et '), + month: monthName, + language: this.form.get('preferredLanguage').value, }; - this.language = this.form.get('preferredLanguage').value; } } diff --git a/src/app/form/orientation-form-view/global-components/print-header/print-header.component.scss b/src/app/form/orientation-form-view/global-components/print-header/print-header.component.scss index 81f1b77d9..3c058a357 100644 --- a/src/app/form/orientation-form-view/global-components/print-header/print-header.component.scss +++ b/src/app/form/orientation-form-view/global-components/print-header/print-header.component.scss @@ -3,10 +3,12 @@ .header-infos { display: flex; - align-items: flex-start; + align-items: center; + margin-bottom: 2rem; h3 { @include lato-bold-16; margin-top: 0.25rem; + margin-bottom: 0; } img { margin-right: 3rem; @@ -18,10 +20,12 @@ text-align: right; text-transform: capitalize; font-style: italic; - margin-bottom: 0.5rem; + font-weight: 400; color: $grey-3; + margin: 0; } hr { - height: 1px; - background: $grey-3; + border: 1px solid $grey-6; + width: 100%; + margin-top: 0.5rem; } diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.ts b/src/app/form/orientation-form-view/orientation-form-view.component.ts index c377ca210..223d9a059 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.ts +++ b/src/app/form/orientation-form-view/orientation-form-view.component.ts @@ -13,10 +13,10 @@ import { Module } from '../../structure-list/models/module.model'; import { SearchService } from '../../structure-list/services/search.service'; import { OrientationUtils } from '../../utils/orientationUtils'; import { Utils } from '../../utils/utils'; +import { MeetingRDVSSteps } from './enums/MeetingRDVSSteps.enum'; import { FiltersSteps } from './enums/filtersSteps.enum'; import { GenericOrientationSteps } from './enums/genericOrientationSteps.enum'; import { HotlineMediationSteps } from './enums/hotlineMediationSteps.enum'; -import { MeetingRDVSSteps } from './enums/MeetingRDVSSteps.enum'; import { NeedsType } from './enums/needs.enum'; import { OnlineDemarche } from './enums/onlineDemarche.enum'; import { OnlineDemarchesCommonSteps } from './enums/onlineDemarchesCommonSteps.enum'; diff --git a/src/app/utils/orientationUtils.ts b/src/app/utils/orientationUtils.ts index 881ee4c6f..25dad14d5 100644 --- a/src/app/utils/orientationUtils.ts +++ b/src/app/utils/orientationUtils.ts @@ -7,9 +7,9 @@ import { Validators, } from '@angular/forms'; import { structureFormStep } from '../form/form-view/structure-form/structureFormStep.enum'; +import { MeetingRDVSSteps } from '../form/orientation-form-view/enums/MeetingRDVSSteps.enum'; import { FiltersSteps } from '../form/orientation-form-view/enums/filtersSteps.enum'; import { HotlineMediationSteps } from '../form/orientation-form-view/enums/hotlineMediationSteps.enum'; -import { MeetingRDVSSteps } from '../form/orientation-form-view/enums/MeetingRDVSSteps.enum'; import { NeedsType } from '../form/orientation-form-view/enums/needs.enum'; import { OnlineDemarchesCommonSteps } from '../form/orientation-form-view/enums/onlineDemarchesCommonSteps.enum'; import { PreferredLanguages } from '../form/orientation-form-view/enums/preferredLanguages.enum'; diff --git a/src/assets/ico/sprite.svg b/src/assets/ico/sprite.svg index dc969cf09..c3dbc3c0e 100644 --- a/src/assets/ico/sprite.svg +++ b/src/assets/ico/sprite.svg @@ -2719,42 +2719,4 @@ <path d="M6 16L12.5 9L19 16" stroke="black" stroke-linecap="round" stroke-linejoin="round" /> </symbol> - <symbol id="mediation1" width="120" height="121" viewBox="0 0 120 121" fill="none" xmlns="http://www.w3.org/2000/svg"> - <path - d="M6.11031 48.6199L43.7206 26.9067C45.1912 26.0611 47.5662 26.0611 49.0221 26.9067L113.89 64.6052C115.044 65.2375 114.978 66.1273 114.978 66.1273L115 73.9508C115 74.5096 114.632 75.0684 113.89 75.4949L76.2795 97.2081C74.8089 98.0537 72.4412 98.0537 70.9779 97.2081L6.11031 59.5096C5.38972 59.0905 5.02208 58.539 5.02208 57.9875L5 50.164C5.11765 49.0169 6.11031 48.6199 6.11031 48.6199Z" - fill="#EDEDED" /> - <path - d="M6.30068 48.8262L70.9183 86.3777L70.9404 94.1718L6.32276 56.6203C5.60217 56.2012 5.2419 55.6497 5.23454 55.1056L5.21246 47.3115C5.21246 47.863 5.58009 48.4071 6.30068 48.8262Z" - fill="#DA3635" stroke="#DA3635" stroke-miterlimit="10" /> - <path - d="M113.654 64.7516C114.39 64.3252 114.757 63.7663 114.757 63.2148L114.779 71.009C114.779 71.5678 114.412 72.1193 113.676 72.5457L76.213 94.1781L76.1911 86.384L113.654 64.7516Z" - fill="#DA3635" stroke="#DA3635" stroke-miterlimit="10" /> - <path - d="M70.9115 86.377L70.9335 94.1711C72.3894 95.0166 74.7497 95.0166 76.2129 94.1711L76.1909 86.377C74.7277 87.2225 72.3673 87.2225 70.9115 86.377Z" - fill="white" stroke="#DA3635" stroke-miterlimit="10" /> - <path - d="M6.31607 45.7666C4.85283 46.6122 4.84547 47.9798 6.30135 48.8254L70.919 86.3769C72.3749 87.2225 74.7352 87.2225 76.1984 86.3769L113.662 64.7445C115.125 63.8989 115.132 62.5313 113.676 61.6857L49.0587 24.1342C47.6102 23.2886 45.2425 23.2886 43.7793 24.1342L6.31607 45.7666Z" - fill="white" stroke="#696969" stroke-miterlimit="10" /> - <mask id="path-6-inside-1_9886_206609" fill="white"> - <path - d="M76.2781 57.4244C75.4145 58.4066 74.2261 59.0449 72.9303 59.2227C46.3578 63.0383 36.949 54.0058 36.5621 53.619C36.0129 53.0722 36.1124 52.2599 36.7093 51.5024C37.0672 51.0663 37.504 50.7015 37.9967 50.4268C38.0451 50.3995 38.0937 50.3748 38.1404 50.35L41.157 48.0001C43.0017 46.5624 45.7463 46.0349 47.2709 46.83L50.816 48.6676C51.1532 48.8141 51.4321 49.0686 51.6088 49.3911C51.7855 49.7135 51.8501 50.0855 51.7922 50.4486C51.7012 50.9556 51.4787 51.4298 51.1471 51.824C50.8796 52.156 50.5733 52.4547 50.2347 52.7139L49.0482 53.639C49.188 53.6859 49.3282 53.7316 49.4737 53.7771C54.0534 55.1266 58.8157 55.7526 63.5886 55.6325L63.9001 54.762C64.0273 54.4189 64.2099 54.099 64.4407 53.815C64.8469 53.3196 65.3328 52.8953 65.8784 52.5595C66.8707 51.9279 67.9967 51.5366 69.1668 51.4167L74.5654 50.9137C76.8885 50.6971 78.3059 51.8462 77.727 53.4744L76.7813 56.1233C76.786 56.264 76.7711 56.4046 76.7371 56.5412C76.6486 56.8644 76.4927 57.1651 76.2796 57.4238" /> - </mask> - <path - d="M72.9303 59.2227L72.7944 58.2319L72.7882 58.2328L72.9303 59.2227ZM36.5621 53.619L37.2691 52.9118L37.2677 52.9104L36.5621 53.619ZM36.7093 51.5024L35.9363 50.8679L35.93 50.8757L35.9238 50.8835L36.7093 51.5024ZM37.9967 50.4268L38.4836 51.3003L38.4879 51.2979L37.9967 50.4268ZM38.1404 50.35L38.6097 51.2331L38.6864 51.1923L38.7549 51.1389L38.1404 50.35ZM41.157 48.0001L41.7715 48.789L41.7717 48.7889L41.157 48.0001ZM47.2709 46.83L46.8085 47.7166L46.8107 47.7178L47.2709 46.83ZM50.816 48.6676L50.3558 49.5554L50.3861 49.5711L50.4174 49.5847L50.816 48.6676ZM51.7922 50.4486L52.7765 50.6254L52.7782 50.6157L52.7798 50.6059L51.7922 50.4486ZM51.1471 51.824L50.3819 51.1802L50.375 51.1883L50.3684 51.1966L51.1471 51.824ZM50.2347 52.7139L49.6269 51.9198L49.6198 51.9253L50.2347 52.7139ZM49.0482 53.639L48.4333 52.8504L46.9648 53.9954L48.7304 54.5872L49.0482 53.639ZM49.4737 53.7771L49.1755 54.7316L49.1832 54.734L49.1911 54.7363L49.4737 53.7771ZM63.5886 55.6325L63.6138 56.6321L64.2991 56.6149L64.5301 55.9694L63.5886 55.6325ZM63.9001 54.762L62.9624 54.4144L62.9586 54.4251L63.9001 54.762ZM64.4407 53.815L63.6674 53.1809L63.6646 53.1844L64.4407 53.815ZM65.8784 52.5595L66.4026 53.4111L66.409 53.4072L66.4153 53.4031L65.8784 52.5595ZM69.1668 51.4167L69.074 50.421L69.0648 50.4219L69.1668 51.4167ZM74.5654 50.9137L74.6581 51.9094L74.6582 51.9094L74.5654 50.9137ZM77.727 53.4744L78.6688 53.8106L78.6692 53.8094L77.727 53.4744ZM76.7813 56.1233L75.8395 55.7871L75.7755 55.9664L75.7819 56.1566L76.7813 56.1233ZM76.7371 56.5412L77.7016 56.8054L77.7047 56.7941L77.7075 56.7827L76.7371 56.5412ZM75.5271 56.7641C74.8222 57.5658 73.8521 58.0869 72.7944 58.2319L73.0662 60.2134C74.6 60.003 76.0068 59.2474 77.0291 58.0847L75.5271 56.7641ZM72.7882 58.2328C46.5097 62.0062 37.4209 53.0635 37.2691 52.9118L35.8551 54.3262C36.4771 54.948 46.2059 64.0704 73.0725 60.2125L72.7882 58.2328ZM37.2677 52.9104C37.213 52.856 37.195 52.811 37.2024 52.7236C37.2123 52.6059 37.2796 52.3944 37.4947 52.1213L35.9238 50.8835C35.5421 51.3679 35.2612 51.9413 35.2095 52.5558C35.1551 53.2006 35.362 53.8352 35.8565 54.3276L37.2677 52.9104ZM37.4822 52.1369C37.7606 51.7977 38.1003 51.5139 38.4836 51.3003L37.5099 49.5533C36.9076 49.889 36.3738 50.335 35.9363 50.8679L37.4822 52.1369ZM38.4879 51.2979C38.5222 51.2785 38.541 51.2696 38.6097 51.2331L37.6711 49.467C37.6464 49.4801 37.568 49.5205 37.5056 49.5557L38.4879 51.2979ZM38.7549 51.1389L41.7715 48.789L40.5425 47.2113L37.5258 49.5611L38.7549 51.1389ZM41.7717 48.7889C42.5596 48.1748 43.5579 47.7447 44.5222 47.5599C45.5084 47.3709 46.321 47.4624 46.8085 47.7166L47.7333 45.9433C46.6962 45.4025 45.3741 45.3602 44.1458 45.5956C42.8954 45.8353 41.5991 46.3877 40.5423 47.2114L41.7717 48.7889ZM46.8107 47.7178L50.3558 49.5554L51.2762 47.7797L47.7311 45.9421L46.8107 47.7178ZM50.4174 49.5847C50.5511 49.6428 50.6618 49.7438 50.7319 49.8717L52.4857 48.9104C52.2024 48.3935 51.7552 47.9854 51.2146 47.7504L50.4174 49.5847ZM50.7319 49.8717C50.802 49.9996 50.8276 50.1472 50.8047 50.2913L52.7798 50.6059C52.8725 50.0238 52.7691 49.4273 52.4857 48.9104L50.7319 49.8717ZM50.808 50.2718C50.7478 50.6066 50.6009 50.9198 50.3819 51.1802L51.9122 52.4678C52.3565 51.9398 52.6545 51.3046 52.7765 50.6254L50.808 50.2718ZM50.3684 51.1966C50.151 51.4664 49.902 51.7092 49.6269 51.9198L50.8425 53.508C51.2445 53.2003 51.6082 52.8456 51.9258 52.4514L50.3684 51.1966ZM49.6198 51.9253L48.4333 52.8504L49.6631 54.4276L50.8496 53.5025L49.6198 51.9253ZM48.7304 54.5872C48.8753 54.6357 49.0221 54.6837 49.1755 54.7316L49.772 52.8226C49.6343 52.7796 49.5007 52.736 49.366 52.6909L48.7304 54.5872ZM49.1911 54.7363C53.8706 56.1153 58.7368 56.7549 63.6138 56.6321L63.5634 54.6328C58.8947 54.7503 54.2362 54.138 49.7564 52.8179L49.1911 54.7363ZM64.5301 55.9694L64.8417 55.099L62.9586 54.4251L62.6471 55.2955L64.5301 55.9694ZM64.8378 55.1096C64.927 54.8691 65.055 54.6448 65.2168 54.4456L63.6646 53.1844C63.3649 53.5533 63.1277 53.9688 62.9625 54.4144L64.8378 55.1096ZM65.2139 54.4492C65.5498 54.0396 65.9515 53.6888 66.4026 53.4111L65.3542 51.7079C64.7141 52.1019 64.1441 52.5997 63.6674 53.1809L65.2139 54.4492ZM66.4153 53.4031C67.2764 52.8551 68.2534 52.5156 69.2688 52.4115L69.0648 50.4219C67.7399 50.5577 66.465 51.0008 65.3415 51.7159L66.4153 53.4031ZM69.2596 52.4124L74.6581 51.9094L74.4726 49.918L69.074 50.421L69.2596 52.4124ZM74.6582 51.9094C75.6683 51.8152 76.3069 52.0378 76.6049 52.2792C76.7434 52.3914 76.8087 52.5045 76.8369 52.6116C76.8656 52.7208 76.8731 52.891 76.7848 53.1394L78.6692 53.8094C78.8703 53.2436 78.9177 52.6596 78.7709 52.1023C78.6236 51.5427 78.2978 51.0768 77.8639 50.7252C77.0172 50.0393 75.7856 49.7956 74.4725 49.918L74.6582 51.9094ZM76.7852 53.1382L75.8395 55.7871L77.7231 56.4595L78.6688 53.8106L76.7852 53.1382ZM75.7819 56.1566C75.7835 56.2047 75.7784 56.2529 75.7667 56.2997L77.7075 56.7827C77.7639 56.5563 77.7885 56.3232 77.7808 56.0901L75.7819 56.1566ZM75.7727 56.277C75.7214 56.4641 75.6311 56.6382 75.5078 56.788L77.0515 58.0596C77.3542 57.6921 77.5758 57.2646 77.7016 56.8054L75.7727 56.277Z" - fill="#DA3635" mask="url(#path-6-inside-1_9886_206609)" /> - <path - d="M83.8306 74.8474L86.9041 76.6341C87.0659 76.7297 87.2717 76.7297 87.4335 76.6341L98.3085 70.3547C98.6615 70.1489 98.6615 69.6415 98.3085 69.4356L95.235 67.6488C95.0732 67.5533 94.8673 67.5533 94.7056 67.6488L83.8306 73.9283C83.4777 74.1342 83.4777 74.6415 83.8306 74.8474Z" - fill="white" stroke="#696969" stroke-miterlimit="10" /> - <path - d="M44.5673 25.8112C44.1261 26.0612 44.1261 26.473 44.5599 26.723C44.9937 26.973 45.6997 26.973 46.1408 26.723C46.582 26.473 46.582 26.0612 46.1482 25.8112C45.7144 25.5538 45.0085 25.5538 44.5673 25.8112Z" - fill="#696969" /> - <path - d="M41.7207 27.3395C41.2795 27.5895 41.2795 28.0013 41.7133 28.2513C42.1471 28.5013 42.853 28.5013 43.2942 28.2513C43.7353 28.0013 43.7353 27.5895 43.3015 27.3395C42.8677 27.0821 42.1618 27.0821 41.7207 27.3395Z" - fill="#696969" /> - <line y1="-0.5" x2="49.1376" y2="-0.5" transform="matrix(-0.866026 0.5 0.866026 0.5 106.741 57.6836)" - stroke="#696969" /> - <line y1="-0.5" x2="49.1376" y2="-0.5" transform="matrix(-0.866025 0.5 0.866025 0.500001 52.2617 25.6357)" - stroke="#696969" /> - </symbol> - </svg> -- GitLab From ce8f69b8bc30ee690a51f1a4e86bc3b79e0060ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20PAILHAREY?= <rpailharey@grandlyon.com> Date: Thu, 15 Jun 2023 12:13:13 +0000 Subject: [PATCH 06/11] fix(cicd): update docker from 18.09 to 24.0.2 --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7fe54ba16..cf28de943 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ stages: default: services: - - name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09-dind + - name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:24.0.2-dind alias: docker variables: @@ -18,7 +18,7 @@ build_branch: DOCKER_DRIVER: overlay2 only: - merge_requests - image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:24.0.2 stage: build except: - master @@ -34,7 +34,7 @@ build: DOCKER_TLS_CERTDIR: '' DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 - image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:24.0.2 stage: build only: - master @@ -49,7 +49,7 @@ build-release: DOCKER_TLS_CERTDIR: '' DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 - image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:24.0.2 stage: build only: - tags @@ -63,7 +63,7 @@ build_dev: DOCKER_TLS_CERTDIR: '' DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 - image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:24.0.2 stage: build only: - dev -- GitLab From d75fbc04285e46beba4160a4273d65e46f263cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marl=C3=A8ne=20SIMONDANT?= <msimondant@grandlyon.com> Date: Thu, 15 Jun 2023 14:26:10 +0000 Subject: [PATCH 07/11] fix(admin): add empty option in employer, job and jobsgroup dropdown menu --- Dockerfile | 2 - .../manage-jobs/manage-jobs.component.ts | 19 +++++--- .../manage-users/manage-users.component.html | 16 ++++++- .../manage-users/manage-users.component.ts | 48 ++++++++++++++----- src/app/admin/services/admin.service.ts | 25 ++++++---- 5 files changed, 79 insertions(+), 31 deletions(-) diff --git a/Dockerfile b/Dockerfile index b132014c3..a0382ac55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,8 +28,6 @@ RUN npm run build:prod FROM ${DEPENDENCY_PROXY}nginx # copy artifact build from the 'build environment' -RUN apt-get update - COPY --from=build /app/dist/fr /usr/share/nginx/html # Add outdated browser page diff --git a/src/app/admin/components/manage-jobs/manage-jobs.component.ts b/src/app/admin/components/manage-jobs/manage-jobs.component.ts index fd7c288a0..53e3cd480 100644 --- a/src/app/admin/components/manage-jobs/manage-jobs.component.ts +++ b/src/app/admin/components/manage-jobs/manage-jobs.component.ts @@ -23,6 +23,7 @@ export class ManageJobsComponent implements OnInit { public validatedJobs: Job[] = []; public unvalidatedJobs: Job[] = []; public jobsGroups: JobGroup[] = []; + public jobsGroupsList: JobGroup[] = []; public deleteModalOpened = false; public validatedJobsName: string[] = []; public mergeJobModalOpened = false; @@ -264,7 +265,7 @@ export class ManageJobsComponent implements OnInit { if (arg.oldValue === arg.newValue) { return; } else { - this.adminService.editJob(arg.data._id, arg.data.name, arg.data.hasPersonalOffer).subscribe(() => { + this.adminService.updateJob(arg.data._id, arg.data).subscribe(() => { this.notificationService.showSuccess("L'opération a réussie.", ''); this.findValidatedJobs(); this.findUnvalidatedJobs(); @@ -348,7 +349,8 @@ export class ManageJobsComponent implements OnInit { this.jobsGroupsName = []; this.adminService.getJobsGroupsWithJobs().subscribe((jobsGrps) => { this.jobsGroups = jobsGrps; - jobsGrps.forEach((jobsGroup) => { + this.jobsGroupsList = [{ name: '' }, ...jobsGrps]; + this.jobsGroupsList.forEach((jobsGroup) => { this.jobsGroupsName.push(jobsGroup.name); }); }); @@ -390,8 +392,7 @@ export class ManageJobsComponent implements OnInit { public onJobsGroupChange(arg): void { const selectedJob = this.validatedJobs.find((job) => job._id === arg.data._id); - const selectedJobsGroup = this.jobsGroups.find((jobsGroup) => jobsGroup.name === arg.newValue); - + const selectedJobsGroup = this.jobsGroupsList.find((jobsGroup) => jobsGroup.name === arg.newValue); // The column field is the jobsGroup.name text, we manually assign in selectedJob the full jobsGroup object to be consistent selectedJob.jobsGroup = { ...selectedJobsGroup }; @@ -399,9 +400,13 @@ export class ManageJobsComponent implements OnInit { this.getJobsGroupsWithJobs(); this.newJobsGroupForm.reset(); - this.notificationService.showSuccess( - `Le groupe de fonctions ${selectedJobsGroup.name} a bien été attribuée à la fonction ${arg.data.name}.` - ); + if (selectedJob.jobsGroup?.name === '') { + this.notificationService.showSuccess(`Le groupe de fonctions a bien été enlevé.`); + } else { + this.notificationService.showSuccess( + `Le groupe de fonctions ${selectedJobsGroup.name} a bien été attribuée à la fonction ${arg.data.name}.` + ); + } }); return; diff --git a/src/app/admin/components/manage-users/manage-users.component.html b/src/app/admin/components/manage-users/manage-users.component.html index b3068c147..b89005e95 100644 --- a/src/app/admin/components/manage-users/manage-users.component.html +++ b/src/app/admin/components/manage-users/manage-users.component.html @@ -69,7 +69,7 @@ (closed)="deleteUser(userToDelete, $event)" /> <app-modal-confirmation - *ngIf="changingJobs" + *ngIf="changingJobs && changingJobs[0] !== null" [opened]="editJobModalOpened" [content]=" 'Voulez-vous vraiment changer la fonction de cet utilisateur ? (' + @@ -81,7 +81,13 @@ (closed)="editJob(changingJobs[0], changingJobs[1], $event, contextRow)" /> <app-modal-confirmation - *ngIf="changingEmployers" + *ngIf="changingJobs && changingJobs[0] === null" + [opened]="editJobModalOpened" + [content]="'Voulez-vous vraiment supprimer la fonction de cet utilisateur ?'" + (closed)="editJob(changingJobs[0], changingJobs[1], $event, contextRow)" +/> +<app-modal-confirmation + *ngIf="changingEmployers && changingEmployers[0] !== null" [opened]="editEmployerModalOpened" [content]=" 'Voulez-vous vraiment changer l\'employeur de cet utilisateur ? (' + @@ -92,3 +98,9 @@ " (closed)="editEmployer(changingEmployers[0], changingEmployers[1], $event, contextRow)" /> +<app-modal-confirmation + *ngIf="changingEmployers && changingEmployers[0] === null" + [opened]="editEmployerModalOpened" + [content]="'Voulez-vous vraiment supprimer l\'employeur de cet utilisateur ?'" + (closed)="editEmployer(changingEmployers[0], changingEmployers[1], $event, contextRow)" +/> diff --git a/src/app/admin/components/manage-users/manage-users.component.ts b/src/app/admin/components/manage-users/manage-users.component.ts index 5c2cf6c9d..5390bee31 100644 --- a/src/app/admin/components/manage-users/manage-users.component.ts +++ b/src/app/admin/components/manage-users/manage-users.component.ts @@ -155,6 +155,10 @@ export class ManageUsersComponent { public onJobChange(arg): void { const selectedJob = this.validatedJobs.find((job) => job.name === arg.newValue); + if (selectedJob === undefined && arg.oldValue !== undefined) { + this.toggleEditJobModal(null, arg.oldValue, arg); + return; + } if (selectedJob && arg.oldValue === undefined) { // user had no job assigned, and admin selected a job -> call setUserJob without modal this.adminService.setUserJob(selectedJob._id, arg.data.id).subscribe(() => { @@ -175,6 +179,10 @@ export class ManageUsersComponent { public onEmployerChange(arg): void { const selectedEmployer = this.validatedEmployers.find((employ) => employ.name === arg.newValue); + if (selectedEmployer === undefined && arg.oldValue !== undefined) { + this.toggleEditEmployerModal(null, arg.oldValue, arg); + return; + } if (selectedEmployer && arg.oldValue === undefined) { // user had no employer assigned, and admin selected a employer -> call setUserEmployer this.adminService.setUserEmployer(selectedEmployer._id, arg.data.id).subscribe(() => { @@ -206,12 +214,20 @@ export class ManageUsersComponent { public editJob(newJob: Job, oldJob: Job, shouldEdit: boolean, context?): void { this.toggleEditJobModal(newJob, oldJob, context); if (shouldEdit) { - // store newJob otherwise cell will only keep name value - this.adminService.setUserJob(newJob._id, context.node.data._id).subscribe((data) => { - context.node.data[context.colDef.field] = data.job; - context.api.refreshCells({ rowNodes: [context.node], columns: [context.column.colId] }); - this.notificationService.showSuccess("L'opération a réussie.", ''); - }); + if (newJob) { + // store newJob otherwise cell will only keep name value + this.adminService.setUserJob(newJob._id, context.node.data._id).subscribe((data) => { + context.node.data[context.colDef.field] = data.job; + context.api.refreshCells({ rowNodes: [context.node], columns: [context.column.colId] }); + this.notificationService.showSuccess("L'opération a réussie.", ''); + }); + } else { + this.adminService.removeUserJob(context.node.data._id).subscribe((data) => { + context.node.data[context.colDef.field] = data.job; + context.api.refreshCells({ rowNodes: [context.node], columns: [context.column.colId] }); + this.notificationService.showSuccess("L'opération a réussie.", ''); + }); + } } else { if (context.oldValue && context.oldValue.name) { context.node.data[context.colDef.field] = context.oldValue; @@ -223,11 +239,19 @@ export class ManageUsersComponent { public editEmployer(newEmployer: Employer, oldEmployer: Employer, shouldEdit: boolean, context?): void { this.toggleEditEmployerModal(newEmployer, oldEmployer, context); if (shouldEdit) { - this.adminService.setUserEmployer(newEmployer._id, context.node.data._id).subscribe((data) => { - context.node.data[context.colDef.field] = data.employer; - context.api.refreshCells({ rowNodes: [context.node], columns: [context.column.colId] }); - this.notificationService.showSuccess("L'opération a réussie.", ''); - }); + if (newEmployer) { + this.adminService.setUserEmployer(newEmployer._id, context.node.data._id).subscribe((data) => { + context.node.data[context.colDef.field] = data.employer; + context.api.refreshCells({ rowNodes: [context.node], columns: [context.column.colId] }); + this.notificationService.showSuccess("L'opération a réussie.", ''); + }); + } else { + this.adminService.removeUserEmployer(context.node.data._id).subscribe((data) => { + context.node.data[context.colDef.field] = data.employer; + context.api.refreshCells({ rowNodes: [context.node], columns: [context.column.colId] }); + this.notificationService.showSuccess("L'opération a réussie.", ''); + }); + } } else { if (context.oldValue && context.oldValue.name) { context.node.data[context.colDef.field] = context.oldValue; @@ -256,6 +280,7 @@ export class ManageUsersComponent { public findValidatedJobs(): void { this.adminService.getJobs().subscribe((jobs) => { this.validatedJobs = jobs; + this.validatedJobsName.push(''); jobs.map((job) => { this.validatedJobsName.push(job.name); }); @@ -265,6 +290,7 @@ export class ManageUsersComponent { public findValidatedEmployers(): void { this.adminService.getEmployers().subscribe((employers) => { this.validatedEmployers = employers; + this.validatedEmployersName.push(''); employers.map((employer) => { this.validatedEmployersName.push(employer.name); }); diff --git a/src/app/admin/services/admin.service.ts b/src/app/admin/services/admin.service.ts index bcbb2b2d5..7041279ec 100644 --- a/src/app/admin/services/admin.service.ts +++ b/src/app/admin/services/admin.service.ts @@ -51,6 +51,12 @@ export class AdminService { }); } + public removeUserJob(userId: string): Observable<User> { + return this.http.put<User>(`${this.baseUrl}/removeUserJob`, { + userId, + }); + } + public setUserEmployer(employerId: string, userId: string): Observable<User> { return this.http.put<User>(`${this.baseUrl}/setUserEmployer`, { userId, @@ -58,6 +64,12 @@ export class AdminService { }); } + public removeUserEmployer(userId: string): Observable<User> { + return this.http.put<User>(`${this.baseUrl}/removeUserEmployer`, { + userId, + }); + } + // By default return only validated jobs public getJobs(): Observable<Job[]> { return this.http.get<Job[]>(`api/jobs`); @@ -96,7 +108,7 @@ export class AdminService { } public editJobsGroup(id: string, name: string): Observable<JobGroup> { - return this.http.put<Job>(`${this.jobsGroupBaseUrl}/${id}/`, { name }); + return this.http.put<JobGroup>(`${this.jobsGroupBaseUrl}/${id}/`, { name }); } public getUnvalidatedEmployers(): Observable<Employer[]> { @@ -128,7 +140,9 @@ export class AdminService { } public updateJob(id: string, job: Job): Observable<Job> { - return this.http.put<Job>(`${this.jobBaseUrl}/${id}`, job); + const newJob: Job = { ...job }; + if (job.jobsGroup?.name === '') delete newJob.jobsGroup; + return this.http.put<Job>(`${this.jobBaseUrl}/${id}`, newJob); } public createEmployer(name: string): Observable<Employer> { @@ -143,13 +157,6 @@ export class AdminService { return this.http.post<Employer>(`${this.employerBaseUrl}/validate/${id}`, {}); } - public editJob(id: string, name: string, hasPersonalOffer: boolean): Observable<Job> { - return this.http.put<Job>(`${this.jobBaseUrl}/${id}`, { - name, - hasPersonalOffer, - }); - } - public editEmployer(id: string, name: string): Observable<Employer> { return this.http.put<Employer>(`${this.employerBaseUrl}/${id}`, { name, -- GitLab From 1d7174fc57f2b8843eccd1a99da605b213313f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20PAILHAREY?= <rpailharey@grandlyon.com> Date: Mon, 19 Jun 2023 07:59:53 +0000 Subject: [PATCH 08/11] feat(admin): list all CNFS from Espace Coop --- .vscode/settings.json | 1 + Dockerfile | 2 +- src/app/admin/admin-routing.module.ts | 6 ++ src/app/admin/admin.module.ts | 2 + .../espace-coop-cnfs.component.html | 29 ++++++ .../espace-coop-cnfs.component.spec.ts | 22 +++++ .../espace-coop-cnfs.component.ts | 90 +++++++++++++++++++ .../manage-employers.component.ts | 4 +- .../manage-jobs/manage-jobs.component.ts | 8 +- .../manage-users/manage-users.component.ts | 3 +- .../components/nav-bar/nav-bar.component.html | 5 ++ src/app/admin/services/admin.service.ts | 9 ++ src/app/models/espaceCoopCNFS.model.ts | 8 ++ 13 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.html create mode 100644 src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.spec.ts create mode 100644 src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.ts create mode 100644 src/app/models/espaceCoopCNFS.model.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 38a5306b5..3a69a3f04 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -30,6 +30,7 @@ "cSpell.language": "fr,en", "cSpell.words": [ "carto", + "cnfs", "covid", "demarch", "facebook", diff --git a/Dockerfile b/Dockerfile index b132014c3..406b759c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Stage 0, based on Node.js, to build and compile Angular ARG DEPENDENCY_PROXY= -FROM ${DEPENDENCY_PROXY}node:14.20-slim as build +FROM ${DEPENDENCY_PROXY}node:14.20-slim AS build WORKDIR /app diff --git a/src/app/admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts index eb4d6760c..719de652e 100644 --- a/src/app/admin/admin-routing.module.ts +++ b/src/app/admin/admin-routing.module.ts @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { ClaimStructureComponent } from './components/claim-structure/claim-structure.component'; import { DeletedStructuresComponent } from './components/deleted-structures/deleted-structures.component'; +import { EspaceCoopCNFSComponent } from './components/espace-coop-cnfs/espace-coop-cnfs.component'; import { ManageLockdownInfoComponent } from './components/lockdown-info/manage-lockdown-info.component'; import { ManageEmployersComponent } from './components/manage-employers/manage-employers.component'; import { ManageJobsComponent } from './components/manage-jobs/manage-jobs.component'; @@ -37,6 +38,10 @@ export const AdminRoutes = { link: 'admin/structure-list', path: 'structure-list', }, + espaceCoopCNFS: { + link: 'admin/espaceCoopCNFS', + path: 'espaceCoopCNFS', + }, }; const routes: Routes = [ @@ -54,6 +59,7 @@ const routes: Routes = [ path: AdminRoutes.structuresList.path, component: AdminStructuresListComponent, }, + { path: AdminRoutes.espaceCoopCNFS.path, component: EspaceCoopCNFSComponent }, ]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index 498247f2f..42cf737cf 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -5,6 +5,7 @@ import { SharedModule } from '../shared/shared.module'; import { AdminRoutingModule } from './admin-routing.module'; import { ClaimStructureComponent } from './components/claim-structure/claim-structure.component'; import { DeletedStructuresComponent } from './components/deleted-structures/deleted-structures.component'; +import { EspaceCoopCNFSComponent } from './components/espace-coop-cnfs/espace-coop-cnfs.component'; import { ManageLockdownInfoComponent } from './components/lockdown-info/manage-lockdown-info.component'; import { DeleteEmployerComponent } from './components/manage-employers/delete-employer/delete-employer.component'; import { ManageEmployersComponent } from './components/manage-employers/manage-employers.component'; @@ -46,6 +47,7 @@ import { AdminStructuresListComponent } from './components/structures-list/admin ManageEmployersComponent, DeletedStructuresComponent, NavBarComponent, + EspaceCoopCNFSComponent, ], imports: [CommonModule, AdminRoutingModule, SharedModule, AgGridModule], }) diff --git a/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.html b/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.html new file mode 100644 index 000000000..efceca730 --- /dev/null +++ b/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.html @@ -0,0 +1,29 @@ +<app-admin-nav-bar /> +<div class="adminLayout"> + <h2>CNFS présents dans Espace Coop sans compte Rés'in ({{ unregisteredCNFS.length }})</h2> + <ag-grid-angular + *ngIf="unregisteredCNFS.length" + class="ag-theme-alpine user-table" + rowSelection="multiple" + domLayout="autoHeight" + style="width: 100%" + [rowData]="unregisteredCNFS" + [columnDefs]="unregisteredColumnDefs" + [getRowHeight]="getRowHeight" + > + </ag-grid-angular> + <p *ngIf="!unregisteredCNFS.length">Tous les CNFS dans Espace Coop ont un compte Rés'in</p> + + <h2>CNFS présents dans Rés'in mais pas dans Espace Coop ({{ cnfsNotInEspaceCoop.length }})</h2> + <ag-grid-angular + *ngIf="cnfsNotInEspaceCoop.length" + class="ag-theme-alpine user-table" + rowSelection="multiple" + domLayout="autoHeight" + style="width: 100%" + [rowData]="cnfsNotInEspaceCoop" + [columnDefs]="notInEspaceCoopColumnDefs" + > + </ag-grid-angular> + <p *ngIf="!cnfsNotInEspaceCoop.length">Tous les CNFS dans Rés'in sont présents dans Espace Coop</p> +</div> diff --git a/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.spec.ts b/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.spec.ts new file mode 100644 index 000000000..4c0e3abc9 --- /dev/null +++ b/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EspaceCoopCNFSComponent } from './espace-coop-cnfs.component'; + +describe('EspaceCoopCnfsComponent', () => { + let component: EspaceCoopCNFSComponent; + let fixture: ComponentFixture<EspaceCoopCNFSComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [EspaceCoopCNFSComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(EspaceCoopCNFSComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.ts b/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.ts new file mode 100644 index 000000000..39d13ae11 --- /dev/null +++ b/src/app/admin/components/espace-coop-cnfs/espace-coop-cnfs.component.ts @@ -0,0 +1,90 @@ +import { Component, OnInit } from '@angular/core'; +import { ColDef } from 'ag-grid-community'; +import { User } from '../../../models/user.model'; +import { AdminService } from '../../services/admin.service'; +import { EspaceCoopCNFS } from './../../../models/espaceCoopCNFS.model'; + +@Component({ + selector: 'app-espace-coop-cnfs', + templateUrl: './espace-coop-cnfs.component.html', + styleUrls: ['../../admin.scss'], +}) +export class EspaceCoopCNFSComponent implements OnInit { + public unregisteredCNFS: EspaceCoopCNFS[] = []; + public unregisteredColumnDefs: ColDef<EspaceCoopCNFS>[] = [ + { + headerName: 'Nom', + field: 'name', + sortable: true, + sort: 'asc', + resizable: true, + }, + { + headerName: 'Employeur', + field: 'employer', + sortable: true, + // Case insensitive alphabetical order + comparator: (a, b) => a.toLowerCase().localeCompare(b.toLowerCase()), + flex: 1, + resizable: true, + }, + { + headerName: 'Structures', + field: 'structures', + cellRenderer: (param) => param.data.structures.join('<br/>'), + flex: 1, + resizable: true, + }, + { + headerName: 'Email', + field: 'email', + flex: 1, + resizable: true, + }, + { + headerName: 'Téléphone', + field: 'phone', + resizable: true, + }, + ]; + + public cnfsNotInEspaceCoop: User[] = []; + public notInEspaceCoopColumnDefs: ColDef<User>[] = [ + { + headerName: 'Prénom', + field: 'name', + sortable: true, + }, + { + headerName: 'Nom', + field: 'surname', + sort: 'asc', + }, + { + headerName: 'Email', + field: 'email', + }, + { + headerName: 'Téléphone', + field: 'phone', + }, + ]; + + public getRowHeight(params: { data: EspaceCoopCNFS }): number { + const structures = params.data.structures || []; + if (structures.length <= 1) return 40; + return structures.length * 40; + } + + constructor(private adminService: AdminService) {} + ngOnInit(): void { + this.adminService.getAllEspaceCoopCNFS().subscribe((espaceCoopCNFS) => { + this.unregisteredCNFS = espaceCoopCNFS.filter((member) => !member.hasAccount); + this.adminService.getAllResinCNFS().subscribe((resinCNFS) => { + this.cnfsNotInEspaceCoop = resinCNFS.filter( + (resin) => !espaceCoopCNFS.some((coop) => coop.email === resin.email) + ); + }); + }); + } +} diff --git a/src/app/admin/components/manage-employers/manage-employers.component.ts b/src/app/admin/components/manage-employers/manage-employers.component.ts index a1e1b5c4f..94b05ddab 100644 --- a/src/app/admin/components/manage-employers/manage-employers.component.ts +++ b/src/app/admin/components/manage-employers/manage-employers.component.ts @@ -247,6 +247,8 @@ export class ManageEmployersComponent implements OnInit { } public getRowHeight(params): number { - return params.data.users ? (params.data.users.length != 0 ? params.data.users.length * 40 : 40) : 40; + const users = params.data.users || []; + if (users.length <= 1) return 40; + return users.length * 40; } } diff --git a/src/app/admin/components/manage-jobs/manage-jobs.component.ts b/src/app/admin/components/manage-jobs/manage-jobs.component.ts index fd7c288a0..c48cfd705 100644 --- a/src/app/admin/components/manage-jobs/manage-jobs.component.ts +++ b/src/app/admin/components/manage-jobs/manage-jobs.component.ts @@ -434,10 +434,14 @@ export class ManageJobsComponent implements OnInit { } public getUsersRowHeight(params): number { - return params.data.users && params.data.users.length !== 0 ? params.data.users.length * 40 : 40; + const users = params.data.users || []; + if (users.length <= 1) return 40; + return users.length * 40; } public getJobsRowHeight(params): number { - return params.data.jobs && params.data.jobs.length !== 0 ? params.data.jobs.length * 40 : 40; + const jobs = params.data.jobs || []; + if (jobs.length <= 1) return 40; + return jobs.length * 40; } } diff --git a/src/app/admin/components/manage-users/manage-users.component.ts b/src/app/admin/components/manage-users/manage-users.component.ts index 5c2cf6c9d..6e2702efc 100644 --- a/src/app/admin/components/manage-users/manage-users.component.ts +++ b/src/app/admin/components/manage-users/manage-users.component.ts @@ -299,7 +299,8 @@ export class ManageUsersComponent { } public getRowHeight(params): number { - return params.data.structures?.length * 40 || 40; + const structures = params.data.structures || []; + return structures.length !== 0 ? structures.length * 40 : 40; } public onGridReady(params: GridReadyEvent, status: UsersStatus): void { diff --git a/src/app/admin/components/nav-bar/nav-bar.component.html b/src/app/admin/components/nav-bar/nav-bar.component.html index dcc0fe9df..6b2045c75 100644 --- a/src/app/admin/components/nav-bar/nav-bar.component.html +++ b/src/app/admin/components/nav-bar/nav-bar.component.html @@ -31,6 +31,11 @@ [style]="buttonTypeEnum.Secondary" (click)="router.navigateByUrl(routes.employersList.link)" /> + <app-button + [text]="'CNFS Espace Coop'" + [style]="buttonTypeEnum.Secondary" + (click)="router.navigateByUrl(routes.espaceCoopCNFS.link)" + /> <app-button [text]="'Infos covid'" [style]="buttonTypeEnum.Secondary" diff --git a/src/app/admin/services/admin.service.ts b/src/app/admin/services/admin.service.ts index bcbb2b2d5..ceaaf66c0 100644 --- a/src/app/admin/services/admin.service.ts +++ b/src/app/admin/services/admin.service.ts @@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { Employer } from '../../models/employer.model'; +import { EspaceCoopCNFS } from '../../models/espaceCoopCNFS.model'; import { Job } from '../../models/job.model'; import { JobGroup } from '../../models/jobGroup.model'; import { Structure } from '../../models/structure.model'; @@ -201,4 +202,12 @@ export class AdminService { public restoreDeletedStructure(structureId: string): Observable<void> { return this.http.post<void>(`${this.baseUrl}/restoreDeletedStructure/${structureId}`, {}); } + + public getAllEspaceCoopCNFS() { + return this.http.get<EspaceCoopCNFS[]>(`${this.baseUrl}/espaceCoopCNFS`); + } + + public getAllResinCNFS() { + return this.http.get<User[]>(`${this.baseUrl}/resinCNFS`); + } } diff --git a/src/app/models/espaceCoopCNFS.model.ts b/src/app/models/espaceCoopCNFS.model.ts new file mode 100644 index 000000000..db152fe42 --- /dev/null +++ b/src/app/models/espaceCoopCNFS.model.ts @@ -0,0 +1,8 @@ +export interface EspaceCoopCNFS { + name: string; + email?: string; + phone?: string; + employer: string; + structures: string[]; + hasAccount: boolean; +} -- GitLab From c9fee6837ca173e70777ec919fe575ac9f35396d Mon Sep 17 00:00:00 2001 From: Marlene Simondant <msimondant@grandlyon.com> Date: Wed, 21 Jun 2023 12:22:54 +0200 Subject: [PATCH 09/11] fix(news): link styles --- .../post/components/post-details/post-details.component.scss | 5 +++++ 1 file changed, 5 insertions(+) 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 3364f5c4b..95e2c8237 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -22,6 +22,11 @@ } .description { + a { + font-size: $font-size-small; + color: $red; + text-decoration: underline; + } div { height: fit-content; } -- GitLab From a48b2c6c86d24c6c8b92f7984def21067427f8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marl=C3=A8ne=20SIMONDANT?= <msimondant@grandlyon.com> Date: Thu, 22 Jun 2023 08:15:31 +0000 Subject: [PATCH 10/11] fix(structureTypes): update structure types --- src/app/models/structure.model.ts | 4 ++-- .../post/components/post-details/post-details.component.scss | 5 +++++ .../structure-type-picker/structure-type-picker.component.ts | 4 ++-- src/app/shared/enum/structureType.enum.ts | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/app/models/structure.model.ts b/src/app/models/structure.model.ts index 67611ab11..ba4ed7504 100644 --- a/src/app/models/structure.model.ts +++ b/src/app/models/structure.model.ts @@ -189,8 +189,8 @@ export class Structure { } } - public getLabelTypeStructure(): StructureTypeEnum | '' { - if (this.structureType) return StructureTypeEnum[this.structureType.value] || ''; + public getLabelTypeStructure(): StructureTypeEnum | string { + if (this.structureType) return StructureTypeEnum[this.structureType.value] || this.structureType.value; return ''; } 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 95e2c8237..1448fefc7 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -27,6 +27,11 @@ color: $red; text-decoration: underline; } + img { + max-width: 100%; + width: auto; + height: auto; + } div { height: fit-content; } diff --git a/src/app/shared/components/structure-type-picker/structure-type-picker.component.ts b/src/app/shared/components/structure-type-picker/structure-type-picker.component.ts index df363b833..a0782ecb4 100644 --- a/src/app/shared/components/structure-type-picker/structure-type-picker.component.ts +++ b/src/app/shared/components/structure-type-picker/structure-type-picker.component.ts @@ -2,9 +2,9 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { StructureType } from '../../../models/structureType.model'; import { StructureTypeService } from '../../../services/structure-type.service'; import { StructureCategoryEnum } from '../../enum/structureCategory.enum'; +import { StructureCategoryIconEnum } from '../../enum/structureCategoryIcon.enum'; import { StructureTypeEnum } from '../../enum/structureType.enum'; import { ButtonType } from '../button/buttonType.enum'; -import { StructureCategoryIconEnum } from '../../enum/structureCategoryIcon.enum'; @Component({ selector: 'app-structure-type-picker', @@ -87,6 +87,6 @@ export class StructureTypePickerComponent implements OnInit { } public getStructureTypeLabel(type: string): string { - return StructureTypeEnum[type]; + return StructureTypeEnum[type] ? StructureTypeEnum[type] : type; } } diff --git a/src/app/shared/enum/structureType.enum.ts b/src/app/shared/enum/structureType.enum.ts index df0092949..2a32ad6cf 100644 --- a/src/app/shared/enum/structureType.enum.ts +++ b/src/app/shared/enum/structureType.enum.ts @@ -21,13 +21,15 @@ export enum StructureTypeEnum { bijPij = 'BIJ/PIJ', logement = 'Logement', MaisonFranceService = 'Maison France Service', + laPoste = 'La Poste', + espaceEmploi = 'Espace emploi', + CPAM = 'CPAM', autre = 'Autre', // Privée à but non lucratif association = 'Association', centreSocio = 'Centre socio-culturel', mjc = 'MJC / Cyberbase', - pimms = 'PIMMS', sij = 'Structure information jeunesse (SIJ)', missionsLocales = 'Missions locales', -- GitLab From ae03668b9dcf14d87634285962a60ecf66226e82 Mon Sep 17 00:00:00 2001 From: Marlene Simondant <msimondant@grandlyon.com> Date: Thu, 22 Jun 2023 10:33:19 +0200 Subject: [PATCH 11/11] chore(release): 2.3.2 --- CHANGELOG.md | 20 ++++++++++++++++++++ package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90c30901a..55215be6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ 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. +### [2.3.2](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v2.3.1...v2.3.2) (2023-06-22) + + +### Features + +* **admin:** list all CNFS from Espace Coop ([1d7174f](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/1d7174fc57f2b8843eccd1a99da605b213313f57)) +* **mediation:** update recap meeting ([49bac59](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/49bac59ebcfee5d45852e27c785c83c03c901300)) +* **mobile:** footer links in burger menu ([eef7657](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/eef76575e04a8ba5b30add117df98dda94b349b7)) + + +### Bug Fixes + +* **admin:** add empty option in employer, job and jobsgroup dropdown menu ([d75fbc0](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/d75fbc04285e46beba4160a4273d65e46f263cfb)) +* **cicd:** update docker from 18.09 to 24.0.2 ([ce8f69b](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/ce8f69b8bc30ee690a51f1a4e86bc3b79e0060ee)) +* **edit structure:** add condition to display missing information on freeWorkshops ([16161ef](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/16161efa1caf72a9be050e687060673d413bec55)) +* **edit-structure:** missing information on structure contact ([8549aa7](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/8549aa72c48ffa28508c1c7e29798dd7bde83bc4)) +* **loader:** double loader ([d6cc737](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/d6cc737407427dffaf9811dc24b9ae6381232bb5)) +* **news:** link styles ([c9fee68](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/c9fee6837ca173e70777ec919fe575ac9f35396d)) +* **structureTypes:** update structure types ([a48b2c6](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/a48b2c6c86d24c6c8b92f7984def21067427f8cd)) + ### [2.3.1](https://forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v2.3.0...v2.3.1) (2023-06-06) diff --git a/package.json b/package.json index 221e90d9c..92102e5d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "2.3.1", + "version": "2.3.2", "scripts": { "ng": "ng", "start": "ng serve --configuration=local,fr --proxy-config proxy.conf.json", -- GitLab