From 8e8d0d905b80cfff02a795829f6e1b5e7843e4b9 Mon Sep 17 00:00:00 2001 From: Lachlan McKee Date: Wed, 2 Sep 2020 09:24:51 +0100 Subject: [PATCH] Fixed scenario where 'finished_at' was null (#14) --- .../net/lachlanmckee/bitrise/core/data/entity/BuildsData.kt | 2 +- .../lachlanmckee/bitrise/core/data/entity/BuildsResponse.kt | 2 +- .../bitrise/results/domain/entity/TestResultModel.kt | 2 +- .../bitrise/results/presentation/TestResultsListScreen.kt | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsData.kt b/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsData.kt index 5106858..ba77003 100644 --- a/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsData.kt +++ b/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsData.kt @@ -11,7 +11,7 @@ data class BuildsData( val buildNumber: Int, val buildSlug: String, val triggeredAt: String, - val finishedAt: String, + val finishedAt: String?, val originalEnvironmentValueList: List ) diff --git a/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsResponse.kt b/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsResponse.kt index 45277d8..d0f4a01 100644 --- a/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsResponse.kt +++ b/core/src/main/kotlin/net/lachlanmckee/bitrise/core/data/entity/BuildsResponse.kt @@ -19,7 +19,7 @@ data class BuildsResponse( val buildNumber: Int, val slug: String, val triggeredAt: String, - val finishedAt: String, + val finishedAt: String?, @SerializedName("original_build_params.environments") val originalEnvironmentValueList: List ) diff --git a/results/src/main/kotlin/net/lachlanmckee/bitrise/results/domain/entity/TestResultModel.kt b/results/src/main/kotlin/net/lachlanmckee/bitrise/results/domain/entity/TestResultModel.kt index 47a0055..6ed26b7 100644 --- a/results/src/main/kotlin/net/lachlanmckee/bitrise/results/domain/entity/TestResultModel.kt +++ b/results/src/main/kotlin/net/lachlanmckee/bitrise/results/domain/entity/TestResultModel.kt @@ -5,7 +5,7 @@ internal data class TestResultModel( val status: String, val commitHash: String, val triggeredAt: String, - val finishedAt: String, + val finishedAt: String?, val buildSlug: String, val jobName: String? ) diff --git a/results/src/main/kotlin/net/lachlanmckee/bitrise/results/presentation/TestResultsListScreen.kt b/results/src/main/kotlin/net/lachlanmckee/bitrise/results/presentation/TestResultsListScreen.kt index 6b59c3c..1eba5b3 100644 --- a/results/src/main/kotlin/net/lachlanmckee/bitrise/results/presentation/TestResultsListScreen.kt +++ b/results/src/main/kotlin/net/lachlanmckee/bitrise/results/presentation/TestResultsListScreen.kt @@ -50,7 +50,11 @@ internal class TestResultsListScreen( br() } - text("${build.triggeredAt} - ${build.finishedAt}") + text(build.triggeredAt) + + if (build.finishedAt != null) { + text(" - ${build.finishedAt}") + } br() br()