-
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.
[NU-1979] DeploymentService refactor: extracted ActionService and Sce…
…narioStateProvider + BuildInfo as a Map -> ModelInfo as a value class (#7563)
- Loading branch information
Showing
54 changed files
with
1,327 additions
and
1,915 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
common-api/src/main/scala/pl/touk/nussknacker/engine/api/modelinfo/ModelInfo.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,33 @@ | ||
package pl.touk.nussknacker.engine.api.modelinfo | ||
|
||
import io.circe | ||
import io.circe.parser._ | ||
import io.circe.syntax.EncoderOps | ||
import io.circe.{Decoder, Encoder, Printer} | ||
|
||
case class ModelInfo private (parameters: Map[String, String]) { | ||
|
||
val asJsonString: String = { | ||
val prettyParams = Printer.spaces2.copy(sortKeys = true) | ||
parameters.asJson.printWith(prettyParams) | ||
} | ||
|
||
} | ||
|
||
object ModelInfo { | ||
|
||
val empty = new ModelInfo(Map.empty[String, String]) | ||
|
||
def fromMap(parameters: Map[String, String]) = new ModelInfo(parameters) | ||
|
||
def parseJsonString(json: String): Either[circe.Error, ModelInfo] = { | ||
parse(json) | ||
.flatMap(js => Decoder[Map[String, String]].decodeJson(js)) | ||
.map(new ModelInfo(_)) | ||
} | ||
|
||
implicit val encoder: Encoder[ModelInfo] = Encoder[Map[String, String]].contramap(_.parameters) | ||
|
||
implicit val decoder: Decoder[ModelInfo] = Decoder[Map[String, String]].map(ModelInfo.fromMap) | ||
|
||
} |
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
1 change: 1 addition & 0 deletions
1
designer/server/src/main/resources/db/migration/hsql/V1_063__RenameBuildInfoToModelInfo.sql
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 @@ | ||
ALTER TABLE "scenario_activities" ALTER COLUMN "build_info" RENAME TO "model_info"; |
1 change: 1 addition & 0 deletions
1
...er/server/src/main/resources/db/migration/postgres/V1_063__RenameBuildInfoToModelInfo.sql
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 @@ | ||
ALTER TABLE "scenario_activities" RENAME COLUMN "build_info" TO "model_info"; |
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
26 changes: 0 additions & 26 deletions
26
designer/server/src/main/scala/pl/touk/nussknacker/ui/app/BuildInfo.scala
This file was deleted.
Oops, something went wrong.
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.