Commit 2ed9f10b authored by Eugene Shapovalov's avatar Eugene Shapovalov 💬

Handle Todo BUILD_FAILED, APPROVAL_REQUIRED actions.

parent 5da8c199
......@@ -15,7 +15,6 @@ import ru.terrakok.gitlabclient.entity.app.target.TargetHeaderTitle
import ru.terrakok.gitlabclient.entity.event.EventAction
import ru.terrakok.gitlabclient.entity.todo.TodoAction
import ru.terrakok.gitlabclient.model.system.ResourceManager
import timber.log.Timber
import java.io.IOException
/**
......@@ -123,9 +122,7 @@ fun TargetHeaderTitle.getHumanName(resources: Resources) = when (this) {
when (action) {
TodoAction.ASSIGNED -> {
"$author $actionName $targetName ${resources.getString(R.string.at)} $projectName ${resources.getString(
R.string.to
)} $assignee"
"$author $actionName $targetName ${resources.getString(R.string.at)} $projectName ${resources.getString(R.string.to)} $assignee"
}
TodoAction.DIRECTLY_ADDRESSED,
TodoAction.MENTIONED -> {
......@@ -135,11 +132,13 @@ fun TargetHeaderTitle.getHumanName(resources: Resources) = when (this) {
"$author $actionName ${resources.getString(R.string.for_str)} $targetName ${resources.getString(R.string.at)} $projectName"
}
TodoAction.UNMERGEABLE -> {
"$actionName $targetName $projectName"
"$actionName $targetName ${resources.getString(R.string.at)} $projectName"
}
else -> {
Timber.e("Unsupported template for todo action=$actionName.")
"$author $actionName $targetName $assignee ${resources.getString(R.string.at)} $projectName"
TodoAction.BUILD_FAILED -> {
"$actionName ${resources.getString(R.string.for_str)} $targetName ${resources.getString(R.string.at)} $projectName"
}
TodoAction.APPROVAL_REQUIRED -> {
"$author $actionName ${resources.getString(R.string.for_str)} $targetName ${resources.getString(R.string.at)} $projectName"
}
}
}
......
......@@ -135,9 +135,9 @@
<string name="my_todos_done">Done</string>
<string name="todo_action_assigned">assigned</string>
<string name="todo_action_mentioned">mentioned</string>
<string name="todo_action_build_failed">build failed</string>
<string name="todo_action_build_failed">The build failed</string>
<string name="todo_action_marked">added a todo</string>
<string name="todo_action_approval_required">approval required</string>
<string name="todo_action_approval_required">set you as an approver</string>
<string name="todo_action_directly_addressed">directly addressed</string>
<string name="todo_action_unmergeable">Could not merge</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