Commit d8da1848 authored by Eugene Shapovalov's avatar Eugene Shapovalov 💬

Handle todo unmergeable action.

parent ac4587e7
......@@ -17,7 +17,9 @@ enum class TodoAction(private val jsonName: String) {
@SerializedName("approval_required")
APPROVAL_REQUIRED("approval_required"),
@SerializedName("directly_addressed")
DIRECTLY_ADDRESSED("directly_addressed");
DIRECTLY_ADDRESSED("directly_addressed"),
@SerializedName("unmergeable")
UNMERGEABLE("unmergeable");
override fun toString() = jsonName
}
\ No newline at end of file
......@@ -95,6 +95,7 @@ fun TodoAction.getHumanName(resources: Resources): String = when (this) {
TodoAction.DIRECTLY_ADDRESSED -> resources.getString(R.string.todo_action_directly_addressed)
TodoAction.MARKED -> resources.getString(R.string.todo_action_marked)
TodoAction.MENTIONED -> resources.getString(R.string.todo_action_mentioned)
TodoAction.UNMERGEABLE -> resources.getString(R.string.todo_action_unmergeable)
}
fun TargetHeaderTitle.getHumanName(resources: Resources) = when (this) {
......@@ -131,9 +132,12 @@ fun TargetHeaderTitle.getHumanName(resources: Resources) = when (this) {
TodoAction.MARKED -> {
"$author $actionName ${resources.getString(R.string.for_str)} $targetName ${resources.getString(R.string.at)} $projectName"
}
TodoAction.UNMERGEABLE -> {
"$actionName $targetName $projectName"
}
else -> {
Timber.e("Unsupported template for todo action=$actionName.")
"$author $actionName $targetName $assignee ${resources.getString(R.string.at)}"
"$author $actionName $targetName $assignee ${resources.getString(R.string.at)} $projectName"
}
}
}
......
......@@ -139,6 +139,7 @@
<string name="todo_action_marked">added a todo</string>
<string name="todo_action_approval_required">approval required</string>
<string name="todo_action_directly_addressed">directly addressed</string>
<string name="todo_action_unmergeable">Could not merge</string>
<!--Merge Request Info screen-->
<string name="merge_request_info_tab">Details</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment