diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b40915a21022451d5093fe1095baa75843109795..11f699b5deec147610d4031015418b1e00a5a752 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -102,7 +102,6 @@ deploy_rec: environment: name: rec url: https://resin-rec.grandlyon.com - # code_analysis: # image: skilldlabs/sonar-scanner:3.4.0 # services: @@ -124,15 +123,15 @@ deploy_rec: # -Dsonar.projectKey=${SONAR_PROJECT_KEY} # -Dsonar.login=${SONAR_TOKEN} -mr: - variables: - DOCKER_TLS_CERTDIR: '' - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 - stage: build - only: - - merge_requests - script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker build --pull -t "$CI_REGISTRY_IMAGE:dev" --build-arg conf=dev . +# mr: +# variables: +# DOCKER_TLS_CERTDIR: '' +# DOCKER_HOST: tcp://docker:2375/ +# DOCKER_DRIVER: overlay2 +# image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:18.09 +# stage: build +# only: +# - merge_requests +# script: +# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY +# - docker build --pull -t "$CI_REGISTRY_IMAGE:dev" --build-arg conf=dev . diff --git a/CHANGELOG.md b/CHANGELOG.md index c4aed4b02c524c3e1a5e11a544fdb0474c028b3b..26164cc720199f2c1004835e173373ae011b9b73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.16.0](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v1.15.0...v1.16.0) (2022-03-18) + + +### Bug Fixes + +* **carto:** issue [#11](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/issues/11) responsive structure details ([ad5e3bf](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/ad5e3bf7e824c5e0cde1cafa1019035a51aecb07)) +* **carto:** issue on category name after migration ([41f6d76](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/41f6d76839755d8e0d725ccb1e0fa6eb84258071)) +* **carto:** maker not setting in some case ([a13de9a](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/a13de9a2d184fac6569564a4953b5aeb6a100b04)) +* **pwa:** add icon for ios ([e18c936](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/e18c93606c14a41ba0da4a407d7ec94c492f8089)) +* **structure-details:** display workshops again in structure details ([897a215](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/897a215b2bada359b8ee587902a8a313e7960829)) +* **structures:** Impossible de rentrer des adresses sans numéro ([4d79383](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/commit/4d79383c2703396c9fa0c48bebed8b40ee1543c0)) + ## [1.15.0](https://forge.grandlyon.com/web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client/compare/v1.14.0...v1.15.0) (2022-03-08) diff --git a/package-lock.json b/package-lock.json index fd2d00ca8b44fdb6992b0e53f5326b6768bd4073..ab163b0bd00becd14f02b8621a4ab16128d53093 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "1.15.0", + "version": "1.16.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 541783c6ea4a08ca8b99d08f69121032a7ac0d98..73da33c2450a09efa9d5ab39db06a9abadd19481 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pamn", - "version": "1.15.0", + "version": "1.16.0", "scripts": { "ng": "ng", "start": "ng serve --configuration=fr --proxy-config proxy.conf.json", diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts index 35f1387f229a45b0b8ab7597f72b1f8b81f8e951..1758fe2735b98d404882d528a0d4aca8cbfc6a34 100644 --- a/src/app/map/components/map.component.ts +++ b/src/app/map/components/map.component.ts @@ -106,7 +106,7 @@ export class MapComponent implements OnChanges { ); } } - // Handle map marker selection + // Handle map marker if none selected if (changes.selectedMarkerId && this.map) { this.map.closePopup(); if (changes.selectedMarkerId.currentValue === undefined) { @@ -115,14 +115,15 @@ export class MapComponent implements OnChanges { this.getMarkerTypeByStructureId(changes.selectedMarkerId.previousValue) ); this.map.setView(this.mapOptions.center, this.mapOptions.zoom); - } else { - this.mapService.setSelectedMarker( - changes.selectedMarkerId.currentValue, - this.getMarkerTypeByStructureId(changes.selectedMarkerId.currentValue) - ); - this.centerLeafletMapOnMarker(changes.selectedMarkerId.currentValue); } } + // Handle map marker if one is set with url or selected + if (this.mapService.getMarker(this.selectedMarkerId)) { + this.mapService.setSelectedMarker(this.selectedMarkerId, this.getMarkerTypeByStructureId(this.selectedMarkerId)); + this.centerLeafletMapOnMarker(this.selectedMarkerId); + } + + this.closePreviousMarker(changes); if (changes.structuresToPrint) { if (changes.structuresToPrint.currentValue < changes.structuresToPrint.previousValue) { @@ -205,7 +206,7 @@ export class MapComponent implements OnChanges { } private getStructuresPositions(structureList: Structure[]): void { - structureList.forEach((structure: Structure) => { + for (const structure of structureList) { this.mapService .createMarker( structure.getLat(), @@ -219,7 +220,8 @@ export class MapComponent implements OnChanges { .on('popupopen', () => { this.currentStructure = structure; }); - }); + } + // Reset location if active to prevent graphical issue if (this.locate) { this.lc.stop(); @@ -329,11 +331,13 @@ export class MapComponent implements OnChanges { } private centerLeafletMapOnMarker(markerId: string): void { - const marker = this.mapService.getMarker(markerId); - const latLngs = [marker.getLatLng()]; - const markerBounds = latLngBounds(latLngs); - // paddingTopLeft is used for centering marker because of structure details pane - this.map.fitBounds(markerBounds, { paddingTopLeft: [300, 0] }); + if (this.mapService.getMarker(markerId)) { + const marker = this.mapService.getMarker(markerId); + const latLngs = [marker.getLatLng()]; + const markerBounds = latLngBounds(latLngs); + // paddingTopLeft is used for centering marker because of structure details pane + this.map.fitBounds(markerBounds, { paddingTopLeft: [300, 0] }); + } } private initMetropoleLayer(): void { @@ -347,4 +351,21 @@ export class MapComponent implements OnChanges { ) ); } + + /** + * Close previous markers + * - if strucure is closed + * - if a new marker is selected + */ + private closePreviousMarker(changes: SimpleChanges): void { + if ( + (changes.selectedMarkerId?.currentValue === undefined && changes.selectedMarkerId?.previousValue) || + changes.selectedMarkerId?.currentValue !== changes.selectedMarkerId?.previousValue + ) { + this.mapService.setUnactiveMarker( + changes.selectedMarkerId.previousValue, + this.getMarkerTypeByStructureId(changes.selectedMarkerId.previousValue) + ); + } + } } diff --git a/src/app/map/services/map.service.ts b/src/app/map/services/map.service.ts index c65d925857a3a09c795e8bb28e1868a160ab939a..75cd373b1ae07150e627195a8f771e05d172bcb1 100644 --- a/src/app/map/services/map.service.ts +++ b/src/app/map/services/map.service.ts @@ -122,9 +122,7 @@ export class MapService { public setUnactiveMarker(id: string, type: MarkerType = MarkerType.structure): void { // To skip mouseleave when user emit click on structure list - if (!this.isMarkerActive) { - this.getMarker(id).setIcon(this.getMarkerIcon(type)); - } + this.getMarker(id)?.setIcon(this.getMarkerIcon(type)); this.isMarkerActive = false; } @@ -144,7 +142,7 @@ export class MapService { */ public setSelectedMarker(id: string, type: MarkerType = MarkerType.structure): void { if (id) { - this.getMarker(id).setIcon(this.getActiveMarkerIcon(type)); + this.getMarker(id)?.setIcon(this.getActiveMarkerIcon(type)); this.isMarkerActive = true; } } 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 a1115c3acfb124518e39b3e1a87b538c1a048523..45710320a46494229892ebfe77369aaeaf4ebbd1 100644 --- a/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts +++ b/src/app/shared/components/address-autocomplete/address-autocomplete.component.ts @@ -57,9 +57,13 @@ export class AddressAutocompleteComponent implements OnInit { public selectedResult(hit: any): void { const address = new Address(); address.numero = hit.properties.housenumber ? hit.properties.housenumber : null; - address.street = hit.properties.street; address.commune = hit.properties.city; address.coordinates = hit.geometry.coordinates; + if (hit.properties.street) { + address.street = hit.properties.street; + } else { + address.street = hit.properties.name; + } const value = this.parseHitToAddress(hit); // Set input value this.searchAddress.nativeElement.value = value; 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 3e30ac6647185550e8d3aff85e822e5d7a4e14e6..86370318682dc7b97ac2951781bd23aefa4106a2 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 @@ -229,7 +229,7 @@ </div> <div *ngIf="structure.exceptionalClosures" class="bold-info"> <h3 class="subtitle">Précisions sur les horaires</h3> - <p>{{ structure.exceptionalClosures }}</p> + <p class="description">{{ structure.exceptionalClosures }}</p> </div> <div *ngIf="structure.remoteAccompaniment" class="bold-info"> <h3>Cette structure propose un accompagnement à distance.</h3> 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 2b5a439e1bff52c30b5e88c5bc51233f51dde5ff..083fba5beb09b810763ef1a852314c6fe90aff96 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,17 +18,15 @@ a { left: 0; max-width: 980px; width: 100%; + box-sizing: border-box; height: calc(100vh - #{$header-height} - #{$footer-height}); padding: 0px 24px; overflow: auto; @media #{$tablet} { + height: calc(100vh - #{$header-height}); .printButton { display: none !important; } - - .ico-close { - margin-left: 16px; - } } .printButton { margin-right: 75px; 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 cae5b0b60b3aae1e9ac58aa95f6371ad76f6da7e..5ccbc64f40a8bfc410b34233d07bbc201da618bb 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 @@ -94,6 +94,7 @@ export class StructureDetailsComponent implements OnInit { this.socialAndProfessionalsReferentiel = referentiel; } }); + this.setServiceCategories(); if (this.printMode) { this.printService.onDataReady(); } @@ -249,6 +250,24 @@ export class StructureDetailsComponent implements OnInit { } } + public setServiceCategories(): void { + this.baseSkills = this.structure.baseSkills.map((skill) => + _.find(this.baseSkillssReferentiel.modules, { id: skill }) + ); + this.accessRights = this.structure.accessRight.map((rights) => + _.find(this.accessRightsReferentiel.modules, { id: rights }) + ); + this.parentingHelp = this.structure.parentingHelp.map((help) => + _.find(this.parentingHelpsReferentiel.modules, { id: help }) + ); + this.socialAndProfessional = this.structure.socialAndProfessional.map((skill) => + _.find(this.socialAndProfessionalsReferentiel.modules, { id: skill }) + ); + this.digitalCultureSecurity = this.structure.digitalCultureSecurity.map((skill) => + _.find(this.digitalCultureSecuritysReferentiel.modules, { id: skill }) + ); + } + public keepOriginalOrder = (a, b) => a.key; public isBaseSkills(): boolean { diff --git a/src/app/structure-list/models/category.model.ts b/src/app/structure-list/models/category.model.ts index b130dc1337cd4025a75a758db57e6ec79e610bae..6dc08cf79e02f99b679998be441a53fcb2ba0be9 100644 --- a/src/app/structure-list/models/category.model.ts +++ b/src/app/structure-list/models/category.model.ts @@ -16,22 +16,22 @@ export class Category { } public isBaseSkills(): boolean { - return this.name === 'Les compétences de base'; + return this.id === 'baseSkills'; } public isRigthtsAccess(): boolean { - return this.name === 'Accès aux droits'; + return this.id === 'accessRight'; } public isParentingHelp(): boolean { - return this.name === 'Aide à la parentalité'; + return this.id === 'parentingHelp'; } public isDigitalCultureSecurity(): boolean { - return this.name === 'Culture et sécurité numérique'; + return this.id === 'digitalCultureSecurity'; } public isSocialAndProfessional(): boolean { - return this.name === 'Insertion sociale et professionnelle'; + return this.id === 'socialAndProfessional'; } } diff --git a/src/assets/icons/apple-touch-icon.png b/src/assets/icons/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..51ea999122d9909a379c8d105f4dbbe54022d870 Binary files /dev/null and b/src/assets/icons/apple-touch-icon.png differ diff --git a/src/index.html b/src/index.html index 78caed151ffbfd74023d064f96288f725cb686f8..774bab5be7e1443627ee271a0497c1e7a6e7c082 100644 --- a/src/index.html +++ b/src/index.html @@ -43,6 +43,9 @@ <!-- Favicon --> <link rel="icon" type="image/x-icon" href="favicon.ico" /> + <!-- PWA --> + <link rel="apple-touch-icon" sizes="180x180" href="assets/icons/apple-touch-icon.png" /> + <!-- CSS & scripts --> <link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css" /> <link