Skip to content
Snippets Groups Projects
Commit 55d9241e authored by Pierre Ecarlat's avatar Pierre Ecarlat
Browse files

Revert "Fixed null freeworkshop in structure edition"

This reverts commit 667e0307.
parent dcaeeed9
Branches
No related tags found
1 merge request!850V3.1.0
......@@ -40,7 +40,7 @@ export class StructureEditionSummaryComponent implements OnInit {
public structureFormStep = structureFormStep;
public equipmentEnum = Equipment;
public trainingCategories: Map<string, Category>;
public freeWorkshopName: FreeWorkshop = null;
public freeWorkshopName = FreeWorkshop;
// Digital learning
public categories: Category[] = [];
......@@ -73,8 +73,8 @@ export class StructureEditionSummaryComponent implements OnInit {
this.structureService.getStructureWithOwners(data.structure._id).subscribe((result) => {
this.members = result.owners;
const freeWorkShop = result.structure.categories?.freeWorkShop as unknown as FreeWorkshop;
if (freeWorkShop) {
if (result.structure.categories?.freeWorkShop.length) {
const freeWorkShop = result.structure.categories?.freeWorkShop as unknown as string;
this.freeWorkshopName = FreeWorkshop[freeWorkShop];
}
});
......
......@@ -28,6 +28,7 @@ export class CardComponent implements OnInit {
/** If true, the form comes from the orientation and will propose to reserve an appointment */
@Input() public isOrientationRdv = false;
@Output() public showDetails = new EventEmitter<Structure>();
@Output() public hover = new EventEmitter<Structure>();
@Output() public addToList = new EventEmitter<Structure>();
@Output() public selectRDV = new EventEmitter<Structure>();
......@@ -63,11 +64,13 @@ export class CardComponent implements OnInit {
public cardClicked(): void {
if (this.redirectToStructure) {
this.showDetails.emit(this.structure);
this.router.navigate([], {
relativeTo: this.route,
queryParams: {
structure: this.structure.permalink,
},
queryParamsHandling: 'merge',
state: { isOrientation: this.isOrientation },
});
} else {
......
......@@ -26,6 +26,8 @@
[isOrientation]="isOrientation"
[isOrientationRdv]="isOrientationRdv"
[isSelected]="isInPrintList(structure._id)"
(showDetails)="showDetails(structure)"
(keyup.enter)="showDetails(structure)"
(hover)="handleCardHover($event)"
(addToList)="addToList($event)"
(selectRDV)="selectRDV($event)"
......
......@@ -50,6 +50,13 @@ export class StructureListComponent implements OnChanges, OnInit {
ngOnChanges(changes: SimpleChanges): void {
if (changes.selectedStructure && this.selectedStructure) {
this.showDetails(this.selectedStructure);
this.router.navigate([], {
relativeTo: this.route,
queryParams: {
structure: this.selectedStructure.permalink,
},
queryParamsHandling: 'merge',
});
}
if (changes.structureList) {
document.getElementById('listCard').scrollTo(0, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment