diff --git a/common-api/src/main/scala/pl/touk/nussknacker/engine/api/Comment.scala b/common-api/src/main/scala/pl/touk/nussknacker/engine/api/Comment.scala index b4725fb750a..7bf312ac80a 100644 --- a/common-api/src/main/scala/pl/touk/nussknacker/engine/api/Comment.scala +++ b/common-api/src/main/scala/pl/touk/nussknacker/engine/api/Comment.scala @@ -6,13 +6,6 @@ final case class Comment private (content: String) extends AnyVal { override def toString: String = content } -final case class NonEmptyComment private (content: String) - -object NonEmptyComment { - def from(comment: Comment): Option[NonEmptyComment] = - if (comment.content.isEmpty) None else Some(NonEmptyComment(comment.content)) -} - object Comment { def from(content: String): Option[Comment] = { diff --git a/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/repository/ProcessRepository.scala b/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/repository/ProcessRepository.scala index 5b82149fe28..8592ad868ae 100644 --- a/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/repository/ProcessRepository.scala +++ b/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/repository/ProcessRepository.scala @@ -4,7 +4,7 @@ import akka.http.scaladsl.model.HttpHeader import com.typesafe.scalalogging.LazyLogging import db.util.DBIOActionInstances._ import io.circe.generic.JsonCodec -import pl.touk.nussknacker.engine.api.NonEmptyComment +import pl.touk.nussknacker.engine.api.Comment import pl.touk.nussknacker.engine.api.deployment._ import pl.touk.nussknacker.engine.api.process._ import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess @@ -69,14 +69,13 @@ object ProcessRepository { val increaseVersionWhenJsonNotChanged: Boolean val labels: List[ScenarioLabel] val forwardedUserName: Option[RemoteUserName] - val comment: Option[NonEmptyComment] def id: ProcessIdWithName = ProcessIdWithName(processId, canonicalProcess.name) } final case class UpdateProcessAction( protected val processId: ProcessId, canonicalProcess: CanonicalProcess, - comment: Option[NonEmptyComment], + comment: Option[Comment], labels: List[ScenarioLabel], increaseVersionWhenJsonNotChanged: Boolean, forwardedUserName: Option[RemoteUserName] @@ -91,9 +90,7 @@ object ProcessRepository { sourceEnvironment: String, targetEnvironment: String, sourceScenarioVersionId: Option[VersionId], - ) extends ModifyProcessAction { - override val comment: Option[NonEmptyComment] = None - } + ) extends ModifyProcessAction final case class AutomaticProcessUpdateAction( protected val processId: ProcessId, @@ -102,9 +99,7 @@ object ProcessRepository { increaseVersionWhenJsonNotChanged: Boolean, forwardedUserName: Option[RemoteUserName], migrationsApplies: List[ProcessMigration] - ) extends ModifyProcessAction { - override val comment: Option[NonEmptyComment] = None - } + ) extends ModifyProcessAction final case class ProcessUpdated(processId: ProcessId, oldVersion: Option[VersionId], newVersion: Option[VersionId]) diff --git a/designer/server/src/test/scala/pl/touk/nussknacker/test/processes/WithScenarioActivitySpecAsserts.scala b/designer/server/src/test/scala/pl/touk/nussknacker/test/processes/WithScenarioActivitySpecAsserts.scala index 3c425ae08f7..f50971ef79f 100644 --- a/designer/server/src/test/scala/pl/touk/nussknacker/test/processes/WithScenarioActivitySpecAsserts.scala +++ b/designer/server/src/test/scala/pl/touk/nussknacker/test/processes/WithScenarioActivitySpecAsserts.scala @@ -160,69 +160,6 @@ trait WithScenarioActivitySpecAsserts ScenarioActivitiesResponseWrapperForAddedAttachment(response) } - def verifyAttachmentAddedActivityExists( - user: String, - scenarioName: String, - fileIdPresent: Boolean, - filename: String, - fileStatus: String, - overrideDisplayableName: String, - ): ValidatableResponse = { - val fileJson = if (fileIdPresent) { - s""" - |"file": { - | "id": "${regexes.digitsRegex}", - | "status": "$fileStatus" - |} - |""".stripMargin - } else { - s""" - |"file": { - | "status": "$fileStatus" - |} - |""".stripMargin - } - given() - .when() - .basicAuthAllPermUser() - .get(s"$nuDesignerHttpAddress/api/processes/$scenarioName/activity/activities") - .Then() - .statusCode(200) - .body( - matchJsonWithRegexValues( - s""" - |{ - | "activities": [ - | { - | "id": "${regexes.looseUuidRegex}", - | "user": "admin", - | "date": "${regexes.zuluDateRegex}", - | "scenarioVersionId": 1, - | "additionalFields": [], - | "type": "SCENARIO_CREATED" - | }, - | { - | "id": "${regexes.looseUuidRegex}", - | "user": "$user", - | "date": "${regexes.zuluDateRegex}", - | "scenarioVersionId": 1, - | "attachment": { - | $fileJson, - | "filename": "$filename", - | "lastModifiedBy": "$user", - | "lastModifiedAt": "${regexes.zuluDateRegex}" - | }, - | "additionalFields": [], - | "overrideDisplayableName": "$overrideDisplayableName", - | "type": "ATTACHMENT_ADDED" - | } - | ] - |} - |""".stripMargin - ) - ) - } - def verifyEmptyCommentsAndAttachments(scenarioName: String): Unit = { given() .when()