Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client
1 result
Show changes
Commits on Source (22)
Showing
with 224 additions and 98 deletions
......@@ -16,6 +16,19 @@
"integrity": "sha512-ahLdpRAoGsdgEfy2SGV2wnnHrBSLDHuwA32v+BoNGnz1gqajr8VMzF8y6mIQt28hHi4LQ272wqSi78DK4YdT2g==",
"dev": true
},
"@ag-grid-community/core": {
"version": "28.2.1",
"resolved": "https://registry.npmjs.org/@ag-grid-community/core/-/core-28.2.1.tgz",
"integrity": "sha512-qGhqZhY8KbPlr3cJBVkNjGKu+cOyFc8IGvPcvlm0pjNC9cdxO/ct9Sa1Dg+k3ACCEroMEt1apBvnoOgurpvewQ=="
},
"@ag-grid-community/csv-export": {
"version": "28.2.1",
"resolved": "https://registry.npmjs.org/@ag-grid-community/csv-export/-/csv-export-28.2.1.tgz",
"integrity": "sha512-LILJCp9K9wdpqNyuMxqH90BsZZ7MvhFNmTZGIYciRTf1pgURdolZFCuuxdMi32D7Qzxa0gpYCljmXf0GJ2uCGQ==",
"requires": {
"@ag-grid-community/core": "~28.2.1"
}
},
"@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
......@@ -27842,11 +27855,11 @@
"dev": true
},
"zone.js": {
"version": "0.11.4",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.11.4.tgz",
"integrity": "sha512-DDh2Ab+A/B+9mJyajPjHFPWfYU1H+pdun4wnnk0OcQTNjem1XQSZ2CDW+rfZEUDjv5M19SBqAkjZi0x5wuB5Qw==",
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.12.0.tgz",
"integrity": "sha512-XtC+I5dXU14HrzidAKBNMqneIVUykLEAA1x+v4KVrd6AUPWlwYORF8KgsVqvgdHiKZ4BkxxjvYi/ksEixTPR0Q==",
"requires": {
"tslib": "^2.0.0"
"tslib": "^2.3.0"
}
}
}
......@@ -16,6 +16,7 @@
},
"private": true,
"dependencies": {
"@ag-grid-community/csv-export": "^28.2.1",
"@angular/animations": "^14.2.1",
"@angular/cdk": "^14.0.0",
"@angular/common": "^14.2.1",
......@@ -39,7 +40,7 @@
"ngx-toastr": "^15.0.0",
"rxjs": "~7.5.0",
"tslib": "^2.4.0",
"zone.js": "~0.11.4"
"zone.js": "~0.12.0"
},
"devDependencies": {
"@angular-builders/jest": "^14.0.0",
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PanelComponent } from './components/panel/panel.component';
import { ClaimStructureComponent } from './components/claim-structure/claim-structure.component';
import { ManageUsersComponent } from './components/manage-users/manage-users.component';
import { NgModule } from '@angular/core';
import { AgGridModule } from 'ag-grid-angular';
import { SharedModule } from '../shared/shared.module';
import { AdminStructuresListComponent } from './components/structures-list/admin-structures-list.component';
import { ManageLockdownInfoComponent } from './components/lockdown-info/manage-lockdown-info.component';
import { AdminRoutingModule } from './admin-routing.module';
import { AgGridModule } from 'ag-grid-angular';
import { DeleteUserComponent } from './components/manage-users/delete-user/delete-user.component';
import { AdministredStructuresComponent } from './components/manage-users/administred-structures/administred-structures.component';
import { ManageJobsComponent } from './components/manage-jobs/manage-jobs.component';
import { ClaimStructureComponent } from './components/claim-structure/claim-structure.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';
import { JobRenderer } from './components/manage-users/job-renderer/job-renderer.component';
import { EmployerRenderer } from './components/manage-users/employer-renderer/employer-renderer.component';
import { ValidateEmployerComponent } from './components/manage-employers/validate-employer/validate-employer.component';
import { AttachedUsersComponent } from './components/manage-jobs/attached-users/attached-users.component';
import { DeleteJobComponent } from './components/manage-jobs/delete-job/delete-job.component';
import { DeleteEmployerComponent } from './components/manage-employers/delete-employer/delete-employer.component';
import { ValidateJobComponent } from './components/manage-jobs/validate-job/validate-job.component';
import { ValidateEmployerComponent } from './components/manage-employers/validate-employer/validate-employer.component';
import { JobPersonalOffer } from './components/manage-jobs/jobPersonalOffer/job-personal-offer';
import { ManageJobsComponent } from './components/manage-jobs/manage-jobs.component';
import { ValidateJobComponent } from './components/manage-jobs/validate-job/validate-job.component';
import { AdministredStructuresComponent } from './components/manage-users/administred-structures/administred-structures.component';
import { DeleteUserComponent } from './components/manage-users/delete-user/delete-user.component';
import { EmployerRenderer } from './components/manage-users/employer-renderer/employer-renderer.component';
import { JobRenderer } from './components/manage-users/job-renderer/job-renderer.component';
import { ManageUsersComponent } from './components/manage-users/manage-users.component';
import { PanelComponent } from './components/panel/panel.component';
import { AdminStructuresListComponent } from './components/structures-list/admin-structures-list.component';
@NgModule({
declarations: [
......
<div *ngIf="isLoading" class="loader">
<img class="loader-gif" src="/assets/gif/loader_circle.gif" alt />
<img class="loader-gif" src="/assets/gif/loader_circle_grey.gif" alt />
</div>
<div *ngIf="!isLoading" fxLayout="column" fxLayoutAlign="center center">
<H2>Gestion de l'affichage des infos Covid</H2>
......
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center" class="userBlock">
<h3>
<h2>
Gestion des utilisateurs
<span *ngIf="unVerifiedUsers && unAttachedUsers && attachedUsers">
({{ unVerifiedUsers.length + unAttachedUsers.length + attachedUsers.length }})
</span>
</h3>
</h2>
</div>
<div class="tables-list">
......@@ -24,7 +24,14 @@
</ag-grid-angular>
</div>
<div>
<h3 class="title" *ngIf="unAttachedUsers">Utilisateurs non rattachés ({{ unAttachedUsers.length }})</h3>
<h3 class="title" *ngIf="unAttachedUsers">
Utilisateurs non rattachés ({{ unAttachedUsers.length }})
<app-button
[text]="'Exporter'"
[style]="buttonTypeEnum.Tertiary"
(click)="exportUsers('unattached')"
></app-button>
</h3>
<ag-grid-angular
*ngIf="validatedJobs && validatedEmployers"
class="ag-theme-alpine user-table"
......@@ -35,11 +42,15 @@
[getRowHeight]="getRowHeight"
[defaultColDef]="unAttachedColDef"
[frameworkComponents]="frameworkComponents"
(gridReady)="onGridReady($event, 'unattached')"
>
</ag-grid-angular>
</div>
<div>
<h3 class="title" *ngIf="attachedUsers">Utilisateurs rattachés ({{ attachedUsers.length }})</h3>
<h3 class="title" *ngIf="attachedUsers">
Utilisateurs rattachés ({{ attachedUsers.length }})
<app-button [text]="'Exporter'" [style]="buttonTypeEnum.Tertiary" (click)="exportUsers('attached')"></app-button>
</h3>
<ag-grid-angular
*ngIf="validatedJobs && validatedEmployers"
class="ag-theme-alpine user-table"
......@@ -50,6 +61,7 @@
[getRowHeight]="getRowHeight"
[defaultColDef]="defaultColDef"
[frameworkComponents]="frameworkComponents"
(gridReady)="onGridReady($event, 'attached')"
>
</ag-grid-angular>
</div>
......
......@@ -18,3 +18,7 @@
app-delete-user {
text-align: center;
}
::ng-deep button {
margin-left: 0.5rem;
}
......@@ -8,6 +8,10 @@ import { Employer } from '../../../models/employer.model';
import { EmployerRenderer } from './employer-renderer/employer-renderer.component';
import { NotificationService } from '../../../services/notification.service';
import { DeleteUserComponent } from './delete-user/delete-user.component';
import { CsvExportParams, GridApi, GridReadyEvent } from 'ag-grid-community';
import { ButtonType } from '../../../shared/components/button/buttonType.enum';
type UsersStatus = 'attached' | 'unattached';
@Component({
selector: 'app-admin-manage-users',
......@@ -16,7 +20,9 @@ import { DeleteUserComponent } from './delete-user/delete-user.component';
})
export class ManageUsersComponent {
public attachedUsers: User[] = [];
public gridApiAttached: GridApi;
public unAttachedUsers: User[] = [];
public gridApiUnattached: GridApi;
public unVerifiedUsers: User[] = [];
public validatedJobsName: string[] = [];
public validatedJobs: Job[] = [];
......@@ -53,6 +59,7 @@ export class ManageUsersComponent {
color: '#da6c2e',
},
};
public buttonTypeEnum = ButtonType;
constructor(private adminService: AdminService, private notificationService: NotificationService) {
this.findValidatedJobs();
......@@ -293,6 +300,31 @@ export class ManageUsersComponent {
}
public getRowHeight(params): number {
return params.data.structures ? (params.data.structures.length != 0 ? params.data.structures.length * 40 : 40) : 40;
return params.data.structures?.length * 40 || 40;
}
public onGridReady(params: GridReadyEvent, status: UsersStatus): void {
if (status === 'attached') {
this.gridApiAttached = params.api;
} else if (status === 'unattached') {
this.gridApiUnattached = params.api;
}
}
public exportUsers(status: UsersStatus): void {
const exportParams: CsvExportParams = {
columnKeys: ['name', 'surname', 'email'],
};
if (status === 'attached') {
this.gridApiAttached.exportDataAsCsv({
...exportParams,
fileName: 'RESIN - export utilisateurs rattachés',
});
} else if (status === 'unattached') {
this.gridApiUnattached.exportDataAsCsv({
...exportParams,
fileName: 'RESIN - export utilisateurs non rattachés',
});
}
}
}
<div fxLayout="column" fxLayoutGap="20px" class="content-container full-screen">
<div fxLayout="row" fxLayoutAlign="center center"><h1>Administration</h1></div>
<div fxLayout="row" fxLayoutGap="20px" fxLayoutAlign="center center">
<button (click)="changeActiveFeature(features.pendingStructures)">Revendication structure</button>
<button (click)="changeActiveFeature(features.structuresList)">Liste structures</button>
<button (click)="changeActiveFeature(features.manageUsers)">Gestion des utilisateurs</button>
<button (click)="changeActiveFeature(features.lockdownInfo)">Gestion des infos covid</button>
<button (click)="changeActiveFeature(features.jobsList)">Fonctions</button>
<button (click)="changeActiveFeature(features.employersList)">Employeurs</button>
<app-button
[text]="'Revendication structure'"
[style]="buttonTypeEnum.Secondary"
(click)="changeActiveFeature(features.pendingStructures)"
></app-button>
<app-button
[text]="'Liste structures'"
[style]="buttonTypeEnum.Secondary"
(click)="changeActiveFeature(features.structuresList)"
></app-button>
<app-button
[text]="'Gestion des utilisateurs'"
[style]="buttonTypeEnum.Secondary"
(click)="changeActiveFeature(features.manageUsers)"
></app-button>
<app-button
[text]="'Infos covid'"
[style]="buttonTypeEnum.Secondary"
(click)="changeActiveFeature(features.lockdownInfo)"
></app-button>
<app-button
[text]="'Fonctions'"
[style]="buttonTypeEnum.Secondary"
(click)="changeActiveFeature(features.jobsList)"
></app-button>
<app-button
[text]="'Employeurs'"
[style]="buttonTypeEnum.Secondary"
(click)="changeActiveFeature(features.employersList)"
></app-button>
<a target="_blank" class="custom-link" rel="noopener noreferrer" [href]="ghostLink">Ghost</a>
</div>
<div *ngIf="selectedFeature === features.structuresList">
......
import { Component, OnInit } from '@angular/core';
import { environment } from '../../../../environments/environment';
import { ButtonType } from '../../../shared/components/button/buttonType.enum';
import { AdminPannelEnum } from '../../../shared/enum/adminPanel.enum';
import { PanelRouteService } from '../../services/panel-route.service';
@Component({
selector: 'app-admin-panel',
templateUrl: './panel.component.html',
providers: [PanelRouteService]
providers: [PanelRouteService],
})
export class PanelComponent implements OnInit {
public features = AdminPannelEnum;
public ghostLink = environment.ghostAdmin;
public selectedFeature;
public buttonTypeEnum = ButtonType;
constructor(private panelRouteService: PanelRouteService) {
this.panelRouteService.destinationChanged$.subscribe((selected: AdminPannelEnum) => {
......
......@@ -2,12 +2,7 @@
<div class="userNumber">
{{ userList.length }} utilisateur(s)<span *ngIf="showPagination"> sur {{ totalUserResult }} </span>
</div>
<div
class="singleUser"
[ngClass]="{ singleResult: userList.length == 1 }"
*ngFor="let user of userList; let index = index"
(click)="goToUser(user._id)"
>
<div class="singleUser" *ngFor="let user of userList; let index = index" (click)="goToUser(user._id)">
<div class="avatar-container">
<app-svg-icon class="avatar" [type]="'avatar'" [icon]="'defaultAvatar'" [iconClass]="'icon-40'"></app-svg-icon>
</div>
......
......@@ -19,7 +19,7 @@
.userNumber {
font-size: 0.875rem;
color: $grey-3;
margin: 1rem 0.75rem;
padding: 1rem 0.75rem;
}
&.empty {
padding-bottom: 2rem;
......@@ -91,9 +91,9 @@
.singleUser {
display: flex;
align-items: center;
gap: 0.5rem;
height: 65px;
padding: 0.75rem;
border-bottom: solid 1px $grey-8;
box-sizing: border-box;
cursor: pointer;
transition: all 300ms ease;
......@@ -104,6 +104,9 @@
&:hover {
background: $grey-8;
}
&:not(:last-child) {
border-bottom: solid 1px $grey-8;
}
.avatar-container {
width: 40px;
height: 44px;
......@@ -111,7 +114,6 @@
background: $grey-8;
}
.identity {
margin: 0 0.5rem;
max-width: 330px;
p {
margin: 0;
......@@ -128,7 +130,4 @@
color: $grey-3;
}
}
.singleResult {
border-bottom: none;
}
}
......@@ -4,7 +4,6 @@ import { AnnuaireComponent } from './annuaire/annuaire.component';
import { CartoComponent } from './carto/carto.component';
import { ContactComponent } from './contact/contact.component';
import { FooterComponent } from './footer/footer.component';
import { StructureListPrintComponent } from './form/orientation-form/component/structure-list-print/structure-list-print.component';
import { AdminGuard } from './guards/admin.guard';
import { AuthGuard } from './guards/auth.guard';
import { LegalNoticeComponent } from './legal-notice/legal-notice.component';
......@@ -15,11 +14,12 @@ import { ResetEmailComponent } from './reset-email/reset-email.component';
import { ResetPasswordComponent } from './reset-password/reset-password.component';
import { StructureResolver } from './resolvers/structure.resolver';
import { PasswordFormComponent } from './shared/components';
import { StructureListPrintComponent } from './shared/components/structure-list-print/structure-list-print.component';
import { StructureDetailsComponent } from './structure-list/components/structure-details/structure-details.component';
import { StructureListSearchPrintComponent } from './structure-list/components/structure-list-search-print/structure-list-search-print.component';
import { StructureListComponent } from './structure-list/structure-list.component';
import { StructureExcludeComponent } from './structure/structure-exclude/structure-exclude.component';
import { StructureJoinComponent } from './structure/structure-join/structure-join.component';
import { StructureListSearchPrintComponent } from './structure-list/components/structure-list-search-print/structure-list-search-print.component';
const footerOutletRoute: Route = {
path: '',
......@@ -244,7 +244,21 @@ const routes: Routes = [
},
{
path: 'orientation',
loadChildren: () => import('./form/orientation-form-view/orientation.module').then((m) => m.OrientationModule),
children: [
{
path: '',
loadChildren: () => import('./form/orientation-form-view/orientation.module').then((m) => m.OrientationModule),
},
{
path: '',
outlet: 'left-pane',
data: { fullScreen: true },
component: StructureDetailsComponent,
resolve: {
structure: StructureResolver,
},
},
],
},
{
path: 'home',
......
import { Component, OnInit } from '@angular/core';
import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router } from '@angular/router';
import {
GuardsCheckStart,
NavigationCancel,
NavigationEnd,
NavigationError,
NavigationStart,
Router,
} from '@angular/router';
import { ProfileService } from './profile/services/profile.service';
import { AuthService } from './services/auth.service';
import { RouterListenerService } from './services/routerListener.service';
......@@ -41,8 +48,12 @@ export class AppComponent implements OnInit {
break;
}
case event instanceof GuardsCheckStart:
case event instanceof NavigationEnd:
case event instanceof NavigationCancel:
case event instanceof NavigationCancel: {
this.loading = false;
break;
}
case event instanceof NavigationError: {
setTimeout(() => {
this.loading = false;
......
......@@ -13,18 +13,13 @@ import { FilterModalComponent } from './annuaire/filter-modal/filter-modal.compo
import { ResultListComponent } from './annuaire/result-list/result-list.component';
import { SearchBarComponent } from './annuaire/search-bar/search-bar.component';
import { AppComponent } from './app.component';
import { CartoComponent } from './carto/carto.component';
import { CartoModule } from './carto/carto.module';
import { CustomBreakPointsProvider } from './config/custom-breakpoint';
import { CustomHttpInterceptor } from './config/http-interceptor';
import { ContactComponent } from './contact/contact.component';
import { FooterComponent } from './footer/footer.component';
import { FormViewModule } from './form/form-view/form-view.module';
import { OrientationModule } from './form/orientation-form-view/orientation.module';
import { OrientationComponent } from './form/orientation-form/component/orientation-modal/orientation-modal.component';
import { StructureDetailPrintComponent } from './form/orientation-form/component/structure-detail-print/structure-detail-print.component';
import { StructureListPrintComponent } from './form/orientation-form/component/structure-list-print/structure-list-print.component';
import { StructurePrintHeaderComponent } from './form/orientation-form/component/structure-print-header/structure-print-header.component';
import { OrientationFormComponent } from './form/orientation-form/orientation-form.component';
import { AdminGuard } from './guards/admin.guard';
import { AuthGuard } from './guards/auth.guard';
import { DeactivateGuard } from './guards/deactivate.guard';
......@@ -43,12 +38,8 @@ import { RouterListenerService } from './services/routerListener.service';
import { UpdateService } from './services/update.service';
import { DataShareConsentComponent } from './shared/components/data-share-consent/data-share-consent.component';
import { SharedModule } from './shared/shared.module';
import { CardComponent } from './structure-list/components/card/card.component';
import { ModalFilterComponent } from './structure-list/components/modal-filter/modal-filter.component';
import { StructureDetailsComponent } from './structure-list/components/structure-details/structure-details.component';
import { StructureListSearchPrintComponent } from './structure-list/components/structure-list-search-print/structure-list-search-print.component';
import { StructureListSearchComponent } from './structure-list/components/structure-list-search/structure-list-search.component';
import { StructureListComponent } from './structure-list/structure-list.component';
import { StructureExcludeComponent } from './structure/structure-exclude/structure-exclude.component';
import { StructureJoinComponent } from './structure/structure-join/structure-join.component';
......@@ -57,11 +48,6 @@ import { StructureJoinComponent } from './structure/structure-join/structure-joi
AppComponent,
HeaderComponent,
FooterComponent,
CartoComponent,
StructureListComponent,
CardComponent,
StructureListSearchComponent,
ModalFilterComponent,
StructureDetailsComponent,
LegalNoticeComponent,
PageComponent,
......@@ -70,12 +56,7 @@ import { StructureJoinComponent } from './structure/structure-join/structure-joi
ResetPasswordComponent,
StructureJoinComponent,
NewsletterSubscriptionComponent,
OrientationFormComponent,
StructureDetailPrintComponent,
StructureListPrintComponent,
StructurePrintHeaderComponent,
DataShareConsentComponent,
OrientationComponent,
LoginComponent,
StructureExcludeComponent,
AnnuaireComponent,
......@@ -90,6 +71,7 @@ import { StructureJoinComponent } from './structure/structure-join/structure-joi
AppRoutingModule,
SharedModule,
MapModule,
CartoModule,
BrowserAnimationsModule,
ToastrModule.forRoot(),
FormViewModule,
......
<div class="content-container">
<div class="content-container" [ngClass]="{ 'height-100': isOrientationForm }">
<div class="hide-on-print">
<app-structure-list-search (searchEvent)="getStructures($event)"></app-structure-list-search>
<app-structure-list-search (searchEvent)="getStructures($event)" [filters]="filters"></app-structure-list-search>
</div>
<div class="panes-container" fxLayout="row">
<app-structure-list
(searchEvent)="getStructures($event)"
[structureList]="structures"
[isOrientation]="isOrientationForm"
[location]="currentLocation"
(displayMapMarkerId)="setMapMarkerId($event)"
(selectedMarkerId)="setSelectedMarkerId($event)"
[selectedStructure]="currentStructure"
(updatedStructure)="updateStructures($event)"
(structureSelected)="selectStructure($event)"
class="left-pane"
[ngClass]="{ mapPhone: isMapPhone == true }"
fxLayout="column"
......@@ -24,12 +26,14 @@
></app-button>
</div>
<app-map
[isOrientationForm]="isOrientationForm"
[structures]="structures"
[toogleToolTipId]="displayMarkerId"
[selectedMarkerId]="selectedMarkerId"
[structuresToPrint]="structuresSelected"
(selectedStructure)="showDetailStructure($event)"
[isMapPhone]="isMapPhone"
[searchedValue]="searchedValue"
[searchedValue]="searchedValue || userLocate"
class="right-pane"
[ngClass]="{ mapPhone: isMapPhone == true }"
></app-map>
......
......@@ -17,6 +17,10 @@
flex-direction: column;
}
.height-100 {
height: 100%;
}
.panes-container {
width: 100%;
position: relative;
......
import { Component, OnInit } from '@angular/core';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Meta } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import * as _ from 'lodash';
import { Observable } from 'rxjs';
import { GeoJson } from '../map/models/geojson.model';
import { ProfileService } from '../profile/services/profile.service';
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';
import { ButtonType } from '../shared/components/button/buttonType.enum';
import { Filter } from '../structure-list/models/filter.model';
import { CustomRegExp } from '../utils/CustomRegExp';
import { Observable } from 'rxjs';
@Component({
selector: 'app-carto',
......@@ -18,17 +18,22 @@ import { Observable } from 'rxjs';
styleUrls: ['./carto.component.scss'],
})
export class CartoComponent implements OnInit {
public filters: Filter[] = [];
@Input() public isOrientationForm = false;
@Input() public filters: Filter[] = [];
@Input() public userLatitude: number = null;
@Input() public userLongitude: number = null;
@Output() structureSelection = new EventEmitter<any>();
public structures: Structure[] = [];
public structuresSelected: Structure[] = [];
public currentLocation: GeoJson;
public displayMarkerId: string;
public selectedMarkerId: string;
public geolocation = false;
public currentLocation: GeoJson;
public currentStructure: Structure;
public userLatitude: number;
public userLongitude: number;
public isMapPhone = false;
public searchedValue = null;
public userLocate = null;
public buttonTypeEnum = ButtonType;
constructor(
......@@ -41,10 +46,14 @@ export class CartoComponent implements OnInit {
ngOnInit(): void {
if (!this.activatedRoute.snapshot.queryParamMap.get('search')) {
// Set user location if provided
if (this.userLatitude && this.userLongitude) {
this.userLocate = [this.userLongitude, this.userLatitude];
}
if (navigator.geolocation) {
this.getLocation();
this.getLocation(this.filters);
} else {
this.getStructures(null);
this.getStructures(this.filters);
}
}
......@@ -166,18 +175,20 @@ export class CartoComponent implements OnInit {
return structure;
}
public getLocation(): void {
public getLocation(filters: Filter[]): void {
navigator.geolocation.getCurrentPosition(
(position) => {
this.geolocation = true;
this.userLongitude = position.coords.longitude;
this.userLatitude = position.coords.latitude;
if (!this.userLongitude && !this.userLatitude) {
this.userLongitude = position.coords.longitude;
this.userLatitude = position.coords.latitude;
}
this.getAddress(position.coords.longitude, position.coords.latitude);
this.getStructures(null);
this.getStructures(filters);
},
(err) => {
if (err.PERMISSION_DENIED) {
this.getStructures(null);
this.getStructures(filters);
}
}
);
......@@ -222,4 +233,9 @@ export class CartoComponent implements OnInit {
public isClaimed(structure: Structure): Observable<boolean> {
return this.structureService.isClaimed(structure._id, null);
}
public selectStructure(structures: Structure[]): void {
this.structuresSelected = structures;
this.structureSelection.emit(this.structuresSelected);
}
}
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MapModule } from '../map/map.module';
import { SharedModule } from '../shared/shared.module';
import { CardComponent } from '../structure-list/components/card/card.component';
import { ModalFilterComponent } from '../structure-list/components/modal-filter/modal-filter.component';
import { StructureListSearchComponent } from '../structure-list/components/structure-list-search/structure-list-search.component';
import { StructureListComponent } from '../structure-list/structure-list.component';
import { CartoComponent } from './carto.component';
@NgModule({
imports: [CommonModule, SharedModule, MapModule],
declarations: [
CartoComponent,
CardComponent,
ModalFilterComponent,
StructureListComponent,
StructureListSearchComponent,
],
exports: [CartoComponent, CardComponent, ModalFilterComponent, StructureListComponent, StructureListSearchComponent],
})
export class CartoModule {}
......@@ -46,7 +46,6 @@ export class FooterFormComponent implements OnChanges {
private authService: AuthService,
public utils: Utils,
private router: Router,
private profileService: ProfileService,
private newsletterService: NewsletterService
) {}
public goToNextPage(): void {
......@@ -96,13 +95,6 @@ export class FooterFormComponent implements OnChanges {
return this.form.value.categories.baseSkills.length > 0 || this.form.value.categories.advancedSkills.length > 0;
}
/**
* Check if trainings are selected in order to ask for pricing
*/
public isOtherAccompanimentSelected(): boolean {
return this.form.value.categories?.onlineProcedures.find((el) => el === 'autres') ? true : false;
}
public prevPage(): void {
if (!this.isEditMode && this.currentForm === formType.structure) {
if (this.currentStep === structureFormStep.structureType) {
......@@ -118,7 +110,7 @@ export class FooterFormComponent implements OnChanges {
return;
}
if (this.currentStep === structureFormStep.structureTrainingType) {
if (this.isOtherAccompanimentSelected()) {
if (this.utils.isOtherAccompanimentSelected(this.form)) {
this.changeCurrentStep.emit(structureFormStep.structureDigitalHelpingAccompanimentOther);
} else {
this.changeCurrentStep.emit(structureFormStep.structureDigitalHelpingAccompaniment);
......@@ -177,7 +169,7 @@ export class FooterFormComponent implements OnChanges {
}
// Check if trainings are selected in order to ask for pricing
if (this.currentStep === structureFormStep.structureDigitalHelpingAccompaniment) {
if (this.isOtherAccompanimentSelected()) {
if (this.utils.isOtherAccompanimentSelected(this.form)) {
this.changeCurrentStep.emit(structureFormStep.structureDigitalHelpingAccompanimentOther);
} else {
this.changeCurrentStep.emit(structureFormStep.structureTrainingType);
......
......@@ -14,7 +14,7 @@
max-width: 980px;
width: 100%;
height: 100%;
margin: 1rem auto;
margin: 0 auto;
overflow-y: auto;
color: $grey-1;
background: $white;
......