* add edit member dialog, refactored to be ts-strict from member-dialog component
* clean up
* fix dialog selector pattern
* remove feature flag logic
* clean up, fix type error
* fix circular dependency, fix dialog directive
* fix remove user
* refactor nested-checkbox, add story
* update member-access-report to use new member edit component
* refactors org user view models and consumers to be ts-strict compliant
* DRY up invite logic
* clean up
* run prettier
* fix circular dep
* fix circular dependency (real)
* update test
* more clean up
* more type saftey fixes
* more types
* even more types
* add jsdoc
* fix test
* Refactor bidirectional mapping for CollectionType and SDK types
Updated the mapping between numeric CollectionType and SDK's numeric variant to ensure type safety. The previous string variant has been replaced with numeric values for better consistency and maintainability. This change enhances type checking in TypeScript and ensures that any additions to the CollectionTypes require corresponding updates in the mapping.
* Refactor CollectionType handling in collection models
Removed bidirectional mapping for CollectionType and SDK types, simplifying the type assignment in the Collection and CollectionView classes. This change enhances code clarity and reduces complexity by directly using the SDK's numeric variant for type assignments.
* Update CollectionType handling in tests to use numeric values
Replaced string representations of CollectionType with their corresponding numeric values in the collection SDK mapping tests. This change ensures consistency with the recent refactor of type handling, enhancing type safety and maintainability across the codebase.
* Update tests to use CollectionTypes for type assignments
Replaced numeric values with the CollectionTypes enum in the collection SDK mapping tests. This change improves code clarity and consistency, aligning with recent refactors to enhance type safety and maintainability across the codebase.
* Update Bitwarden SDK dependencies to version 0.2.0-main.739 in package.json and package-lock.json. This change ensures compatibility with the latest features and fixes in the SDK.
* Refactor tests to utilize CollectionTypes enum for type assignments
Updated test cases in default-collection-encryption.service.spec.ts to replace string literals with the CollectionTypes enum for improved type safety and consistency. This aligns with recent refactors aimed at enhancing code clarity and maintainability.
* Add Collection Encryption Service and integrate into collection handling
- Introduced `CollectionEncryptionService` and its default implementation `DefaultCollectionEncryptionService` for handling collection encryption and decryption.
- Updated `DefaultCollectionService` to utilize the new encryption service based on feature flags.
- Refactored collection-related classes to support SDK-based encryption operations.
- Added necessary imports and updated service providers in Angular module for dependency injection.
- Enhanced collection models to support SDK format conversions for encryption tasks.
* Implement encryption functionality in CollectionEncryptionService
- Added `encrypt` method to `CollectionEncryptionService` for encrypting collection views.
- Updated `DefaultCollectionEncryptionService` to include the new `encrypt` method, ensuring proper handling of SDK encryption.
- Modified `DefaultCollectionService` to utilize the encryption service based on feature flags.
- Enhanced collection and collection view models to support SDK format conversions for encryption tasks.
* refactor(collections): Update collection decryption methods and handle encryption support
- Modified `fromSdkCollectionView` to include `sourceCollection` for preserving `defaultUserCollectionEmail`.
- Updated decryption methods in `DefaultCollectionEncryptionService` to pass the original collection.
- Marked `encrypt` method as unsupported in the SDK, directing users to the legacy key-service path.
- Removed SDK feature flag checks from `DefaultCollectionService`'s `encrypt` method.
* refactor(collections): Update feature flag for collection decryption to PM35153
- Changed references from PM34918CollectionEncryptionService to PM35153CollectionSdkDecryption in both service and test files.
- Adjusted the feature flag checks to align with the new decryption implementation.
* Implement collection encryption using SDK in DefaultCollectionEncryptionService
* Refactor collection decryption in DefaultCollectionEncryptionService to handle errors individually and improve logging
* Add polyfills for Symbol.dispose and Symbol.asyncDispose in test setup; add unit tests for DefaultCollectionEncryptionService and collection SDK mapping
* Refactor error handling in DefaultCollectionEncryptionService to throw errors instead of returning EMPTY, improving error propagation and logging consistency.
* Refactor collection decryption and enhance type mapping
- Updated the `decrypt` method in `default-collection-encryption.service.ts` to utilize `decryptMany` for improved error handling.
- Added exhaustive bidirectional mapping for `CollectionType` and `SdkCollectionType` in `collection.ts`.
- Enhanced tests in `collection-sdk-mapping.spec.ts` to verify roundtrip conversions for `CollectionTypes`.
- Adjusted `Collection` and `CollectionView` classes to use the new type mappings for SDK interactions.
* Refactor DefaultCollectionEncryptionService to use a more concise method for encrypting collections. Update collection-sdk-mapping tests to utilize SdkEncString for better type safety. Simplify NewItemNudgeComponent's logic for showing nudge spotlight based on cipher type, ensuring null checks are handled appropriately.
* Refactor NewItemNudgeComponent to use strict null checks for cipher type comparison, enhancing code clarity and consistency.
* Add bulk auto-confirm functionality for organization users
- Introduced methods to retrieve pending auto-confirm users and to bulk auto-confirm them in the OrganizationUserApiService.
- Added OrganizationUserPendingAutoConfirmResponse model to handle responses for pending auto-confirmation.
- Implemented logic in DefaultAutomaticUserConfirmationService to automatically confirm users who accepted their invitations while the admin was offline.
- Updated feature flags to enable bulk auto-confirmation on login.
These changes enhance the user management experience by streamlining the confirmation process for organization users.
* Enhance MainBackground class by adding authService, accountService, and configService dependencies to the constructor. This update improves service integration for background operations.
* Add bulk auto-confirm functionality on user login
- Implemented the `initBulkAutoConfirmOnLoginSweep` method in `DefaultAutomaticUserConfirmationService` to trigger bulk auto-confirmation for users transitioning from Locked to Unlocked status.
- Enhanced unit tests to verify the behavior of the sweep service under different authentication states.
- Updated the service to utilize `AuthenticationStatus` for improved state management during user confirmation processes.
These changes streamline the user confirmation workflow, ensuring timely processing of pending confirmations upon user login.
* Refactor DefaultAutomaticUserConfirmationService for improved user confirmation handling
- Updated the `initBulkAutoConfirmOnLoginSweep` method to utilize a set for tracking seen user IDs, preventing duplicate processing during user state transitions.
- Enhanced error handling in the bulk auto-confirmation process to gracefully manage transient errors.
- Introduced a new `resolveAutoConfirmOrg` method to streamline organization retrieval logic for user confirmation.
- Updated unit tests to reflect changes in the handling of account information and ensure correct behavior during user confirmation processes.
These modifications enhance the efficiency and reliability of the user confirmation workflow, particularly during login transitions.
* Update BulkAutoConfirmOnLogin feature flag value to reflect new implementation
* Enhance unit tests for DefaultAutomaticUserConfirmationService to validate feature flag behavior. Added checks to ensure subscriptions are not set up when the feature flag is disabled and confirmed correct behavior during user state transitions. Updated the `initBulkAutoConfirmOnLoginSweep` method to be asynchronous for proper feature flag handling.
* Adding validation to ensure organizations are not being created without keys unintentionally
* Added request test class.
* Removing request test.
* removing duplicate check
* Keys is different than key
* removed feature flag for default user collection being created for restored users.
* leaving the url as we'll need it in case we have to revert a release
* Added encrypted default collection name to new feature flagged restore user methods/endpoint.
* corrected filter to use null check with imperative code
* Added self revoke and toast to the transfer item service
* Renamed to a clearer name
* Update organization-user-api.service.ts
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
* fixed merge conflcits
---------
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Migrated vault filters to new v3 vault's navigation
* Decoupled existing vault filtering from vault component by using routed params with routed-vault-filter-bridge
* Converted vault filters to standalone components
* Removed extending filter Base Components from deprecated /libs/angular library and handled logic directly
* Moved shared 'models' and 'services' directories from web-vault into /libs/vault
* [PM-27675] Integrate dialogs into VaultItemTransferService
* [PM-27675] Update tests for new dialogs
* [PM-27675] Center dialogs and prevent closing with escape or pointer events
* [PM-27675] Add transferInProgress$ observable to VaultItemsTransferService
* [PM-27675] Hook vault item transfer service into browser vault component
* [PM-27675] Move defaultUserCollection$ to collection service
* [PM-27675] Cleanup dialog styles
* [PM-27675] Introduce readySubject to popup vault component to keep prevent flashing content while item transfer is in progress
* [PM-27675] Fix vault-v2 tests
* add one time setup dialog for auto confirm
* add one time setup dialog for auto confirm
* fix copy, padding, cleanup observable logic
* cleanup
* cleanup
* refactor
* clean up
* more cleanup
* Fix deleted files
This reverts commit 7c18a5e512.
* add state definition for auto confirm
* typo
* refactor organziation user service
* WIP create auto confirm service
* add POST method, finish implementation
* add missing userId param, jsdoc
* fix DI
* refactor organziation user service
* WIP create auto confirm service
* add POST method, finish implementation
* add missing userId param, jsdoc
* clean up, more DI fixes
* remove @Injectable from service, fix tests
* remove from libs/common, fix dir structure, add tests
* enforce restrictions based on collection type, set default collection type
* fix ts strict errors
* fix default collection enforcement in vault header
* enforce default collection restrictions in vault collection row
* enforce default collection restrictions in AC vault header
* enforce default collection restriction for select all
* fix ts strict error
* switch to signal, fix feature flag
* fix story
* clean up
* remove feature flag, move check for defaultCollecion to CollecitonView
* fix test
* remove unused configService
* fix test: coerce null to undefined for collection Id
* clean up leaky abstraction for default collection
* fix ts-strict error
* fix parens
* add new property to models, update logic, refactor for ts-strict
* fix type
* rename defaultCollection getter
* clean up
* clean up
* clean up, add comment, fix submit
* add comment
* add feature flag
* check model for name
* cleanup readonly logic, remove featureflag logic
* wip
* refactor CollectionRequest into Create and Update models
* fix readonly logic
* cleanup
* set defaultUserCollectionEmail in decryption from Collection
* split save into update/create methods
* fix readonly logic
* fix collections post and put requests
* add defaultUserCollection email to model when submitting collection dialog
* Add bulk user confirmation method to OrganizationUserService
* Update OrganizationUserBulkConfirmRequest to include optional defaultUserCollectionName property
* Implement conditional bulk user confirmation logic in BulkConfirmDialogComponent.
Its gated behind the feature flag for default user collection.
* Refactor OrganizationUserBulkConfirmRequest to use SdkEncString for defaultUserCollectionName
* Refactor BulkConfirmDialogComponent to use organization object instead of organizationId for improved clarity and type safety.
* Add unit tests for OrganizationUserService to validate user single/bulk confirmation logic
* Refactor OrganizationUserService to streamline encrypted collection name retrieval by introducing getEncryptedDefaultCollectionName$ method.
* Refactor unit tests for OrganizationUserService to reduce duplication by introducing a setupCommonMocks function for common mock configurations.
* refactor(organization-user.service): streamline retrieval of encrypted collection name in bulk confirmation process
Upgrade Angular to v19 using the update guide.
- Add `standalone: false` to any missed component in stories or tests.
- Update jest.config to follow the new best practices.
* Add ssoExternalId to OrganizationUserAdminView and OrganizationUserDetailsResponse
- Updated OrganizationUserAdminView to include ssoExternalId property.
- Enhanced OrganizationUserDetailsResponse constructor to initialize ssoExternalId from response data.
* Add SSO External ID copy to messages.json
* Implement SSO External ID field in member dialog
- Added a new input field for ssoExternalId in the member dialog component.
- Introduced visibility logic for both externalId and ssoExternalId based on feature flags.
- Updated form control initialization to include ssoExternalId.
Fail tests when relying on unknownProperties or unknownElements. Existing instances are whitelist and have tickets created and assigned to the relevant teams.
* Move encrypt service to km ownership
* Update imports for encrypt service abstraction and move bulk encrypt service abstraction
* Fix imports
* Fix further imports
* Fix imports
* Fix worker import
The legacy config is deprecated and will be removed in eslint 10. The flat config also allows us to write js functions which will assist in handling limitations with multiple identical rules.