Skip to content

Commit

Permalink
Merge pull request #108 from niscy-eudiw/main
Browse files Browse the repository at this point in the history
Removed unused docType and localization
  • Loading branch information
stzouvaras authored May 28, 2024
2 parents a213fa0 + 7a7882e commit 2418d21
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ fun DocumentType.toUiName(resourceProvider: ResourceProvider): String {
return when (this) {
DocumentType.PID -> resourceProvider.getString(R.string.pid)
DocumentType.MDL -> resourceProvider.getString(R.string.mdl)
DocumentType.CONFERENCE_BADGE -> resourceProvider.getString(R.string.conference_badge)
DocumentType.SAMPLE_DOCUMENTS -> resourceProvider.getString(R.string.load_sample_data)
DocumentType.OTHER -> ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ object TestsData {
value = testFieldUi.value,
)

DocumentType.CONFERENCE_BADGE, DocumentType.SAMPLE_DOCUMENTS, DocumentType.OTHER -> throw NotSupportedDocumentTypeException
DocumentType.SAMPLE_DOCUMENTS, DocumentType.OTHER -> throw NotSupportedDocumentTypeException
}

resultList.add(RequestDataUi.Space())
Expand Down Expand Up @@ -625,7 +625,7 @@ object TestsData {
docRequest = mockedMdlWithBasicFieldsDocRequest
}

DocumentType.CONFERENCE_BADGE, DocumentType.SAMPLE_DOCUMENTS, DocumentType.OTHER -> throw NotSupportedDocumentTypeException
DocumentType.SAMPLE_DOCUMENTS, DocumentType.OTHER -> throw NotSupportedDocumentTypeException
}

return RequestDocumentItemUi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ enum class DocumentType(
nameSpace = "org.iso.18013.5.1",
docType = "org.iso.18013.5.1.mDL"
),
CONFERENCE_BADGE(
nameSpace = "com.example.conference.badge",
docType = "com.example.conference.badge"
),
SAMPLE_DOCUMENTS(
nameSpace = "load_sample_documents",
docType = "load_sample_documents"
Expand All @@ -41,14 +37,13 @@ enum class DocumentType(
val isSupported: Boolean
get() = when (this) {
PID, MDL -> true
CONFERENCE_BADGE, SAMPLE_DOCUMENTS, OTHER -> false
SAMPLE_DOCUMENTS, OTHER -> false
}
}

fun String.toDocumentType(): DocumentType = when (this) {
"eu.europa.ec.eudiw.pid.1" -> DocumentType.PID
"org.iso.18013.5.1.mDL" -> DocumentType.MDL
"com.example.conference.badge" -> DocumentType.CONFERENCE_BADGE
"load_sample_documents" -> DocumentType.SAMPLE_DOCUMENTS
else -> DocumentType.OTHER
}
1 change: 0 additions & 1 deletion resources-logic/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
<!-- Document Types -->
<string name="pid">National ID</string>
<string name="mdl">Driving License</string>
<string name="conference_badge">EUDI Conference Badge</string>
<string name="load_sample_data">Load Sample Documents</string>

<!-- Biometric prompt -->
Expand Down
4 changes: 0 additions & 4 deletions test-feature/src/main/java/eu/europa/ec/testfeature/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import org.mockito.kotlin.whenever

private const val mockedDocUiNamePid = "National ID"
private const val mockedDocUiNameMdl = "Driving License"
private const val mockedDocUiNameConferenceBadge = "EUDI Conference Badge"
private const val mockedDocUiNameSampleData = "Load Sample Documents"

@VisibleForTesting(otherwise = VisibleForTesting.NONE)
Expand All @@ -40,9 +39,6 @@ object MockResourceProviderForStringCalls {
whenever(resourceProvider.getString(R.string.mdl))
.thenReturn(mockedDocUiNameMdl)

whenever(resourceProvider.getString(R.string.conference_badge))
.thenReturn(mockedDocUiNameConferenceBadge)

whenever(resourceProvider.getString(R.string.load_sample_data))
.thenReturn(mockedDocUiNameSampleData)
}
Expand Down

0 comments on commit 2418d21

Please sign in to comment.