From f9b7a50384cb914bc5a9773cd4b72571766def14 Mon Sep 17 00:00:00 2001 From: fumiya-kume Date: Mon, 19 Aug 2024 23:22:31 +0900 Subject: [PATCH 1/3] Use cardType property instead of theme, since the property is Deprecated in ProfileCardJson --- .../droidkaigi/confsched/data/profilecard/ProfileCardJson.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt index 0773557e3..06351e615 100644 --- a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt +++ b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt @@ -22,7 +22,7 @@ internal fun ProfileCardJson.toModel() = ProfileCard.Exists( occupation = occupation, link = link, image = image, - cardType = checkNotNull(cardType ?: theme).toProfileCardType(), + cardType = checkNotNull(cardType ?: cardType).toProfileCardType(), ) internal fun String.toProfileCardType() = ProfileCardType.valueOf(this) From c5dec26e088fcec1d66f750691afc8b1bf313543 Mon Sep 17 00:00:00 2001 From: fumiya-kume Date: Mon, 19 Aug 2024 23:24:02 +0900 Subject: [PATCH 2/3] Use cardType property instead of theme, since the property is Deprecated in ProfileCardJson --- .../droidkaigi/confsched/data/profilecard/ProfileCardJson.kt | 2 -- .../confsched/data/profilecard/ProfileCardJsonTest.kt | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt index 06351e615..45c71c447 100644 --- a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt +++ b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt @@ -11,8 +11,6 @@ internal data class ProfileCardJson( val occupation: String, val link: String, val image: String, - @Deprecated("Use cardType instead", replaceWith = ReplaceWith("cardType")) - val theme: String? = null, @SerialName("card_type") val cardType: String? = null, ) diff --git a/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt b/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt index acde3bee6..b83a0c924 100644 --- a/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt +++ b/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt @@ -24,7 +24,7 @@ class ProfileCardJsonTest { assertEquals("test occupation", profileCardJson.occupation) assertEquals("https://github.com/DroidKaigi/conference-app-2024", profileCardJson.link) assertEquals("BASE64_ENCODED_SAMPLE_IMAGE_STRING", profileCardJson.image) - assertEquals("Iguana", profileCardJson.theme) + assertEquals("Iguana", profileCardJson.cardType) assertNull(profileCardJson.cardType) } @@ -44,7 +44,7 @@ class ProfileCardJsonTest { assertEquals("test occupation", profileCardJson.occupation) assertEquals("https://github.com/DroidKaigi/conference-app-2024", profileCardJson.link) assertEquals("BASE64_ENCODED_SAMPLE_IMAGE_STRING", profileCardJson.image) - assertNull(profileCardJson.theme) + assertNull(profileCardJson.cardType) assertEquals("Iguana", profileCardJson.cardType) } From 7f21b0a4810e54ff5f9cfeb52f917d73ea1f0aeb Mon Sep 17 00:00:00 2001 From: fumiya-kume Date: Tue, 20 Aug 2024 00:29:24 +0900 Subject: [PATCH 3/3] Revival the theme property with explain comment --- .../droidkaigi/confsched/data/profilecard/ProfileCardJson.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt index 45c71c447..dfddd3879 100644 --- a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt +++ b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt @@ -11,6 +11,11 @@ internal data class ProfileCardJson( val occupation: String, val link: String, val image: String, + @Deprecated( + "Let's use cardType, but keep it for compatibility.", + replaceWith = ReplaceWith("cardType") + ) + val theme: String? = null, @SerialName("card_type") val cardType: String? = null, )