Skip to content

Commit

Permalink
#1434 deleting display result view port action as not used
Browse files Browse the repository at this point in the history
  • Loading branch information
naleeha authored and keikeicheung committed Sep 5, 2024
1 parent ecfcaf4 commit 79a8934
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.finos.vuu.net.rpc

import com.typesafe.scalalogging.StrictLogging
import org.finos.vuu.net.{Error, RequestContext, RpcCall, RpcResponse, ViewServerMessage, VsMsg}
import org.finos.vuu.viewport.{DisplayResultAction, ViewPortAction, ViewPortRpcFailure, ViewPortRpcSuccess}
import org.finos.vuu.viewport.{ViewPortAction, ViewPortRpcFailure, ViewPortRpcSuccess}

import java.util.concurrent.ConcurrentHashMap

Expand All @@ -28,11 +28,7 @@ class DefaultRpcHandler extends RpcHandler with StrictLogging {
override def processViewPortRpcCall(methodName: String, rpcParams: RpcParams): ViewPortAction = {
val result = processRpcMethodHandler(methodName, rpcParams)
result match {
case RpcFunctionSuccess(result) =>
result match {
case Some(value) => DisplayResultAction(value)
case None => ViewPortRpcSuccess()
}
case RpcFunctionSuccess(result) => ViewPortRpcSuccess()
case _: RpcFunctionFailure => ViewPortRpcFailure(s"Exception occurred calling rpc $methodName")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ trait ViewPortAction {}
case class NoAction() extends ViewPortAction
case class OpenDialogViewPortAction(table: ViewPortTable, renderComponent: String = "grid") extends ViewPortAction
case class CloseDialogViewPortAction(vpId: String) extends ViewPortAction
case class DisplayResultAction(result: Any) extends ViewPortAction
case class ViewPortRpcSuccess() extends ViewPortAction
case class ViewPortRpcFailure(msg: String) extends ViewPortAction
case class ViewPortCreateSuccess(key:String) extends ViewPortAction
Expand All @@ -22,7 +21,6 @@ case class ViewPortCreateSuccess(key:String) extends ViewPortAction
new Type(value = classOf[OpenDialogViewPortAction], name = "OPEN_DIALOG_ACTION"),
new Type(value = classOf[CloseDialogViewPortAction], name = "CLOSE_DIALOG_ACTION"),
new Type(value = classOf[NoAction], name = "NO_ACTION"),
new Type(value = classOf[DisplayResultAction], name = "DISPLAY_RESULT_ACTION"),
new Type(value = classOf[ViewPortEditSuccess], name = "VP_EDIT_SUCCESS"),
new Type(value = classOf[ViewPortEditFailure], name = "VP_EDIT_FAILURE"),
new Type(value = classOf[ViewPortRpcSuccess], name = "VP_RPC_SUCCESS"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.finos.vuu.net.rpc

import org.finos.vuu.net.{ClientSessionId, Error, JsonViewServerMessage, RequestContext, RpcCall, RpcResponse}
import org.finos.vuu.viewport.{DisplayResultAction, ViewPortRpcFailure, ViewPortRpcSuccess}
import org.finos.vuu.viewport.{ViewPortRpcFailure, ViewPortRpcSuccess}
import org.scalatest.BeforeAndAfterEach
import org.scalatest.featurespec.AnyFeatureSpec
import org.scalatest.matchers.should.Matchers
Expand All @@ -24,14 +24,6 @@ class DefaultRpcHandlerTest extends AnyFeatureSpec with Matchers with BeforeAndA
result should be(ViewPortRpcSuccess())
}

Scenario("Can register and handle Rpc request that returns result") {
handler.registerRpc("myMethod", _ => new RpcFunctionSuccess("result"))

val result = handler.processViewPortRpcCall("myMethod", new RpcParams(Array("param1"), Map("namedParam1" -> "value1"), None, ctx))

result should be(DisplayResultAction("result"))
}

Scenario("Throw exception when registering a function under already registered name") {

handler.registerRpc("myMethod", _ => new RpcFunctionSuccess("result1"))
Expand Down

0 comments on commit 79a8934

Please sign in to comment.