Commit 2d2215e9 authored by Dorchies David's avatar Dorchies David
Browse files

Merge branch '536-lois-d-ouvrages-les-champs-ne-sont-pas-vide-a-l-ajout-d-un-ouvrage' into 'devel'

Resolve "Lois d'ouvrages: les champs ne sont pas vide à l'ajout d'un ouvrage"

Closes #536

See merge request !136
parents ec828fee 625b757b
Pipeline #35810 passed with stages
in 17 minutes
......@@ -163,4 +163,23 @@ describe("ngHyd - check that created/cloned structures have empty fields - ", ()
const emptys = [true, true, true];
await checkFields(inputIds, emptys);
});
it("when a structure is modified (input) and then a structure is added", async () => {
await setup();
// fill
const inp = calcPage.getInputById("0_ZDV");
await inp.clear();
await inp.sendKeys("1");
// copy structure
const addStruct = calcPage.getAddStructureButton();
await addStruct.click();
await browser.sleep(200);
// check empty fields
const inputIds = ["1_ZDV", "1_L", "1_W", "1_CdGR"];
const emptys = [true, true, true, false];
await checkFields(inputIds, emptys);
});
});
......@@ -75,15 +75,15 @@ export class FieldsetContainerComponent implements DoCheck, AfterViewInit {
* dans un nouveau fieldset
*/
private addSubNub(after: FieldSet, clone: boolean = false) {
const prms = after.backupParameters();
const prms = clone ? after.backupParameters() : undefined;
const newFs = this._container.addFromTemplate(0, after.indexAsKid());
if (clone) {
// replace in-place to change properties (overkill)
// @WTF why only those two ?
newFs.setPropValue("structureType", after.properties.getPropValue("structureType"));
newFs.setPropValue("loiDebit", after.properties.getPropValue("loiDebit"));
newFs.restoreParameters(prms);
}
newFs.restoreParameters(prms);
}
private onFieldsetListChange() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment