diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b2f6cc08f4f44af4a87d877e04a81c15cc52c37..649e6c9624b4cab4821702a1ccbaee176a007927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ 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. +### [3.0.2](https://forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v3.0.1...v3.0.2) (2024-03-28) + + +### Bug Fixes + +* **post:** fix the size of embedded YouTube videos. ([7079f79](https://forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/7079f7900b7098bc3c7696f02ffacb839f0a8ba0)) +* **post:** fix the size of embedded YouTube videos. ([822843c](https://forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/822843c44abbc3f65f27635daf8504f655743c63)) +* Some fixes ([e6ded6a](https://forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/e6ded6a0718ffb121f30dc7e0117a9337c38b5d1)) +* **structure:** edit page reload redirect to home ([b9beb70](https://forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/b9beb70bd38947412f4aa24c711743fd6ca2ed19)) + ### [3.0.1](https://forge.grandlyon.com/web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v3.0.0...v3.0.1) (2024-03-27) diff --git a/package-lock.json b/package-lock.json index cbccf036395661a325600756d1c0a64f4fe411ae..6dc94f90e96ac023b9792a9f8ed3a2d2cdd2fd39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pamn", - "version": "3.0.1", + "version": "3.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pamn", - "version": "3.0.1", + "version": "3.0.2", "dependencies": { "@ag-grid-community/csv-export": "^29.0.0", "@angular/animations": "^17.0.7", diff --git a/package.json b/package.json index 5d90b52dfba556ec81aa6f981cd77034d08a5efe..5595773e10cf235f3affc157b0377c6feec027dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "3.0.1", + "version": "3.0.2", "scripts": { "ng": "ng", "start": "ng serve --configuration=local,fr --proxy-config proxy.conf.json", diff --git a/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html b/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html index e7b46ff2de4a238e6d2a0d6f82624f06a714e865..e51fc8bc80715113241574baf40cfe76d939ed97 100644 --- a/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html +++ b/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html @@ -1,7 +1,7 @@ <form *ngIf="personalOfferForm" [formGroup]="personalOfferForm"> <div class="title"> <p class="overtitle">{{ structureName }}</p> - <h3>Quelles aides aux démarches en ligne proposez-vous ?</h3> + <h3>Quelles aides aux démarches en ligne proposez-vous dans cette structure ?</h3> <p>Facultatif - Plusieurs choix possibles</p> </div> diff --git a/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html b/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html index fef2754c79c7d7d64248bbf2986e06a62993c102..a8a261b1e026dad2da402f70c76a47d190bc16f3 100644 --- a/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html +++ b/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html @@ -1,7 +1,7 @@ <form *ngIf="personalOfferForm" [formGroup]="personalOfferForm"> <div class="title"> <p class="overtitle">{{ structureName }}</p> - <h3>Quels accompagnements au numérique proposez-vous ?</h3> + <h3>Quels accompagnements au numérique proposez-vous dans cette structure ?</h3> <p>Facultatif</p> </div> <app-training-type-picker diff --git a/src/app/guards/role.guard.ts b/src/app/guards/role.guard.ts index a98f13aed407271e04c04cb707247da314a44e6b..2162565376f8fedd99e2d5b1590c0d19ac60ab00 100644 --- a/src/app/guards/role.guard.ts +++ b/src/app/guards/role.guard.ts @@ -1,5 +1,5 @@ -import { ActivatedRouteSnapshot, Router, UrlTree } from '@angular/router'; import { Injectable } from '@angular/core'; +import { ActivatedRouteSnapshot, Router, UrlTree } from '@angular/router'; import { ProfileService } from '../profile/services/profile.service'; import { AuthService } from '../services/auth.service'; import { RouteRole } from '../shared/enum/routeRole.enum'; @@ -15,14 +15,14 @@ export class RoleGuard { private authService: AuthService, ) {} - canActivate(route: ActivatedRouteSnapshot): UrlTree | boolean { + async canActivate(route: ActivatedRouteSnapshot): Promise<UrlTree | boolean> { const allowedRoles = route.data.allowedRoles; if (this.authService.isLoggedIn()) { if (this.profileService.isAdmin()) return true; if (allowedRoles.includes(RouteRole.structureAdmin)) { const structureId = route.params.id; - if (this.profileService.isLinkedToStructure(structureId)) { + if (await this.profileService.isLinkedToStructure(structureId)) { return true; } } 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 3c8671b56de64786be08b91bdfdf535584fab2ee..5f678e4f420f7d65deebca1bb0152ae32b3c2237 100644 --- a/src/app/post/components/post-details/post-details.component.scss +++ b/src/app/post/components/post-details/post-details.component.scss @@ -47,6 +47,7 @@ h1 { } .description { + position: relative; a { font-size: $font-size-small; color: $red; @@ -64,11 +65,6 @@ h1 { ::ng-deep img { height: 100%; } - ::ng-deep iframe { - width: 100% !important; - max-height: 400px; - height: 100vw; - } ::ng-deep .kg-embed-card { max-height: 400px; iframe { @@ -83,4 +79,9 @@ h1 { text-align: center; } } + iframe { + position: relative; + width: 100%; + height: 400px; + } } diff --git a/src/app/profile/services/profile.service.ts b/src/app/profile/services/profile.service.ts index b740c65af1271728fcfdd6ec4da186eef7440202..363580320c74cfa41ca72d9f6207a275ba01a907 100644 --- a/src/app/profile/services/profile.service.ts +++ b/src/app/profile/services/profile.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import decode from 'jwt-decode'; -import { Observable } from 'rxjs'; +import { Observable, lastValueFrom } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { Employer } from '../../models/employer.model'; import { Job } from '../../models/job.model'; @@ -25,7 +25,7 @@ export class ProfileService { public async getProfile(): Promise<User> { if (this.authService.isLoggedIn()) { - const profile = await this.http.get<User>(`${this.baseUrl}/profile`).toPromise(); + const profile = await lastValueFrom(this.http.get<User>(`${this.baseUrl}/profile`)); this.currentProfile = profile; } return this.currentProfile; @@ -38,7 +38,8 @@ export class ProfileService { return this.http.delete<User>(`${this.baseUrl}`); } - public isLinkedToStructure(idStructure: string): boolean { + public async isLinkedToStructure(idStructure: string): Promise<boolean> { + await this.getProfile(); if (!this.currentProfile) { return false; } diff --git a/src/app/shared/components/hour-picker/hour-picker.component.html b/src/app/shared/components/hour-picker/hour-picker.component.html index b52deadd1dd4f0a8e33ddefa7f6ddb1d6d839181..4cf6b42b83114afed317e8fc152e55dfc23c8c6b 100644 --- a/src/app/shared/components/hour-picker/hour-picker.component.html +++ b/src/app/shared/components/hour-picker/hour-picker.component.html @@ -19,7 +19,7 @@ [label]="'De :'" [size]="'large'" [status]="getStatus(hour.start)" - [statusText]="getStatusText(hour)" + [statusText]="getStatusText(hour.start)" [(value)]="hour.start" (valueChange)="submitForm()" /> @@ -31,7 +31,7 @@ [label]="'Jusqu’à :'" [size]="'large'" [status]="getStatus(hour.start, hour.end)" - [statusText]="getStatusText(hour)" + [statusText]="getStatusText(hour.start, hour.end)" [(value)]="hour.end" (valueChange)="submitForm()" /> diff --git a/src/app/shared/components/hour-picker/hour-picker.component.ts b/src/app/shared/components/hour-picker/hour-picker.component.ts index 88616a331e1dbd872051891a579326ebb774a7cf..217fd8a14e84c42fbe7690f1a2ed23d68370b53e 100644 --- a/src/app/shared/components/hour-picker/hour-picker.component.ts +++ b/src/app/shared/components/hour-picker/hour-picker.component.ts @@ -174,7 +174,7 @@ export class HourPickerComponent implements OnInit { return end && end > start ? 'success' : 'error'; } - getStatusText(hour: { start: string; end: string }): string { - return 'Horaire ' + (this.getStatus(hour.start, hour.end) === 'error' ? 'invalide' : 'valide'); + getStatusText(start: string, end?: string): string { + return 'Horaire ' + (this.getStatus(start, end) === 'error' ? 'invalide' : 'valide'); } } diff --git a/src/app/shared/components/training-type-picker/training-type-picker.component.html b/src/app/shared/components/training-type-picker/training-type-picker.component.html index 1b031728bc062d2f8abac98328a8d8db32ea30de..03741b86b4b44b34d0a7de2426e160e051a15da8 100644 --- a/src/app/shared/components/training-type-picker/training-type-picker.component.html +++ b/src/app/shared/components/training-type-picker/training-type-picker.component.html @@ -1,5 +1,5 @@ <div class="trainingContainer"> - <app-collapse *ngFor="let category of categories" [expanded]="isCategorieExpanded(category.id)"> + <app-collapse *ngFor="let category of categories" [expanded]="true"> <app-collapse-header> <div class="collapseHeader"> <app-checkbox diff --git a/src/app/shared/components/training-type-picker/training-type-picker.component.ts b/src/app/shared/components/training-type-picker/training-type-picker.component.ts index 373ab003d2bcb994ea84063328f500049955bdde..3ff3d20afa31ee26262e2a2aeaa356feeacc36ec 100644 --- a/src/app/shared/components/training-type-picker/training-type-picker.component.ts +++ b/src/app/shared/components/training-type-picker/training-type-picker.component.ts @@ -47,11 +47,6 @@ export class TrainingTypePickerComponent implements OnInit, OnChanges { }); } - public isCategorieExpanded(id: string): boolean { - const index = this.selectedChoices.findIndex((category) => category.id === id); - return this.selectedChoices[index].modules.length !== 0; - } - public isModulePicked(categorie: Category, module: Module): boolean { const index = this.selectedChoices.findIndex((_categorie) => _categorie.id === categorie.id); if (index === -1) return false; 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 e6ba1b6ccd517f4d272a547598ea3680cbb83f14..cdc28cb548e990e09bdf4158b875b0009b69a308 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 @@ -21,7 +21,14 @@ [clickable]="false" /> </div> - <app-svg-icon tabindex="0" [folder]="'ico'" [icon]="'cross'" [iconColor]="'grey-1'" (click)="close()" (keyup.enter)="close()" /> + <app-svg-icon + tabindex="0" + [folder]="'ico'" + [icon]="'cross'" + [iconColor]="'grey-1'" + (click)="close()" + (keyup.enter)="close()" + /> </section> <section *ngIf="showButtons" class="actions hide-on-print"> @@ -66,7 +73,7 @@ </div> <!-- Je travaille ici --> <div - *ngIf="!profileService.isLinkedToStructure(structure._id)" + *ngIf="!isInStructure" class="clickableDiv" role="button" tabindex="0" @@ -78,7 +85,7 @@ </div> <!-- Modifier la structure --> <div - *ngIf="profileService.isLinkedToStructure(structure._id) || profileService.isAdmin()" + *ngIf="isInStructure || profileService.isAdmin()" class="clickableDiv" role="button" tabindex="0" 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 bf023d60945a34bc772f8839cfe527cbe9da87ec..973eba153f519626031ae9444e04b067efccdc93 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 @@ -56,6 +56,7 @@ export class StructureDetailsComponent implements OnInit { public showButtons = true; public Equipment = Equipment; public FreeWorkshop = FreeWorkshop; + public isInStructure = false; constructor( private searchService: SearchService, @@ -74,6 +75,7 @@ export class StructureDetailsComponent implements OnInit { if (queryParams.id) { this.structureService.getStructure(queryParams.id).subscribe((structure) => { this.structure = new Structure(structure); + this.profileIsLinkedToStructure(this.structure._id); this.isLoading = true; this.initForm(); }); @@ -107,6 +109,10 @@ export class StructureDetailsComponent implements OnInit { }); } + public async profileIsLinkedToStructure(id: string): Promise<void> { + this.isInStructure = await this.profileService.isLinkedToStructure(id); + } + public userIsLoggedIn(): boolean { return this.authService.isLoggedIn(); }