Skip to content

Commit

Permalink
fixing bug in stepper that in expertMode substistutions are invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Nov 27, 2024
1 parent 1d328ad commit 042d00e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ export class MappingStepperComponent implements OnInit, OnDestroy {
this.templateTarget = this.editorTargetStepTemplate?.get();
event.stepper.next();
} else {
console.log("Updated subs III:", this.mapping.substitutions);
event.stepper.next();
}
}
Expand Down Expand Up @@ -796,10 +797,11 @@ export class MappingStepperComponent implements OnInit, OnDestroy {
modalRef.content.closeSubject.subscribe((editedSub) => {
if (editedSub) {
this.mapping.substitutions[selected] = editedSub;
this.substitutionModel = editedSub;
//this.substitutionModel = editedSub; not needed
}
});
this.countDeviceIdentifiers$.next(countDeviceIdentifiers(this.mapping));
console.log("Updated subs I:", this.mapping.substitutions);
}
}

Expand Down Expand Up @@ -842,7 +844,11 @@ export class MappingStepperComponent implements OnInit, OnDestroy {
async onSelectSubstitution(selected: number) {
if (selected < this.mapping.substitutions.length && selected > -1) {
this.selectedSubstitution = selected;
this.substitutionModel = _.clone(this.mapping.substitutions[selected]);
this.substitutionModel.pathSource = this.mapping.substitutions[selected].pathSource;
this.substitutionModel.pathTarget = this.mapping.substitutions[selected].pathTarget;
this.substitutionModel.expandArray = this.mapping.substitutions[selected].expandArray;
this.substitutionModel.resolve2ExternalId = this.mapping.substitutions[selected].resolve2ExternalId;
this.substitutionModel.repairStrategy = this.mapping.substitutions[selected].repairStrategy;
this.substitutionModel.stepperConfiguration = this.stepperConfiguration;
await this.editorSourceStepSubstitution?.setSelectionToPath(
this.substitutionModel.pathSource
Expand All @@ -851,6 +857,7 @@ export class MappingStepperComponent implements OnInit, OnDestroy {
this.substitutionModel.pathTarget
);
}
console.log("Updated subs II:", this.mapping.substitutions);
}

ngOnDestroy() {
Expand Down

0 comments on commit 042d00e

Please sign in to comment.