Skip to content

Commit

Permalink
Merge pull request #19659 from wordpress-mobile/merge/23.7-rc-2-to-trunk
Browse files Browse the repository at this point in the history
Merge 23.7-rc-2 to trunk
  • Loading branch information
oguzkocer authored Nov 23, 2023
2 parents 6325387 + ea78775 commit 71476aa
Show file tree
Hide file tree
Showing 59 changed files with 568 additions and 245 deletions.
56 changes: 26 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/Automattic/dangermattic
revision: 078aa57c084790327da4cb401f18b350a4d1e329
revision: 9ba0e5824e66e16526897a4583c9b900f9b8635c
specs:
danger-dangermattic (0.0.1)
danger (~> 9.3)
Expand All @@ -16,7 +16,7 @@ GEM
specs:
CFPropertyList (3.0.6)
rexml
activesupport (7.1.1)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -31,24 +31,24 @@ GEM
artifactory (3.0.15)
ast (2.4.2)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.844.0)
aws-sdk-core (3.186.0)
aws-eventstream (1.3.0)
aws-partitions (1.855.0)
aws-sdk-core (3.188.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.72.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sdk-kms (1.73.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.136.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-s3 (1.139.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.1)
aws-sigv4 (1.7.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.1.1)
base64 (0.2.0)
bigdecimal (3.1.4)
buildkit (1.5.0)
sawyer (>= 0.6)
Expand All @@ -66,7 +66,7 @@ GEM
connection_pool (2.4.1)
cork (0.3.0)
colored2 (~> 3.1)
danger (9.3.2)
danger (9.4.0)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
Expand All @@ -77,7 +77,7 @@ GEM
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
no_proxy_fix
octokit (~> 6.0)
octokit (>= 6.0, < 8.0)
terminal-table (>= 1, < 4)
danger-junit (1.0.2)
danger (> 2.0)
Expand All @@ -87,7 +87,7 @@ GEM
danger-rubocop (0.12.0)
danger
rubocop (~> 1.0)
danger-swiftlint (0.33.0)
danger-swiftlint (0.34.0)
danger
rake (> 10)
thor (~> 0.19)
Expand All @@ -98,10 +98,9 @@ GEM
diffy (3.4.2)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
domain_name (0.6.20231109)
dotenv (2.8.1)
drb (2.1.1)
drb (2.2.0)
ruby2_keywords
emoji_regex (3.2.3)
excon (0.104.0)
Expand Down Expand Up @@ -136,7 +135,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.7)
fastlane (2.216.0)
fastlane (2.217.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -197,7 +196,7 @@ GEM
git (1.18.0)
addressable (~> 2.8)
rchardet (~> 1.8)
google-apis-androidpublisher_v3 (0.51.0)
google-apis-androidpublisher_v3 (0.53.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.2)
addressable (~> 2.5, >= 2.5.1)
Expand All @@ -212,19 +211,19 @@ GEM
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.19.0)
google-apis-core (>= 0.9.0, < 2.a)
google-apis-storage_v1 (0.29.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.1)
google-cloud-storage (1.44.0)
google-cloud-storage (1.45.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.19.0)
google-apis-storage_v1 (~> 0.29.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
Expand Down Expand Up @@ -255,12 +254,12 @@ GEM
minitest (5.20.0)
multi_json (1.15.0)
multipart-post (2.3.0)
mutex_m (0.1.2)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
naturally (2.2.1)
no_proxy_fix (0.1.2)
nokogiri (1.15.4)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
octokit (6.1.1)
Expand All @@ -279,8 +278,8 @@ GEM
progress_bar (1.3.3)
highline (>= 1.6, < 3)
options (~> 2.3.0)
public_suffix (5.0.3)
racc (1.7.2)
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rake-compiler (1.2.5)
Expand Down Expand Up @@ -335,9 +334,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.5.0)
webrick (1.8.1)
word_wrap (1.0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.lifecycle.ViewModelProvider
import org.wordpress.android.BuildConfig
import org.wordpress.android.R
import org.wordpress.android.WordPress
import org.wordpress.android.analytics.AnalyticsTracker
import org.wordpress.android.databinding.DomainsDashboardFragmentBinding
import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.ui.ActivityLauncher
Expand Down Expand Up @@ -65,7 +66,10 @@ class DomainsDashboardFragment : Fragment(R.layout.domains_dashboard_fragment),

override fun onMenuItemSelected(menuItem: MenuItem) = when (menuItem.itemId) {
R.id.all_domains_item -> {
context?.let { ActivityLauncher.openDomainManagement(it) }
context?.let {
AnalyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_DOMAINS_DASHBOARD_ALL_DOMAINS_TAPPED)
ActivityLauncher.openDomainManagement(it)
}
true
}
else -> true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DomainManagementViewModel @Inject constructor(
private val searchQuery = MutableStateFlow("")

init {
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_MY_DOMAINS_SCREEN_SHOWN)
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_DOMAINS_LIST_SHOWN)
launch {
fetchAllDomains()
}
Expand Down Expand Up @@ -84,14 +84,13 @@ class DomainManagementViewModel @Inject constructor(
}

fun onDomainTapped(domain: String, detailUrl: String) {
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_MY_DOMAINS_SCREEN_DOMAIN_TAPPED)
launch {
_actionEvents.emit(ActionEvent.DomainTapped(domain, detailUrl))
}
}

fun onAddDomainClicked() {
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_MY_DOMAINS_SCREEN_ADD_DOMAIN_TAPPED)
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_ADD_DOMAIN_TAPPED)
launch {
_actionEvents.emit(ActionEvent.AddDomainTapped)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import org.wordpress.android.analytics.AnalyticsTracker
import org.wordpress.android.ui.ActivityLauncher
import org.wordpress.android.ui.WPWebViewActivity

Expand All @@ -14,6 +15,7 @@ class DomainManagementDetailsActivity : WPWebViewActivity(),
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
toggleNavbarVisibility(false)
AnalyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_DOMAIN_DETAILS_WEB_VIEW_SHOWN)
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NewDomainSearchViewModel @Inject constructor(
private val debouncedQuery = MutableStateFlow("")

init {
analyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_SEARCH_FOR_A_DOMAIN_SCREEN_SHOWN)
analyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_DOMAINS_SEARCH_SHOWN)
debouncedQuery
.filter { it.isNotBlank() }
.debounce(SEARCH_QUERY_DELAY_MS)
Expand Down Expand Up @@ -82,17 +82,14 @@ class NewDomainSearchViewModel @Inject constructor(
}

fun onTransferDomainClicked() {
analyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_TRANSFER_DOMAIN_TAPPED)
analyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_DOMAINS_SEARCH_TRANSFER_DOMAIN_TAPPED)
launch {
_actionEvents.emit(ActionEvent.TransferDomain(DOMAIN_TRANSFER_PAGE_URL))
}
}

fun onDomainTapped(domain: ProposedDomain) {
analyticsTracker.track(
AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_SEARCH_DOMAIN_TAPPED,
mapOf("domain_name" to domain.domain)
)
analyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_SEARCH_DOMAIN_TAPPED)
launch {
_actionEvents.emit(
ActionEvent.PurchaseDomain(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class PurchaseDomainViewModel @AssistedInject constructor(
}

fun onNewDomainSelected() {
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_SCREEN_NEW_DOMAIN_TAPPED)
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_GET_DOMAIN_TAPPED)
createCart(null, productId, domain, privacy)
}

fun onExistingSiteSelected() {
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_SCREEN_EXISTING_SITE_TAPPED)
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_CHOOSE_SITE_TAPPED)
launch {
_actionEvents.emit(ActionEvent.GoToSitePicker(domain = domain))
}
Expand All @@ -57,7 +57,7 @@ class PurchaseDomainViewModel @AssistedInject constructor(
}

fun onSiteChosen(site: SiteModel?) {
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_SCREEN_EXISTING_SITE_CHOSEN)
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_SITE_SELECTED)
createCart(site, productId, domain, privacy)
}

Expand All @@ -69,6 +69,7 @@ class PurchaseDomainViewModel @AssistedInject constructor(

fun onDomainRegistrationComplete(event: DomainRegistrationCompletedEvent?) = event?.also {
launch {
analyticsTracker.track(Stat.DOMAIN_MANAGEMENT_PURCHASE_DOMAIN_COMPLETED)
_actionEvents.emit(ActionEvent.OpenDomainManagement)
}
} ?: run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ class MeFragment : Fragment(R.layout.me_fragment), OnScrollToTopListener {
if (shouldShowDomainButton) {
domainManagementContainer.visibility = View.VISIBLE
domainManagementContainer.setOnClickListener {
context?.let { ActivityLauncher.openDomainManagement(it) }
context?.let {
AnalyticsTracker.track(AnalyticsTracker.Stat.DOMAIN_MANAGEMENT_ME_DOMAINS_TAPPED)
ActivityLauncher.openDomainManagement(it)
}
}
} else {
domainManagementContainer.visibility = View.GONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class SiteCreationActivity : LocaleAwareActivity(),
mainViewModel.onDomainsScreenFinished(domain)
}

override fun onPlanSelected(plan: PlanModel, domainName: String?) {
override fun onPlanSelected(plan: PlanModel?, domainName: String?) {
mainViewModel.onPlanSelection(plan, domainName)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class SiteCreationMainVM @Inject constructor(
wizardManager.showNextStep()
}

fun onPlanSelection(plan: PlanModel, domainName: String?) {
fun onPlanSelection(plan: PlanModel?, domainName: String?) {
siteCreationState = siteCreationState.copy(plan = plan)
domainName?.let {
siteCreationState = siteCreationState.copy(domain = siteCreationState.domain?.copy(domainName = it))
Expand Down Expand Up @@ -332,7 +332,7 @@ class SiteCreationMainVM @Inject constructor(

fun onFreeSiteCreated(site: SiteModel) {
siteCreationState = siteCreationState.copy(result = CreatedButNotFetched.NotInLocalDb(site))
if (siteCreationState.plan?.productSlug == "free_plan") {
if (siteCreationState.plan == null || siteCreationState.plan?.productSlug == "free_plan") {
wizardManager.showNextStep()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ import android.os.Parcelable
import kotlinx.parcelize.Parcelize

interface PlansScreenListener {
fun onPlanSelected(plan: PlanModel, domainName: String?)
fun onPlanSelected(plan: PlanModel?, domainName: String?)
}

@Parcelize
data class PlanModel(
val productId: Int?,
val productSlug: String?,
val isCurrentPlan: Boolean,
val hasDomainCredit: Boolean
) : Parcelable
data class PlanModel(val productId: Int?, val productSlug: String?) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.webkit.ConsoleMessage
import android.webkit.WebChromeClient
import android.webkit.WebView
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -162,11 +164,24 @@ class SiteCreationPlansFragment : Fragment(), SiteCreationPlansWebViewClientList
@Composable
private fun SiteCreationPlansWebView(uiState: SiteCreationPlansUiState) {
var webView: WebView? by remember { mutableStateOf(null) }
val viewModel: SiteCreationPlansViewModel = viewModel()

if (uiState is SiteCreationPlansUiState.Prepared) {
val model = uiState.model
LaunchedEffect(true) {
webView = WebView(requireContext()).apply {
webChromeClient = object : WebChromeClient() {
override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean {
consoleMessage?.let { message ->
val calypsoErrorMessage = "Uncaught TypeError: window.AppBoot is not a function"
if (message.message().contains(calypsoErrorMessage)) {
viewModel.onCalypsoError()
}
}
return super.onConsoleMessage(consoleMessage)
}
}

layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
Expand Down
Loading

0 comments on commit 71476aa

Please sign in to comment.