Skip to content

Commit

Permalink
Ignore Null value when building summary in pending action list fix #19
Browse files Browse the repository at this point in the history
for that null must be detectable in action map info
  • Loading branch information
e-marchand committed May 21, 2024
1 parent b17030a commit 723477a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ActionParametersFragment : BaseFragment(), ActionProvider, MenuProvider {
override lateinit var actionActivity: ActionActivity

internal var errorsByParameter = HashMap<String, String>()
internal var paramsToSubmit = HashMap<String, Any>()
internal var paramsToSubmit = HashMap<String, Any?>()
private val metaDataToSubmit = HashMap<String, String>()
internal var validationMap = linkedMapOf<String, Boolean>()
internal var imagesToUpload = HashMap<String, Uri>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ActionsParametersListAdapter(
private val context: Context,
val allParameters: JSONArray,
// contains data of the failed action, this data will be used for pre-fill form to edit pending task
private val paramsToSubmit: HashMap<String, Any>,
private val paramsToSubmit: HashMap<String, Any?>,
private val imagesToUpload: HashMap<String, Uri>,
private val paramsError: HashMap<String, String>,
private val inputControlFormatHolders: Map<Int, InputControlFormatHolder>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ class PendingTaskViewHolder(
index: Int,
format: String?,
type: String?,
value: Any,
value: Any?,
sb: StringBuilder
): StringBuilder {
if (value == null) return sb
val stringToAppend = when {
format == "password" -> "" // We don't display password fields
type == "date" -> FormatterUtils.applyFormat("shortDate", value.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object ActionHelper {
tableName: String,
actionUUID: String,
itemId: String = "",
parameters: HashMap<String, Any>? = null,
parameters: HashMap<String, Any?>? = null,
metaData: HashMap<String, String>? = null,
parentItemId: String = "",
relation: Relation? = null
Expand Down Expand Up @@ -88,7 +88,7 @@ object ActionHelper {
}

fun updateActionContent(actionContent: MutableMap<String, Any>?,
parameters: HashMap<String, Any>? = null,
parameters: HashMap<String, Any?>? = null,
metaData: HashMap<String, String>? = null) {

parameters?.let { actionContent?.put("parameters", parameters) }
Expand Down

0 comments on commit 723477a

Please sign in to comment.