From e141d705703a4a6d2d785164cffd1752365c7a2d Mon Sep 17 00:00:00 2001 From: Etienne LOUPIAS <eloupias@grandlyon.com> Date: Tue, 3 Jan 2023 16:18:25 +0100 Subject: [PATCH 1/2] feat(structure): remove useless completion question in structure creation tunnel --- .../form/footer-form/footer-form.component.ts | 7 ------ src/app/form/form-view/form-view.module.ts | 4 +-- ...structure-choice-completion.component.html | 11 -------- ...ucture-choice-completion.component.spec.ts | 25 ------------------- .../structure-choice-completion.component.ts | 24 ------------------ .../structure-form.component.html | 8 ------ .../structure-form.component.ts | 3 --- .../structure-form/structureFormStep.enum.ts | 1 - src/app/utils/formUtils.ts | 6 ----- 9 files changed, 1 insertion(+), 88 deletions(-) delete mode 100644 src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.html delete mode 100644 src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.spec.ts delete mode 100644 src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.ts diff --git a/src/app/form/footer-form/footer-form.component.ts b/src/app/form/footer-form/footer-form.component.ts index 60e8f5f3e..6f1237635 100644 --- a/src/app/form/footer-form/footer-form.component.ts +++ b/src/app/form/footer-form/footer-form.component.ts @@ -142,13 +142,6 @@ export class FooterFormComponent implements OnChanges { return; } if (this.currentForm === formType.structure) { - if (this.currentStep === structureFormStep.structureChoiceCompletion) { - const chooseCompleteStructInfo = this.form.get('choiceCompletion').value; - if (!chooseCompleteStructInfo) { - this.changeCurrentStep.emit(structureFormStep.StructureInfoUnknown); - return; - } - } if (this.currentStep === structureFormStep.structureAccompanimentChoice) { const hasPlaceOfReception = this.form.get('placeOfReception').value; if (!hasPlaceOfReception) { diff --git a/src/app/form/form-view/form-view.module.ts b/src/app/form/form-view/form-view.module.ts index 4bb05cce3..90f4f5a4c 100644 --- a/src/app/form/form-view/form-view.module.ts +++ b/src/app/form/form-view/form-view.module.ts @@ -19,7 +19,6 @@ import { ProfileJobSelectionComponent } from './profile-form/profile-job-selecti import { ProfileStructureChoiceComponent } from './profile-form/profile-structure-choice/profile-structure-choice.component'; import { StructureAccessModalityComponent } from './structure-form/structure-access-modality/structure-access-modality.component'; import { StructureAccompanimentChoiceComponent } from './structure-form/structure-accompaniment-choice/structure-accompaniment-choice.component'; -import { StructureChoiceCompletionComponent } from './structure-form/structure-choice-completion/structure-choice-completion.component'; import { StructureConsentComponent } from './structure-form/structure-consent/structure-consent.component'; import { StructureContactCompletionComponent } from './structure-form/structure-contact-completion/structure-contact-completion.component'; import { StructureContactComponent } from './structure-form/structure-contact/structure-contact.component'; @@ -32,12 +31,12 @@ import { StructureHoursComponent } from './structure-form/structure-hours/struct import { StructureLabelsComponent } from './structure-form/structure-labels/structure-labels.component'; import { StructureNameAndAddressComponent } from './structure-form/structure-name-and-address/structure-name-and-address.component'; import { structureDigitalHelpingAccompanimentOtherComponent } from './structure-form/structure-public-target-other/structure-public-target-other.component'; +import { StructureSolidarityMaterialComponent } from './structure-form/structure-solidarity-material/structure-solidarity-material.component'; import { StructureTrainingPriceComponent } from './structure-form/structure-training-price/structure-training-price.component'; import { StructureTrainingTypeComponent } from './structure-form/structure-training-type/structure-training-type.component'; import { StructureTypeComponent } from './structure-form/structure-type/structure-type.component'; import { StructureWebAndSocialNetworkComponent } from './structure-form/structure-web-and-social-network/structure-web-and-social-network.component'; import { StructureWifiComponent } from './structure-form/structure-wifi/structure-wifi.component'; -import { StructureSolidarityMaterialComponent } from './structure-form/structure-solidarity-material/structure-solidarity-material.component'; @NgModule({ declarations: [ @@ -55,7 +54,6 @@ import { StructureSolidarityMaterialComponent } from './structure-form/structure StructureNameAndAddressComponent, StructureContactComponent, StructureAccompanimentChoiceComponent, - StructureChoiceCompletionComponent, StructureContactCompletionComponent, StructureAccessModalityComponent, StructureHoursComponent, diff --git a/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.html b/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.html deleted file mode 100644 index 42a147472..000000000 --- a/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.html +++ /dev/null @@ -1,11 +0,0 @@ -<form [formGroup]="structureForm" *ngIf="structureForm" (keyup.enter)="isPageValid && !isEditMode ? nextPage() : null"> - <div class="title"> - <h3>Souhaitez-vous renseigner les informations de la structure ?</h3> - <p>Exemple : type d'établissement, accessibilité PMR, type de public ?</p> - </div> - <app-radio-form - [selectedOption]="structureForm.get('choiceCompletion').value" - (selectedEvent)="onRadioChange('choiceCompletion', $event)" - > - </app-radio-form> -</form> diff --git a/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.spec.ts b/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.spec.ts deleted file mode 100644 index cd0a35a36..000000000 --- a/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { StructureChoiceCompletionComponent } from './structure-choice-completion.component'; - -describe('StructureChoiceCompletionComponent', () => { - let component: StructureChoiceCompletionComponent; - let fixture: ComponentFixture<StructureChoiceCompletionComponent>; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ StructureChoiceCompletionComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(StructureChoiceCompletionComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.ts b/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.ts deleted file mode 100644 index 9b6bac48f..000000000 --- a/src/app/form/form-view/structure-form/structure-choice-completion/structure-choice-completion.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; - -@Component({ - selector: 'app-structure-choice-completion', - templateUrl: './structure-choice-completion.component.html', -}) -export class StructureChoiceCompletionComponent { - @Input() structureForm: UntypedFormGroup; - @Input() isEditMode: boolean; - @Output() radioChange = new EventEmitter<any>(); - @Output() validateForm = new EventEmitter<any>(); - - ngOnInit(): void { - this.validateForm.emit(); - } - - public onRadioChange(name: string, value: boolean): void { - this.radioChange.emit({ name, value }); - } - public goBack(): void { - history.back(); - } -} diff --git a/src/app/form/form-view/structure-form/structure-form.component.html b/src/app/form/form-view/structure-form/structure-form.component.html index 847438c3c..61507d139 100644 --- a/src/app/form/form-view/structure-form/structure-form.component.html +++ b/src/app/form/form-view/structure-form/structure-form.component.html @@ -47,14 +47,6 @@ (radioChange)="onRadioChange($event)" ></app-structure-accompaniment-choice> </div> - <div *ngIf="currentStep == structureFormStep.structureChoiceCompletion"> - <app-structure-choice-completion - [isEditMode]="isEditMode" - [structureForm]="structureForm" - (validateForm)="setValidationsForm()" - (radioChange)="onRadioChange($event)" - ></app-structure-choice-completion> - </div> <div *ngIf="currentStep == structureFormStep.structureContactCompletion"> <app-structure-contact-completion [isEditMode]="isEditMode" diff --git a/src/app/form/form-view/structure-form/structure-form.component.ts b/src/app/form/form-view/structure-form/structure-form.component.ts index f5b0c3964..e3f5d5d1d 100644 --- a/src/app/form/form-view/structure-form/structure-form.component.ts +++ b/src/app/form/form-view/structure-form/structure-form.component.ts @@ -162,9 +162,6 @@ export class StructureFormComponent implements OnChanges, OnInit { this.pagesValidation[structureFormStep.structureAccompanimentChoice] = { valid: this.structureForm.get('placeOfReception').valid, }; - this.pagesValidation[structureFormStep.structureChoiceCompletion] = { - valid: this.isEditMode ? true : this.structureForm.get('choiceCompletion').valid, - }; this.pagesValidation[structureFormStep.structureContactCompletion] = { valid: this.isEditMode ? true diff --git a/src/app/form/form-view/structure-form/structureFormStep.enum.ts b/src/app/form/form-view/structure-form/structureFormStep.enum.ts index 5e1ce4ffb..0e9211440 100644 --- a/src/app/form/form-view/structure-form/structureFormStep.enum.ts +++ b/src/app/form/form-view/structure-form/structureFormStep.enum.ts @@ -3,7 +3,6 @@ export enum structureFormStep { structureAccompanimentChoice, structureNameAndAddress, structureContact, - structureChoiceCompletion, structureFormTime, structureContactCompletion, structureType, diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts index 9efa1ed23..df9cf117a 100644 --- a/src/app/utils/formUtils.ts +++ b/src/app/utils/formUtils.ts @@ -48,12 +48,6 @@ export class formUtils { name: 'Partage de données sur data.grandlyon.com', inputs: ['dataShareConsentDate'], }, - { - step: structureFormStep.structureChoiceCompletion, - name: 'Completion info structure', - inputs: ['choiceCompletion'], - hideForEdit: true, - }, { step: structureFormStep.structureContactCompletion, name: 'Personne contact informations', -- GitLab From a07602afcd0a309d6b37f07b7032cb72f4434387 Mon Sep 17 00:00:00 2001 From: Etienne LOUPIAS <eloupias@grandlyon.com> Date: Tue, 3 Jan 2023 16:36:41 +0100 Subject: [PATCH 2/2] remove useless StructureInfoUnknown step --- src/app/form/footer-form/footer-form.component.ts | 9 ++------- src/app/form/form-view/form-view.component.ts | 5 ----- .../information-step/information-step.component.html | 5 +---- .../structure-form/structure-form.component.html | 3 +-- .../form-view/structure-form/structureFormStep.enum.ts | 1 - 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/app/form/footer-form/footer-form.component.ts b/src/app/form/footer-form/footer-form.component.ts index 6f1237635..b2e8abb40 100644 --- a/src/app/form/footer-form/footer-form.component.ts +++ b/src/app/form/footer-form/footer-form.component.ts @@ -62,11 +62,7 @@ export class FooterFormComponent implements OnChanges { ) { this.isNextFormTransition = true; } - if ( - this.currentForm === formType.structure && - (this.currentStep === structureFormStep.noStructure || - this.currentStep === structureFormStep.StructureInfoUnknown) - ) { + if (this.currentForm === formType.structure && this.currentStep === structureFormStep.noStructure) { this.isLastFormStep = true; } } @@ -207,8 +203,7 @@ export class FooterFormComponent implements OnChanges { this.currentForm === formType.structure && (this.currentStep === structureFormStep.mailSentInfo || this.currentStep === structureFormStep.structureCreationFinishedInfo || - this.currentStep === structureFormStep.noStructure || - this.currentStep === structureFormStep.StructureInfoUnknown) + this.currentStep === structureFormStep.noStructure) ); } diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index 8c71adcc1..168cd76d9 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -316,10 +316,6 @@ export class FormViewComponent implements OnInit, AfterViewInit { if (type.formStep === structureFormStep.noStructure) { this.router.navigateByUrl('/profile'); } - if (type.formStep === structureFormStep.StructureInfoUnknown) { - //Creation de coquille vide ?? - this.router.navigateByUrl('/profile'); - } break; case formType.personaloffer: this.savePersonalOfferForm(); @@ -525,7 +521,6 @@ export class FormViewComponent implements OnInit, AfterViewInit { structureFormStep.noStructure, structureFormStep.structureCreationFinishedInfo, structureFormStep.mailSentInfo, - structureFormStep.StructureInfoUnknown, ]; case formType.profile: return [profileFormStep.profileJobSelection]; diff --git a/src/app/form/form-view/global-components/information-step/information-step.component.html b/src/app/form/form-view/global-components/information-step/information-step.component.html index 4cab13a7b..7b73134fe 100644 --- a/src/app/form/form-view/global-components/information-step/information-step.component.html +++ b/src/app/form/form-view/global-components/information-step/information-step.component.html @@ -74,10 +74,7 @@ </div> </ng-container> <ng-container - *ngIf=" - (formType === formTypeEnum.personaloffer && step === personalOfferFormStep.personalOfferFinishedInfo) || - (formType === formTypeEnum.structure && step === structureFormStepEnum.StructureInfoUnknown) - " + *ngIf="formType === formTypeEnum.personaloffer && step === personalOfferFormStep.personalOfferFinishedInfo" > <div class="information-step-container profile-updated no-max-width"> <img src="../../assets/form/profileUpdated.svg" alt="image profil" /> diff --git a/src/app/form/form-view/structure-form/structure-form.component.html b/src/app/form/form-view/structure-form/structure-form.component.html index 61507d139..f2aa9a8c9 100644 --- a/src/app/form/form-view/structure-form/structure-form.component.html +++ b/src/app/form/form-view/structure-form/structure-form.component.html @@ -11,8 +11,7 @@ *ngIf=" currentStep === structureFormStep.structureFormTime || currentStep === structureFormStep.mailSentInfo || - currentStep === structureFormStep.noStructure || - currentStep === structureFormStep.StructureInfoUnknown + currentStep === structureFormStep.noStructure " class="no-max-width" > diff --git a/src/app/form/form-view/structure-form/structureFormStep.enum.ts b/src/app/form/form-view/structure-form/structureFormStep.enum.ts index 0e9211440..e548acc8d 100644 --- a/src/app/form/form-view/structure-form/structureFormStep.enum.ts +++ b/src/app/form/form-view/structure-form/structureFormStep.enum.ts @@ -26,5 +26,4 @@ export enum structureFormStep { structureCreationFinishedInfo, mailSentInfo, noStructure, - StructureInfoUnknown, } -- GitLab