diff --git a/.vscode/settings.json b/.vscode/settings.json index 7a19f79ba23a5cd23cd8d4327c432f4c3f17c5c4..9d9d0008571126ab6d3272aca9e7bbe804a19403 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,8 @@ "eslint.enable": true, "javascript.format.enable": false, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": true, + "source.organizeImports": true }, "[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" @@ -26,5 +27,21 @@ "i18n-ally.keystyle": "nested", "i18n-ally.enabledFrameworks": "ngx-translate", "typescript.preferences.importModuleSpecifier": "relative", - "cSpell.words": ["covid", "onespace", "Rés'in", "toastr"] + "cSpell.words": [ + "covid", + "facebook", + "instagram", + "linkedin", + "onespace", + "Rés'in", + "toastr", + "ultrawide", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday" + ] } diff --git a/src/app/form/footer-form/footer-form.component.html b/src/app/form/footer-form/footer-form.component.html index 598ff4b927633f8f441c016f96118a13a1470d95..9faffe7cf3a4b24e36c758a02d24875b2de74eb7 100644 --- a/src/app/form/footer-form/footer-form.component.html +++ b/src/app/form/footer-form/footer-form.component.html @@ -1,10 +1,4 @@ -<div - class="footerForm" - fxLayout="row" - [ngClass]="{ column: hasFinishButton() }" - fxLayoutGap="10px" - fxLayoutAlign="center center" -> +<div class="footerForm" [ngClass]="{ column: hasFinishButton() }"> <app-button *ngIf="!isLastFormStep && !isNextFormTransition && !isStructureLastPage() && !isPersonalOfferFirstPage()" (action)="prevPage()" diff --git a/src/app/form/footer-form/footer-form.component.scss b/src/app/form/footer-form/footer-form.component.scss index 511b53de235a894ccab6e6d395fdd14478f240fc..7caaffa4fb1e70a9375588c6def075046d3896cd 100644 --- a/src/app/form/footer-form/footer-form.component.scss +++ b/src/app/form/footer-form/footer-form.component.scss @@ -3,6 +3,9 @@ @import '../../../assets/scss/breakpoint'; .footerForm { + display: flex; + justify-content: center; + gap: 1rem; padding: 20px 0; } diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index b68828603c77ba9a0f93f915b856302b61198322..0de5140bde1760f528233fe0dd54cc863b0370ae 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -538,7 +538,7 @@ export class FormViewComponent implements OnInit, AfterViewInit { } public canExit(): Promise<boolean> { - // List all exit pages in order to authorise exit + // List all exit pages in order to authorize exit const exitPages: stepType[] = this.setExitPages(); // Avoid confirmation when user submit form and leave. if ( diff --git a/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts b/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts index fed97c1604fdb9190c175cadf3e480f1d309345f..70738dac28e969cb85cfb394ab67b6bc0b33a02e 100644 --- a/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts +++ b/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts @@ -1,4 +1,3 @@ -import { ThisReceiver } from '@angular/compiler'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { Address } from '../../../../models/address.model'; diff --git a/src/app/form/orientation-form-view/online-demarch/mediation-language-selection/mediation-language-selection.component.scss b/src/app/form/orientation-form-view/online-demarch/mediation-language-selection/mediation-language-selection.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/app/form/orientation-form-view/online-demarch/mediation-language-selection/mediation-language-selection.component.ts b/src/app/form/orientation-form-view/online-demarch/mediation-language-selection/mediation-language-selection.component.ts index 9b320ff541844c980f5eb6d0837cca1adcc77ae5..f68b86d00406008cdd362106afe1c23d6894eac4 100644 --- a/src/app/form/orientation-form-view/online-demarch/mediation-language-selection/mediation-language-selection.component.ts +++ b/src/app/form/orientation-form-view/online-demarch/mediation-language-selection/mediation-language-selection.component.ts @@ -5,7 +5,6 @@ import { PreferredLanguages } from '../../enums/preferredLanguages.enum'; @Component({ selector: 'app-mediation-language-selection', templateUrl: './mediation-language-selection.component.html', - styleUrls: ['./mediation-language-selection.component.scss'], }) export class MediationLanguageSelectionComponent implements OnInit { @Input() form: UntypedFormGroup; diff --git a/src/app/form/orientation-form-view/online-demarch/meeting-rdvs/meeting-rdvs-doing/meeting-rdvs-doing.component.ts b/src/app/form/orientation-form-view/online-demarch/meeting-rdvs/meeting-rdvs-doing/meeting-rdvs-doing.component.ts index 07d1bdf96f14e51af6af5b3f8e9f2d0024ad629d..7a80719f930331716e075e0773ceb4206e87c3be 100644 --- a/src/app/form/orientation-form-view/online-demarch/meeting-rdvs/meeting-rdvs-doing/meeting-rdvs-doing.component.ts +++ b/src/app/form/orientation-form-view/online-demarch/meeting-rdvs/meeting-rdvs-doing/meeting-rdvs-doing.component.ts @@ -1,12 +1,11 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { Structure } from '../../../../../models/structure.model'; +import { GeojsonService } from '../../../../../services/geojson.service'; import { NotificationService } from '../../../../../services/notification.service'; import { RdvsService } from '../../../../../services/rdvs.service'; import { StructureService } from '../../../../../services/structure.service'; import { Filter } from '../../../../../structure-list/models/filter.model'; -import * as _ from 'lodash'; -import { GeojsonService } from '../../../../../services/geojson.service'; @Component({ selector: 'app-meeting-rdvs-doing', diff --git a/src/app/profile/profile-structure/personal-offer/personal-offer.component.ts b/src/app/profile/profile-structure/personal-offer/personal-offer.component.ts index 20ae4e006186844c34b107db6a8934db1c524692..236d48483707fd23249c5e38d8df2a7e985c7df3 100644 --- a/src/app/profile/profile-structure/personal-offer/personal-offer.component.ts +++ b/src/app/profile/profile-structure/personal-offer/personal-offer.component.ts @@ -1,5 +1,5 @@ import { animate, AUTO_STYLE, state, style, transition, trigger } from '@angular/animations'; -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { ButtonType } from '../../../shared/components/button/buttonType.enum'; import { PersonalOffer } from './../../../models/personalOffer.model'; diff --git a/src/app/profile/profile-structure/profile-structure-member/profile-structure-member.component.ts b/src/app/profile/profile-structure/profile-structure-member/profile-structure-member.component.ts index 7e49f99ef1f59ebb8eab6238d4b9bdb241eeb3e6..b476c18c5f29462fc39be057244a6647cab12f46 100644 --- a/src/app/profile/profile-structure/profile-structure-member/profile-structure-member.component.ts +++ b/src/app/profile/profile-structure/profile-structure-member/profile-structure-member.component.ts @@ -4,13 +4,11 @@ import { User } from '../../../models/user.model'; @Component({ selector: 'app-profile-structure-member', templateUrl: './profile-structure-member.component.html', - styleUrls: ['./profile-structure-member.component.scss'] + styleUrls: ['./profile-structure-member.component.scss'], }) export class ProfileStructureMemberComponent { @Input() public member: User; - constructor() {} - getJobEmployer(): string { if (this.member.job?.name && this.member.employer?.name) { return this.member.job.name + ', ' + this.member.employer.name; diff --git a/src/app/shared/components/button/button.component.scss b/src/app/shared/components/button/button.component.scss index cdcb6ce1bd10de1947eb0e26d17cdb12eb189194..4b722ed01a7a9b9da57f146162b640440e2132bf 100644 --- a/src/app/shared/components/button/button.component.scss +++ b/src/app/shared/components/button/button.component.scss @@ -146,24 +146,6 @@ button { .small-text { height: 22px !important; } - &.wide { - div:first-child { - min-width: 50px; - width: 184px; - } - } - &.ultrawide { - div:first-child { - min-width: 50px; - width: 400px; - @media #{$tablet} { - width: 200px; - } - span { - padding-inline: 4px; - } - } - } } &.tertiary { div:first-child { diff --git a/src/app/shared/components/data-share-consent/data-share-consent.component.ts b/src/app/shared/components/data-share-consent/data-share-consent.component.ts index 476e73811b784474c3f3b39996365c8635f5dbaf..e7bfa2b06579435269c769b7f75310b7d7134e29 100644 --- a/src/app/shared/components/data-share-consent/data-share-consent.component.ts +++ b/src/app/shared/components/data-share-consent/data-share-consent.component.ts @@ -18,12 +18,12 @@ export class DataShareConsentComponent implements OnInit { constructor(private structureService: StructureService) {} - @Input() public openned: boolean = true; + @Input() public openned = true; @Input() public dataConsentPendingStructures: Structure[]; ngOnInit() { this.consentForm = new UntypedFormGroup({}); - for (let structure of this.dataConsentPendingStructures) { + for (const structure of this.dataConsentPendingStructures) { this.consentForm.addControl( structure._id, new UntypedFormControl(structure.dataShareConsentDate, [Validators.required]) @@ -36,14 +36,13 @@ export class DataShareConsentComponent implements OnInit { } public getPendingStructure(id: string): Structure { - var result = this.dataConsentPendingStructures.filter(function (o) { - return o._id == id; - }); - return result ? result[0] : null; + const result = this.dataConsentPendingStructures.filter((structure) => structure._id == id); + return result?.[0] || null; + // return result ? result[0] : null; } public onRadioBtnChangeAll(bool: boolean): void { - for (let structure of this.dataConsentPendingStructures) { + for (const structure of this.dataConsentPendingStructures) { structure.dataShareConsentDate = bool ? new Date().toString() : null; this.getFormControl(structure._id).setValue(bool); } @@ -57,7 +56,7 @@ export class DataShareConsentComponent implements OnInit { // select or unselect "all structures" radio button let isAllYes: boolean = true; let isAllNo: boolean = true; - for (let structure of this.dataConsentPendingStructures) { + for (const structure of this.dataConsentPendingStructures) { isAllYes = isAllYes && this.getFormControl(structure._id).value === true; isAllNo = isAllNo && this.getFormControl(structure._id).value === false; } @@ -68,7 +67,7 @@ export class DataShareConsentComponent implements OnInit { public setValidationsForm(): void { let isPageValid: boolean = true; - for (let structure of this.dataConsentPendingStructures) { + for (const structure of this.dataConsentPendingStructures) { isPageValid = isPageValid && this.getFormControl(structure._id).valid; } this.isPageValid = isPageValid; @@ -77,7 +76,7 @@ export class DataShareConsentComponent implements OnInit { public onSubmit(): void { this.submitted = true; this.loading = true; - for (let structure of this.dataConsentPendingStructures) { + for (const structure of this.dataConsentPendingStructures) { this.structureService .editStructure( { diff --git a/src/app/shared/components/hour-picker/hour-picker.component.ts b/src/app/shared/components/hour-picker/hour-picker.component.ts index 40b8366424ec6bae9a82d68e48c89463ae36a6ee..712a749b90afd589e0955c0288b070f073399da0 100644 --- a/src/app/shared/components/hour-picker/hour-picker.component.ts +++ b/src/app/shared/components/hour-picker/hour-picker.component.ts @@ -2,9 +2,9 @@ import { Component, EventEmitter, Input, OnChanges, OnDestroy, Output } from '@a import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { Day } from '../../../models/day.model'; import { Time } from '../../../models/time.model'; -import { ButtonType } from '../button/buttonType.enum'; import { WeekDayEnum } from '../../enum/weekDay.enum'; import { CheckHours } from '../../validator/form'; +import { ButtonType } from '../button/buttonType.enum'; @Component({ selector: 'app-hour-picker', @@ -169,7 +169,6 @@ export class HourPickerComponent implements OnChanges, OnDestroy { this.parseFormToHours(this.getStructureControl('saturday').value, WeekDayEnum.saturday); this.parseFormToHours(this.getStructureControl('sunday').value, WeekDayEnum.sunday); } - // this.structure.hours = this.structureHoursDefault; } /** diff --git a/src/styles.scss b/src/styles.scss index 548f930e2e1bf1dd64a9479fa2c162d00417ad8e..751218bd52203ed747e979df002fe35518ce1307 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -399,17 +399,15 @@ button { min-width: 0; } } - .blockLigne li { - &:last-child { - margin-bottom: 0; - } - } .blockLigne { padding-left: 0; margin: 0px; padding-bottom: 0.5rem; li { margin-bottom: 1rem; + &:last-child { + margin-bottom: 0; + } } } label { diff --git a/tslint.json b/tslint.json index 6bc1948c3191a79159ad0084aa219c748ed7c5ca..b89375a854cd97610ced1f310323a3ae91e4ea0c 100644 --- a/tslint.json +++ b/tslint.json @@ -87,6 +87,7 @@ "use-lifecycle-interface": true, "use-pipe-transform-interface": true, "directive-selector": [true, "attribute", "app", "camelCase"], - "component-selector": [true, "element", "app", "kebab-case"] + "component-selector": [true, "element", "app", "kebab-case"], + "unnecessary-constructor": true } }