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 (10)
Showing
with 69 additions and 50 deletions
{
"printWidth": 120,
"singleQuote": true,
"useTabs": false,
"printWidth": 128,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"bracketSpacing": true
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "always",
"requirePragma": false,
"insertPragma": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "ignore",
"vueIndentScriptAndStyle": false,
"endOfLine": "lf",
"embeddedLanguageFormatting": "auto"
}
......@@ -36,7 +36,7 @@ export class ClaimStructureComponent implements OnInit {
});
}
public claimedStructure(event: boolean): void {
public claimedStructure(_event: boolean): void {
this.isClaimedStructure = !this.isClaimedStructure;
}
}
......@@ -18,7 +18,7 @@ export class ManageEmployersComponent implements OnInit {
public validatedEmployers: Employer[] = [];
public unvalidatedEmployers: Employer[] = [];
public deleteModalOpenned = false;
public validatedEmployersName: String[] = [];
public validatedEmployersName: string[] = [];
public mergeEmployerModalOpenned = false;
public employerToDelete: Employer = null;
public mergeOpe: any = {
......@@ -209,8 +209,8 @@ export class ManageEmployersComponent implements OnInit {
}
}
public validateEmployer(employerId: string, context?): void {
this.adminService.validateEmployer(employerId).subscribe((data) => {
public validateEmployer(employerId: string, _context?): void {
this.adminService.validateEmployer(employerId).subscribe((_data) => {
this.findValidatedEmployers();
this.findUnvalidatedEmployers();
});
......
......@@ -20,7 +20,7 @@ export class ManageJobsComponent implements OnInit {
public validatedJobs: Job[] = [];
public unvalidatedJobs: Job[] = [];
public deleteModalOpenned = false;
public validatedJobsName: String[] = [];
public validatedJobsName: string[] = [];
public mergeJobModalOpenned = false;
public jobToDelete: Job = null;
public mergeOpe: any = {
......@@ -246,8 +246,8 @@ export class ManageJobsComponent implements OnInit {
}
}
public validateJob(jobId: string, context?): void {
this.adminService.validateJob(jobId).subscribe((data) => {
public validateJob(jobId: string, _context?): void {
this.adminService.validateJob(jobId).subscribe((_data) => {
this.findValidatedJobs();
this.findUnvalidatedJobs();
});
......
......@@ -18,9 +18,9 @@ export class ManageUsersComponent {
public attachedUsers: User[] = [];
public unAttachedUsers: User[] = [];
public unVerifiedUsers: User[] = [];
public validatedJobsName: String[] = [];
public validatedJobsName: string[] = [];
public validatedJobs: Job[] = [];
public validatedEmployersName: String[] = [];
public validatedEmployersName: string[] = [];
public validatedEmployers: Employer[] = [];
public deleteModalOpenned = false;
public editJobModalOpenned = false;
......
......@@ -34,7 +34,7 @@ export class NewsletterUsersComponent {
public unsubscribeEmail(email: string, shouldUnsubscribe: boolean): void {
this.toggleUnsubscribeModal(email);
if (shouldUnsubscribe) {
this.adminService.unsubscribeEmail(email).subscribe((data) => {
this.adminService.unsubscribeEmail(email).subscribe((_data) => {
this.subscriptions = this.subscriptions.filter((obj) => obj.email !== email);
this.subscriptionsCount = this.subscriptions.length;
});
......
......@@ -33,7 +33,7 @@ describe('HomeComponent', () => {
it('getAddress(): should getAddress', () => {
spyOn(navigator.geolocation, 'getCurrentPosition').and.callFake(() => {
const position = {
return {
coords: {
accuracy: 1490,
altitude: null,
......@@ -44,7 +44,6 @@ describe('HomeComponent', () => {
speed: null,
},
};
return position;
});
component.getLocation();
expect(navigator.geolocation.getCurrentPosition).toHaveBeenCalled();
......
......@@ -116,7 +116,9 @@ export class CartoComponent implements OnInit {
structures.map(async (structure) => {
if (this.geolocation) {
structure = this.getStructurePosition(structure, lon, lat);
structure.isClaimed = await this.isClaimed(structure).toPromise();
if (this.isAdmin) {
structure.isClaimed = await this.isClaimed(structure).toPromise();
}
}
return structure;
})
......
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
import { HttpInterceptor } from '@angular/common/http';
import { HttpRequest } from '@angular/common/http';
import { HttpHandler } from '@angular/common/http';
import { HttpEvent } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';
import { HttpInterceptor, HttpHandler, HttpEvent, HttpRequest, HttpHeaders } from '@angular/common/http';
import { AuthService } from '../services/auth.service';
@Injectable()
......
......@@ -10,7 +10,7 @@ export class AccountNewsletterComponent {
@Input() accountForm: FormGroup;
@Input() profile: User;
@Output() acceptNewsletter = new EventEmitter<any>();
public userAcceptNewsletter: Boolean = false;
public userAcceptNewsletter: boolean = false;
public acceptReceiveNewsletter(accepts: boolean) {
this.acceptNewsletter.emit(accepts);
......
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AdminGuard } from '../../guards/admin.guard';
import { AuthGuard } from '../../guards/auth.guard';
import { RoleGuard } from '../../guards/role.guard';
import { StructureResolver } from '../../resolvers/structure.resolver';
......
......@@ -19,6 +19,8 @@ import { personalOfferFormStep } from './personal-offer-form/personalOfferFormSt
import { profileFormStep } from './profile-form/profileFormStep.enum';
import { structureFormStep } from './structure-form/structureFormStep.enum';
type stepType = accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep;
@Component({
selector: 'app-form-view',
templateUrl: './form-view.component.html',
......@@ -27,7 +29,7 @@ import { structureFormStep } from './structure-form/structureFormStep.enum';
export class FormViewComponent implements OnInit {
public routeParam: string;
public formType = formType;
public currentPage: accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep;
public currentPage: stepType;
public currentFormType: formType;
public currentForm: FormGroup;
public formUtils = new formUtils();
......@@ -261,10 +263,7 @@ export class FormViewComponent implements OnInit {
});
}
public async endForm(type: {
formType: formType;
formStep?: accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep;
}): Promise<void> {
public async endForm(type: { formType: formType; formStep?: stepType }): Promise<void> {
switch (type.formType) {
case formType.account:
break;
......@@ -308,17 +307,17 @@ export class FormViewComponent implements OnInit {
forkJoin({
employer: this.profileService.createEmployer(this.profileForm.get('employer').value).pipe(
map((res) => res),
catchError((e) => of(this.profileForm.get('employer').value))
catchError((_e) => of(this.profileForm.get('employer').value))
),
job: this.profileService.createJob(this.profileForm.get('job').value).pipe(
map((res) => res),
catchError((e) => of(this.profileForm.get('job').value))
catchError((_e) => of(this.profileForm.get('job').value))
),
profile: this.profileService
.updateProfile(this.profileForm.get('employer').value.name, this.profileForm.get('job').value.name)
.pipe(
map((res) => res),
catchError((e) => of())
catchError((_e) => of())
),
}).subscribe(() => {
this.router.navigateByUrl('form/structure');
......@@ -345,7 +344,7 @@ export class FormViewComponent implements OnInit {
}
});
}
public setCurrentStep(step: accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep): void {
public setCurrentStep(step: stepType): void {
//THIS PROBABLY CREATES CONSOLE ERRORS NG100 only in dev mode, please refer to https://angular.io/errors/NG0100 for more info
this.currentPage = step;
}
......
......@@ -5,7 +5,6 @@ import { Category } from '@gouvfr-anct/mediation-numerique';
@Component({
selector: 'app-personal-offer-training-type',
templateUrl: './personal-offer-training-type.component.html',
styleUrls: ['./personal-offer-training-type.component.scss'],
})
export class PersonalOfferTrainingTypeComponent {
@Input() structureName: string;
......
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { FormGroup } from '@angular/forms';
@Component({
......
......@@ -19,22 +19,17 @@
<span>Il faut renseigner tous les champs</span>
</p>
<div class="form-group" fxLayout="column">
<label for="contactPhone">Téléphone de la structure</label>
<label for="structureName">Email de la structure</label>
<div fxLayout="row" fxLayoutGap="13px">
<input
type="text"
formControlName="contactPhone"
class="form-input"
(input)="utils.modifyPhoneInput(structureForm, 'contactPhone', $event.target.value); setValidationsForm()"
/>
<input type="text" (input)="setValidationsForm()" formControlName="contactMail" class="form-input" />
<app-svg-icon
*ngIf="structureForm.get('contactPhone').valid"
*ngIf="structureForm.get('contactMail').valid"
[iconClass]="'icon-26'"
[type]="'form'"
[icon]="'validate'"
></app-svg-icon>
<app-svg-icon
*ngIf="structureForm.get('contactPhone').invalid && structureForm.get('contactPhone').value"
*ngIf="structureForm.get('contactMail').invalid && structureForm.get('contactMail').value !== null"
[iconClass]="'icon-26'"
[type]="'form'"
[icon]="'notValidate'"
......@@ -42,17 +37,25 @@
</div>
</div>
<div class="form-group" fxLayout="column">
<label for="structureName">Email de la structure</label>
<div fxLayout="row" fxLayoutGap="8px">
<label for="contactPhone">Téléphone de la structure</label>
<label class="label-optional">(Facultatif)</label>
</div>
<div fxLayout="row" fxLayoutGap="13px">
<input type="text" (input)="setValidationsForm()" formControlName="contactMail" class="form-input" />
<input
type="text"
formControlName="contactPhone"
class="form-input"
(input)="utils.modifyPhoneInput(structureForm, 'contactPhone', $event.target.value); setValidationsForm()"
/>
<app-svg-icon
*ngIf="structureForm.get('contactMail').valid"
*ngIf="structureForm.get('contactPhone').valid && structureForm.get('contactPhone').value"
[iconClass]="'icon-26'"
[type]="'form'"
[icon]="'validate'"
></app-svg-icon>
<app-svg-icon
*ngIf="structureForm.get('contactMail').invalid && structureForm.get('contactMail').value !== null"
*ngIf="structureForm.get('contactPhone').invalid && structureForm.get('contactPhone').value"
[iconClass]="'icon-26'"
[type]="'form'"
[icon]="'notValidate'"
......
@import './../../../../../assets/scss/color';
@import './../../../../../assets/scss/typography';
.label-optional {
color: $grey-3;
@include lato-regular-14;
font-style: italic;
margin-top: 2px;
}
......@@ -5,6 +5,7 @@ import { Utils } from '../../../../utils/utils';
@Component({
selector: 'app-structure-contact',
templateUrl: './structure-contact.component.html',
styleUrls: ['./structure-contact.component.scss'],
})
export class StructureContactComponent implements OnInit {
@Input() structureForm: FormGroup;
......
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input } from '@angular/core';
import { AbstractControl, FormGroup } from '@angular/forms';
@Component({
......
......@@ -26,7 +26,7 @@
<div class="textareaBlock" fxLayout="column">
<textarea
rows="8"
placeholder="Exemple : nous ne sommes ouvert que le 1er mercredi du mois."
placeholder="Exemple : nous ne sommes ouverts que le 1er mercredi du mois."
maxlength="500"
formControlName="exceptionalClosures"
></textarea>
......