Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plans in site creation: Plan selection screen #19304

Merged
merged 27 commits into from
Oct 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5442558
Update SiteCreationStep.kt
ravishanker Oct 5, 2023
ad2692a
Create SiteCreationPlansUiState.kt
ravishanker Oct 5, 2023
012d532
Create SiteCreationPlansWebViewClient.kt
ravishanker Oct 5, 2023
363aa9a
Update strings.xml
ravishanker Oct 5, 2023
7ca8666
Update SiteCreationMainVM.kt
ravishanker Oct 5, 2023
71969f0
Create SiteCreationPlansFragment.kt
ravishanker Oct 5, 2023
8e68b03
Create SiteCreationPlansViewModel.kt
ravishanker Oct 5, 2023
3f62e76
Update SiteCreationActivity.kt
ravishanker Oct 5, 2023
62c0f59
Add params to request
ravishanker Oct 6, 2023
3b54c20
Merge branch 'trunk' into Plans-in-site-creation-Plan-Selection-Screen
ravishanker Oct 8, 2023
fb4dbd7
Detect plan selection in site creation flow
irfano Oct 12, 2023
68559c3
Update SiteCreationPlansViewModel.kt
ravishanker Oct 13, 2023
44c8e2b
Update SiteCreationPlansWebViewClient.kt
ravishanker Oct 13, 2023
3cf4396
Update DomainRegistrationCheckoutWebViewNavigationDelegate.kt
ravishanker Oct 13, 2023
fc30b40
Update SiteCreationProgressViewModel.kt
ravishanker Oct 13, 2023
b91069b
Remove unused
ravishanker Oct 13, 2023
7b80db6
Update SiteCreationFixtures.kt
ravishanker Oct 13, 2023
69fb18b
Create PlansScreenListener.kt
ravishanker Oct 13, 2023
fac06f3
Update SiteCreationPlansWebViewClient.kt
ravishanker Oct 13, 2023
f336392
Update SiteCreationPlansViewModel.kt
ravishanker Oct 13, 2023
8356847
Update SiteCreationPlansFragment.kt
ravishanker Oct 13, 2023
b92f5a8
Update SiteCreationActivity.kt
ravishanker Oct 13, 2023
a5ac692
Update SiteCreationMainVM.kt
ravishanker Oct 13, 2023
63015e7
Update SiteCreationPlansWebViewClient.kt
ravishanker Oct 14, 2023
b094d59
Update SiteCreationPlansViewModel.kt
ravishanker Oct 14, 2023
782b7b4
Update SiteCreationProgressViewModel.kt
ravishanker Oct 14, 2023
05d9682
handle free plan selection
ravishanker Oct 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create SiteCreationPlansUiState.kt
  • Loading branch information
ravishanker committed Oct 5, 2023
commit ad2692a0e060431193cd1daee0dce2b2b78bbd8f
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package org.wordpress.android.ui.sitecreation.plans

import org.wordpress.android.R
import org.wordpress.android.ui.utils.UiString

sealed class SiteCreationPlansUiState {
object Preparing : SiteCreationPlansUiState()

data class Prepared(
val model: SiteCreationPlansModel
) : SiteCreationPlansUiState()

object Loaded : SiteCreationPlansUiState()

open class Error(
val title: UiString,
val description: UiString,
val button: ErrorButton? = null
) : SiteCreationPlansUiState() {
data class ErrorButton(
val text: UiString,
val click: () -> Unit
)
}

data class NoNetworkError(val buttonClick: () -> Unit): Error(
title = UiString.UiStringRes(R.string.no_network_title),
description = UiString.UiStringRes(R.string.request_failed_message),
button = ErrorButton(
text = UiString.UiStringRes(R.string.retry),
click = buttonClick
)
)

data class GenericError(val buttonClick: () -> Unit): Error(
title = UiString.UiStringRes(R.string.jp_migration_generic_error_title),
description = UiString.UiStringRes(R.string.request_failed_message),
button = ErrorButton(
text = UiString.UiStringRes(R.string.retry),
click = buttonClick
)
)
}

data class SiteCreationPlansModel(
val enableJavascript: Boolean = true,
val enableDomStorage: Boolean = true,
val enableChromeClient: Boolean = true,
val userAgent: String = "",
val url: String = "",
val addressToLoad: String = ""
)