TP-61032 | RN Quote PageTesting fixes (#10203)
Co-authored-by: Raaj Gopal <raaj.gopal@navi.com>
This commit is contained in:
committed by
GitHub
parent
f716fb7df7
commit
feb5b7d3fb
@@ -99,7 +99,7 @@ open class NaviApplication : MultiDexApplication(), Application.ActivityLifecycl
|
||||
private val applicationScope = CoroutineScope(Dispatchers.IO + rnJob)
|
||||
|
||||
override val reactNativeHost = object : DefaultReactNativeHost(this) {
|
||||
override fun getUseDeveloperSupport() = false
|
||||
override fun getUseDeveloperSupport() = BuildConfig.DEBUG
|
||||
override fun getPackages(): List<ReactPackage> {
|
||||
val packages = PackageList(this).packages.toMutableList()
|
||||
packages.add(NativePackage())
|
||||
|
||||
@@ -165,6 +165,8 @@ constructor(private val repository: QuoteRepository, actionHandler: ActionHandle
|
||||
get() = _isQuotePageScrollingDown
|
||||
|
||||
val refreshQuotePage = SingleLiveEvent<Boolean>()
|
||||
var ctaData: CtaData? = null
|
||||
|
||||
|
||||
fun turnOffLaunchFlag(key: String) {
|
||||
_launchBottomSheet.value?.set(key, false)
|
||||
|
||||
@@ -34,6 +34,7 @@ data class QuoteGenericResponse(
|
||||
@SerializedName("callbackData") val callbackData: CallbackData? = null,
|
||||
@SerializedName("floatingButtonData")
|
||||
val floatingButtonData: FloatingButtonData? = null,
|
||||
@SerializedName("backCta") val backCta: CtaData? = null
|
||||
)
|
||||
|
||||
@Parcelize
|
||||
|
||||
@@ -422,7 +422,9 @@ object NaviInsuranceDeeplinkNavigator {
|
||||
) {
|
||||
Intent(activity, QuoteActivity::class.java)
|
||||
} else null
|
||||
intent?.action = deepLink
|
||||
intent?.action =
|
||||
ctaData.parameters?.find { it.key == "actionUrl" }?.value
|
||||
?: deepLink
|
||||
intent?.putExtra(FROM_DEEP_LINK, true)
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e)
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.navi.base.sharedpref.CommonPrefConstants.USER_EXTERNAL_ID
|
||||
import com.navi.base.sharedpref.PreferenceManager
|
||||
import com.navi.base.utils.isNotNull
|
||||
import com.navi.base.utils.orFalse
|
||||
import com.navi.base.utils.orTrue
|
||||
import com.navi.common.callback.RequestToCallbackHandler
|
||||
import com.navi.common.juspay.HyperServicesHolder
|
||||
import com.navi.common.model.ModuleName
|
||||
@@ -153,6 +154,7 @@ class QuoteActivity :
|
||||
val insuranceAnalyticsHandler = InsuranceAnalyticsHandler()
|
||||
private var isDeeplinkNavigationDone = false
|
||||
private val paymentScreenAnalytics by lazy { NaviPaymentScreenAnalytics.naviAnalytics.PaymentMethodAnalytics() }
|
||||
public var backCta: CtaData? = null
|
||||
|
||||
@Inject
|
||||
lateinit var callbackActionButton: CallbackActionButton
|
||||
@@ -434,11 +436,30 @@ class QuoteActivity :
|
||||
}
|
||||
)
|
||||
}
|
||||
} else if(backCta != null){
|
||||
sendAnalyticsEvent(backCta)
|
||||
NaviInsuranceDeeplinkNavigator.navigate(
|
||||
this,
|
||||
backCta!!,
|
||||
finish = backCta?.finish.orTrue(),
|
||||
clearTask = backCta?.clearTask.orFalse()
|
||||
)
|
||||
backCta = null
|
||||
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendAnalyticsEvent(ctaData: CtaData?) {
|
||||
ctaData?.analyticsEventProperties?.name?.let { analyticsEventName ->
|
||||
NaviInsuranceAnalytics.postAnalyticsEvent(
|
||||
eventName = analyticsEventName,
|
||||
eventProperties = backCta?.analyticsEventProperties?.properties
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun shouldShowSurveyBottomSheet(): Boolean {
|
||||
val isExperimentEnabled =
|
||||
quoteViewModel.quoteResponse.value
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.navi.naviwidgets.adapters.NaviAdapter
|
||||
import com.navi.naviwidgets.callbacks.WidgetCallback
|
||||
import com.navi.design.utils.isValidHexColor
|
||||
import com.navi.insurance.navigator.NaviInsuranceDeeplinkNavigator
|
||||
import com.navi.insurance.quoteredesign.QuoteActivity
|
||||
import com.navi.naviwidgets.extensions.FloatingButtonOverlay
|
||||
import com.navi.naviwidgets.models.GenericWidgetDataInfo
|
||||
import com.navi.naviwidgets.viewholder.ViewHolderFactoryImpl
|
||||
@@ -61,6 +62,7 @@ class PolicyAddonFragment : BaseFragment(), WidgetCallback, View.OnClickListener
|
||||
private val FIRST_ITEM = 0
|
||||
private var apiErrorHandler: ApiErrorHandler? = null
|
||||
private var analyticsEventHandler: AnalyticsEventHandler? = null
|
||||
private var parentActivity: QuoteActivity? = null
|
||||
|
||||
@Inject
|
||||
lateinit var insuranceAnalyticsHandler: InsuranceAnalyticsHandler
|
||||
@@ -76,6 +78,7 @@ class PolicyAddonFragment : BaseFragment(), WidgetCallback, View.OnClickListener
|
||||
container,
|
||||
false
|
||||
)
|
||||
parentActivity = activity as? QuoteActivity
|
||||
startShimmerLoading()
|
||||
initObservers()
|
||||
initListeners()
|
||||
@@ -167,6 +170,8 @@ class PolicyAddonFragment : BaseFragment(), WidgetCallback, View.OnClickListener
|
||||
sharedViewModel.addOnResponse.observe(viewLifecycleOwner) { widgetGenericResponse ->
|
||||
widgetGenericResponse?.let {
|
||||
stopShimmerLoading()
|
||||
sharedViewModel.ctaData = it.backCta
|
||||
if (parentActivity != null) parentActivity?.backCta = sharedViewModel.ctaData
|
||||
it.contentWidget?.let { widgetConfigList ->
|
||||
if (binding.addonRv.adapter == null) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
|
||||
Reference in New Issue
Block a user