Skip to content

Commit c85e8c7

Browse files
Klaas-RitenseThomasMinkeRitense
authored andcommitted
doc: Bugfix: Will no longer deploy a form flow step multiple times (#1662)
1 parent 20b63db commit c85e8c7

File tree

1 file changed

+9
-6
lines changed
  • form-flow/src/main/kotlin/com/ritense/formflow/domain/definition/configuration

1 file changed

+9
-6
lines changed

form-flow/src/main/kotlin/com/ritense/formflow/domain/definition/configuration/FormFlowStep.kt

+9-6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ data class FormFlowStep(
4646
if (key != other.id.key) return false
4747
if (title != other.title) return false
4848

49+
val nextSteps = getAllNextSteps()
4950
if (nextSteps.size != other.nextSteps.size) return false
5051
if (nextSteps.any { nextStep ->
5152
other.nextSteps.none { otherNextStep ->
@@ -62,12 +63,7 @@ data class FormFlowStep(
6263
}
6364

6465
fun toDefinition(): FormFlowStepEntity {
65-
val nextSteps =
66-
if (this.nextStep != null)
67-
listOf(FormFlowNextStep(step = this.nextStep).toDefinition())
68-
else
69-
this.nextSteps.map(FormFlowNextStep::toDefinition)
70-
66+
val nextSteps = getAllNextSteps().map(FormFlowNextStep::toDefinition)
7167

7268
return FormFlowStepEntity(
7369
FormFlowStepId.create(key),
@@ -80,6 +76,13 @@ data class FormFlowStep(
8076
)
8177
}
8278

79+
private fun getAllNextSteps(): List<FormFlowNextStep> {
80+
return if (this.nextStep != null)
81+
listOf(FormFlowNextStep(step = this.nextStep))
82+
else
83+
this.nextSteps
84+
}
85+
8386
companion object {
8487
fun fromEntity(entity: FormFlowStepEntity): FormFlowStep {
8588
return FormFlowStep(

0 commit comments

Comments
 (0)