[PR #2033] [MERGED] [SG-223] Mobile username generator #3307

Closed
opened 2025-11-26 23:31:01 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2033
Author: @LRNcardozoWDF
Created: 8/10/2022
Status: Merged
Merged: 8/26/2022
Merged by: @LRNcardozoWDF

Base: masterHead: feature/SG-223-mobile-username-generator


📝 Commits (10+)

  • 65acbf9 SG-223 - Changed page title and password title
  • 9508db6 Merge branch 'master' into feature/SG-223-mobile-username-generator
  • be787c6 SG-223 - Refactored generated field
  • cbe1ff3 SG-223 - Refactor type to passwordType
  • 0c427d5 SG-223 - Added password or username selector
  • f8d335d SG-223 - Added logic for different types of username
  • 7d4c294 [SG-223] - Added UI components for different username types
  • 03a8f30 [SG-223] Added control over type picker visibility
  • c042ee9 [SG-223] Refactored username entry on add edit page and added generate icon
  • 0822679 [SG-223] - Implemented service for username generation

📊 Changes

25 files changed (+1469 additions, -98 deletions)

View changed files

📝 src/App/Pages/Generator/GeneratorPage.xaml (+291 -44)
📝 src/App/Pages/Generator/GeneratorPage.xaml.cs (+26 -17)
📝 src/App/Pages/Generator/GeneratorPageViewModel.cs (+475 -20)
📝 src/App/Pages/Vault/CipherAddEditPage.xaml (+16 -5)
📝 src/App/Pages/Vault/CipherAddEditPageViewModel.cs (+32 -0)
📝 src/App/Pages/Vault/CipherDetailsPageViewModel.cs (+2 -2)
📝 src/App/Resources/AppResources.Designer.cs (+145 -1)
📝 src/App/Resources/AppResources.resx (+76 -1)
📝 src/App/Utilities/AppHelpers.cs (+3 -0)
📝 src/App/Utilities/ColoredPasswordConverter.cs (+1 -1)
📝 src/App/Utilities/GeneratedValueFormatter.cs (+7 -7)
📝 src/Core/Abstractions/IApiService.cs (+2 -0)
📝 src/Core/Abstractions/IStateService.cs (+2 -0)
src/Core/Abstractions/IUsernameGenerationService.cs (+13 -0)
📝 src/Core/Constants.cs (+2 -0)
src/Core/Enums/ForwardedEmailServiceType.cs (+14 -0)
src/Core/Enums/GeneratorType.cs (+12 -0)
src/Core/Enums/UsernameEmailType.cs (+12 -0)
src/Core/Enums/UsernameType.cs (+16 -0)
src/Core/Models/Domain/UsernameGenerationOptions.cs (+23 -0)

...and 5 more files

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Add username's generation option to mobile app.

Code changes

  • GeneratorPage.xaml: Added UI elements needed for username generation options. Refactored password's display and some tags to help distinguish from password and username.
  • GeneratorPage.xaml.cs: Added flags to control visual display of Password vs Username. Refactored Regenerate_Clicked into AsyncCommand in ViewModel.
  • GeneratorPageViewModel.cs: Added logic to handle username creation, saving and loading username options. Refactored some properties to help distinguish from password and username.
  • CipherAddEditPage.xaml: Refactored username field to grid and added button, with an icon, to navigate to Generator.
  • CipherAddEditPageViewModel.cs: Added command to perform navigation to Generator page.
  • AppResources.Designer.cs AppResources.resx: Added new strings.
  • AppHelpers.cs: Added to new service to cache cleaning task.
  • Constants.cs: Added new constant key.
  • ForwardedEmailServiceType.cs UsernameEmailType.cs UsernameType.cs: Added to help identify newly required types related to username creation.
  • UsernameGenerationOptions.cs: Added model of username generation options.
  • ApiService.cs: Added Http requests to various api's in order to consume their username creation service.
  • StateService.cs: Added username generation options get/set support from/to storage.
  • UsernameGenerationService.cs: Added to handle username creation based on username type intended.
  • ServiceContainer.cs: Registered new service, UsernameGenerationService.cs.

Screenshots

Add item page with button to generate username:
image

Generator page for username when navigated from Add item page.
Chosen Plus Addressed Email username type and it's available options:

image

Generator page for username when navigated from Add item page.
Chosen Forwarded Email username type and it's available options:

image

Generator page for username when navigated from Add item page.
Chosen Random Word username type and it's available options:

image

Generator page tab for password:
image

Generator page tab for username:
image

Before you submit

  • I have checked for formatting errors (dotnet tool run dotnet-format --check) (required)
  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2033 **Author:** [@LRNcardozoWDF](https://github.com/LRNcardozoWDF) **Created:** 8/10/2022 **Status:** ✅ Merged **Merged:** 8/26/2022 **Merged by:** [@LRNcardozoWDF](https://github.com/LRNcardozoWDF) **Base:** `master` ← **Head:** `feature/SG-223-mobile-username-generator` --- ### 📝 Commits (10+) - [`65acbf9`](https://github.com/bitwarden/android/commit/65acbf9c30fd91dc64c2ce3e05a44040259c15e1) SG-223 - Changed page title and password title - [`9508db6`](https://github.com/bitwarden/android/commit/9508db6fbf22cfc060ec2e3eec9c3950063777ea) Merge branch 'master' into feature/SG-223-mobile-username-generator - [`be787c6`](https://github.com/bitwarden/android/commit/be787c6789b3a8d24c40a3e1f8af99800197b460) SG-223 - Refactored generated field - [`cbe1ff3`](https://github.com/bitwarden/android/commit/cbe1ff37216dae556c5d45387a2476f80950ba95) SG-223 - Refactor type to passwordType - [`0c427d5`](https://github.com/bitwarden/android/commit/0c427d59cfe760e80cd2086a3ce578313ba54dc5) SG-223 - Added password or username selector - [`f8d335d`](https://github.com/bitwarden/android/commit/f8d335db48976662a171b1e310304a7e550b469f) SG-223 - Added logic for different types of username - [`7d4c294`](https://github.com/bitwarden/android/commit/7d4c2946548f23f4035ab1956d3d505571654324) [SG-223] - Added UI components for different username types - [`03a8f30`](https://github.com/bitwarden/android/commit/03a8f306c9d180ed99dc5b38e67549cb47d4d453) [SG-223] Added control over type picker visibility - [`c042ee9`](https://github.com/bitwarden/android/commit/c042ee956079fa8468e792778dc52af48cf6736e) [SG-223] Refactored username entry on add edit page and added generate icon - [`0822679`](https://github.com/bitwarden/android/commit/0822679f5360721552e49ae227ede37b5276b2a6) [SG-223] - Implemented service for username generation ### 📊 Changes **25 files changed** (+1469 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Generator/GeneratorPage.xaml` (+291 -44) 📝 `src/App/Pages/Generator/GeneratorPage.xaml.cs` (+26 -17) 📝 `src/App/Pages/Generator/GeneratorPageViewModel.cs` (+475 -20) 📝 `src/App/Pages/Vault/CipherAddEditPage.xaml` (+16 -5) 📝 `src/App/Pages/Vault/CipherAddEditPageViewModel.cs` (+32 -0) 📝 `src/App/Pages/Vault/CipherDetailsPageViewModel.cs` (+2 -2) 📝 `src/App/Resources/AppResources.Designer.cs` (+145 -1) 📝 `src/App/Resources/AppResources.resx` (+76 -1) 📝 `src/App/Utilities/AppHelpers.cs` (+3 -0) 📝 `src/App/Utilities/ColoredPasswordConverter.cs` (+1 -1) 📝 `src/App/Utilities/GeneratedValueFormatter.cs` (+7 -7) 📝 `src/Core/Abstractions/IApiService.cs` (+2 -0) 📝 `src/Core/Abstractions/IStateService.cs` (+2 -0) ➕ `src/Core/Abstractions/IUsernameGenerationService.cs` (+13 -0) 📝 `src/Core/Constants.cs` (+2 -0) ➕ `src/Core/Enums/ForwardedEmailServiceType.cs` (+14 -0) ➕ `src/Core/Enums/GeneratorType.cs` (+12 -0) ➕ `src/Core/Enums/UsernameEmailType.cs` (+12 -0) ➕ `src/Core/Enums/UsernameType.cs` (+16 -0) ➕ `src/Core/Models/Domain/UsernameGenerationOptions.cs` (+23 -0) _...and 5 more files_ </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective Add username's generation option to mobile app. ## Code changes * **GeneratorPage.xaml:** Added UI elements needed for username generation options. Refactored password's display and some tags to help distinguish from password and username. * **GeneratorPage.xaml.cs:** Added flags to control visual display of Password vs Username. Refactored Regenerate_Clicked into AsyncCommand in ViewModel. * **GeneratorPageViewModel.cs:** Added logic to handle username creation, saving and loading username options. Refactored some properties to help distinguish from password and username. * **CipherAddEditPage.xaml:** Refactored username field to grid and added button, with an icon, to navigate to Generator. * **CipherAddEditPageViewModel.cs:** Added command to perform navigation to Generator page. * **AppResources.Designer.cs AppResources.resx:** Added new strings. * **AppHelpers.cs:** Added to new service to cache cleaning task. * **Constants.cs:** Added new constant key. * **ForwardedEmailServiceType.cs UsernameEmailType.cs UsernameType.cs:** Added to help identify newly required types related to username creation. * **UsernameGenerationOptions.cs:** Added model of username generation options. * **ApiService.cs:** Added Http requests to various api's in order to consume their username creation service. * **StateService.cs:** Added username generation options get/set support from/to storage. * **UsernameGenerationService.cs:** Added to handle username creation based on username type intended. * **ServiceContainer.cs:** Registered new service, UsernameGenerationService.cs. ## Screenshots **Add item page with button to generate username:** <img width="419" alt="image" src="https://user-images.githubusercontent.com/6855596/183939921-d6679bb0-c6bb-4c4d-a50e-602eb690ca54.png"> **Generator page for username when navigated from Add item page. Chosen Plus Addressed Email username type and it's available options:** <img width="419" alt="image" src="https://user-images.githubusercontent.com/6855596/183940134-fe2267ba-ac5e-4fe6-9747-4de322696e8e.png"> **Generator page for username when navigated from Add item page. Chosen Forwarded Email username type and it's available options:** <img width="419" alt="image" src="https://user-images.githubusercontent.com/6855596/183940184-ff064be1-a333-4e3d-a322-18086b375821.png"> **Generator page for username when navigated from Add item page. Chosen Random Word username type and it's available options:** <img width="419" alt="image" src="https://user-images.githubusercontent.com/6855596/183940241-d814f9ff-cf32-43fd-b43c-898b8dd7e6f8.png"> **Generator page tab for password:** <img width="419" alt="image" src="https://user-images.githubusercontent.com/6855596/183940283-3f34d491-6131-43de-b77a-b947a48fef4c.png"> **Generator page tab for username:** <img width="419" alt="image" src="https://user-images.githubusercontent.com/6855596/183940322-10ed8f8a-55b4-40e4-a0de-ff97c039569a.png"> ## Before you submit - [X] I have checked for formatting errors (`dotnet tool run dotnet-format --check`) (required) - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [x] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:31:01 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3307