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