* implement multi-step policy ui framework
* policy wip
* Refactor organization data ownership policy component to use multi-step dialog and signals. Remove deprecated dialog component and update related tests. Add organizationId input to base policy edit component and implement save logic in the new dialog structure.
* Update multi-step policy edit dialog to handle loading state and improve template initialization. Adjust button disable logic to account for loading status and modify ViewChild static property for proper change detection.
* Refactor policy confirmation logic in base policy edit component. Remove deprecated confirm method and update policy edit dialog to handle confirmation checks dynamically. Adjust organization data ownership policy component to align with new confirmation structure.
* Update apps/web/src/app/admin-console/organizations/policies/policy-edit-definitions/auto-confirm-policy.component.html
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
* Refactor multi-step policy dialog component and remove legacy confirm method
- Deleted the multi-step policy plan documentation.
- Introduced a new `MultiStepPolicyEditDialogComponent` to handle multi-step workflows.
- Updated `BasePolicyEditComponent` to support multi-step configurations and removed the deprecated `confirm()` method.
- Enhanced `PolicyStep` type to include optional `disableSave` and `bodyContent` properties.
- Adjusted HTML templates to utilize signals for dynamic content rendering.
- Refactored existing policy components to integrate with the new multi-step dialog structure.
* Refactor AutoConfirmPolicy component constructor to use readonly modifier for firstTimeDialog parameter
* Update multi-step policy edit dialog template to ensure proper rendering of policy form before lifecycle hooks. Added comment for clarity on rendering behavior.
* Update apps/web/src/app/admin-console/organizations/policies/policy-edit-definitions/auto-confirm-policy.component.html
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
* Add confirmation step before policy submission in dialog component
- Introduced an optional `confirm` method in `BasePolicyEditComponent` to allow components to implement a confirmation step before saving.
- Updated `PolicyEditDialogComponent` to call the `confirm` method and handle user confirmation.
- Added new test files for `AutoConfirmPolicyEditComponent` and `MultiStepPolicyEditDialogComponent` to ensure proper functionality and behavior of the new confirmation logic.
* Update apps/web/src/app/admin-console/organizations/policies/policy-edit-definitions/vnext-organization-data-ownership.component.ts
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
* Refactor policy edit components to streamline side effects and improve save logic
- Moved side effect logic from inline definitions to dedicated methods in AutoConfirmPolicyEditComponent.
- Updated vNextOrganizationDataOwnershipPolicyComponent to remove unused template references.
- Adjusted PolicyStep type to allow for side effects returning void.
- Enhanced save button logic in MultiStepPolicyEditDialogComponent to utilize a computed signal for save state management.
* Enhance MultiStepPolicyEditDialogComponent tests and update references
- Refactored tests in multi-step policy edit dialog to improve saveDisabled logic and ensure accurate state management.
- Updated references from AutoConfirmPolicyDialogComponent to MultiStepPolicyEditDialogComponent in web-vault-prompt service tests for consistency.
* Refactor auto-confirm policy component template and update imports
- Improved readability of the auto-confirm policy component template by formatting the button element.
- Cleaned up import statements in the auto-confirm policy component test file for consistency.
* Update WebVaultPromptService tests to validate firstTimeDialog property
- Added assertion to ensure the firstTimeDialog property is correctly passed in the policy data during dialog closure in WebVaultPromptService tests.
* Refactor policy edit components to support migration to new policy steps
- Added TODO comments in BasePolicyEditComponent and PolicyEditDialogComponent to indicate the removal of the confirm method when the `MigrateMyVaultToMyItems` feature flag is deprecated.
- Updated vNextOrganizationDataOwnershipPolicyComponent to ensure proper handling of organizationId.
- Enhanced MultiStepPolicyEditDialogComponent template for improved subtitle handling and readability.
* Refactor policy edit components to utilize Angular's input function
- Replaced traditional @Input() properties with the new input() function in BasePolicyEditComponent for better reactivity.
- Updated policy edit dialog component to set inputs using the new method for improved clarity and consistency.
- Adjusted various policy components to ensure compatibility with the new input handling, enhancing overall code maintainability.
* fix(policy-edit): update policy access method to use function call syntax
Changed the way policy properties are accessed in the auto-confirm policy component template, ensuring compatibility with the updated policy structure.
* refactor(session-timeout): update policyResponse handling in component and tests
Modified the SessionTimeoutPolicyComponent to use function call syntax for accessing policyResponse. Updated corresponding unit tests to reflect this change, ensuring consistent handling of policy data across the component and its tests.
* refactor(policy-edit-dialog): simplify test structure and improve saveDisabled logic
Updated the unit tests for MultiStepPolicyEditDialogComponent to eliminate the use of fakeAsync and detectChanges, replacing them with direct state manipulation and TestBed.flushEffects(). This change enhances test clarity and reliability. Additionally, refactored the account age calculation in WebVaultExtensionPromptService to use UTC midnight for accurate day counting, addressing potential off-by-one errors.
* Fix change to prompt service which was unneeded
* refactor(policy-edit): enhance savePolicy method and inject dependencies
Updated the BasePolicyEditComponent to inject AccountService, KeyService, and PolicyApiServiceAbstraction. Refactored the savePolicy method to streamline the policy saving process, ensuring proper handling of organization keys and error management. Adjusted AutoConfirmPolicyEditComponent and vNextOrganizationDataOwnershipPolicyComponent to utilize the new savePolicy implementation.
* refactor(policy-edit): remove unused AccountService dependency
Removed the AccountService dependency from MasterPasswordPolicyComponent and ResetPasswordPolicyComponent as it was not utilized. Added a getter for autoConfirmPolicy in AutoConfirmPolicyEditComponent to enhance code clarity.
* refactor(policy-edit): update sideEffect callbacks in AutoConfirmPolicyEditComponent
Modified the sideEffect properties in the AutoConfirmPolicyEditComponent to use arrow functions, ensuring proper context binding for the savePolicy and navigateToExtensionPromptStep methods.
* refactor(policy-edit): update sideEffect to use arrow function in vNextOrganizationDataOwnershipPolicyComponent
Changed the sideEffect property in the vNextOrganizationDataOwnershipPolicyComponent to use an arrow function for the savePolicy method, ensuring proper context binding.
* Fixes tests for PR
* refactor(vault): improve account age calculation to use UTC boundaries
Updated the account age calculation in WebVaultExtensionPromptService to utilize UTC midnight boundaries, preventing issues with Daylight Saving Time skewing the day count.
* Refactor PolicyEditDialogComponent to improve signal usage for save button state management
- Changed saveDisabled property to use a private signal for better encapsulation.
- Updated template bindings to call loading() and saveDisabled() as functions for correct state handling.
- Enhanced observables management for save button disable logic to ensure proper state updates.
* Fix optional chaining in policy confirmation and add policy steps to vNext organization data ownership component
* Update tests for vNext organization data ownership component to use fixture inputs and add missing service mocks
---------
Co-authored-by: Brandon <btreston@bitwarden.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
* [PM-33580] fix: skip change-password notification when no ciphers exist for URL
* [PM-33580] consolidate password-only notification branches into single block
---------
Signed-off-by: Ben Brooks <bbrooks@bitwarden.com>
* check for open popup with polling to allow for more deviation in browser behavior
* firefox bug has been resolved, remove check for firefox
* add check for `getContexts` returning `undefined` rather than a promise in MV2 scenarios
* remove old tests
* fix merge conflict mistake
- Updates the line labels for the "applications" view in the trend chart. Now matches Figma design
- Right aligns the chart's period selector dropdown items. Now matches Figma design
- Chart wraps period selector and shrinks view selector button at small screen sizes, fixes overflow issue.
* fix(bug): Admin/Owner viewing and editing ciphers from within health reports
* Change check for unassigned ciphers to include default collection check
* Remove unnecessary typecasting
Remove the enableDiscountDisplay$ feature flag observable and collapse the
ngIf/else template to always show the discount badge. The badge handles
null/no-discount gracefully.
* fix: warn user about unsaved changes before applying desktop update
* fix: update dialog
* fix: update restart to properly clean up IPC listeners on timeout and warn about unsaved Send forms
* revert: Revert AddEditComponent changes
* fix: solve type error
* fix: warn user about unsaved chagnes
* fix: use FormGroupDirective in DirtyFormService to detect dirty forms after form reassignment
---------
Co-authored-by: bittoby <bittoby@users.noreply.github.com>
* fix(dirt): check response.error before showing success toast for critical apps
The orchestrator's catchError converts API failures into next emissions
with response.error set. The component's next handler was unconditionally
showing a success toast without checking this field.
Now checks response.error and shows an error toast when the API call
failed. Selection is preserved on error so users can retry.
Also ensures updatingCriticalApps signal is reset on all paths (success,
caught error, and uncaught error).
[PM-33067]
* test(dirt): add tests for mark/unmark critical apps error handling
Tests verify that:
- Success toast shown when response.error is null
- Error toast shown when response.error is non-null
- Selection preserved on error, cleared on success
[PM-33067]
* fix(dirt): use specific error toast for unmark critical apps failure
Replace generic "An unexpected error has occurred" with
"Failed to unmark applications as critical" for consistency
with the mark-as-critical error toast.
* fix(dirt): check response.error in Review New Applications mark critical
The AllApplicationsComponent (Review New Applications widget) had the
same false success toast bug as the All Applications tab. The next
handler ignored the response parameter entirely, showing a success
toast even when response.error was set by the orchestrator's catchError.
Now checks response.error before showing toast. On error: shows
"Failed to mark applications as critical" and preserves selection.
Also resets markingAsCritical on all paths.
Adds unit tests for mark success and error paths.
[PM-33067]
* Revert "fix(dirt): check response.error in Review New Applications mark critical"
This reverts commit b646598613.
* fix(dirt): check response.error in application review dialog before showing success toast
The saveApplicationReviewStatus$ orchestrator method uses catchError
to convert API failures into next emissions with response.error set.
The dialog used firstValueFrom inside try/catch, but since catchError
prevents the Observable from erroring, firstValueFrom resolves
successfully and the catch block never fires.
Now checks response.error on the resolved value before showing the
success toast. On error: shows "Error saving review status" and
stays on the dialog so the user can retry.
[PM-33067]
* Replace usage of two factor images with TwoFactorIcon component
* Delete web scss and now unused two-factor images
* Remove mfaType from eslint whitelist
* Delete unused mfaType scss entries on browser and desktop
* Fix linting issue
* Remove icons from two factor setup dialogs
* Delete unused images on browser and desktop
* Remove mfaLogoSuffix
* Remove paragraph
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Makes a distinct `"settings-change-password"` route on Extension - to be used when the user initiates changing their password by navigating to Settings > Account Recovery. This route uses the `ChangePasswordPageComponent` (unlike the "change-password" route, which uses the `ExtensionAnonLayoutWrapperComponent`).
Feature flag: `pm-32413-multi-client-password-management`