mirror of
https://github.com/bitwarden/android.git
synced 2026-08-01 18:53:39 -05:00
Update SDK to 3.0.0-7896-62f4decd (#7187)
Co-authored-by: bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com>
parent
c2255ba778
commit
92971df5c0
+6
-14
@@ -30,8 +30,6 @@ import com.x8bit.bitwarden.ui.vault.model.VaultIdentityTitle
|
||||
import com.x8bit.bitwarden.ui.vault.model.VaultLinkedFieldType.Companion.fromId
|
||||
import com.x8bit.bitwarden.ui.vault.model.findVaultCardBrandWithNameOrNull
|
||||
import java.time.Clock
|
||||
import java.time.LocalDate
|
||||
import java.time.format.DateTimeParseException
|
||||
import java.time.format.FormatStyle
|
||||
import java.util.UUID
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
@@ -126,18 +124,18 @@ fun CipherView.toViewState(
|
||||
licenseNumber = driversLicense?.licenseNumber.orEmpty(),
|
||||
issuingCountry = driversLicense?.issuingCountry.orEmpty(),
|
||||
issuingState = driversLicense?.issuingState.orEmpty(),
|
||||
expirationDate = driversLicense?.expirationDate?.toLocalDate(),
|
||||
expirationDate = driversLicense?.expirationDate,
|
||||
licenseClass = driversLicense?.licenseClass.orEmpty(),
|
||||
dateOfBirth = driversLicense?.dateOfBirth?.toLocalDate(),
|
||||
dateOfBirth = driversLicense?.dateOfBirth,
|
||||
issuingAuthority = driversLicense?.issuingAuthority.orEmpty(),
|
||||
issueDate = driversLicense?.issueDate?.toLocalDate(),
|
||||
issueDate = driversLicense?.issueDate,
|
||||
)
|
||||
}
|
||||
|
||||
CipherType.PASSPORT -> VaultAddEditState.ViewState.Content.ItemType.Passport(
|
||||
givenName = passport?.givenName.orEmpty(),
|
||||
surname = passport?.surname.orEmpty(),
|
||||
dateOfBirth = passport?.dateOfBirth?.toLocalDate(),
|
||||
dateOfBirth = passport?.dateOfBirth,
|
||||
sex = passport?.sex.orEmpty(),
|
||||
birthPlace = passport?.birthPlace.orEmpty(),
|
||||
nationality = passport?.nationality.orEmpty(),
|
||||
@@ -146,8 +144,8 @@ fun CipherView.toViewState(
|
||||
nationalIdentificationNumber = passport?.nationalIdentificationNumber.orEmpty(),
|
||||
issuingCountry = passport?.issuingCountry.orEmpty(),
|
||||
issuingAuthority = passport?.issuingAuthority.orEmpty(),
|
||||
issueDate = passport?.issueDate?.toLocalDate(),
|
||||
expirationDate = passport?.expirationDate?.toLocalDate(),
|
||||
issueDate = passport?.issueDate,
|
||||
expirationDate = passport?.expirationDate,
|
||||
)
|
||||
},
|
||||
common = VaultAddEditState.ViewState.Content.Common(
|
||||
@@ -177,12 +175,6 @@ fun CipherView.toViewState(
|
||||
isIndividualVaultDisabled = isIndividualVaultDisabled,
|
||||
)
|
||||
|
||||
private fun String.toLocalDate(): LocalDate? = try {
|
||||
LocalDate.parse(this)
|
||||
} catch (_: DateTimeParseException) {
|
||||
null
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds Folder and Owner data to [VaultAddEditState.ViewState].
|
||||
*/
|
||||
|
||||
+3
-15
@@ -34,7 +34,6 @@ import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import java.time.Clock
|
||||
import java.time.LocalDate
|
||||
import java.time.format.DateTimeParseException
|
||||
import java.time.format.FormatStyle
|
||||
import java.util.Locale
|
||||
|
||||
@@ -306,22 +305,11 @@ fun FieldView.toCustomField(
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes a string date that is formatted in the default ISO-8601 format (uuuu-MM-dd) and converts
|
||||
* it to appropriate human-readable format.
|
||||
* Takes a [LocalDate] and converts it to appropriate human-readable format.
|
||||
*/
|
||||
private fun String.toFormattedDate(
|
||||
private fun LocalDate.toFormattedDate(
|
||||
clock: Clock,
|
||||
): String? {
|
||||
val localDate = try {
|
||||
LocalDate.parse(this)
|
||||
} catch (_: DateTimeParseException) {
|
||||
null
|
||||
}
|
||||
return localDate?.toFormattedDateStyle(
|
||||
dateStyle = FormatStyle.LONG,
|
||||
clock = clock,
|
||||
)
|
||||
}
|
||||
): String = this.toFormattedDateStyle(dateStyle = FormatStyle.LONG, clock = clock)
|
||||
|
||||
private fun LoginUriView.toUriData() =
|
||||
VaultItemState.ViewState.Content.ItemType.Login.UriData(
|
||||
|
||||
+6
-6
@@ -126,13 +126,13 @@ private fun VaultAddEditState.ViewState.Content.ItemType.toDriversLicense(): Dri
|
||||
firstName = it.firstName.orNullIfBlank(),
|
||||
middleName = it.middleName.orNullIfBlank(),
|
||||
lastName = it.lastName.orNullIfBlank(),
|
||||
dateOfBirth = it.dateOfBirth?.toString(),
|
||||
dateOfBirth = it.dateOfBirth,
|
||||
licenseNumber = it.licenseNumber.orNullIfBlank(),
|
||||
issuingCountry = it.issuingCountry.orNullIfBlank(),
|
||||
issuingState = it.issuingState.orNullIfBlank(),
|
||||
issueDate = it.issueDate?.toString(),
|
||||
issueDate = it.issueDate,
|
||||
issuingAuthority = it.issuingAuthority.orNullIfBlank(),
|
||||
expirationDate = it.expirationDate?.toString(),
|
||||
expirationDate = it.expirationDate,
|
||||
licenseClass = it.licenseClass.orNullIfBlank(),
|
||||
)
|
||||
}
|
||||
@@ -142,7 +142,7 @@ private fun VaultAddEditState.ViewState.Content.ItemType.toPassport(): PassportV
|
||||
PassportView(
|
||||
surname = it.surname.orNullIfBlank(),
|
||||
givenName = it.givenName.orNullIfBlank(),
|
||||
dateOfBirth = it.dateOfBirth?.toString(),
|
||||
dateOfBirth = it.dateOfBirth,
|
||||
birthPlace = it.birthPlace.orNullIfBlank(),
|
||||
sex = it.sex.orNullIfBlank(),
|
||||
nationality = it.nationality.orNullIfBlank(),
|
||||
@@ -150,8 +150,8 @@ private fun VaultAddEditState.ViewState.Content.ItemType.toPassport(): PassportV
|
||||
passportType = it.passportType.orNullIfBlank(),
|
||||
issuingCountry = it.issuingCountry.orNullIfBlank(),
|
||||
issuingAuthority = it.issuingAuthority.orNullIfBlank(),
|
||||
issueDate = it.issueDate?.toString(),
|
||||
expirationDate = it.expirationDate?.toString(),
|
||||
issueDate = it.issueDate,
|
||||
expirationDate = it.expirationDate,
|
||||
nationalIdentificationNumber = it.nationalIdentificationNumber.orNullIfBlank(),
|
||||
)
|
||||
}
|
||||
|
||||
+7
-6
@@ -22,6 +22,7 @@ import com.bitwarden.vault.SshKeyView
|
||||
import com.bitwarden.vault.UriMatchType
|
||||
import java.time.Clock
|
||||
import java.time.Instant
|
||||
import java.time.LocalDate
|
||||
import java.time.ZoneOffset
|
||||
|
||||
/**
|
||||
@@ -272,13 +273,13 @@ fun createMockDriversLicenseView(
|
||||
firstName: String? = "mockFirstName-$number",
|
||||
middleName: String? = "mockMiddleName-$number",
|
||||
lastName: String? = "mockLastName-$number",
|
||||
dateOfBirth: String? = "2006-05-11",
|
||||
dateOfBirth: LocalDate? = LocalDate.parse("2006-05-11"),
|
||||
licenseNumber: String? = "mockLicenseNumber-$number",
|
||||
issuingCountry: String? = "mockIssuingCountry-$number",
|
||||
issuingState: String? = "mockIssuingState-$number",
|
||||
issuingAuthority: String? = "mockIssuingAuthority-$number",
|
||||
issueDate: String? = "2024-06-15",
|
||||
expirationDate: String? = "2031-11-25",
|
||||
issueDate: LocalDate? = LocalDate.parse("2024-06-15"),
|
||||
expirationDate: LocalDate? = LocalDate.parse("2031-11-25"),
|
||||
licenseClass: String? = "mockLicenseClass-$number",
|
||||
): DriversLicenseView =
|
||||
DriversLicenseView(
|
||||
@@ -303,7 +304,7 @@ fun createMockPassportView(
|
||||
number: Int,
|
||||
surname: String? = "mockSurname-$number",
|
||||
givenName: String? = "mockGivenName-$number",
|
||||
dateOfBirth: String? = "2006-05-11",
|
||||
dateOfBirth: LocalDate? = LocalDate.parse("2006-05-11"),
|
||||
birthPlace: String? = "mockBirthPlace-$number",
|
||||
sex: String? = "mockSex-$number",
|
||||
nationality: String? = "mockNationality-$number",
|
||||
@@ -311,8 +312,8 @@ fun createMockPassportView(
|
||||
passportType: String? = "mockPassportType-$number",
|
||||
issuingCountry: String? = "mockIssuingCountry-$number",
|
||||
issuingAuthority: String? = "mockIssuingAuthority-$number",
|
||||
issueDate: String? = "2024-06-15",
|
||||
expirationDate: String? = "2031-11-25",
|
||||
issueDate: LocalDate? = LocalDate.parse("2024-06-15"),
|
||||
expirationDate: LocalDate? = LocalDate.parse("2031-11-25"),
|
||||
nationalIdentificationNumber: String? = "mockNationalIdentificationNumber-$number",
|
||||
): PassportView =
|
||||
PassportView(
|
||||
|
||||
+3
-3
@@ -961,7 +961,7 @@ private val DEFAULT_PASSPORT_CIPHER_VIEW: CipherView = DEFAULT_BASE_CIPHER_VIEW.
|
||||
passport = PassportView(
|
||||
surname = "the surname",
|
||||
givenName = "the given name",
|
||||
dateOfBirth = "1990-08-10",
|
||||
dateOfBirth = LocalDate.parse("1990-08-10"),
|
||||
birthPlace = "the birth place",
|
||||
sex = "the sex",
|
||||
nationality = "the nationality",
|
||||
@@ -969,8 +969,8 @@ private val DEFAULT_PASSPORT_CIPHER_VIEW: CipherView = DEFAULT_BASE_CIPHER_VIEW.
|
||||
passportType = "the passport type",
|
||||
issuingCountry = "the issuing country",
|
||||
issuingAuthority = "the issuing authority",
|
||||
issueDate = "2021-03-20",
|
||||
expirationDate = "2031-03-20",
|
||||
issueDate = LocalDate.parse("2021-03-20"),
|
||||
expirationDate = LocalDate.parse("2031-03-20"),
|
||||
nationalIdentificationNumber = "the national identification number",
|
||||
),
|
||||
)
|
||||
|
||||
+7
-7
@@ -1,5 +1,6 @@
|
||||
package com.x8bit.bitwarden.ui.vault.feature.vault.util
|
||||
|
||||
import com.bitwarden.ui.util.asText
|
||||
import com.bitwarden.vault.CardView
|
||||
import com.bitwarden.vault.CipherRepromptType
|
||||
import com.bitwarden.vault.CipherType
|
||||
@@ -15,7 +16,6 @@ import com.bitwarden.vault.PasswordHistoryView
|
||||
import com.bitwarden.vault.SecureNoteType
|
||||
import com.bitwarden.vault.SecureNoteView
|
||||
import com.bitwarden.vault.SshKeyView
|
||||
import com.bitwarden.ui.util.asText
|
||||
import com.bitwarden.vault.UriMatchType
|
||||
import com.x8bit.bitwarden.data.vault.datasource.sdk.model.createMockSdkFido2CredentialList
|
||||
import com.x8bit.bitwarden.ui.vault.feature.addedit.VaultAddEditState
|
||||
@@ -609,7 +609,7 @@ class VaultAddItemStateExtensionsTest {
|
||||
passport = PassportView(
|
||||
surname = "Wayne",
|
||||
givenName = "Bruce",
|
||||
dateOfBirth = "1939-05-27",
|
||||
dateOfBirth = LocalDate.parse("1939-05-27"),
|
||||
birthPlace = "Gotham City",
|
||||
sex = "M",
|
||||
nationality = "American",
|
||||
@@ -617,8 +617,8 @@ class VaultAddItemStateExtensionsTest {
|
||||
passportType = "Regular",
|
||||
issuingCountry = "USA",
|
||||
issuingAuthority = "U.S. Department of State",
|
||||
issueDate = "2020-01-15",
|
||||
expirationDate = "2030-01-15",
|
||||
issueDate = LocalDate.parse("2020-01-15"),
|
||||
expirationDate = LocalDate.parse("2030-01-15"),
|
||||
nationalIdentificationNumber = "987-65-4321",
|
||||
),
|
||||
favorite = false,
|
||||
@@ -690,13 +690,13 @@ class VaultAddItemStateExtensionsTest {
|
||||
firstName = "Bruce",
|
||||
middleName = "Thomas",
|
||||
lastName = "Wayne",
|
||||
dateOfBirth = "1939-05-27",
|
||||
dateOfBirth = LocalDate.parse("1939-05-27"),
|
||||
licenseNumber = "DL12345678",
|
||||
issuingCountry = "USA",
|
||||
issuingState = "NJ",
|
||||
issueDate = "2020-01-15",
|
||||
issueDate = LocalDate.parse("2020-01-15"),
|
||||
issuingAuthority = "NJ MVC",
|
||||
expirationDate = "2030-01-15",
|
||||
expirationDate = LocalDate.parse("2030-01-15"),
|
||||
licenseClass = "D",
|
||||
),
|
||||
passport = null,
|
||||
|
||||
@@ -29,7 +29,7 @@ androidxRoom = "2.8.4"
|
||||
androidxSecurityCrypto = "1.1.0"
|
||||
androidxSplash = "1.2.0"
|
||||
androidxWork = "2.11.2"
|
||||
bitwardenSdk = "3.0.0-7895-3831dfe2"
|
||||
bitwardenSdk = "3.0.0-7896-62f4decd"
|
||||
crashlytics = "3.0.7"
|
||||
detekt = "1.23.8"
|
||||
firebaseBom = "34.15.0"
|
||||
|
||||
Reference in New Issue
Block a user