Skip to content
Snippets Groups Projects
Commit c1d828b9 authored by François Grand's avatar François Grand
Browse files

feat: predams: implement delete icon button in basin list

refs #522
parent d7a3199f
No related branches found
No related tags found
1 merge request!166Resolve "Prébarrages: Regroupement de la saisie des bassins"
......@@ -31,4 +31,9 @@ export class BasinFieldsetContainerComponent extends FieldsetContainerComponent
protected addSubNub(after: FieldSet, clone?: boolean): void {
this.predamService.copySelectedBasin(ServiceFactory.applicationSetupService.enableEmptyFieldsOnFormInit);
}
public onRemoveFieldset(fs: FieldSet) {
super.onRemoveFieldset(fs);
this.predamService.deleteSelected(ServiceFactory.applicationSetupService.enableEmptyFieldsOnFormInit);
}
}
......@@ -459,10 +459,6 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
/** Removes a basin or wall, and all related items */
public onRemoveClick() {
this.predamService.deleteSelected(ServiceFactory.applicationSetupService.enableEmptyFieldsOnFormInit);
this.clearResults();
this.unselect();
this.refreshWithSelection();
this.calculatorComponent.showPBInputData = true;
}
public get uitextRemove() {
......@@ -512,6 +508,13 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
this.refreshWithSelection(nub.uid);
this.calculatorComponent.showPBInputData = true;
break;
case PrebarrageServiceEvents.BASIN_WALL_REMOVED:
this.clearResults();
this.unselect();
this.refreshWithSelection();
this.calculatorComponent.showPBInputData = true;
break;
}
}
......
......@@ -4,6 +4,7 @@ import { MermaidUtil, PbBassin, PbBassinParams, PbCloison, PreBarrage } from "ja
export enum PrebarrageServiceEvents {
BASIN_WALL_ADDED, // a wall has been added
BASIN_WALL_COPIED, // a basin or wall has been copied
BASIN_WALL_REMOVED, // a basin or a wall has been removed
}
/**
* service relatif au schéma de prébarrage
......@@ -67,6 +68,11 @@ export class PrebarrageService {
this._model.addChild(new PbCloison(undefined, this._selectedNub.bassinAval, undefined, emptyFields));
}
}
this._changeEventEmitter.emit(
{
id: PrebarrageServiceEvents.BASIN_WALL_REMOVED,
}
);
}
private copyWall(wall: PbCloison, emptyFields: boolean): PbCloison {
......
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