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
44 changes: 0 additions & 44 deletions .github/workflows/generate_next_tag.sh

This file was deleted.

15 changes: 5 additions & 10 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,19 @@ jobs:
- name: Run unit tests
run: ./gradlew testDemoReleaseUnitTest

- name: Generate Next Tag with version
- name: Read version from version file and set as TAG_NAME
run: |
chmod +x ./.github/workflows/generate_next_tag.sh
NEXT_TAG=$(./.github/workflows/generate_next_tag.sh)
echo "Next tag: $NEXT_TAG"
echo "TAG_NAME=$NEXT_TAG" >> $GITHUB_ENV

- name: Update version.properties with tag
run: |
echo "VERSION_NAME=$TAG_NAME" > version.properties
TAG_NAME=$(grep '^VERSION_NAME=' version.properties | cut -d'=' -f2-)
echo "TAG_NAME=$TAG_NAME"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV

- name: Build DEMO release APK
run: ./gradlew assembleDemoRelease

- name: Build DEMO release Bundle (AAB)
run: ./gradlew bundleDemoRelease

- name: Create Tag
- name: Create Tag with version
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
package eu.europa.ec.commonfeature.model

enum class PinFlow {
CREATE,
UPDATE
CREATE
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,23 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavController
import eu.europa.ec.commonfeature.model.PinFlow
import eu.europa.ec.resourceslogic.R
import eu.europa.ec.uilogic.component.TopStepBar
import eu.europa.ec.uilogic.component.content.ContentScreen
import eu.europa.ec.uilogic.component.preview.PreviewTheme
import eu.europa.ec.uilogic.component.preview.ThemeModePreviews
import eu.europa.ec.uilogic.component.utils.VSpacer
import eu.europa.ec.uilogic.component.wrap.BottomSheetTextData
import eu.europa.ec.uilogic.component.wrap.ButtonConfig
import eu.europa.ec.uilogic.component.wrap.ButtonType
import eu.europa.ec.uilogic.component.wrap.DialogBottomSheet
import eu.europa.ec.uilogic.component.wrap.OtpTextField
import eu.europa.ec.uilogic.component.wrap.PinHintText
import eu.europa.ec.uilogic.component.wrap.StickyBottomConfig
import eu.europa.ec.uilogic.component.wrap.StickyBottomType
import eu.europa.ec.uilogic.component.wrap.TextConfig
import eu.europa.ec.uilogic.component.wrap.WrapModalBottomSheet
import eu.europa.ec.uilogic.component.wrap.WrapStickyBottomContent
import eu.europa.ec.uilogic.component.wrap.WrapText
import eu.europa.ec.uilogic.navigation.CommonScreens
Expand All @@ -73,9 +67,7 @@ fun PinScreen(
viewModel: PinViewModel,
) {
val state: State by viewModel.viewState.collectAsStateWithLifecycle()
val context = LocalContext.current

val isBottomSheetOpen = state.isBottomSheetOpen
val scope = rememberCoroutineScope()
val bottomSheetState = rememberModalBottomSheetState(
skipPartiallyExpanded = false
Expand Down Expand Up @@ -122,25 +114,6 @@ fun PinScreen(
coroutineScope = scope,
modalBottomSheetState = bottomSheetState,
)

if (isBottomSheetOpen) {
WrapModalBottomSheet(
onDismissRequest = {
viewModel.setEvent(
Event.BottomSheet.UpdateBottomSheetState(
isOpen = false
)
)
},
sheetState = bottomSheetState
) {
SheetContent(
onEventSent = {
viewModel.setEvent(it)
}
)
}
}
}
}

Expand Down Expand Up @@ -220,22 +193,6 @@ private fun Content(
}
}

@Composable
private fun SheetContent(
onEventSent: (event: Event) -> Unit
) {
DialogBottomSheet(
textData = BottomSheetTextData(
title = stringResource(id = R.string.quick_pin_bottom_sheet_cancel_title),
message = stringResource(id = R.string.quick_pin_bottom_sheet_cancel_subtitle),
positiveButtonText = stringResource(id = R.string.quick_pin_bottom_sheet_cancel_primary_button_text),
negativeButtonText = stringResource(id = R.string.quick_pin_bottom_sheet_cancel_secondary_button_text),
),
onPositiveClick = { onEventSent(Event.BottomSheet.Cancel.PrimaryButtonPressed) },
onNegativeClick = { onEventSent(Event.BottomSheet.Cancel.SecondaryButtonPressed) }
)
}

@Composable
private fun PinFieldLayout(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -280,14 +237,4 @@ private fun PinScreenEmptyPreview() {
modalBottomSheetState = rememberModalBottomSheetState(),
)
}
}

@ThemeModePreviews
@Composable
private fun SheetContentCancelPreview() {
PreviewTheme {
SheetContent(
onEventSent = {}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,18 @@ import androidx.lifecycle.viewModelScope
import eu.europa.ec.businesslogic.validator.Form
import eu.europa.ec.businesslogic.validator.FormValidationResult
import eu.europa.ec.businesslogic.validator.Rule
import eu.europa.ec.commonfeature.config.SuccessUIConfig
import eu.europa.ec.commonfeature.interactor.QuickPinInteractor
import eu.europa.ec.commonfeature.interactor.QuickPinInteractorPinValidPartialState
import eu.europa.ec.commonfeature.interactor.QuickPinInteractorSetPinPartialState
import eu.europa.ec.commonfeature.model.PinFlow
import eu.europa.ec.resourceslogic.R
import eu.europa.ec.resourceslogic.provider.ResourceProvider
import eu.europa.ec.uilogic.component.content.ScreenNavigateAction
import eu.europa.ec.uilogic.config.ConfigNavigation
import eu.europa.ec.uilogic.config.NavigationType
import eu.europa.ec.uilogic.mvi.MviViewModel
import eu.europa.ec.uilogic.mvi.ViewEvent
import eu.europa.ec.uilogic.mvi.ViewSideEffect
import eu.europa.ec.uilogic.mvi.ViewState
import eu.europa.ec.uilogic.navigation.CommonScreens
import eu.europa.ec.uilogic.navigation.CommonScreens.BiometricSetup
import eu.europa.ec.uilogic.navigation.LandingScreens
import eu.europa.ec.uilogic.navigation.helper.generateComposableArguments
import eu.europa.ec.uilogic.navigation.helper.generateComposableNavigationLink
import eu.europa.ec.uilogic.serializer.UiSerializer
Expand Down Expand Up @@ -72,15 +67,13 @@ data class State(
get() {
return when (pinFlow) {
PinFlow.CREATE -> ScreenNavigateAction.NONE
PinFlow.UPDATE -> ScreenNavigateAction.CANCELABLE
}
}

val onBackEvent: Event
get() {
return when (pinFlow) {
PinFlow.CREATE -> Event.GoBack
PinFlow.UPDATE -> Event.CancelPressed
}
}
}
Expand Down Expand Up @@ -131,14 +124,6 @@ class PinViewModel(
pinState = PinValidationState.ENTER
buttonText = calculateButtonText(pinState)
}

PinFlow.UPDATE -> {
title = resourceProvider.getString(R.string.quick_pin_change_title)
subtitle =
resourceProvider.getString(R.string.quick_pin_change_validate_current_subtitle)
pinState = PinValidationState.VALIDATE
buttonText = calculateButtonText(pinState)
}
}

return State(
Expand Down Expand Up @@ -333,14 +318,6 @@ class PinViewModel(

private fun calculateSubtitle(pinState: PinValidationState): String {
return when (pinFlow) {
PinFlow.UPDATE -> {
when (pinState) {
PinValidationState.ENTER -> resourceProvider.getString(R.string.quick_pin_change_enter_new_subtitle)
PinValidationState.REENTER -> resourceProvider.getString(R.string.quick_pin_change_reenter_new_subtitle)
PinValidationState.VALIDATE -> resourceProvider.getString(R.string.quick_pin_change_validate_current_subtitle)
}
}

PinFlow.CREATE -> {
when (pinState) {
PinValidationState.ENTER -> resourceProvider.getString(R.string.quick_pin_create_enter_subtitle)
Expand Down Expand Up @@ -368,46 +345,9 @@ class PinViewModel(
arguments = generateComposableArguments(emptyMap<String, String>()),
)
}

PinFlow.UPDATE -> {
generateComposableNavigationLink(
screen = CommonScreens.Success,
arguments = generateComposableArguments(
getArgumentsForSuccessScreen(
ConfigNavigation(
navigationType = NavigationType.PopTo(LandingScreens.Landing),
)
)
)
)
}
}
}

private fun getArgumentsForSuccessScreen(navigationAfterUpdate: ConfigNavigation) = mapOf(
SuccessUIConfig.serializedKeyName to uiSerializer.toBase64(
getSuccessUiConfig(navigationAfterUpdate),
SuccessUIConfig
).orEmpty()
)

private fun getSuccessUiConfig(navigationAfterUpdate: ConfigNavigation) =
SuccessUIConfig(
textElementsConfig = SuccessUIConfig.TextElementsConfig(
text = resourceProvider.getString(R.string.quick_pin_change_success_text),
description = resourceProvider.getString(R.string.quick_pin_change_success_description)
),
imageConfig = SuccessUIConfig.ImageConfig(),
buttonConfig = listOf(
SuccessUIConfig.ButtonConfig(
text = resourceProvider.getString(R.string.quick_pin_change_success_btn),
style = SuccessUIConfig.ButtonConfig.Style.PRIMARY,
navigation = navigationAfterUpdate
)
),
onBackScreenToNavigate = navigationAfterUpdate,
)

private fun showBottomSheet() {
setEffect {
Effect.ShowBottomSheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private fun SuccessDefaultPreview() {
successConfig = SuccessUIConfig(
textElementsConfig = SuccessUIConfig.TextElementsConfig(
text = stringResource(R.string.generic_success),
description = stringResource(R.string.quick_pin_change_success_description),
description = stringResource(R.string.generic_success),
),
imageConfig = SuccessUIConfig.ImageConfig(),
buttonConfig = listOf(
Expand Down
Loading
Loading