Skip to content

[MS-1340] MFID: adding validation for manual credential entry#1584

Merged
alexandr-simprints merged 8 commits intorelease/2025.4.1from
MS-1340-mfid-add-validation-for-manual-credential-entry
Feb 17, 2026
Merged

[MS-1340] MFID: adding validation for manual credential entry#1584
alexandr-simprints merged 8 commits intorelease/2025.4.1from
MS-1340-mfid-add-validation-for-manual-credential-entry

Conversation

@alexandr-simprints
Copy link
Contributor

@alexandr-simprints alexandr-simprints commented Feb 12, 2026

JIRA ticket
Will be released in: 2025.4.1

Notable changes

  • Edited credential can only be saved if it has valid format
  • State object in ViewModel now reflects the UI edit state so that it is preserved during the configuration change (i.e.: rotation)
  • Continue button is available only if checkbox is selected and the format of the current displayed credential is correct
image image image

Additional work checklist

  • Effect on other features and security has been considered

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds validation for manual credential entry in the Multi-Factor ID (MFID) feature. It ensures that credentials can only be saved when they match the expected format for their type (Ghana ID Card, NHIS Card, or QR Code), and preserves the editing state across configuration changes like screen rotation.

Changes:

  • Added format validation for manually entered credentials using dedicated use cases for Ghana ID Card and NHIS Card patterns
  • Introduced isEditingCredential flag in SearchCredentialState to track and persist editing state across configuration changes
  • Updated UI to enable/disable the edit/save icon based on credential format validity
  • Continue button is now disabled while editing to prevent proceeding with unsaved changes
  • Added color selector resource to visually indicate disabled state for the save icon

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ExternalCredentialSearchViewModelTest.kt Added mock dependencies for Ghana ID and NHIS card validation use cases
ic_done.xml Changed hardcoded color to color resource reference to support disabled state
ic_edit_color.xml New color selector defining colors for enabled and disabled states
SearchCredentialState.kt Added isEditingCredential boolean field to preserve editing state
ExternalCredentialSearchViewModel.kt Added validation method delegating to credential-specific use cases and state management for editing mode
ExternalCredentialSearchFragment.kt Implemented UI logic for edit mode including validation-based icon enabling and text change listener
.editorconfig Added ktlint rules for when-entry bracing, blank lines, backticked identifiers, and unused imports

Copy link
Contributor

@BurningAXE BurningAXE left a comment

Choose a reason for hiding this comment

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

From UX side - maybe the checkbox should be disabled, too, when the number is not valid. Otherwise it's weird to verify an invalid number. But then you have to reset it after every edit and you get into a rabbit hole :)

Copy link
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.

+1 to all of Milen's comments

@alexandr-simprints
Copy link
Contributor Author

Thanks for feedback! The checkbox is now disabled when the credential is being edited

checkbox.mp4

@sonarqubecloud
Copy link

@alexandr-simprints alexandr-simprints merged commit 295763e into release/2025.4.1 Feb 17, 2026
13 checks passed
@alexandr-simprints alexandr-simprints deleted the MS-1340-mfid-add-validation-for-manual-credential-entry branch February 17, 2026 10:50
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