Skip to content

Commit

Permalink
Fix propagation of currentEntity parameter from input control manif…
Browse files Browse the repository at this point in the history
…est to
  • Loading branch information
e-marchand committed Jan 17, 2024
1 parent 398742a commit 38b894e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion models/projecteditor/FieldMapping.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ data class FieldMappingFormatter(
val imageHeight: Int?,
val tintable: Boolean?,
val target: Any?,
val capabilities : List<String>?
val capabilities : List<String>?,
val currentEntity: Boolean?
) {
fun isImageNamed() = this.binding == "imageNamed"
}
Expand All @@ -27,6 +28,7 @@ data class FieldMappingDefaultInputControl(
var format: String?,
val imageWidth: Int?,
val imageHeight: Int?,
val currentEntity: Boolean?,
)

data class FieldMappingLoginForm(
Expand Down
6 changes: 4 additions & 2 deletions utils/Formatters.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ fun getFieldMappingFormatter(manifestContent: JSONObject, format: String): Field
tintable = manifestContent.getSafeObject("assets")?.getSafeBoolean("tintable"),
target = manifestContent.getSafeString("target") ?: manifestContent.getSafeArray("target")
.getStringList(), // target can be a String or a JSONArray,
capabilities = manifestContent.getSafeObject("capabilities")?.checkCapabilities()
capabilities = manifestContent.getSafeObject("capabilities")?.checkCapabilities(),
currentEntity = manifestContent.getSafeBoolean("currentEntity")
)

fun getFieldMappingKotlinInputControl(manifestContent: JSONObject, format: String): FieldMappingKotlinInputControl =
Expand Down Expand Up @@ -44,7 +45,8 @@ fun getFieldMappingDefaultInputControl(manifestContent: JSONObject): FieldMappin
name = manifestContent.getSafeString("name"),
format = manifestContent.getSafeString("format"),
imageWidth = getSize(manifestContent, "width"),
imageHeight = getSize(manifestContent, "height")
imageHeight = getSize(manifestContent, "height"),
currentEntity = manifestContent.getSafeBoolean("currentEntity")
)

fun getChoiceList(manifestContent: JSONObject): Any {
Expand Down

0 comments on commit 38b894e

Please sign in to comment.