Skip to content
Snippets Groups Projects
Commit a2f1bdf7 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

retour vers page edition structure

parent 308a49ef
No related branches found
No related tags found
1 merge request!936Resolve "[modification fiche structure] - Offre structure vs. Offre accompagnant numérique + ordre des blocs"
......@@ -5,7 +5,7 @@
<div class="title">
<div>
<h1>Gérer mon offre d'accompagnements</h1>
<h2 *ngIf="structureName" class="overtitle">{{ structureName }}</h2>
<h2 *ngIf="structure.structureName" class="overtitle">{{ structure.structureName }}</h2>
</div>
</div>
<app-button
......@@ -80,7 +80,7 @@
(closed)="$event ? confirmDeleteOffer() : closeModal()"
>
<div class="deleteModal">
<p *ngIf="structureName" class="emphasized">{{ structureName }}</p>
<p *ngIf="structure.structureName" class="emphasized">{{ structure.structureName }}</p>
<p>Vous êtes sur le point de supprimer votre offre d’accompagnements, veuillez confirmer pour poursuivre</p>
</div>
</app-modal>
......
......@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { ActivatedRoute, Data, Router } from '@angular/router';
import { CategoriesToggle } from '../../models/categoriesToggle.model';
import { Structure } from '../../models/structure.model';
import { NotificationService } from '../../services/notification.service';
import { CategoryEnum } from '../../shared/enum/category.enum';
import { Category } from '../../structure-list/models/category.model';
......@@ -29,7 +30,7 @@ export class PersonalOfferEditionComponent implements OnInit {
public onlineProcedures: Category;
public trainingCategories: CategoriesToggle[] = [];
public deleteOfferModal: boolean;
public structureName: string;
public structure: Structure;
constructor(
private route: ActivatedRoute,
......@@ -49,7 +50,7 @@ export class PersonalOfferEditionComponent implements OnInit {
this.initialPersonalOffer = this.personalOfferForm.value;
}
});
this.structureName = history.state.structureName;
this.structure = history.state.structure;
if (history.state.tab) {
// Convert string 'digitalSkills' to enum
this.currentTab = tabsEnum[history.state.tab as keyof typeof tabsEnum];
......@@ -122,7 +123,7 @@ export class PersonalOfferEditionComponent implements OnInit {
this.initialPersonalOffer = this.personalOfferForm.value;
this.personalOfferForm.markAsPristine();
});
this.router.navigateByUrl('/profil');
this.router.navigate(['profil', 'edition-structure', this.structure.permalink]);
}
}
......@@ -152,7 +153,7 @@ export class PersonalOfferEditionComponent implements OnInit {
this.notificationService.showError(`${err.error.message}`, 'Une erreur est survenue');
},
);
this.router.navigate(['/profil']);
this.router.navigate(['profil', 'edition-structure', this.structure.permalink]);
}
public goBack(): void {
......
......@@ -169,7 +169,7 @@ export class StructureEditionSummaryComponent implements OnInit {
if (offer.offers._id) {
this.router.navigate([`/profil/edition-offre-personnelle/${offer.offers._id}`], {
state: {
structureName: this.structure.structureName,
structure: this.structure,
tab: step === structureFormStep.structureTrainingType ? 'digitalSkills' : '',
},
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment