From 7d1b1aa2f4b8d4ae59bd88735f750954ff13efdc Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Sat, 14 Sep 2024 16:22:22 +0300 Subject: [PATCH 1/6] Update fluxCVersion to the PR --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index bada18398c6..69fe6eac7c9 100644 --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,7 @@ tasks.register("installGitHooks", Copy) { } ext { - fluxCVersion = '2.96.0' + fluxCVersion = '3095-826c0640684a3f9aeb07e441536671996a0f51d8' glideVersion = '4.16.0' coilVersion = '2.1.0' constraintLayoutVersion = '1.2.0' From a304d9dd4901ce9dba66134fe0e121933d71efc8 Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Sat, 14 Sep 2024 16:28:09 +0300 Subject: [PATCH 2/6] Add Objective model to BlazeRepository --- .../kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt index b8de35e1e27..6d9722ba779 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt @@ -378,6 +378,9 @@ class BlazeRepository @Inject constructor( data class RemoteImage(val mediaId: Long, override val uri: String) : BlazeCampaignImage } + @Parcelize + data class Objective(val id: String, val title: String, val description: String) : Parcelable + @Parcelize data class TargetingParameters( val locations: List = emptyList(), From b49df1c96c4f96ca0b3d24fbf4dc46d4a7efe9e8 Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Sat, 14 Sep 2024 16:28:41 +0300 Subject: [PATCH 3/6] Add fetchObjectives() to BlazeRepository --- .../woocommerce/android/ui/blaze/BlazeRepository.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt index 6d9722ba779..d1bff0cd46b 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt @@ -51,6 +51,19 @@ class BlazeRepository @Inject constructor( const val WEEKLY_DURATION = 7 // Used to calculate weekly budget in endless campaigns } + suspend fun fetchObjectives(): Result { + val result = blazeCampaignsStore.fetchBlazeCampaignObjectives(selectedSite.get()) + + return when { + result.isError -> { + WooLog.w(WooLog.T.BLAZE, "Failed to fetch objectives: ${result.error}") + Result.failure(OnChangedException(result.error)) + } + + else -> Result.success(Unit) + } + } + fun observeLanguages() = blazeCampaignsStore.observeBlazeTargetingLanguages() .map { it.map { language -> Language(language.id, language.name) } } From 29424db594c0f7256c4b6e7143b95ca03526e204 Mon Sep 17 00:00:00 2001 From: Irfan Omur Date: Sat, 14 Sep 2024 16:28:52 +0300 Subject: [PATCH 4/6] Add observeObjectives() to BlazeRepository --- .../com/woocommerce/android/ui/blaze/BlazeRepository.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt index d1bff0cd46b..e3a31073917 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt @@ -51,6 +51,10 @@ class BlazeRepository @Inject constructor( const val WEEKLY_DURATION = 7 // Used to calculate weekly budget in endless campaigns } + fun observeObjectives() = blazeCampaignsStore.observeBlazeCampaignObjectives().map { + it.map { objective -> Objective(objective.id, objective.title, objective.description) } + } + suspend fun fetchObjectives(): Result { val result = blazeCampaignsStore.fetchBlazeCampaignObjectives(selectedSite.get()) From e6194005be16bc8d6e31d1484b963b878d6e9bf3 Mon Sep 17 00:00:00 2001 From: jorgemucientesfayos Date: Thu, 19 Sep 2024 16:50:02 +0200 Subject: [PATCH 5/6] Adds missing suitableForDescription field to Objective model --- .../android/ui/blaze/BlazeRepository.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt index e3a31073917..2d94bf3da21 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/blaze/BlazeRepository.kt @@ -52,7 +52,14 @@ class BlazeRepository @Inject constructor( } fun observeObjectives() = blazeCampaignsStore.observeBlazeCampaignObjectives().map { - it.map { objective -> Objective(objective.id, objective.title, objective.description) } + it.map { objective -> + Objective( + objective.id, + objective.title, + objective.description, + objective.suitableForDescription + ) + } } suspend fun fetchObjectives(): Result { @@ -396,7 +403,12 @@ class BlazeRepository @Inject constructor( } @Parcelize - data class Objective(val id: String, val title: String, val description: String) : Parcelable + data class Objective( + val id: String, + val title: String, + val description: String, + val suitableForDescription: String + ) : Parcelable @Parcelize data class TargetingParameters( From 0cb3a398ea8b5a1c29e12d1a6e2c1d9ea7639e03 Mon Sep 17 00:00:00 2001 From: jorgemucientesfayos Date: Thu, 19 Sep 2024 17:34:14 +0200 Subject: [PATCH 6/6] Update fluxc changeset --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 69fe6eac7c9..6d16a11b5b2 100644 --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,7 @@ tasks.register("installGitHooks", Copy) { } ext { - fluxCVersion = '3095-826c0640684a3f9aeb07e441536671996a0f51d8' + fluxCVersion = 'trunk-8667e16c65dedc984042fbfe33b3f5b3cb5b86ce' glideVersion = '4.16.0' coilVersion = '2.1.0' constraintLayoutVersion = '1.2.0'