mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:06:50 +00:00
Merge pull request #2577 from hongwei1/refactor/TweakedWebUi
Refactor/tweaked web UI
This commit is contained in:
commit
649fda3ff7
@ -471,7 +471,7 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats with MdcLoggable{
|
||||
|
||||
def createTransactionJSON(transaction : ModeratedTransaction) : TransactionJsonV13 = {
|
||||
val bookingDate = transaction.startDate.orNull
|
||||
val valueDate = transaction.finishDate.orNull
|
||||
val valueDate = if(transaction.finishDate.isDefined) Some(BgSpecValidation.formatToISODate(transaction.finishDate.orNull)) else None
|
||||
|
||||
val creditorName = transaction.otherBankAccount.map(_.label.display).getOrElse("")
|
||||
val creditorAccountIban = stringOrNone(transaction.otherBankAccount.map(_.iban.getOrElse("")).getOrElse(""))
|
||||
@ -502,7 +502,7 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats with MdcLoggable{
|
||||
transaction.amount.get.toString()
|
||||
),
|
||||
bookingDate = Some(BgSpecValidation.formatToISODate(bookingDate)) ,
|
||||
valueDate = Some(BgSpecValidation.formatToISODate(valueDate)),
|
||||
valueDate = valueDate,
|
||||
remittanceInformationUnstructured = transaction.description
|
||||
)
|
||||
}
|
||||
|
||||
@ -5206,7 +5206,6 @@ trait APIMethods510 {
|
||||
)
|
||||
,
|
||||
List(
|
||||
UserNotLoggedIn,
|
||||
UserHasMissingRoles,
|
||||
UnknownError
|
||||
),
|
||||
@ -5217,9 +5216,8 @@ trait APIMethods510 {
|
||||
cc => implicit val ec = EndpointContext(Some(cc))
|
||||
val active = ObpS.param("active").getOrElse("false")
|
||||
for {
|
||||
(Full(u), callContext) <- authenticatedAccess(cc)
|
||||
invalidMsg = s"""$InvalidFilterParameterFormat `active` must be a boolean, but current `active` value is: ${active} """
|
||||
isActived <- NewStyle.function.tryons(invalidMsg, 400, callContext) {
|
||||
invalidMsg <- Future(s"""$InvalidFilterParameterFormat `active` must be a boolean, but current `active` value is: ${active} """)
|
||||
isActived <- NewStyle.function.tryons(invalidMsg, 400, cc.callContext) {
|
||||
active.toBoolean
|
||||
}
|
||||
explicitWebUiProps <- Future{ MappedWebUiPropsProvider.getAll() }
|
||||
@ -5237,7 +5235,7 @@ trait APIMethods510 {
|
||||
}
|
||||
} yield {
|
||||
val listCommons: List[WebUiPropsCommons] = explicitWebUiProps ++ implicitWebUiPropsRemovedDuplicated
|
||||
(ListResult("webui_props", listCommons), HttpCode.`200`(callContext))
|
||||
(ListResult("webui_props", listCommons), HttpCode.`200`(cc.callContext))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,15 +55,6 @@ class WebUiPropsTest extends V510ServerSetup {
|
||||
|
||||
|
||||
feature("Get WebUiPropss v5.1.0 ") {
|
||||
scenario("We will call the endpoint without user credentials", VersionOfApi) {
|
||||
When("We make a request v5.1.0")
|
||||
val request510 = (v5_1_0_Request / "webui-props").GET
|
||||
val response510 = makeGetRequest(request510)
|
||||
Then("We should get a 401")
|
||||
response510.code should equal(401)
|
||||
And("error should be " + UserNotLoggedIn)
|
||||
response510.body.extract[ErrorMessage].message should equal (UserNotLoggedIn)
|
||||
}
|
||||
|
||||
scenario("successful case", VersionOfApi) {
|
||||
Entitlement.entitlement.vend.addEntitlement("", resourceUser1.userId, CanCreateWebUiProps.toString)
|
||||
@ -74,7 +65,7 @@ class WebUiPropsTest extends V510ServerSetup {
|
||||
response510.code should equal(201)
|
||||
val customerJson = response510.body.extract[WebUiPropsCommons]
|
||||
|
||||
val requestGet510 = (v5_1_0_Request / "webui-props").GET <@(user1)
|
||||
val requestGet510 = (v5_1_0_Request / "webui-props").GET
|
||||
val responseGet510 = makeGetRequest(requestGet510)
|
||||
Then("We should get a 200")
|
||||
responseGet510.code should equal(200)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user