-
Notifications
You must be signed in to change notification settings - Fork 99
[PM-33981] feat: Integrate device management into Account Security #2491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pm-33981/innovation-device-list
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,8 @@ final class AccountSecurityProcessor: StateProcessor<// swiftlint:disable:this t | |
| coordinator.navigate(to: .deleteAccount) | ||
| case .logout: | ||
| showLogoutConfirmation() | ||
| case .manageDevicesTapped: | ||
| coordinator.navigate(to: .deviceManagement) | ||
| case .pendingLoginRequestsTapped: | ||
| coordinator.navigate(to: .pendingLoginRequests) | ||
| case let .sessionTimeoutActionChanged(newValue): | ||
|
|
@@ -181,6 +183,8 @@ final class AccountSecurityProcessor: StateProcessor<// swiftlint:disable:this t | |
|
|
||
| state.isAuthenticatorSyncEnabled = try await services.stateService.getSyncToAuthenticator() | ||
|
|
||
| state.isManageDevicesEnabled = await services.configService.getFeatureFlag(.manageDevices) | ||
|
||
|
|
||
| if state.biometricUnlockStatus.isEnabled || state.isUnlockWithPINCodeOn { | ||
| await completeAccountSetupVaultUnlockIfNeeded() | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,7 +21,9 @@ struct AccountSecurityView: View { | |||||
| VStack(spacing: 16) { | ||||||
| setUpUnlockActionCard | ||||||
|
|
||||||
| pendingLoginRequests | ||||||
| if !store.state.isManageDevicesEnabled { | ||||||
| pendingLoginRequests | ||||||
| } | ||||||
|
Comment on lines
+24
to
+26
|
||||||
|
|
||||||
| if store.state.showUnlockOptions { | ||||||
| unlockOptionsSection | ||||||
|
|
@@ -80,25 +82,37 @@ struct AccountSecurityView: View { | |||||
| private var otherSection: some View { | ||||||
| SectionView(Localizations.other) { | ||||||
| ContentBlock(dividerLeadingPadding: 16) { | ||||||
| SettingsListItem( | ||||||
| Localizations.accountFingerprintPhrase, | ||||||
| accessibilityIdentifier: "AccountFingerprintPhraseLabel", | ||||||
| ) { | ||||||
| Task { | ||||||
| await store.perform(.accountFingerprintPhrasePressed) | ||||||
| if store.state.isManageDevicesEnabled { | ||||||
| SettingsListItem( | ||||||
| Localizations.manageDevices, | ||||||
|
||||||
| Localizations.manageDevices, | |
| "Manage devices", |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -64,12 +64,14 @@ final class SettingsCoordinator: Coordinator, HasStackNavigator { // swiftlint:d | |||||||||||||||||||
|
|
||||||||||||||||||||
| typealias Services = HasASSettingsMediator | ||||||||||||||||||||
| & HasAccountAPIService | ||||||||||||||||||||
| & HasAppIdService | ||||||||||||||||||||
| & HasAppInfoService | ||||||||||||||||||||
| & HasAuthRepository | ||||||||||||||||||||
| & HasAuthService | ||||||||||||||||||||
| & HasAutofillCredentialService | ||||||||||||||||||||
| & HasBiometricsRepository | ||||||||||||||||||||
| & HasConfigService | ||||||||||||||||||||
| & HasDeviceAPIService | ||||||||||||||||||||
| & HasEnvironmentService | ||||||||||||||||||||
| & HasErrorAlertServices.ErrorAlertServices | ||||||||||||||||||||
| & HasErrorReporter | ||||||||||||||||||||
|
|
@@ -167,6 +169,8 @@ final class SettingsCoordinator: Coordinator, HasStackNavigator { // swiftlint:d | |||||||||||||||||||
| showAutoFill() | ||||||||||||||||||||
| case .deleteAccount: | ||||||||||||||||||||
| showDeleteAccount() | ||||||||||||||||||||
| case .deviceManagement: | ||||||||||||||||||||
| showDeviceManagement() | ||||||||||||||||||||
|
Comment on lines
171
to
+173
|
||||||||||||||||||||
| case .dismiss: | ||||||||||||||||||||
| stackNavigator?.dismiss() | ||||||||||||||||||||
| case .exportVault: | ||||||||||||||||||||
|
|
@@ -344,6 +348,17 @@ final class SettingsCoordinator: Coordinator, HasStackNavigator { // swiftlint:d | |||||||||||||||||||
| stackNavigator?.present(DeleteAccountView(store: Store(processor: processor))) | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| /// Shows the device management screen. | ||||||||||||||||||||
| /// | ||||||||||||||||||||
| private func showDeviceManagement() { | ||||||||||||||||||||
| let processor = DeviceManagementProcessor( | ||||||||||||||||||||
| coordinator: asAnyCoordinator(), | ||||||||||||||||||||
| services: services, | ||||||||||||||||||||
| state: DeviceManagementState(), | ||||||||||||||||||||
| ) | ||||||||||||||||||||
| stackNavigator?.present(DeviceManagementView(store: Store(processor: processor))) | ||||||||||||||||||||
|
Comment on lines
+354
to
+359
|
||||||||||||||||||||
| let processor = DeviceManagementProcessor( | |
| coordinator: asAnyCoordinator(), | |
| services: services, | |
| state: DeviceManagementState(), | |
| ) | |
| stackNavigator?.present(DeviceManagementView(store: Store(processor: processor))) | |
| // TODO: Implement device management flow and present the appropriate view. | |
| // Currently left as a no-op to avoid referencing undefined types. | |
| assertionFailure("Device management screen is not yet implemented.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New behavior isn’t covered by tests: there’s no test asserting
.manageDevicesTappednavigates to.deviceManagement, and no test thatloadData()setsisManageDevicesEnabledbased on the feature flag (nomanageDevicesreferences inAccountSecurityProcessorTests). Please add coverage for both.