-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/staging' into NU-1464-NU-color-changes
# Conflicts: # designer/client/cypress/e2e/__image_snapshots__/electron/Linux/Components list should display component #0.png # designer/client/cypress/e2e/__image_snapshots__/electron/Linux/Fragment should allow adding input parameters and display used fragment graph in modal #1.png # designer/client/cypress/e2e/__image_snapshots__/electron/Linux/Fragment should allow adding input parameters and display used fragment graph in modal #2.png # designer/client/cypress/e2e/__image_snapshots__/electron/Linux/Fragment should allow adding input parameters and display used fragment graph in modal #4.png # designer/client/cypress/e2e/__image_snapshots__/electron/Linux/Fragment should allow adding input parameters and display used fragment graph in modal #7.png # designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/StringBooleanVariants/AnyValueWithSuggestionVariant.tsx # designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/StringBooleanVariants/FixedListVariant.tsx # designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/fields/FixedValuesGroup.tsx # designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/fields/StyledSettingsComponnets.tsx # docs/autoScreenshotChangeDocs/Auto Screenshot Change Docs - fragments - Inputs #2.png
- Loading branch information
Showing
96 changed files
with
3,355 additions
and
887 deletions.
There are no files selected for viewing
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
50 changes: 29 additions & 21 deletions
50
components-api/src/main/scala/pl/touk/nussknacker/engine/api/component/ProcessingMode.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,35 +1,43 @@ | ||
package pl.touk.nussknacker.engine.api.component | ||
|
||
import cats.Order | ||
import enumeratum._ | ||
import io.circe.{Decoder, Encoder} | ||
|
||
sealed trait ProcessingMode { | ||
def value: String | ||
override def toString: String = value | ||
} | ||
import scala.collection.immutable | ||
|
||
case object RequestResponseProcessingMode extends ProcessingMode { | ||
override def value: String = "Request-Response" | ||
} | ||
sealed trait ProcessingMode extends EnumEntry | ||
|
||
case class StreamProcessingMode(bounded: Boolean) extends ProcessingMode { | ||
override def value: String = s"${if (bounded) "Bounded" else "Unbounded"}-Stream" | ||
} | ||
object ProcessingMode extends Enum[ProcessingMode] { | ||
case object RequestResponse extends ProcessingMode | ||
case object BoundedStream extends ProcessingMode | ||
case object UnboundedStream extends ProcessingMode | ||
|
||
object ProcessingMode { | ||
override def values: immutable.IndexedSeq[ProcessingMode] = findValues | ||
|
||
val RequestResponse: ProcessingMode = RequestResponseProcessingMode | ||
val UnboundedStream: ProcessingMode = StreamProcessingMode(bounded = false) | ||
val BoundedStream: ProcessingMode = StreamProcessingMode(bounded = true) | ||
private val RequestResponseJsonValue = "Request-Response" | ||
private val BoundedStreamJsonValue = "Bounded-Stream" | ||
private val UnboundedStreamJsonValue = "Unbounded-Stream" | ||
|
||
val all: Set[ProcessingMode] = Set(UnboundedStream, BoundedStream, RequestResponse) | ||
implicit class ProcessingModeOps(processingMode: ProcessingMode) { | ||
|
||
def toJsonString: String = processingMode match { | ||
case ProcessingMode.RequestResponse => RequestResponseJsonValue | ||
case ProcessingMode.BoundedStream => BoundedStreamJsonValue | ||
case ProcessingMode.UnboundedStream => UnboundedStreamJsonValue | ||
} | ||
|
||
} | ||
|
||
implicit val encoder: Encoder[ProcessingMode] = Encoder.encodeString.contramap(_.value) | ||
implicit val processingModeEncoder: Encoder[ProcessingMode] = Encoder.encodeString.contramap(_.toJsonString) | ||
|
||
implicit val decoder: Decoder[ProcessingMode] = Decoder.decodeString.map { | ||
case str if str == RequestResponse.value => RequestResponseProcessingMode | ||
case str if str == UnboundedStream.value => UnboundedStream | ||
case str if str == BoundedStream.value => BoundedStream | ||
case other => throw new IllegalArgumentException(s"Not known processing mode: $other") | ||
implicit val processingModeDecoder: Decoder[ProcessingMode] = Decoder.decodeString.map { | ||
case RequestResponseJsonValue => ProcessingMode.RequestResponse | ||
case BoundedStreamJsonValue => ProcessingMode.BoundedStream | ||
case UnboundedStreamJsonValue => ProcessingMode.UnboundedStream | ||
case other => throw new IllegalArgumentException(s"Unknown processing mode: $other") | ||
} | ||
|
||
implicit val processingModeOrdering: Ordering[ProcessingMode] = Ordering.by(_.toJsonString) | ||
implicit val processingModeOrder: Order[ProcessingMode] = Order.fromOrdering | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...nts-api/src/main/scala/pl/touk/nussknacker/engine/api/typed/CanBeSubclassDeterminer.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
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
30 changes: 30 additions & 0 deletions
30
...la/pl/touk/nussknacker/defaultmodel/migrations/DecisionTableParameterNamesMigration.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,30 @@ | ||
package pl.touk.nussknacker.defaultmodel.migrations | ||
|
||
import pl.touk.nussknacker.engine.api.MetaData | ||
import pl.touk.nussknacker.engine.api.parameter.ParameterName | ||
import pl.touk.nussknacker.engine.graph.evaluatedparam.Parameter | ||
import pl.touk.nussknacker.engine.graph.node | ||
import pl.touk.nussknacker.engine.graph.node.Enricher | ||
import pl.touk.nussknacker.engine.graph.service.ServiceRef | ||
import pl.touk.nussknacker.engine.migration.NodeMigration | ||
|
||
object DecisionTableParameterNamesMigration extends NodeMigration { | ||
|
||
override val description: String = "Change Decision Table component parameter names" | ||
|
||
override def migrateNode(metaData: MetaData): PartialFunction[node.NodeData, node.NodeData] = { | ||
case enricher @ Enricher(_, service @ ServiceRef(_, params), _, _) => | ||
enricher.copy(service = service.copy(parameters = renameParams(params))) | ||
} | ||
|
||
private def renameParams(params: List[Parameter]) = { | ||
params.map { param => | ||
param.name.value match { | ||
case "Basic Decision Table" => param.copy(name = ParameterName("Decision Table")) | ||
case "Expression" => param.copy(name = ParameterName("Filtering expression")) | ||
case _ => param | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.