Skip to content
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 @@ -239,12 +239,10 @@ internal fun HedvigNavHost(
}
},
closeTerminationFlow = {
/**
* If we fail to pop the backstack including TerminateInsuranceGraphDestination here it means we were deep
* linked into this screen only, and they do not wish to continue with the flow they were deep linked to.
* The right way to handle this is to simply finish the app as per the docs:
* https://developer.android.com/guide/navigation/backstack#handle-failure
*/
// If we fail to pop the backstack including TerminateInsuranceGraphDestination here it means we were deep
// linked into this screen only, and they do not wish to continue with the flow they were deep linked to.
// The right way to handle this is to simply finish the app as per the docs:
// https://developer.android.com/guide/navigation/backstack#handle-failure
if (!navController.typedPopBackStack<TerminateInsuranceGraphDestination>(inclusive = true)) {
finishApp()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,31 @@ import hedvig.resources.MY_DOUMENTS_INSURANCE_PREPURCHASE
import hedvig.resources.Res

fun InsuranceVariantDocument.InsuranceDocumentType.getStringRes() = when (this) {
InsuranceVariantDocument.InsuranceDocumentType.TERMS_AND_CONDITIONS -> Res.string.MY_DOCUMENTS_INSURANCE_TERMS
InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD -> Res.string.MY_DOUMENTS_INSURANCE_PREPURCHASE
InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO -> Res.string.MY_DOUMENTS_INSURANCE_PREPURCHASE
InsuranceVariantDocument.InsuranceDocumentType.GENERAL_TERMS -> Res.string.MY_DOCUMENTS_GENERAL_TERMS
InsuranceVariantDocument.InsuranceDocumentType.PRIVACY_POLICY -> Res.string.MY_DOCUMENTS_PRIVACY_POLICY
InsuranceVariantDocument.InsuranceDocumentType.CERTIFICATE -> Res.string.MY_DOCUMENTS_INSURANCE_CERTIFICATE
InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__ -> null
InsuranceVariantDocument.InsuranceDocumentType.TERMS_AND_CONDITIONS -> {
Res.string.MY_DOCUMENTS_INSURANCE_TERMS
}

InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD -> {
Res.string.MY_DOUMENTS_INSURANCE_PREPURCHASE
}

InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO -> {
Res.string.MY_DOUMENTS_INSURANCE_PREPURCHASE
}

InsuranceVariantDocument.InsuranceDocumentType.GENERAL_TERMS -> {
Res.string.MY_DOCUMENTS_GENERAL_TERMS
}

InsuranceVariantDocument.InsuranceDocumentType.PRIVACY_POLICY -> {
Res.string.MY_DOCUMENTS_PRIVACY_POLICY
}

InsuranceVariantDocument.InsuranceDocumentType.CERTIFICATE -> {
Res.string.MY_DOCUMENTS_INSURANCE_CERTIFICATE
}

InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__ -> {
null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ internal class GetAddonOfferUseCaseImpl(

is AddonGenerateOfferMutation.Data.AddonOfferAddonGenerateOffer -> {
val addonOffer = when (val addonOfferResult = result.quote.addonOffer) {
is AddonGenerateOfferMutation.Data.AddonOfferAddonGenerateOffer.Quote.AddonOfferSelectableAddonOffer -> {
is AddonGenerateOfferMutation.Data.AddonOfferAddonGenerateOffer.Quote.AddonOfferSelectableAddonOffer,
-> {
val nonEmptyQuotes = result.quote.addonOffer.quotes.toNonEmptyListOrNull()
if (nonEmptyQuotes.isNullOrEmpty()) {
logcat(LogPriority.ERROR) { "Tried to do AddonGenerateOfferMutation but got empty quotes" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,9 @@ private fun HeaderInfoWithCurrentPrice(
modifier: Modifier = Modifier,
) {
Column(modifier.fillMaxWidth()) {
val pricePerMonth = "${stringResource(Res.string.TIER_FLOW_TOTAL)}: ${chosenOptionPremiumExtra.getPerMonthDescription()}"
val pricePerMonth = "${stringResource(
Res.string.TIER_FLOW_TOTAL,
)}: ${chosenOptionPremiumExtra.getPerMonthDescription()}"
HorizontalItemsWithMaximumSpaceTaken(
startSlot = {
HedvigText(exposureName)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ private fun AddonsSection(
) {
Column {
existingAddons.forEachIndexed { index, existingAddon ->
val isRemovingDisabled =existingAddon.status is ContractAddon.Status.EndsAt
val isRemovingDisabled = existingAddon.status is ContractAddon.Status.EndsAt
AddonRow(
title = existingAddon.displayName,
description = when (val status = existingAddon.status) {
Expand All @@ -415,7 +415,7 @@ private fun AddonsSection(
isRemovingDisabled = isRemovingDisabled,
onLabelClick = {
removeAddonBottomSheetState.show(existingAddon)
}
},
)
}
availableAddons.forEachIndexed { index, availableAddon ->
Expand All @@ -426,7 +426,7 @@ private fun AddonsSection(
isAlreadyAdded = false,
modifier = Modifier.clickable(onClick = dropUnlessResumed { navigateToAddAddon(availableAddon) }),
isRemovingDisabled = false,
onLabelClick = dropUnlessResumed { navigateToAddAddon(availableAddon) }
onLabelClick = dropUnlessResumed { navigateToAddAddon(availableAddon) },
)
}
}
Expand Down Expand Up @@ -560,23 +560,26 @@ private fun AddonRow(
onClick = {},
enabled = false,
buttonStyle = ButtonDefaults.ButtonStyle.Secondary,
buttonSize = ButtonDefaults.ButtonSize.Small,
text = stringResource(Res.string.ADDON_ADDED_COVERAGE)
buttonSize = ButtonDefaults.ButtonSize.Small,
text = stringResource(Res.string.ADDON_ADDED_COVERAGE),
)
}
} else {
HedvigButton(
onClick = onLabelClick,
enabled = true,
buttonStyle = if (isAlreadyAdded) ButtonDefaults.ButtonStyle.Secondary
else ButtonDefaults.ButtonStyle.PrimaryAlt,
buttonSize = ButtonDefaults.ButtonSize.Small,
buttonStyle = if (isAlreadyAdded) {
ButtonDefaults.ButtonStyle.Secondary
} else {
ButtonDefaults.ButtonStyle.PrimaryAlt
},
buttonSize = ButtonDefaults.ButtonSize.Small,
text = if (isAlreadyAdded) {
stringResource(Res.string.ADDON_ADDED_COVERAGE)
} else {
stringResource(Res.string.CONTRACT_OVERVIEW_ADDON_ADD)
},
modifier =Modifier.wrapContentSize(Alignment.TopEnd),
modifier = Modifier.wrapContentSize(Alignment.TopEnd),
)
}
},
Expand Down Expand Up @@ -946,7 +949,7 @@ private fun PreviewYourInfoTab() {
),
displayName = "DisplayName",
description = "Description",
status = ContractAddon.Status.EndsAt(LocalDate(2026,10,1)),
status = ContractAddon.Status.EndsAt(LocalDate(2026, 10, 1)),
isUpgradable = false,
isRemovable = false,
),
Expand Down
2 changes: 1 addition & 1 deletion app/umbrella/src/commonMain/kotlin/Umbrella.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("ktlint:standard:no-empty-file")
@file:Suppress("ktlint:standard:no-empty-file", "ktlint:standard:kdoc")

/**
* ### DO NOT DELETE
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ googleServices = "4.4.4"
gradleDevelocity = "4.3.2"
kmpNativeCoroutines = "1.0.1"
kotlin = "2.3.10"
kotlinter = "5.4.0"
kotlinter = "5.4.2"
ksp = "2.3.2"
ktor = "3.4.0"
license = "0.9.8"
Expand Down
Loading