-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deployments for scenarios with dict editors after model reload
- Loading branch information
Showing
23 changed files
with
155 additions
and
34 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
common-api/src/main/scala/pl/touk/nussknacker/engine/api/parameter/ParameterName.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
package pl.touk.nussknacker.engine.api.parameter | ||
|
||
import io.circe.generic.extras.semiauto.{deriveUnwrappedDecoder, deriveUnwrappedEncoder} | ||
import io.circe.{Decoder, Encoder, KeyDecoder, KeyEncoder} | ||
|
||
final case class ParameterName(value: String) { | ||
def withBranchId(branchId: String): ParameterName = ParameterName(s"$value for branch $branchId") | ||
} | ||
|
||
object ParameterName { | ||
implicit val encoder: Encoder[ParameterName] = deriveUnwrappedEncoder | ||
implicit val decoder: Decoder[ParameterName] = deriveUnwrappedDecoder | ||
|
||
implicit val keyEncoder: KeyEncoder[ParameterName] = KeyEncoder.encodeKeyString.contramap(_.value) | ||
implicit val keyDecoder: KeyDecoder[ParameterName] = KeyDecoder.decodeKeyString.map(ParameterName(_)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...src/main/scala/pl/touk/nussknacker/ui/config/AdditionalDictComponentConfigsProvider.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package pl.touk.nussknacker.ui.config | ||
|
||
import pl.touk.nussknacker.engine.api.component.{ComponentAdditionalConfig, DesignerWideComponentId} | ||
import pl.touk.nussknacker.engine.api.parameter.ValueInputWithDictEditor | ||
import pl.touk.nussknacker.engine.api.process.ProcessingType | ||
import pl.touk.nussknacker.ui.process.processingtype.provider.ProcessingTypeDataProvider | ||
import pl.touk.nussknacker.ui.security.api.LoggedUser | ||
|
||
class AdditionalDictComponentConfigsProvider( | ||
private val additionalConfigsProvider: ProcessingTypeDataProvider[ | ||
Map[DesignerWideComponentId, ComponentAdditionalConfig], | ||
_ | ||
] | ||
) { | ||
|
||
// This function filters additional configs provided by AdditionalUIConfigProvider | ||
// to include only component and parameter configs with Dictionary editors. | ||
// This is done to reduce data sent to Flink as only configs regarding this editor are required to be known during execution. | ||
def getAdditionalConfigsWithDictParametersEditors( | ||
processingType: ProcessingType | ||
)(implicit user: LoggedUser): Map[DesignerWideComponentId, ComponentAdditionalConfig] = { | ||
additionalConfigsProvider | ||
.forProcessingType(processingType) | ||
.getOrElse(Map.empty) | ||
.map { case (componentId, componentAdditionalConfig) => | ||
val parametersWithDictEditors = componentAdditionalConfig.parameterConfigs.filter { | ||
case (_, additionalUiConfig) => | ||
additionalUiConfig.valueEditor match { | ||
case Some(_: ValueInputWithDictEditor) => true | ||
case _ => false | ||
} | ||
} | ||
componentId -> componentAdditionalConfig.copy(parameterConfigs = parametersWithDictEditors) | ||
} | ||
.filter(_._2.parameterConfigs.nonEmpty) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.