mirror of
https://github.com/bitwarden/android.git
synced 2026-08-23 17:47:57 -05:00
PM-30130: feat: Remove the Archive Items feature flag (#6667)
This commit is contained in:
@@ -4,7 +4,6 @@ import android.os.Parcelable
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.bitwarden.annotation.OmitFromCoverage
|
||||
import com.bitwarden.core.data.manager.model.FlagKey
|
||||
import com.bitwarden.core.data.repository.model.DataState
|
||||
import com.bitwarden.data.repository.util.baseIconUrl
|
||||
import com.bitwarden.data.repository.util.baseWebSendUrl
|
||||
@@ -31,7 +30,6 @@ import com.x8bit.bitwarden.data.autofill.accessibility.manager.AccessibilitySele
|
||||
import com.x8bit.bitwarden.data.autofill.manager.AutofillSelectionManager
|
||||
import com.x8bit.bitwarden.data.autofill.model.AutofillSelectionData
|
||||
import com.x8bit.bitwarden.data.autofill.util.login
|
||||
import com.x8bit.bitwarden.data.platform.manager.FeatureFlagManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.PolicyManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.SpecialCircumstanceManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.clipboard.BitwardenClipboardManager
|
||||
@@ -106,7 +104,6 @@ class SearchViewModel @Inject constructor(
|
||||
settingsRepo: SettingsRepository,
|
||||
snackbarRelayManager: SnackbarRelayManager<SnackbarRelay>,
|
||||
specialCircumstanceManager: SpecialCircumstanceManager,
|
||||
featureFlagManager: FeatureFlagManager,
|
||||
) : BaseViewModel<SearchState, SearchEvent, SearchAction>(
|
||||
// We load the state from the savedStateHandle for testing purposes.
|
||||
initialState = savedStateHandle[KEY_STATE]
|
||||
@@ -142,7 +139,6 @@ class SearchViewModel @Inject constructor(
|
||||
hasMasterPassword = userState.activeAccount.hasMasterPassword,
|
||||
isPremium = userState.activeAccount.isPremium,
|
||||
restrictItemTypesPolicyOrgIds = persistentListOf(),
|
||||
isArchiveEnabled = featureFlagManager.getFeatureFlag(FlagKey.ArchiveItems),
|
||||
)
|
||||
},
|
||||
) {
|
||||
@@ -182,12 +178,6 @@ class SearchViewModel @Inject constructor(
|
||||
.map { SearchAction.Internal.SnackbarDataReceived(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
featureFlagManager
|
||||
.getFeatureFlagFlow(FlagKey.ArchiveItems)
|
||||
.map { SearchAction.Internal.ArchiveItemsFlagUpdateReceive(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
override fun handleAction(action: SearchAction) {
|
||||
@@ -649,10 +639,6 @@ class SearchViewModel @Inject constructor(
|
||||
handleDecryptCipherErrorReceive(action)
|
||||
}
|
||||
|
||||
is SearchAction.Internal.ArchiveItemsFlagUpdateReceive -> {
|
||||
handleArchiveItemsFlagUpdateReceive(action)
|
||||
}
|
||||
|
||||
is SearchAction.Internal.ArchiveCipherReceive -> handleArchiveCipherReceive(action)
|
||||
is SearchAction.Internal.UnarchiveCipherReceive -> handleUnarchiveCipherReceive(action)
|
||||
}
|
||||
@@ -672,12 +658,6 @@ class SearchViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleArchiveItemsFlagUpdateReceive(
|
||||
action: SearchAction.Internal.ArchiveItemsFlagUpdateReceive,
|
||||
) {
|
||||
mutableStateFlow.update { it.copy(isArchiveEnabled = action.isEnabled) }
|
||||
}
|
||||
|
||||
private fun handleArchiveCipherReceive(action: SearchAction.Internal.ArchiveCipherReceive) {
|
||||
when (val result = action.result) {
|
||||
is ArchiveCipherResult.Error -> {
|
||||
@@ -1026,7 +1006,6 @@ class SearchViewModel @Inject constructor(
|
||||
isIconLoadingDisabled = state.isIconLoadingDisabled,
|
||||
isAutofill = state.isAutofill,
|
||||
isPremiumUser = state.isPremium,
|
||||
isArchiveEnabled = state.isArchiveEnabled,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1093,7 +1072,6 @@ data class SearchState(
|
||||
val hasMasterPassword: Boolean,
|
||||
val isPremium: Boolean,
|
||||
val restrictItemTypesPolicyOrgIds: ImmutableList<String>,
|
||||
val isArchiveEnabled: Boolean,
|
||||
) : Parcelable {
|
||||
|
||||
/**
|
||||
@@ -1526,13 +1504,6 @@ sealed class SearchAction {
|
||||
data class DecryptCipherErrorReceive(
|
||||
val error: Throwable?,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that the Archive Items flag has been updated.
|
||||
*/
|
||||
data class ArchiveItemsFlagUpdateReceive(
|
||||
val isEnabled: Boolean,
|
||||
) : Internal()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-8
@@ -164,7 +164,6 @@ fun List<CipherListView>.toViewState(
|
||||
isIconLoadingDisabled: Boolean,
|
||||
isAutofill: Boolean,
|
||||
isPremiumUser: Boolean,
|
||||
isArchiveEnabled: Boolean,
|
||||
): SearchState.ViewState =
|
||||
when {
|
||||
searchTerm.isEmpty() -> SearchState.ViewState.Empty(message = null)
|
||||
@@ -176,7 +175,6 @@ fun List<CipherListView>.toViewState(
|
||||
isIconLoadingDisabled = isIconLoadingDisabled,
|
||||
isAutofill = isAutofill,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -188,14 +186,12 @@ fun List<CipherListView>.toViewState(
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
private fun List<CipherListView>.toDisplayItemList(
|
||||
baseIconUrl: String,
|
||||
hasMasterPassword: Boolean,
|
||||
isIconLoadingDisabled: Boolean,
|
||||
isAutofill: Boolean,
|
||||
isPremiumUser: Boolean,
|
||||
isArchiveEnabled: Boolean,
|
||||
): ImmutableList<SearchState.DisplayItem> =
|
||||
this
|
||||
.map {
|
||||
@@ -205,20 +201,17 @@ private fun List<CipherListView>.toDisplayItemList(
|
||||
isIconLoadingDisabled = isIconLoadingDisabled,
|
||||
isAutofill = isAutofill,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
)
|
||||
}
|
||||
.sortAlphabetically()
|
||||
.toImmutableList()
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
private fun CipherListView.toDisplayItem(
|
||||
baseIconUrl: String,
|
||||
hasMasterPassword: Boolean,
|
||||
isIconLoadingDisabled: Boolean,
|
||||
isAutofill: Boolean,
|
||||
isPremiumUser: Boolean,
|
||||
isArchiveEnabled: Boolean,
|
||||
): SearchState.DisplayItem =
|
||||
SearchState.DisplayItem(
|
||||
id = id.orEmpty(),
|
||||
@@ -234,7 +227,6 @@ private fun CipherListView.toDisplayItem(
|
||||
overflowOptions = toOverflowActions(
|
||||
hasMasterPassword = hasMasterPassword,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
overflowTestTag = "CipherOptionsButton",
|
||||
totpCode = login?.totp,
|
||||
|
||||
+2
-29
@@ -184,7 +184,6 @@ class VaultAddEditViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
VaultAddEditState(
|
||||
isArchiveEnabled = featureFlagManager.getFeatureFlag(FlagKey.ArchiveItems),
|
||||
isCardScannerEnabled = featureFlagManager.getFeatureFlag(FlagKey.CardScanner),
|
||||
vaultAddEditType = vaultAddEditType,
|
||||
cipherType = vaultCipherType,
|
||||
@@ -281,12 +280,6 @@ class VaultAddEditViewModel @Inject constructor(
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
featureFlagManager
|
||||
.getFeatureFlagFlow(FlagKey.ArchiveItems)
|
||||
.map { VaultAddEditAction.Internal.ArchiveItemsFlagUpdateReceive(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
featureFlagManager
|
||||
.getFeatureFlagFlow(FlagKey.CardScanner)
|
||||
.map { VaultAddEditAction.Internal.CardScannerFlagUpdateReceive(it) }
|
||||
@@ -1706,10 +1699,6 @@ class VaultAddEditViewModel @Inject constructor(
|
||||
handleUnarchiveCipherReceive(action)
|
||||
}
|
||||
|
||||
is VaultAddEditAction.Internal.ArchiveItemsFlagUpdateReceive -> {
|
||||
handleArchiveItemsFlagUpdateReceive(action)
|
||||
}
|
||||
|
||||
is VaultAddEditAction.Internal.CardScannerFlagUpdateReceive -> {
|
||||
handleCardScannerFlagUpdateReceive(action)
|
||||
}
|
||||
@@ -1929,12 +1918,6 @@ class VaultAddEditViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleArchiveItemsFlagUpdateReceive(
|
||||
action: VaultAddEditAction.Internal.ArchiveItemsFlagUpdateReceive,
|
||||
) {
|
||||
mutableStateFlow.update { it.copy(isArchiveEnabled = action.isEnabled) }
|
||||
}
|
||||
|
||||
private fun handleCardScannerFlagUpdateReceive(
|
||||
action: VaultAddEditAction.Internal.CardScannerFlagUpdateReceive,
|
||||
) {
|
||||
@@ -2544,7 +2527,6 @@ data class VaultAddEditState(
|
||||
val createCredentialRequest: CreateCredentialRequest? = null,
|
||||
val defaultUriMatchType: UriMatchType,
|
||||
private val shouldShowCoachMarkTour: Boolean,
|
||||
private val isArchiveEnabled: Boolean,
|
||||
val isCardScannerEnabled: Boolean,
|
||||
) : Parcelable {
|
||||
|
||||
@@ -2602,8 +2584,7 @@ data class VaultAddEditState(
|
||||
* Helper to determine if the UI should display the archive button.
|
||||
*/
|
||||
val displayArchiveButton: Boolean
|
||||
get() = isArchiveEnabled &&
|
||||
isEditItemMode &&
|
||||
get() = isEditItemMode &&
|
||||
(viewState as? ViewState.Content)
|
||||
?.common
|
||||
?.originalCipher
|
||||
@@ -2613,8 +2594,7 @@ data class VaultAddEditState(
|
||||
* Helper to determine if the UI should display the unarchive button.
|
||||
*/
|
||||
val displayUnarchiveButton: Boolean
|
||||
get() = isArchiveEnabled &&
|
||||
isEditItemMode &&
|
||||
get() = isEditItemMode &&
|
||||
(viewState as? ViewState.Content)
|
||||
?.common
|
||||
?.originalCipher
|
||||
@@ -3992,13 +3972,6 @@ sealed class VaultAddEditAction {
|
||||
val folderData: DataState<List<FolderView>>,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that the Archive Items flag has been updated.
|
||||
*/
|
||||
data class ArchiveItemsFlagUpdateReceive(
|
||||
val isEnabled: Boolean,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that the Card Scanner flag has been updated.
|
||||
*/
|
||||
|
||||
+9
-39
@@ -4,7 +4,6 @@ import android.net.Uri
|
||||
import android.os.Parcelable
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.bitwarden.core.data.manager.model.FlagKey
|
||||
import com.bitwarden.core.data.repository.model.DataState
|
||||
import com.bitwarden.core.data.repository.util.combineDataStates
|
||||
import com.bitwarden.core.data.repository.util.mapNullable
|
||||
@@ -25,10 +24,9 @@ import com.bitwarden.ui.util.asText
|
||||
import com.bitwarden.ui.util.concat
|
||||
import com.bitwarden.vault.CipherView
|
||||
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.BreachCountResult
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.UserState
|
||||
import com.x8bit.bitwarden.data.platform.manager.FeatureFlagManager
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.clipboard.BitwardenClipboardManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.event.OrganizationEventManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.model.OrganizationEvent
|
||||
@@ -84,7 +82,6 @@ class VaultItemViewModel @Inject constructor(
|
||||
private val settingsRepository: SettingsRepository,
|
||||
private val snackbarRelayManager: SnackbarRelayManager<SnackbarRelay>,
|
||||
private val premiumStateManager: PremiumStateManager,
|
||||
featureFlagManager: FeatureFlagManager,
|
||||
) : BaseViewModel<VaultItemState, VaultItemEvent, VaultItemAction>(
|
||||
// We load the state from the savedStateHandle for testing purposes.
|
||||
initialState = savedStateHandle[KEY_STATE] ?: run {
|
||||
@@ -97,7 +94,6 @@ class VaultItemViewModel @Inject constructor(
|
||||
baseIconUrl = environmentRepository.environment.environmentUrlData.baseIconUrl,
|
||||
isIconLoadingDisabled = settingsRepository.isIconLoadingDisabled,
|
||||
hasPremium = authRepository.userStateFlow.value?.activeAccount?.isPremium == true,
|
||||
isArchiveEnabled = featureFlagManager.getFeatureFlag(FlagKey.ArchiveItems),
|
||||
)
|
||||
},
|
||||
) {
|
||||
@@ -234,12 +230,6 @@ class VaultItemViewModel @Inject constructor(
|
||||
.map { VaultItemAction.Internal.SnackbarDataReceived(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
featureFlagManager
|
||||
.getFeatureFlagFlow(FlagKey.ArchiveItems)
|
||||
.map { VaultItemAction.Internal.ArchiveItemsFlagUpdateReceive(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
override fun handleAction(action: VaultItemAction) {
|
||||
@@ -1073,10 +1063,6 @@ class VaultItemViewModel @Inject constructor(
|
||||
handleIsIconLoadingDisabledUpdateReceive(action)
|
||||
}
|
||||
|
||||
is VaultItemAction.Internal.ArchiveItemsFlagUpdateReceive -> {
|
||||
handleArchiveItemsFlagUpdateReceive(action)
|
||||
}
|
||||
|
||||
is VaultItemAction.Internal.ArchiveCipherReceive -> handleArchiveCipherReceive(action)
|
||||
is VaultItemAction.Internal.UnarchiveCipherReceive -> {
|
||||
handleUnarchiveCipherReceive(action)
|
||||
@@ -1312,12 +1298,6 @@ class VaultItemViewModel @Inject constructor(
|
||||
mutableStateFlow.update { it.copy(isIconLoadingDisabled = action.isDisabled) }
|
||||
}
|
||||
|
||||
private fun handleArchiveItemsFlagUpdateReceive(
|
||||
action: VaultItemAction.Internal.ArchiveItemsFlagUpdateReceive,
|
||||
) {
|
||||
mutableStateFlow.update { it.copy(isArchiveEnabled = action.isEnabled) }
|
||||
}
|
||||
|
||||
private fun handleArchiveCipherReceive(action: VaultItemAction.Internal.ArchiveCipherReceive) {
|
||||
when (val result = action.result) {
|
||||
is ArchiveCipherResult.Error -> {
|
||||
@@ -1456,7 +1436,6 @@ data class VaultItemState(
|
||||
val dialog: DialogState?,
|
||||
val baseIconUrl: String,
|
||||
val isIconLoadingDisabled: Boolean,
|
||||
val isArchiveEnabled: Boolean,
|
||||
val hasPremium: Boolean,
|
||||
) : Parcelable {
|
||||
|
||||
@@ -1523,21 +1502,19 @@ data class VaultItemState(
|
||||
* Helper to determine if the UI should display the archive button.
|
||||
*/
|
||||
val displayArchiveButton: Boolean
|
||||
get() = isArchiveEnabled &&
|
||||
viewState.asContentOrNull()
|
||||
?.common
|
||||
?.currentCipher
|
||||
?.isActive == true
|
||||
get() = viewState.asContentOrNull()
|
||||
?.common
|
||||
?.currentCipher
|
||||
?.isActive == true
|
||||
|
||||
/**
|
||||
* Helper to determine if the UI should display the unarchive button.
|
||||
*/
|
||||
val displayUnarchiveButton: Boolean
|
||||
get() = isArchiveEnabled &&
|
||||
viewState.asContentOrNull()
|
||||
?.common
|
||||
?.currentCipher
|
||||
?.let { it.archivedDate != null && it.deletedDate == null } == true
|
||||
get() = viewState.asContentOrNull()
|
||||
?.common
|
||||
?.currentCipher
|
||||
?.let { it.archivedDate != null && it.deletedDate == null } == true
|
||||
|
||||
val canAssignToCollections: Boolean
|
||||
get() = viewState.asContentOrNull()
|
||||
@@ -2387,13 +2364,6 @@ sealed class VaultItemAction {
|
||||
val data: BitwardenSnackbarData,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that the Archive Items flag has been updated.
|
||||
*/
|
||||
data class ArchiveItemsFlagUpdateReceive(
|
||||
val isEnabled: Boolean,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that the archive cipher result has been received.
|
||||
*/
|
||||
|
||||
-29
@@ -11,7 +11,6 @@ import androidx.credentials.provider.ProviderCreateCredentialRequest
|
||||
import androidx.credentials.provider.ProviderGetCredentialRequest
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.bitwarden.core.data.manager.model.FlagKey
|
||||
import com.bitwarden.core.data.manager.toast.ToastManager
|
||||
import com.bitwarden.core.data.repository.model.DataState
|
||||
import com.bitwarden.core.data.repository.util.map
|
||||
@@ -59,7 +58,6 @@ import com.x8bit.bitwarden.data.credentials.model.ValidateOriginResult
|
||||
import com.x8bit.bitwarden.data.credentials.parser.RelyingPartyParser
|
||||
import com.x8bit.bitwarden.data.credentials.repository.PrivilegedAppRepository
|
||||
import com.x8bit.bitwarden.data.credentials.util.getCreatePasskeyCredentialRequestOrNull
|
||||
import com.x8bit.bitwarden.data.platform.manager.FeatureFlagManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.PolicyManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.SpecialCircumstanceManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.ciphermatching.CipherMatchingManager
|
||||
@@ -154,7 +152,6 @@ class VaultItemListingViewModel @Inject constructor(
|
||||
private val toastManager: ToastManager,
|
||||
private val premiumStateManager: PremiumStateManager,
|
||||
snackbarRelayManager: SnackbarRelayManager<SnackbarRelay>,
|
||||
featureFlagManager: FeatureFlagManager,
|
||||
) : BaseViewModel<VaultItemListingState, VaultItemListingEvent, VaultItemListingsAction>(
|
||||
initialState = run {
|
||||
val userState = requireNotNull(authRepository.userStateFlow.value)
|
||||
@@ -196,7 +193,6 @@ class VaultItemListingViewModel @Inject constructor(
|
||||
getCredentialsRequest = providerGetCredentialsRequest,
|
||||
isPremium = userState.activeAccount.isPremium,
|
||||
isRefreshing = false,
|
||||
isArchiveEnabled = featureFlagManager.getFeatureFlag(FlagKey.ArchiveItems),
|
||||
)
|
||||
},
|
||||
) {
|
||||
@@ -244,12 +240,6 @@ class VaultItemListingViewModel @Inject constructor(
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
featureFlagManager
|
||||
.getFeatureFlagFlow(FlagKey.ArchiveItems)
|
||||
.map { VaultItemListingsAction.Internal.ArchiveItemsFlagUpdateReceive(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
specialCircumstanceManager.specialCircumstance
|
||||
?.toCreateCredentialRequestOrNull()
|
||||
?.let { request ->
|
||||
@@ -1695,10 +1685,6 @@ class VaultItemListingViewModel @Inject constructor(
|
||||
handleCredentialOperationFailureReceive(action)
|
||||
}
|
||||
|
||||
is VaultItemListingsAction.Internal.ArchiveItemsFlagUpdateReceive -> {
|
||||
handleArchiveItemsFlagUpdateReceive(action)
|
||||
}
|
||||
|
||||
is VaultItemListingsAction.Internal.ArchiveCipherReceive -> {
|
||||
handleArchiveCipherReceive(action)
|
||||
}
|
||||
@@ -1719,12 +1705,6 @@ class VaultItemListingViewModel @Inject constructor(
|
||||
)
|
||||
}
|
||||
|
||||
private fun handleArchiveItemsFlagUpdateReceive(
|
||||
action: VaultItemListingsAction.Internal.ArchiveItemsFlagUpdateReceive,
|
||||
) {
|
||||
mutableStateFlow.update { it.copy(isArchiveEnabled = action.isEnabled) }
|
||||
}
|
||||
|
||||
private fun handleArchiveCipherReceive(
|
||||
action: VaultItemListingsAction.Internal.ArchiveCipherReceive,
|
||||
) {
|
||||
@@ -2674,7 +2654,6 @@ class VaultItemListingViewModel @Inject constructor(
|
||||
totpData = state.totpData,
|
||||
isPremiumUser = state.isPremium,
|
||||
restrictItemTypesPolicyOrgIds = state.restrictItemTypesPolicyOrgIds,
|
||||
isArchiveEnabled = state.isArchiveEnabled,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2882,7 +2861,6 @@ data class VaultItemListingState(
|
||||
val hasMasterPassword: Boolean,
|
||||
val isPremium: Boolean,
|
||||
val isRefreshing: Boolean,
|
||||
val isArchiveEnabled: Boolean,
|
||||
) {
|
||||
/**
|
||||
* Indicates what action card to display.
|
||||
@@ -3977,13 +3955,6 @@ sealed class VaultItemListingsAction {
|
||||
val data: BitwardenSnackbarData,
|
||||
) : Internal(), BackgroundEvent
|
||||
|
||||
/**
|
||||
* Indicates that the Archive Items flag has been updated.
|
||||
*/
|
||||
data class ArchiveItemsFlagUpdateReceive(
|
||||
val isEnabled: Boolean,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that an error occurred while decrypting a cipher.
|
||||
*/
|
||||
|
||||
-6
@@ -119,7 +119,6 @@ fun VaultData.toViewState(
|
||||
totpData: TotpData?,
|
||||
isPremiumUser: Boolean,
|
||||
restrictItemTypesPolicyOrgIds: List<String>,
|
||||
isArchiveEnabled: Boolean,
|
||||
): VaultItemListingState.ViewState {
|
||||
val filteredCipherViewList = decryptCipherListResult
|
||||
.successes
|
||||
@@ -168,7 +167,6 @@ fun VaultData.toViewState(
|
||||
isAutofill = autofillSelectionData != null,
|
||||
isFido2Creation = createCredentialRequestData != null,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
),
|
||||
displayFolderList = folderList.map { folderView ->
|
||||
@@ -410,7 +408,6 @@ private fun List<CipherListView>.toDisplayItemList(
|
||||
isAutofill: Boolean,
|
||||
isFido2Creation: Boolean,
|
||||
isPremiumUser: Boolean,
|
||||
isArchiveEnabled: Boolean,
|
||||
): List<VaultItemListingState.DisplayItem> =
|
||||
this.map {
|
||||
it.toDisplayItem(
|
||||
@@ -420,7 +417,6 @@ private fun List<CipherListView>.toDisplayItemList(
|
||||
isAutofill = isAutofill,
|
||||
isFido2Creation = isFido2Creation,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -443,7 +439,6 @@ private fun CipherListView.toDisplayItem(
|
||||
isAutofill: Boolean,
|
||||
isFido2Creation: Boolean,
|
||||
isPremiumUser: Boolean,
|
||||
isArchiveEnabled: Boolean,
|
||||
): VaultItemListingState.DisplayItem =
|
||||
VaultItemListingState.DisplayItem(
|
||||
id = id.orEmpty(),
|
||||
@@ -469,7 +464,6 @@ private fun CipherListView.toDisplayItem(
|
||||
overflowOptions = this.toOverflowActions(
|
||||
hasMasterPassword = hasMasterPassword,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
optionsTestTag = "CipherOptionsButton",
|
||||
isAutofill = isAutofill,
|
||||
|
||||
+2
-5
@@ -20,7 +20,6 @@ import kotlinx.collections.immutable.toImmutableList
|
||||
fun CipherListView.toOverflowActions(
|
||||
hasMasterPassword: Boolean,
|
||||
isPremiumUser: Boolean,
|
||||
isArchiveEnabled: Boolean,
|
||||
): ImmutableList<ListingItemOverflowAction.VaultAction> =
|
||||
this
|
||||
.id
|
||||
@@ -89,11 +88,9 @@ fun CipherListView.toOverflowActions(
|
||||
ListingItemOverflowAction.VaultAction.LaunchClick(url = it)
|
||||
},
|
||||
ListingItemOverflowAction.VaultAction.ArchiveClick(cipherId = cipherId)
|
||||
.takeIf { this.isActive && isArchiveEnabled },
|
||||
.takeIf { this.isActive },
|
||||
ListingItemOverflowAction.VaultAction.UnarchiveClick(cipherId = cipherId)
|
||||
.takeIf {
|
||||
this.archivedDate != null && deletedDate == null && isArchiveEnabled
|
||||
},
|
||||
.takeIf { this.archivedDate != null && deletedDate == null },
|
||||
)
|
||||
}
|
||||
.orEmpty()
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.x8bit.bitwarden.ui.vault.feature.vault.handlers.VaultHandlers
|
||||
|
||||
private const val TOTP_TYPES_COUNT: Int = 1
|
||||
private const val HIDDEN_TYPES_COUNT: Int = 2
|
||||
private const val TRASH_TYPES_COUNT: Int = 1
|
||||
|
||||
/**
|
||||
* Content view for the [VaultScreen].
|
||||
@@ -454,11 +453,7 @@ fun VaultContent(
|
||||
item(key = "hidden_items_header") {
|
||||
BitwardenListHeaderText(
|
||||
label = stringResource(id = BitwardenString.hidden_items),
|
||||
supportingLabel = if (state.archiveEnabled) {
|
||||
HIDDEN_TYPES_COUNT.toString()
|
||||
} else {
|
||||
TRASH_TYPES_COUNT.toString()
|
||||
},
|
||||
supportingLabel = HIDDEN_TYPES_COUNT.toString(),
|
||||
modifier = Modifier
|
||||
.animateItem()
|
||||
.fillMaxWidth()
|
||||
@@ -468,23 +463,21 @@ fun VaultContent(
|
||||
Spacer(modifier = Modifier.height(height = 8.dp))
|
||||
}
|
||||
|
||||
if (state.archiveEnabled) {
|
||||
item(key = "archive_group") {
|
||||
BitwardenGroupItem(
|
||||
startIcon = IconData.Local(iconRes = BitwardenDrawable.ic_archive),
|
||||
endIcon = state.archiveEndIcon?.let { IconData.Local(iconRes = it) },
|
||||
label = stringResource(id = BitwardenString.archive_noun),
|
||||
subLabel = state.archiveSubText?.invoke(),
|
||||
supportingLabel = state.archivedItemsCount?.toString().orEmpty(),
|
||||
onClick = vaultHandlers.archiveClick,
|
||||
cardStyle = CardStyle.Top(dividerPadding = 56.dp),
|
||||
modifier = Modifier
|
||||
.animateItem()
|
||||
.fillMaxWidth()
|
||||
.testTag(tag = "ArchiveFilter")
|
||||
.standardHorizontalMargin(),
|
||||
)
|
||||
}
|
||||
item(key = "archive_group") {
|
||||
BitwardenGroupItem(
|
||||
startIcon = IconData.Local(iconRes = BitwardenDrawable.ic_archive),
|
||||
endIcon = state.archiveEndIcon?.let { IconData.Local(iconRes = it) },
|
||||
label = stringResource(id = BitwardenString.archive_noun),
|
||||
subLabel = state.archiveSubText?.invoke(),
|
||||
supportingLabel = state.archivedItemsCount?.toString().orEmpty(),
|
||||
onClick = vaultHandlers.archiveClick,
|
||||
cardStyle = CardStyle.Top(dividerPadding = 56.dp),
|
||||
modifier = Modifier
|
||||
.animateItem()
|
||||
.fillMaxWidth()
|
||||
.testTag(tag = "ArchiveFilter")
|
||||
.standardHorizontalMargin(),
|
||||
)
|
||||
}
|
||||
|
||||
item(key = "trash_group") {
|
||||
@@ -493,7 +486,7 @@ fun VaultContent(
|
||||
label = stringResource(id = BitwardenString.trash),
|
||||
supportingLabel = state.trashItemsCount.toString(),
|
||||
onClick = vaultHandlers.trashClick,
|
||||
cardStyle = if (state.archiveEnabled) CardStyle.Bottom else CardStyle.Full,
|
||||
cardStyle = CardStyle.Bottom,
|
||||
modifier = Modifier
|
||||
.animateItem()
|
||||
.fillMaxWidth()
|
||||
|
||||
@@ -145,7 +145,6 @@ class VaultViewModel @Inject constructor(
|
||||
viewState = VaultState.ViewState.Loading,
|
||||
isIconLoadingDisabled = settingsRepository.isIconLoadingDisabled,
|
||||
isPremium = activeAccount.isPremium,
|
||||
isArchiveEnabled = featureFlagManager.getFeatureFlag(FlagKey.ArchiveItems),
|
||||
isPullToRefreshSettingEnabled = settingsRepository.getPullToRefreshEnabledFlow().value,
|
||||
baseIconUrl = activeAccount.environment.environmentUrlData.baseIconUrl,
|
||||
hasMasterPassword = activeAccount.hasMasterPassword,
|
||||
@@ -273,11 +272,6 @@ class VaultViewModel @Inject constructor(
|
||||
.map { VaultAction.Internal.CredentialExchangeProtocolExportFlagUpdateReceive(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
featureFlagManager
|
||||
.getFeatureFlagFlow(FlagKey.ArchiveItems)
|
||||
.map { VaultAction.Internal.ArchiveItemsFlagUpdateReceive(it) }
|
||||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
|
||||
viewModelScope.launch {
|
||||
delay(timeMillis = BROWSER_AUTOFILL_DIALOG_DELAY)
|
||||
@@ -990,10 +984,6 @@ class VaultViewModel @Inject constructor(
|
||||
handleCredentialExchangeProtocolExportFlagUpdateReceive(action)
|
||||
}
|
||||
|
||||
is VaultAction.Internal.ArchiveItemsFlagUpdateReceive -> {
|
||||
handleArchiveItemsFlagUpdateReceive(action)
|
||||
}
|
||||
|
||||
is VaultAction.Internal.ArchiveCipherReceive -> handleArchiveCipherReceive(action)
|
||||
is VaultAction.Internal.UnarchiveCipherReceive -> handleUnarchiveCipherReceive(action)
|
||||
is VaultAction.Internal.IntroducingArchiveActionCardDismissedFlowReceive -> {
|
||||
@@ -1074,12 +1064,6 @@ class VaultViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleArchiveItemsFlagUpdateReceive(
|
||||
action: VaultAction.Internal.ArchiveItemsFlagUpdateReceive,
|
||||
) {
|
||||
mutableStateFlow.update { it.copy(isArchiveEnabled = action.isEnabled) }
|
||||
}
|
||||
|
||||
private fun handleArchiveCipherReceive(action: VaultAction.Internal.ArchiveCipherReceive) {
|
||||
when (val result = action.result) {
|
||||
is ArchiveCipherResult.Error -> {
|
||||
@@ -1282,7 +1266,6 @@ class VaultViewModel @Inject constructor(
|
||||
?: BitwardenString.generic_error_message.asText(),
|
||||
isRefreshing = false,
|
||||
restrictItemTypesPolicyOrgIds = state.restrictItemTypesPolicyOrgIds,
|
||||
isArchiveEnabled = state.isArchiveEnabled,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1347,7 +1330,6 @@ class VaultViewModel @Inject constructor(
|
||||
hasMasterPassword = state.hasMasterPassword,
|
||||
vaultFilterType = vaultFilterTypeOrDefault,
|
||||
restrictItemTypesPolicyOrgIds = state.restrictItemTypesPolicyOrgIds,
|
||||
isArchiveEnabled = state.isArchiveEnabled,
|
||||
),
|
||||
dialog = dialog,
|
||||
isRefreshing = false,
|
||||
@@ -1392,7 +1374,6 @@ class VaultViewModel @Inject constructor(
|
||||
hasMasterPassword = state.hasMasterPassword,
|
||||
vaultFilterType = vaultFilterTypeOrDefault,
|
||||
restrictItemTypesPolicyOrgIds = state.restrictItemTypesPolicyOrgIds,
|
||||
isArchiveEnabled = state.isArchiveEnabled,
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -1544,7 +1525,6 @@ data class VaultState(
|
||||
val flightRecorderSnackBar: BitwardenSnackbarData?,
|
||||
// Internal-use properties
|
||||
val isSwitchingAccounts: Boolean = false,
|
||||
val isArchiveEnabled: Boolean,
|
||||
val isPremium: Boolean,
|
||||
val hasMasterPassword: Boolean,
|
||||
private val isPullToRefreshSettingEnabled: Boolean,
|
||||
@@ -1566,9 +1546,7 @@ data class VaultState(
|
||||
ActionCardState.UpgradePremium
|
||||
.takeIf { isPremiumUpgradeBannerEligible }
|
||||
?: ActionCardState.IntroducingArchive.takeIf {
|
||||
isPremium &&
|
||||
!isIntroducingArchiveActionCardDismissed &&
|
||||
isArchiveEnabled
|
||||
isPremium && !isIntroducingArchiveActionCardDismissed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1655,7 +1633,6 @@ data class VaultState(
|
||||
* @property collectionItems The list of collections to be displayed.
|
||||
* @property trashItemsCount The number of items present in the trash.
|
||||
* @property archivedItemsCount The number of items present in archive.
|
||||
* @property archiveEnabled Is the archive feature enabled.
|
||||
* @property archiveSubText The subtext to be displayed on the archive item.
|
||||
* @property archiveEndIcon The end icon to be displayed on the archive item.
|
||||
* @property showCardGroup Is the card group available for display.
|
||||
@@ -1675,7 +1652,6 @@ data class VaultState(
|
||||
val collectionItems: List<CollectionItem>,
|
||||
val trashItemsCount: Int,
|
||||
val archivedItemsCount: Int?,
|
||||
val archiveEnabled: Boolean,
|
||||
val archiveSubText: Text?,
|
||||
@field:DrawableRes val archiveEndIcon: Int?,
|
||||
val showCardGroup: Boolean,
|
||||
@@ -2437,13 +2413,6 @@ sealed class VaultAction {
|
||||
val isCredentialExchangeProtocolExportEnabled: Boolean,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that the Archive Items flag has been updated.
|
||||
*/
|
||||
data class ArchiveItemsFlagUpdateReceive(
|
||||
val isEnabled: Boolean,
|
||||
) : Internal()
|
||||
|
||||
/**
|
||||
* Indicates that the archive cipher result has been received.
|
||||
*/
|
||||
@@ -2487,7 +2456,6 @@ private fun MutableStateFlow<VaultState>.updateToErrorStateOrDialog(
|
||||
errorMessage: Text,
|
||||
isRefreshing: Boolean,
|
||||
restrictItemTypesPolicyOrgIds: List<String>,
|
||||
isArchiveEnabled: Boolean,
|
||||
) {
|
||||
this.update {
|
||||
if (vaultData != null) {
|
||||
@@ -2499,7 +2467,6 @@ private fun MutableStateFlow<VaultState>.updateToErrorStateOrDialog(
|
||||
vaultFilterType = vaultFilterType,
|
||||
isIconLoadingDisabled = isIconLoadingDisabled,
|
||||
restrictItemTypesPolicyOrgIds = restrictItemTypesPolicyOrgIds,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
dialog = VaultState.DialogState.Error(
|
||||
title = errorTitle,
|
||||
|
||||
+1
-13
@@ -46,7 +46,6 @@ fun VaultData.toViewState(
|
||||
baseIconUrl: String,
|
||||
vaultFilterType: VaultFilterType,
|
||||
restrictItemTypesPolicyOrgIds: List<String>,
|
||||
isArchiveEnabled: Boolean,
|
||||
): VaultState.ViewState {
|
||||
val allCipherViews =
|
||||
decryptCipherListResult
|
||||
@@ -111,7 +110,6 @@ fun VaultData.toViewState(
|
||||
baseIconUrl = baseIconUrl,
|
||||
isPremiumUser = isPremium,
|
||||
hasDecryptionError = false,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
)
|
||||
}
|
||||
.plus(
|
||||
@@ -124,7 +122,6 @@ fun VaultData.toViewState(
|
||||
baseIconUrl = baseIconUrl,
|
||||
isPremiumUser = isPremium,
|
||||
hasDecryptionError = true,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
)
|
||||
},
|
||||
)
|
||||
@@ -159,7 +156,6 @@ fun VaultData.toViewState(
|
||||
baseIconUrl = baseIconUrl,
|
||||
isPremiumUser = isPremium,
|
||||
hasDecryptionError = false,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
)
|
||||
}
|
||||
.plus(
|
||||
@@ -172,7 +168,6 @@ fun VaultData.toViewState(
|
||||
baseIconUrl = baseIconUrl,
|
||||
isPremiumUser = isPremium,
|
||||
hasDecryptionError = true,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
)
|
||||
},
|
||||
),
|
||||
@@ -219,7 +214,6 @@ fun VaultData.toViewState(
|
||||
},
|
||||
trashItemsCount = allCipherViews.count { it.deletedDate != null },
|
||||
archivedItemsCount = archiveCount.takeIf { isPremium || archiveCount > 0 },
|
||||
archiveEnabled = isArchiveEnabled,
|
||||
archiveEndIcon = BitwardenDrawable.ic_locked.takeIf { !isPremium && archiveCount == 0 },
|
||||
archiveSubText = BitwardenString
|
||||
.premium_subscription_required
|
||||
@@ -279,14 +273,13 @@ fun List<LoginUriView>?.toLoginIconData(
|
||||
/**
|
||||
* Transforms a [CipherListView] into a [VaultState.ViewState.VaultItem].
|
||||
*/
|
||||
@Suppress("MagicNumber", "LongMethod", "CyclomaticComplexMethod", "LongParameterList")
|
||||
@Suppress("MagicNumber", "LongMethod", "CyclomaticComplexMethod")
|
||||
private fun CipherListView.toVaultItemOrNull(
|
||||
hasMasterPassword: Boolean,
|
||||
isIconLoadingDisabled: Boolean,
|
||||
baseIconUrl: String,
|
||||
isPremiumUser: Boolean,
|
||||
hasDecryptionError: Boolean,
|
||||
isArchiveEnabled: Boolean,
|
||||
): VaultState.ViewState.VaultItem? {
|
||||
val id = this.id ?: return null
|
||||
return when (type) {
|
||||
@@ -309,7 +302,6 @@ private fun CipherListView.toVaultItemOrNull(
|
||||
toOverflowActions(
|
||||
hasMasterPassword = hasMasterPassword,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
)
|
||||
},
|
||||
extraIconList = toLabelIcons(),
|
||||
@@ -324,7 +316,6 @@ private fun CipherListView.toVaultItemOrNull(
|
||||
overflowOptions = toOverflowActions(
|
||||
hasMasterPassword = hasMasterPassword,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
extraIconList = toLabelIcons(),
|
||||
shouldShowMasterPasswordReprompt = hasMasterPassword &&
|
||||
@@ -340,7 +331,6 @@ private fun CipherListView.toVaultItemOrNull(
|
||||
overflowOptions = toOverflowActions(
|
||||
hasMasterPassword = hasMasterPassword,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
extraIconList = toLabelIcons(),
|
||||
shouldShowMasterPasswordReprompt = hasMasterPassword &&
|
||||
@@ -355,7 +345,6 @@ private fun CipherListView.toVaultItemOrNull(
|
||||
overflowOptions = toOverflowActions(
|
||||
hasMasterPassword = hasMasterPassword,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
extraIconList = toLabelIcons(),
|
||||
shouldShowMasterPasswordReprompt = hasMasterPassword &&
|
||||
@@ -370,7 +359,6 @@ private fun CipherListView.toVaultItemOrNull(
|
||||
overflowOptions = toOverflowActions(
|
||||
hasMasterPassword = hasMasterPassword,
|
||||
isPremiumUser = isPremiumUser,
|
||||
isArchiveEnabled = isArchiveEnabled,
|
||||
),
|
||||
shouldShowMasterPasswordReprompt = hasMasterPassword &&
|
||||
reprompt == CipherRepromptType.PASSWORD,
|
||||
|
||||
@@ -1107,7 +1107,6 @@ private val DEFAULT_STATE: SearchState = SearchState(
|
||||
autofillSelectionData = null,
|
||||
isPremium = true,
|
||||
restrictItemTypesPolicyOrgIds = persistentListOf(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
private fun createStateForAutofill(
|
||||
|
||||
+1
-15
@@ -5,7 +5,6 @@ import androidx.lifecycle.SavedStateHandle
|
||||
import app.cash.turbine.test
|
||||
import app.cash.turbine.turbineScope
|
||||
import com.bitwarden.core.data.manager.dispatcher.FakeDispatcherManager
|
||||
import com.bitwarden.core.data.manager.model.FlagKey
|
||||
import com.bitwarden.core.data.repository.model.DataState
|
||||
import com.bitwarden.core.data.repository.util.bufferedMutableSharedFlow
|
||||
import com.bitwarden.data.repository.model.Environment
|
||||
@@ -26,7 +25,6 @@ import com.bitwarden.vault.CipherView
|
||||
import com.bitwarden.vault.LoginUriView
|
||||
import com.x8bit.bitwarden.data.auth.datasource.disk.model.OnboardingStatus
|
||||
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.UserState
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.ValidatePasswordResult
|
||||
import com.x8bit.bitwarden.data.autofill.accessibility.manager.AccessibilitySelectionManager
|
||||
@@ -34,7 +32,7 @@ import com.x8bit.bitwarden.data.autofill.accessibility.manager.AccessibilitySele
|
||||
import com.x8bit.bitwarden.data.autofill.manager.AutofillSelectionManager
|
||||
import com.x8bit.bitwarden.data.autofill.manager.AutofillSelectionManagerImpl
|
||||
import com.x8bit.bitwarden.data.autofill.model.AutofillSelectionData
|
||||
import com.x8bit.bitwarden.data.platform.manager.FeatureFlagManager
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.PolicyManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.SpecialCircumstanceManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.SpecialCircumstanceManagerImpl
|
||||
@@ -166,11 +164,6 @@ class SearchViewModelTest : BaseViewModelTest() {
|
||||
private val premiumStateManager: PremiumStateManager = mockk {
|
||||
every { isInAppUpgradeAvailable() } returns false
|
||||
}
|
||||
private val mutableArchiveItemsFlow = MutableStateFlow(true)
|
||||
private val featureFlagManager: FeatureFlagManager = mockk {
|
||||
every { getFeatureFlag(FlagKey.ArchiveItems) } answers { mutableArchiveItemsFlow.value }
|
||||
every { getFeatureFlagFlow(FlagKey.ArchiveItems) } returns mutableArchiveItemsFlow
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
fun setup() {
|
||||
@@ -1482,7 +1475,6 @@ class SearchViewModelTest : BaseViewModelTest() {
|
||||
isAutofill = false,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
} returns expectedViewState
|
||||
val dataState = DataState.Loaded(
|
||||
@@ -1594,7 +1586,6 @@ class SearchViewModelTest : BaseViewModelTest() {
|
||||
isAutofill = false,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
} returns expectedViewState
|
||||
mutableVaultDataStateFlow.tryEmit(
|
||||
@@ -1713,7 +1704,6 @@ class SearchViewModelTest : BaseViewModelTest() {
|
||||
isAutofill = false,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
} returns expectedViewState
|
||||
val dataState = DataState.Error(
|
||||
@@ -1835,7 +1825,6 @@ class SearchViewModelTest : BaseViewModelTest() {
|
||||
isAutofill = false,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
} returns expectedViewState
|
||||
val dataState = DataState.NoNetwork(
|
||||
@@ -2034,7 +2023,6 @@ class SearchViewModelTest : BaseViewModelTest() {
|
||||
organizationEventManager = organizationEventManager,
|
||||
premiumStateManager = premiumStateManager,
|
||||
snackbarRelayManager = snackbarRelayManager,
|
||||
featureFlagManager = featureFlagManager,
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -2070,7 +2058,6 @@ class SearchViewModelTest : BaseViewModelTest() {
|
||||
isAutofill = true,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
} returns expectedViewState
|
||||
val dataState = DataState.Loaded(
|
||||
@@ -2115,7 +2102,6 @@ private val DEFAULT_STATE: SearchState = SearchState(
|
||||
autofillSelectionData = null,
|
||||
isPremium = true,
|
||||
restrictItemTypesPolicyOrgIds = persistentListOf(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
private val DEFAULT_ACCOUNT = UserState.Account(
|
||||
|
||||
-5
@@ -376,7 +376,6 @@ class SearchTypeDataExtensionsTest {
|
||||
isAutofill = false,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(SearchState.ViewState.Empty(message = null), result)
|
||||
@@ -402,7 +401,6 @@ class SearchTypeDataExtensionsTest {
|
||||
isAutofill = false,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -445,7 +443,6 @@ class SearchTypeDataExtensionsTest {
|
||||
isAutofill = true,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -496,7 +493,6 @@ class SearchTypeDataExtensionsTest {
|
||||
isAutofill = false,
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -531,7 +527,6 @@ class SearchTypeDataExtensionsTest {
|
||||
hasMasterPassword = true,
|
||||
isAutofill = false,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
|
||||
-7
@@ -4651,7 +4651,6 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
@@ -4668,7 +4667,6 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
@@ -4685,7 +4683,6 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
@@ -4702,7 +4699,6 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
@@ -4729,7 +4725,6 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
@@ -4746,7 +4741,6 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
@@ -4763,7 +4757,6 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
|
||||
+2
-9
@@ -34,7 +34,6 @@ import com.bitwarden.vault.FolderView
|
||||
import com.bitwarden.vault.UriMatchType
|
||||
import com.x8bit.bitwarden.data.auth.datasource.disk.model.OnboardingStatus
|
||||
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.BreachCountResult
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.UserState
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.ValidatePasswordResult
|
||||
@@ -43,6 +42,7 @@ import com.x8bit.bitwarden.data.auth.repository.model.VaultUnlockType
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.createMockOrganization
|
||||
import com.x8bit.bitwarden.data.autofill.model.AutofillSaveItem
|
||||
import com.x8bit.bitwarden.data.autofill.model.AutofillSelectionData
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.credentials.manager.BitwardenCredentialManager
|
||||
import com.x8bit.bitwarden.data.credentials.model.CreateCredentialRequest
|
||||
import com.x8bit.bitwarden.data.credentials.model.Fido2RegisterCredentialResult
|
||||
@@ -230,16 +230,12 @@ class VaultAddEditViewModelTest : BaseViewModelTest() {
|
||||
private val premiumStateManager: PremiumStateManager = mockk {
|
||||
every { isInAppUpgradeAvailable() } returns false
|
||||
}
|
||||
private val mutableArchiveItemsFlow = MutableStateFlow(true)
|
||||
private val mutableCardScannerFlow = MutableStateFlow(false)
|
||||
private val mutableCardScanResultFlow =
|
||||
bufferedMutableSharedFlow<CardScanResult>()
|
||||
private val mutableCardScanResultFlow = bufferedMutableSharedFlow<CardScanResult>()
|
||||
private val cardScanManager: CardScanManager = mockk {
|
||||
every { cardScanResultFlow } returns mutableCardScanResultFlow
|
||||
}
|
||||
private val featureFlagManager: FeatureFlagManager = mockk {
|
||||
every { getFeatureFlag(FlagKey.ArchiveItems) } answers { mutableArchiveItemsFlow.value }
|
||||
every { getFeatureFlagFlow(FlagKey.ArchiveItems) } returns mutableArchiveItemsFlow
|
||||
every { getFeatureFlag(FlagKey.CardScanner) } answers { mutableCardScannerFlow.value }
|
||||
every { getFeatureFlagFlow(FlagKey.CardScanner) } returns mutableCardScannerFlow
|
||||
}
|
||||
@@ -283,7 +279,6 @@ class VaultAddEditViewModelTest : BaseViewModelTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = true,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
val viewModel = createAddVaultItemViewModel(
|
||||
@@ -373,7 +368,6 @@ class VaultAddEditViewModelTest : BaseViewModelTest() {
|
||||
shouldShowCoachMarkTour = false,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = true,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
),
|
||||
viewModel.stateFlow.value,
|
||||
@@ -5456,7 +5450,6 @@ class VaultAddEditViewModelTest : BaseViewModelTest() {
|
||||
createCredentialRequest = createCredentialRequest,
|
||||
defaultUriMatchType = UriMatchTypeModel.EXACT,
|
||||
hasPremium = hasPremium,
|
||||
isArchiveEnabled = true,
|
||||
isCardScannerEnabled = false,
|
||||
)
|
||||
|
||||
|
||||
@@ -3351,7 +3351,6 @@ private val DEFAULT_STATE: VaultItemState = VaultItemState(
|
||||
baseIconUrl = "https://example.com/",
|
||||
isIconLoadingDisabled = true,
|
||||
hasPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
private val DEFAULT_COMMON: VaultItemState.ViewState.Content.Common =
|
||||
|
||||
+1
-10
@@ -4,7 +4,6 @@ import android.net.Uri
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import app.cash.turbine.test
|
||||
import com.bitwarden.collections.CollectionView
|
||||
import com.bitwarden.core.data.manager.model.FlagKey
|
||||
import com.bitwarden.core.data.repository.model.DataState
|
||||
import com.bitwarden.core.data.repository.util.bufferedMutableSharedFlow
|
||||
import com.bitwarden.data.manager.file.FileManager
|
||||
@@ -26,11 +25,10 @@ import com.bitwarden.vault.CipherView
|
||||
import com.bitwarden.vault.FolderView
|
||||
import com.x8bit.bitwarden.data.auth.datasource.disk.model.OnboardingStatus
|
||||
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.BreachCountResult
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.UserState
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.createMockOrganization
|
||||
import com.x8bit.bitwarden.data.platform.manager.FeatureFlagManager
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.clipboard.BitwardenClipboardManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.event.OrganizationEventManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.model.FirstTimeState
|
||||
@@ -136,11 +134,6 @@ class VaultItemViewModelTest : BaseViewModelTest() {
|
||||
private val premiumStateManager: PremiumStateManager = mockk {
|
||||
every { isInAppUpgradeAvailable() } returns false
|
||||
}
|
||||
private val mutableArchiveItemsFlow = MutableStateFlow(true)
|
||||
private val featureFlagManager: FeatureFlagManager = mockk {
|
||||
every { getFeatureFlag(FlagKey.ArchiveItems) } answers { mutableArchiveItemsFlow.value }
|
||||
every { getFeatureFlagFlow(FlagKey.ArchiveItems) } returns mutableArchiveItemsFlow
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
fun setup() {
|
||||
@@ -3001,7 +2994,6 @@ class VaultItemViewModelTest : BaseViewModelTest() {
|
||||
settingsRepository = settingsRepository,
|
||||
snackbarRelayManager = snackbarRelayManager,
|
||||
premiumStateManager = premiumStateManager,
|
||||
featureFlagManager = featureFlagManager,
|
||||
)
|
||||
|
||||
private fun createViewState(
|
||||
@@ -3040,7 +3032,6 @@ class VaultItemViewModelTest : BaseViewModelTest() {
|
||||
baseIconUrl = Environment.Us.environmentUrlData.baseIconUrl,
|
||||
isIconLoadingDisabled = false,
|
||||
hasPremium = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
private val DEFAULT_USER_ACCOUNT = UserState.Account(
|
||||
|
||||
-1
@@ -2643,7 +2643,6 @@ private val DEFAULT_STATE = VaultItemListingState(
|
||||
isPremium = false,
|
||||
isRefreshing = false,
|
||||
restrictItemTypesPolicyOrgIds = persistentListOf(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
private val STATE_FOR_AUTOFILL = DEFAULT_STATE.copy(
|
||||
|
||||
+1
-10
@@ -16,7 +16,6 @@ import androidx.credentials.provider.PublicKeyCredentialEntry
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import app.cash.turbine.test
|
||||
import com.bitwarden.core.data.manager.dispatcher.FakeDispatcherManager
|
||||
import com.bitwarden.core.data.manager.model.FlagKey
|
||||
import com.bitwarden.core.data.manager.toast.ToastManager
|
||||
import com.bitwarden.core.data.repository.model.DataState
|
||||
import com.bitwarden.core.data.repository.util.bufferedMutableSharedFlow
|
||||
@@ -46,7 +45,6 @@ import com.bitwarden.vault.CipherRepromptType
|
||||
import com.bitwarden.vault.CipherType
|
||||
import com.x8bit.bitwarden.data.auth.datasource.disk.model.OnboardingStatus
|
||||
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.LogoutReason
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.SwitchAccountResult
|
||||
import com.x8bit.bitwarden.data.auth.repository.model.UserState
|
||||
@@ -59,6 +57,7 @@ import com.x8bit.bitwarden.data.autofill.manager.AutofillSelectionManager
|
||||
import com.x8bit.bitwarden.data.autofill.manager.AutofillSelectionManagerImpl
|
||||
import com.x8bit.bitwarden.data.autofill.model.AutofillSaveItem
|
||||
import com.x8bit.bitwarden.data.autofill.model.AutofillSelectionData
|
||||
import com.x8bit.bitwarden.data.billing.manager.PremiumStateManager
|
||||
import com.x8bit.bitwarden.data.credentials.manager.BitwardenCredentialManager
|
||||
import com.x8bit.bitwarden.data.credentials.manager.OriginManager
|
||||
import com.x8bit.bitwarden.data.credentials.model.CreateCredentialRequest
|
||||
@@ -72,7 +71,6 @@ import com.x8bit.bitwarden.data.credentials.model.createMockGetCredentialsReques
|
||||
import com.x8bit.bitwarden.data.credentials.model.createMockProviderGetPasswordCredentialRequest
|
||||
import com.x8bit.bitwarden.data.credentials.parser.RelyingPartyParser
|
||||
import com.x8bit.bitwarden.data.credentials.repository.PrivilegedAppRepository
|
||||
import com.x8bit.bitwarden.data.platform.manager.FeatureFlagManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.PolicyManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.SpecialCircumstanceManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.SpecialCircumstanceManagerImpl
|
||||
@@ -302,11 +300,6 @@ class VaultItemListingViewModelTest : BaseViewModelTest() {
|
||||
private val premiumStateManager: PremiumStateManager = mockk {
|
||||
every { isInAppUpgradeAvailable() } returns false
|
||||
}
|
||||
private val mutableArchiveItemsFlow = MutableStateFlow(true)
|
||||
private val featureFlagManager: FeatureFlagManager = mockk {
|
||||
every { getFeatureFlag(FlagKey.ArchiveItems) } answers { mutableArchiveItemsFlow.value }
|
||||
every { getFeatureFlagFlow(FlagKey.ArchiveItems) } returns mutableArchiveItemsFlow
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
fun setUp() {
|
||||
@@ -6199,7 +6192,6 @@ class VaultItemListingViewModelTest : BaseViewModelTest() {
|
||||
toastManager = toastManager,
|
||||
premiumStateManager = premiumStateManager,
|
||||
relyingPartyParser = relyingPartyParser,
|
||||
featureFlagManager = featureFlagManager,
|
||||
)
|
||||
|
||||
@Suppress("MaxLineLength")
|
||||
@@ -6228,7 +6220,6 @@ class VaultItemListingViewModelTest : BaseViewModelTest() {
|
||||
isPremium = isPremium,
|
||||
isRefreshing = false,
|
||||
restrictItemTypesPolicyOrgIds = persistentListOf(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
-18
@@ -579,7 +579,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -676,7 +675,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -763,7 +761,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -833,7 +830,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -857,7 +853,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -879,7 +874,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -902,7 +896,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -924,7 +917,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -946,7 +938,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -968,7 +959,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -992,7 +982,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1018,7 +1007,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1044,7 +1032,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1071,7 +1058,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
},
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -1326,7 +1312,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1374,7 +1359,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1454,7 +1438,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = listOf("restrict_item_type_policy_id"),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1504,7 +1487,6 @@ class VaultItemListingDataExtensionsTest {
|
||||
totpData = null,
|
||||
isPremiumUser = true,
|
||||
restrictItemTypesPolicyOrgIds = listOf("restrict_item_type_policy_id"),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
// Card type
|
||||
|
||||
-40
@@ -12,7 +12,6 @@ import com.x8bit.bitwarden.ui.vault.feature.itemlisting.model.ListingItemOverflo
|
||||
import com.x8bit.bitwarden.ui.vault.model.VaultTrailingIcon
|
||||
import com.x8bit.bitwarden.ui.vault.util.toSdkCipherType
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Assertions.assertFalse
|
||||
import org.junit.jupiter.api.Assertions.assertTrue
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
@@ -40,7 +39,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = false,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -89,7 +87,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = false,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertTrue(
|
||||
@@ -114,7 +111,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -157,7 +153,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -189,7 +184,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -231,7 +225,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = false,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -257,7 +250,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = false,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -291,7 +283,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -318,7 +309,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -356,7 +346,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = false,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -384,7 +373,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertTrue(
|
||||
@@ -411,7 +399,6 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertTrue(
|
||||
@@ -446,38 +433,11 @@ class CipherListViewExtensionsTest {
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertTrue(result.contains(ListingItemOverflowAction.VaultAction.UnarchiveClick(id)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `toOverflowActions should not return Archive action when Archive is disabled`() {
|
||||
val loginListView = createMockLoginListView(
|
||||
number = 1,
|
||||
username = "",
|
||||
uris = emptyList(),
|
||||
totp = null,
|
||||
)
|
||||
val cipher = createMockCipherListView(
|
||||
number = 1,
|
||||
id = id,
|
||||
isArchived = false,
|
||||
isDeleted = false,
|
||||
edit = true,
|
||||
type = CipherListViewType.Login(loginListView),
|
||||
)
|
||||
|
||||
val result = cipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = false,
|
||||
isArchiveEnabled = false,
|
||||
)
|
||||
|
||||
assertFalse(result.contains(ListingItemOverflowAction.VaultAction.ArchiveClick(id)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `toTrailingIcons should return collection icon if collectionId is not empty`() {
|
||||
val cipher = createMockCipherListView(
|
||||
|
||||
@@ -1003,7 +1003,6 @@ class VaultScreenTest : BitwardenComposeTest() {
|
||||
collectionItems = emptyList(),
|
||||
trashItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = false,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = false,
|
||||
@@ -2651,7 +2650,6 @@ private val DEFAULT_STATE: VaultState = VaultState(
|
||||
cipherDecryptionFailureIds = persistentListOf(),
|
||||
hasShownDecryptionFailureAlert = false,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
isIntroducingArchiveActionCardDismissed = false,
|
||||
)
|
||||
|
||||
@@ -2669,7 +2667,6 @@ private val DEFAULT_CONTENT_VIEW_STATE: VaultState.ViewState.Content = VaultStat
|
||||
itemTypesCount = 4,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
|
||||
@@ -226,13 +226,10 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
coEvery { unregister() } returns UnregisterExportResult.Success
|
||||
}
|
||||
private val mutableCxpExportFeatureFlagFlow = MutableStateFlow(false)
|
||||
private val mutableArchiveItemsFlagFlow = MutableStateFlow(true)
|
||||
private val featureFlagManager: FeatureFlagManager = mockk {
|
||||
every {
|
||||
getFeatureFlagFlow(FlagKey.CredentialExchangeProtocolExport)
|
||||
} returns mutableCxpExportFeatureFlagFlow
|
||||
every { getFeatureFlagFlow(FlagKey.ArchiveItems) } returns mutableArchiveItemsFlagFlow
|
||||
every { getFeatureFlag(FlagKey.ArchiveItems) } returns mutableArchiveItemsFlagFlow.value
|
||||
}
|
||||
|
||||
private val mutablePremiumUpgradeBannerEligibleFlow = MutableStateFlow(false)
|
||||
@@ -465,7 +462,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
val state = createMockVaultState(viewState = contentViewState).copy(
|
||||
isPremiumUpgradeBannerEligible = false,
|
||||
isPremium = true,
|
||||
isArchiveEnabled = true,
|
||||
isIntroducingArchiveActionCardDismissed = false,
|
||||
)
|
||||
|
||||
@@ -481,7 +477,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
val state = createMockVaultState(viewState = contentViewState).copy(
|
||||
isPremiumUpgradeBannerEligible = false,
|
||||
isPremium = false,
|
||||
isArchiveEnabled = true,
|
||||
isIntroducingArchiveActionCardDismissed = false,
|
||||
)
|
||||
|
||||
@@ -1289,7 +1284,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
baseIconUrl = viewModel.stateFlow.value.baseIconUrl,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
)
|
||||
.copy(
|
||||
@@ -1315,7 +1309,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
baseIconUrl = viewModel.stateFlow.value.baseIconUrl,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
),
|
||||
viewModel.stateFlow.value,
|
||||
@@ -1451,7 +1444,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = CipherType.entries.size,
|
||||
sshKeyItemsCount = 1,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1481,7 +1473,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1620,7 +1611,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1761,7 +1751,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1829,7 +1818,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1945,7 +1933,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -2035,7 +2022,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = CipherType.entries.size,
|
||||
sshKeyItemsCount = 1,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -2271,7 +2257,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = null,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = BitwardenString.premium_subscription_required.asText(),
|
||||
archiveEndIcon = BitwardenDrawable.ic_locked,
|
||||
showCardGroup = true,
|
||||
@@ -2378,7 +2363,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 1,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -2451,7 +2435,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -3751,7 +3734,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -3813,7 +3795,6 @@ class VaultViewModelTest : BaseViewModelTest() {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -4047,7 +4028,6 @@ private fun createMockVaultState(
|
||||
cipherDecryptionFailureIds = persistentListOf(),
|
||||
hasShownDecryptionFailureAlert = false,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
isIntroducingArchiveActionCardDismissed = false,
|
||||
isPremiumUpgradeBannerEligible = false,
|
||||
)
|
||||
@@ -4066,7 +4046,6 @@ private val DEFAULT_CONTENT_VIEW_STATE = VaultState.ViewState.Content(
|
||||
collectionItems = emptyList(),
|
||||
trashItemsCount = 0,
|
||||
archivedItemsCount = null,
|
||||
archiveEnabled = false,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
|
||||
-36
@@ -87,7 +87,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -144,7 +143,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 1,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -176,7 +174,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.MyVault,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -200,7 +197,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -241,7 +237,6 @@ class VaultDataExtensionsTest {
|
||||
),
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -276,7 +271,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -304,7 +298,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -332,7 +325,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -361,7 +353,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -379,7 +370,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -408,7 +398,6 @@ class VaultDataExtensionsTest {
|
||||
baseIconUrl = Environment.Us.environmentUrlData.baseIconUrl,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -426,7 +415,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = null,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = BitwardenString.premium_subscription_required.asText(),
|
||||
archiveEndIcon = BitwardenDrawable.ic_locked,
|
||||
showCardGroup = true,
|
||||
@@ -457,7 +445,6 @@ class VaultDataExtensionsTest {
|
||||
baseIconUrl = Environment.Us.environmentUrlData.baseIconUrl,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -475,7 +462,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = null,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = BitwardenString.premium_subscription_required.asText(),
|
||||
archiveEndIcon = BitwardenDrawable.ic_locked,
|
||||
showCardGroup = true,
|
||||
@@ -506,7 +492,6 @@ class VaultDataExtensionsTest {
|
||||
baseIconUrl = Environment.Us.environmentUrlData.baseIconUrl,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -524,7 +509,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = null,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = BitwardenString.premium_subscription_required.asText(),
|
||||
archiveEndIcon = BitwardenDrawable.ic_locked,
|
||||
showCardGroup = true,
|
||||
@@ -739,7 +723,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -757,7 +740,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -788,7 +770,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -806,7 +787,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -840,7 +820,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -864,7 +843,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -899,7 +877,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -924,7 +901,6 @@ class VaultDataExtensionsTest {
|
||||
overflowOptions = mockCipher.toOverflowActions(
|
||||
hasMasterPassword = true,
|
||||
isPremiumUser = true,
|
||||
isArchiveEnabled = true,
|
||||
),
|
||||
shouldShowMasterPasswordReprompt = false,
|
||||
username = "mockUsername-1".asText(),
|
||||
@@ -936,7 +912,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -977,7 +952,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1027,7 +1001,6 @@ class VaultDataExtensionsTest {
|
||||
itemTypesCount = 6,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1076,7 +1049,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = listOf("restrict_item_type_policy_id"),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1094,7 +1066,6 @@ class VaultDataExtensionsTest {
|
||||
totpItemsCount = 0,
|
||||
itemTypesCount = CipherType.entries.size,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1139,7 +1110,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = listOf("restrict_item_type_policy_id"),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1157,7 +1127,6 @@ class VaultDataExtensionsTest {
|
||||
totpItemsCount = 1,
|
||||
itemTypesCount = CipherType.entries.size,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = false,
|
||||
@@ -1188,7 +1157,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1207,9 +1175,7 @@ class VaultDataExtensionsTest {
|
||||
totpItemsCount = 1,
|
||||
// Verify item types count includes all CipherTypes when showSshKeys is true.
|
||||
itemTypesCount = CipherType.entries.size,
|
||||
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
@@ -1254,7 +1220,6 @@ class VaultDataExtensionsTest {
|
||||
vaultFilterType = VaultFilterType.AllVaults,
|
||||
hasMasterPassword = true,
|
||||
restrictItemTypesPolicyOrgIds = emptyList(),
|
||||
isArchiveEnabled = true,
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
@@ -1277,7 +1242,6 @@ class VaultDataExtensionsTest {
|
||||
totpItemsCount = 0,
|
||||
itemTypesCount = CipherType.entries.size,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
|
||||
-1
@@ -86,7 +86,6 @@ class VaultStateExtensionsTest {
|
||||
itemTypesCount = 4,
|
||||
sshKeyItemsCount = 0,
|
||||
archivedItemsCount = 0,
|
||||
archiveEnabled = true,
|
||||
archiveSubText = null,
|
||||
archiveEndIcon = null,
|
||||
showCardGroup = true,
|
||||
|
||||
@@ -35,7 +35,6 @@ sealed class FlagKey<out T : Any> {
|
||||
ForceUpdateKdfSettings,
|
||||
NoLogoutOnKdfChange,
|
||||
MigrateMyVaultToMyItems,
|
||||
ArchiveItems,
|
||||
SendEmailVerification,
|
||||
CardScanner,
|
||||
MobilePremiumUpgrade,
|
||||
@@ -98,14 +97,6 @@ sealed class FlagKey<out T : Any> {
|
||||
override val defaultValue: Boolean = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Data object holding the feature flag key for the Archive Items feature.
|
||||
*/
|
||||
data object ArchiveItems : FlagKey<Boolean>() {
|
||||
override val keyName: String = "pm-19148-innovation-archive"
|
||||
override val defaultValue: Boolean = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Data object holding the feature flag key for the Send Email Verification feature.
|
||||
*/
|
||||
|
||||
@@ -28,10 +28,6 @@ class FlagKeyTest {
|
||||
FlagKey.MigrateMyVaultToMyItems.keyName,
|
||||
"pm-20558-migrate-myvault-to-myitems",
|
||||
)
|
||||
assertEquals(
|
||||
FlagKey.ArchiveItems.keyName,
|
||||
"pm-19148-innovation-archive",
|
||||
)
|
||||
assertEquals(
|
||||
FlagKey.SendEmailVerification.keyName,
|
||||
"pm-19051-send-email-verification",
|
||||
@@ -71,7 +67,6 @@ class FlagKeyTest {
|
||||
FlagKey.BitwardenAuthenticationEnabled,
|
||||
FlagKey.ForceUpdateKdfSettings,
|
||||
FlagKey.MigrateMyVaultToMyItems,
|
||||
FlagKey.ArchiveItems,
|
||||
FlagKey.SendEmailVerification,
|
||||
FlagKey.MobilePremiumUpgrade,
|
||||
FlagKey.AttachmentUpdates,
|
||||
|
||||
@@ -29,7 +29,6 @@ fun <T : Any> FlagKey<T>.ListItemContent(
|
||||
FlagKey.ForceUpdateKdfSettings,
|
||||
FlagKey.NoLogoutOnKdfChange,
|
||||
FlagKey.MigrateMyVaultToMyItems,
|
||||
FlagKey.ArchiveItems,
|
||||
FlagKey.CardScanner,
|
||||
FlagKey.SendEmailVerification,
|
||||
FlagKey.MobilePremiumUpgrade,
|
||||
@@ -88,7 +87,6 @@ private fun <T : Any> FlagKey<T>.getDisplayLabel(): String = when (this) {
|
||||
}
|
||||
|
||||
FlagKey.MigrateMyVaultToMyItems -> stringResource(BitwardenString.migrate_my_vault_to_my_items)
|
||||
FlagKey.ArchiveItems -> stringResource(BitwardenString.archive_items)
|
||||
FlagKey.CardScanner -> stringResource(BitwardenString.scan_card)
|
||||
FlagKey.SendEmailVerification -> stringResource(BitwardenString.send_email_verification)
|
||||
FlagKey.MobilePremiumUpgrade -> stringResource(BitwardenString.mobile_premium_upgrade)
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<string name="force_update_kdf_settings">Force update KDF settings</string>
|
||||
<string name="avoid_logout_on_kdf_change">Avoid logout on KDF change</string>
|
||||
<string name="migrate_my_vault_to_my_items">Migrate My Vault to My Items</string>
|
||||
<string name="archive_items">Archive Items</string>
|
||||
<string name="send_email_verification">Send Email Verification</string>
|
||||
<string name="trigger_cookie_acquisition">Trigger cookie acquisition</string>
|
||||
<string name="clear_sso_cookies">Clear SSO cookies</string>
|
||||
|
||||
Reference in New Issue
Block a user