[PR #856] [MERGED] [Soft Delete] Added trash folder to mobile #2619

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/856
Author: @cscharf
Created: 4/27/2020
Status: Merged
Merged: 4/29/2020
Merged by: @cscharf

Base: soft-deleteHead: soft-delete-init


📝 Commits (2)

  • 1c748cc [Soft Delete] Added trash folder to mobile
  • aeaa43a [Soft Delete] - Revert send to trash label

📊 Changes

25 files changed (+376 additions, -38 deletions)

View changed files

📝 src/App/Pages/Vault/AddEditPageViewModel.cs (+6 -5)
📝 src/App/Pages/Vault/CiphersPage.xaml.cs (+7 -2)
📝 src/App/Pages/Vault/CiphersPageViewModel.cs (+3 -1)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs (+22 -4)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs (+11 -2)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs (+39 -6)
📝 src/App/Pages/Vault/ViewPage.xaml (+3 -2)
📝 src/App/Pages/Vault/ViewPage.xaml.cs (+26 -2)
📝 src/App/Pages/Vault/ViewPageViewModel.cs (+57 -5)
📝 src/App/Resources/AppResources.Designer.cs (+67 -0)
📝 src/App/Resources/AppResources.resx (+43 -0)
📝 src/App/Utilities/AppHelpers.cs (+5 -1)
📝 src/Core/Abstractions/IApiService.cs (+2 -0)
📝 src/Core/Abstractions/ICipherService.cs (+3 -1)
📝 src/Core/Abstractions/ISearchService.cs (+3 -3)
📝 src/Core/Enums/EventType.cs (+2 -0)
📝 src/Core/Models/Data/CipherData.cs (+2 -0)
📝 src/Core/Models/Domain/Cipher.cs (+5 -1)
📝 src/Core/Models/Response/CipherResponse.cs (+1 -0)
📝 src/Core/Models/View/CipherView.cs (+3 -0)

...and 5 more files

📄 Description

Objective

Similar changes as the other clients, added Trash bin support, soft-delete and restore functions to the mobile app. Tested in iOS and Android emulators.

Sorry for the size of this one. PR from soft-delete-init to soft-delete.

Code Changes

  • /App/Pages/Vault/AddEditPage.xaml: When editing an item, only provide "soft-delete", relabeled as "Send to trash"
  • /App/Pages/Vault/AddEditPage.xaml.cs: See "AddEditPage.xaml" above
  • /App/Pages/Vault/AddEditPageViewModel.cs: Text changes for the prompt, "Send to trash" vs. "Delete"
  • /App/Pages/Vault/CiphersPage.xaml.cs: Treatment for handling the display of the trash bin vs. other normal folders/views including messaging
  • /App/Pages/Vault/CiphersPageViewModel.cs: See "CiphersPage.xaml.cs" above
  • /App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs: Handle view of trash bin folder, remove add menu option and add button (android) from view, etc.
  • /App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs: Added trash item grouping with appropriate icon (from font-store)
  • /App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs: Count and management of the trash item, filter and visibility of the add cipher button
  • /App/Pages/Vault/ViewPage.xaml: Default soft delete from menu and whether or not an item is editable
  • /App/Pages/Vault/ViewPage.xaml.cs: Edit toolbar action either Edits or "Restores" a soft-deleted item, handle soft-delete and delete from the same command and adjust toolbar item visibility based on whether a cipher is soft-deleted or not
  • /App/Pages/Vault/ViewPageViewModel.cs: Added actions for restoring and modified the action for delete to prompt and handle either soft or permanently deleting an item based on it's current deleted state
  • /App/Resources/AppResources.resx: New text, labels and messaging regarding soft-delete, permanently delete and restore actions and trash label
  • /App/Utilities/AppHelpers.cs: Only allow the Edit menu option if not soft-deleted
  • /Core/Abstractions/IApiService.cs: Update the API abstraction for putDelete and putRestore endpoints
  • /Core/Abstractions/ICipherService.cs: Added to abstraction definition methods for soft delete and restore with server
  • /Core/Abstractions/ISearchService.cs: Added deleted flags for search service abstraction to match other clients'. Cleaned up syntax for default(T) to default where type is known/inferred
  • /Core/Enums/EventType.cs: Keeping the Event Type enum in sync with the server code
  • /Core/Models/Data/CipherData.cs: Tracking the new DeletedDate property
  • /Core/Models/Domain/Cipher.cs: "
  • /Core/Models/Response/CipherResponse.cs: "
  • /Core/Models/View/CipherView.cs: Added DeletedDate and IsDeleted derived properties
  • /Core/Services/ApiService.cs: Implementation for new putDelete and putRestore methods
  • **/Core/Services/CipherService.cs **: Implementation for soft delete and restore functions as well as preventing IsDeleted ciphers for auto-fill functions
  • /Core/Services/SearchService.cs: Mirror other clients' search service interface, applied Is Deleted filter explicitly unless searching in trash
  • /iOS.Core/Views/ExtensionTableSource.cs: Prevent deleted items from showing up in auto-fill service for iOS
  • /iOS/AppDelegate.cs: Handle event delegates for soft delete and restore actions

Screenshots

image

image

image

image

image

image

image

image


🔄 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/856 **Author:** [@cscharf](https://github.com/cscharf) **Created:** 4/27/2020 **Status:** ✅ Merged **Merged:** 4/29/2020 **Merged by:** [@cscharf](https://github.com/cscharf) **Base:** `soft-delete` ← **Head:** `soft-delete-init` --- ### 📝 Commits (2) - [`1c748cc`](https://github.com/bitwarden/android/commit/1c748cc7ca5620e1a9942f998d0e056d4cfd718b) [Soft Delete] Added trash folder to mobile - [`aeaa43a`](https://github.com/bitwarden/android/commit/aeaa43af5a91c0b630b2a97bcd933e70a2b957af) [Soft Delete] - Revert send to trash label ### 📊 Changes **25 files changed** (+376 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Vault/AddEditPageViewModel.cs` (+6 -5) 📝 `src/App/Pages/Vault/CiphersPage.xaml.cs` (+7 -2) 📝 `src/App/Pages/Vault/CiphersPageViewModel.cs` (+3 -1) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs` (+22 -4) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs` (+11 -2) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs` (+39 -6) 📝 `src/App/Pages/Vault/ViewPage.xaml` (+3 -2) 📝 `src/App/Pages/Vault/ViewPage.xaml.cs` (+26 -2) 📝 `src/App/Pages/Vault/ViewPageViewModel.cs` (+57 -5) 📝 `src/App/Resources/AppResources.Designer.cs` (+67 -0) 📝 `src/App/Resources/AppResources.resx` (+43 -0) 📝 `src/App/Utilities/AppHelpers.cs` (+5 -1) 📝 `src/Core/Abstractions/IApiService.cs` (+2 -0) 📝 `src/Core/Abstractions/ICipherService.cs` (+3 -1) 📝 `src/Core/Abstractions/ISearchService.cs` (+3 -3) 📝 `src/Core/Enums/EventType.cs` (+2 -0) 📝 `src/Core/Models/Data/CipherData.cs` (+2 -0) 📝 `src/Core/Models/Domain/Cipher.cs` (+5 -1) 📝 `src/Core/Models/Response/CipherResponse.cs` (+1 -0) 📝 `src/Core/Models/View/CipherView.cs` (+3 -0) _...and 5 more files_ </details> ### 📄 Description ## Objective > Similar changes as the other clients, added Trash bin support, soft-delete and restore functions to the mobile app. Tested in iOS and Android emulators. Sorry for the size of this one. PR from `soft-delete-init` to `soft-delete`. ## Code Changes - **/App/Pages/Vault/AddEditPage.xaml**: When editing an item, only provide "soft-delete", relabeled as "Send to trash" - **/App/Pages/Vault/AddEditPage.xaml.cs**: See "AddEditPage.xaml" above - **/App/Pages/Vault/AddEditPageViewModel.cs**: Text changes for the prompt, "Send to trash" vs. "Delete" - **/App/Pages/Vault/CiphersPage.xaml.cs**: Treatment for handling the display of the trash bin vs. other normal folders/views including messaging - **/App/Pages/Vault/CiphersPageViewModel.cs**: See "CiphersPage.xaml.cs" above - **/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs**: Handle view of trash bin folder, remove add menu option and add button (android) from view, etc. - **/App/Pages/Vault/GroupingsPage/GroupingsPageListItem.cs**: Added trash item grouping with appropriate icon (from font-store) - **/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs**: Count and management of the trash item, filter and visibility of the add cipher button - **/App/Pages/Vault/ViewPage.xaml**: Default soft delete from menu and whether or not an item is editable - **/App/Pages/Vault/ViewPage.xaml.cs**: Edit toolbar action either Edits or "Restores" a soft-deleted item, handle soft-delete and delete from the same command and adjust toolbar item visibility based on whether a cipher is soft-deleted or not - **/App/Pages/Vault/ViewPageViewModel.cs**: Added actions for restoring and modified the action for delete to prompt and handle either soft or permanently deleting an item based on it's current deleted state - **/App/Resources/AppResources.resx**: New text, labels and messaging regarding soft-delete, permanently delete and restore actions and trash label - **/App/Utilities/AppHelpers.cs**: Only allow the Edit menu option if not soft-deleted - **/Core/Abstractions/IApiService.cs**: Update the API abstraction for putDelete and putRestore endpoints - **/Core/Abstractions/ICipherService.cs**: Added to abstraction definition methods for soft delete and restore with server - **/Core/Abstractions/ISearchService.cs**: Added deleted flags for search service abstraction to match other clients'. Cleaned up syntax for `default(T)` to `default` where type is known/inferred - **/Core/Enums/EventType.cs**: Keeping the Event Type enum in sync with the server code - **/Core/Models/Data/CipherData.cs**: Tracking the new DeletedDate property - **/Core/Models/Domain/Cipher.cs**: " - **/Core/Models/Response/CipherResponse.cs**: " - **/Core/Models/View/CipherView.cs**: Added DeletedDate and IsDeleted derived properties - **/Core/Services/ApiService.cs**: Implementation for new putDelete and putRestore methods - **/Core/Services/CipherService.cs **: Implementation for soft delete and restore functions as well as preventing `IsDeleted` ciphers for auto-fill functions - **/Core/Services/SearchService.cs**: Mirror other clients' search service interface, applied Is Deleted filter explicitly unless searching in trash - **/iOS.Core/Views/ExtensionTableSource.cs**: Prevent deleted items from showing up in auto-fill service for iOS - **/iOS/AppDelegate.cs**: Handle event delegates for soft delete and restore actions ## Screenshots ![image](https://user-images.githubusercontent.com/3904944/80407962-76546080-8894-11ea-8cf2-eccb335b5d10.png) ![image](https://user-images.githubusercontent.com/3904944/80408019-89ffc700-8894-11ea-84f1-9bd61e50984f.png) ![image](https://user-images.githubusercontent.com/3904944/80408037-908e3e80-8894-11ea-8742-1ec2542397f7.png) ![image](https://user-images.githubusercontent.com/3904944/80408060-98e67980-8894-11ea-8d9c-da0c2bfe10fd.png) ![image](https://user-images.githubusercontent.com/3904944/80408081-9f74f100-8894-11ea-86b6-4d6ab96afab5.png) ![image](https://user-images.githubusercontent.com/3904944/80408099-a7cd2c00-8894-11ea-88eb-6ee08910dfcc.png) ![image](https://user-images.githubusercontent.com/3904944/80408125-ae5ba380-8894-11ea-9316-4ccefaaddf29.png) ![image](https://user-images.githubusercontent.com/3904944/80408151-b87da200-8894-11ea-9b96-03f6e8f529ca.png) --- <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:21:47 -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#2619