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

Fix dashboard card domain navigation #18301

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ class MySiteViewModel @Inject constructor(
private fun onDashboardCardDomainClick() {
val selectedSite = requireNotNull(selectedSiteRepository.getSelectedSite())
dashboardCardDomainUtils.trackDashboardCardDomainTapped(uiModel.value?.state as? SiteSelected)
_onNavigation.value = Event(SiteNavigationAction.OpenDomainRegistration(selectedSite))
_onNavigation.value = Event(SiteNavigationAction.OpenPaidDomainSearch(selectedSite))
}

private fun onDashboardCardDomainHideMenuItemClick() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ sealed class SiteNavigationAction {
) : SiteNavigationAction()

data class OpenDomainRegistration(val site: SiteModel) : SiteNavigationAction()
data class OpenPaidDomainSearch(val site: SiteModel) : SiteNavigationAction()
data class AddNewSite(val hasAccessToken: Boolean, val source: SiteCreationSource) : SiteNavigationAction()
data class ShowQuickStartDialog(
@StringRes val title: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.wordpress.android.ui.TextInputDialogFragment
import org.wordpress.android.ui.accounts.LoginEpilogueActivity
import org.wordpress.android.ui.domains.DomainRegistrationActivity.Companion.RESULT_REGISTERED_DOMAIN_EMAIL
import org.wordpress.android.ui.domains.DomainRegistrationActivity.DomainRegistrationPurpose.CTA_DOMAIN_CREDIT_REDEMPTION
import org.wordpress.android.ui.domains.DomainRegistrationActivity.DomainRegistrationPurpose.DOMAIN_PURCHASE
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureFullScreenOverlayFragment
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalOverlayUtil.JetpackFeatureCollectionOverlaySource
import org.wordpress.android.ui.jetpackplugininstall.fullplugin.onboarding.JetpackFullPluginInstallOnboardingDialogFragment
Expand Down Expand Up @@ -399,6 +400,12 @@ class MySiteTabFragment : Fragment(R.layout.my_site_tab_fragment),
action.site,
CTA_DOMAIN_CREDIT_REDEMPTION
)
is SiteNavigationAction.OpenPaidDomainSearch -> ActivityLauncher.viewDomainRegistrationActivityForResult(
this,
action.site,
DOMAIN_PURCHASE
)

is SiteNavigationAction.AddNewSite -> SitePickerActivity.addSite(activity, action.hasAccessToken, action.source)
is SiteNavigationAction.ShowQuickStartDialog -> showQuickStartDialog(
action.title,
Expand Down