Skip to content

MS-479 age group selection screen#749

Merged
meladRaouf merged 16 commits into
mainfrom
MS-479-age-group-selection-screen
Jun 23, 2024
Merged

MS-479 age group selection screen#749
meladRaouf merged 16 commits into
mainfrom
MS-479-age-group-selection-screen

Conversation

@meladRaouf
Copy link
Copy Markdown
Collaborator

@meladRaouf meladRaouf commented Jun 6, 2024

  1. Introduced the new age group selection screen and the associated event.
  2. Retrieve the age limits from the fingerprint configuration.
  3. The retrieval of age limits from the face configuration will be implemented in a separate PR.

# Conflicts:
#	feature/orchestrator/build.gradle.kts
#	feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/steps/StepId.kt
#	feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/usecases/steps/BuildStepsUseCase.kt
#	infra/resources/src/main/res/values/strings.xml
#	settings.gradle.kts
@cla-bot cla-bot Bot added the ... label Jun 6, 2024
@meladRaouf meladRaouf force-pushed the MS-479-age-group-selection-screen branch from afe58b0 to 30a4a7e Compare June 6, 2024 08:53
@meladRaouf meladRaouf force-pushed the MS-479-age-group-selection-screen branch from 30a4a7e to f6937bd Compare June 6, 2024 09:31
@@ -5,7 +5,7 @@ import com.simprints.infra.config.store.models.TokenKeyType
import io.mockk.mockk
import org.junit.Test

class ApiGuidSelectionPayloadTest {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, is it intentional that you've renamed the ApiGuidSelectionPayloadTest?

private fun formatAgeInMonthsForDisplay(ageInMonths: Int): String {
return when {
ageInMonths < 12 -> "$ageInMonths ${getString(IDR.age_group_selection_months)}"
ageInMonths < 24 -> "1 ${getString(IDR.age_group_selection_year)}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it also display the months? Otherwise there would be no difference between 13-23 months and there might be an SDK that works only from say 15 months.

@meladRaouf meladRaouf force-pushed the MS-479-age-group-selection-screen branch from 42baee0 to ca12fa8 Compare June 6, 2024 15:45
@meladRaouf meladRaouf changed the title Ms 479 age group selection screen MS-479 age group selection screen Jun 16, 2024
@meladRaouf meladRaouf marked this pull request as ready for review June 16, 2024 06:59
@meladRaouf meladRaouf requested review from a team, BurningAXE, TristramN, alex-vt, alexandr-simprints, luhmirin-s and ybourgery and removed request for a team June 16, 2024 07:00
Comment thread build-logic/build_properties.gradle.kts Outdated
* Dev version >= 2023.4.0 is required for receiving new fingerprint configurations [CORE-3033]
* Dev version >= 2024.2.1 is required for receiving biometric sdk age restrictions
*/
set("VERSION_NAME", "2024.1.1")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wrote that the dev version should be >= 2024.2.1, but you set 2024.1.1 you will not get the age configuration

Comment on lines +47 to +53
fun ProjectConfiguration.allowedAgeRanges(): List<AgeGroup> {
return listOf(
//Todo add face roc sdk ,
fingerprint?.secugenSimMatcher?.allowedAgeRange,
fingerprint?.nec?.allowedAgeRange
).mapNotNull { it }
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at the API definition the allowedAgeRange field is always present, but it's empty when both start and end are equal to null


@Keep
internal data class ApiAgeGroup(
val startInclusive: Int,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startInclusive is not mandatory, so it should be a nullable int


private fun generateSortedUniqueAgeGroups(ageGroups: List<AgeGroup>): List<AgeGroup> {
// Handle empty list case by returning a single age group starting at 0 and ending with null
if (ageGroups.isEmpty()) return listOf(AgeGroup(0, null))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not happen as you are only displaying the age selection if there are some age groups no?

@meladRaouf meladRaouf requested a review from ybourgery June 18, 2024 02:49
Copy link
Copy Markdown
Contributor

@luhmirin-s luhmirin-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lack of plurals in the range name creation is the dealbreaker for me.

Comment thread build-logic/build_properties.gradle.kts
fillRecyclerView(ageGroupsList)
}

viewModel.showExitForm.observe(viewLifecycleOwner) { exitFormConfig ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be using the custom observer instance to avoid checking "ifNotHandled" manually.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied the code from the consent fragment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then consent fragment could also be improved :)

Comment thread feature/select-subject-age-group/src/main/res/layout/age_group_item.xml Outdated
@meladRaouf meladRaouf requested a review from luhmirin-s June 19, 2024 15:01
@meladRaouf meladRaouf force-pushed the MS-479-age-group-selection-screen branch 3 times, most recently from 4a428b8 to 481c6aa Compare June 19, 2024 15:24
Comment thread infra/resources/src/main/res/values/dimens.xml Outdated
@meladRaouf meladRaouf force-pushed the MS-479-age-group-selection-screen branch from 481c6aa to 501deb7 Compare June 20, 2024 09:53
…d-sdk-selection

# Conflicts:
#	infra/events/src/main/java/com/simprints/infra/events/event/domain/models/EventPayload.kt
@meladRaouf meladRaouf force-pushed the MS-479-age-group-selection-screen branch from 501deb7 to 266b985 Compare June 20, 2024 15:37
@sonarqubecloud
Copy link
Copy Markdown

@meladRaouf meladRaouf merged commit dad1bab into main Jun 23, 2024
@meladRaouf meladRaouf deleted the MS-479-age-group-selection-screen branch June 23, 2024 08:45
@Test
fun `should map correctly the allowedAgeRange`() {
val mapping = mapOf(
ProtoFingerprintConfiguration.VeroGeneration.VERO_1 to FingerprintConfiguration.VeroGeneration.VERO_1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is not testing what it should.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test be a new file instead of renaming ApiGuidSelectionPayloadTest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants