[PR #1271] [MERGED] Support for Disable Send policy #2818

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1271
Author: @mpbw2
Created: 2/18/2021
Status: Merged
Merged: 2/18/2021
Merged by: @mpbw2

Base: masterHead: send-policy


📝 Commits (6)

  • dafcc3b add support for disable send policy
  • 3690e70 cleanup
  • 490899a show/hide options support for send search results
  • fa0b0d3 additional failsafes and copy function consolidation
  • 6a50a69 added missing disabled send icon to android renderer
  • f81d4e4 async fix and string updates

📊 Changes

18 files changed (+235 additions, -42 deletions)

View changed files

📝 src/Android/Renderers/SendViewCellRenderer.cs (+11 -0)
📝 src/Android/Resources/layout/SendViewCell.axml (+8 -0)
📝 src/App/Controls/SendViewCell/SendViewCell.xaml (+1 -0)
📝 src/App/Controls/SendViewCell/SendViewCell.xaml.cs (+13 -0)
📝 src/App/Controls/SendViewCell/SendViewCellViewModel.cs (+7 -0)
📝 src/App/Pages/Send/SendAddEditPage.xaml (+32 -1)
📝 src/App/Pages/Send/SendAddEditPage.xaml.cs (+23 -11)
📝 src/App/Pages/Send/SendAddEditPageViewModel.cs (+16 -11)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml (+17 -1)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml.cs (+8 -1)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageListItem.cs (+1 -0)
📝 src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageViewModel.cs (+16 -1)
📝 src/App/Pages/Send/SendsPage.xaml (+2 -1)
📝 src/App/Pages/Send/SendsPageViewModel.cs (+8 -0)
📝 src/App/Resources/AppResources.Designer.cs (+12 -0)
📝 src/App/Resources/AppResources.resx (+9 -1)
📝 src/App/Utilities/AppHelpers.cs (+44 -8)
📝 src/Core/Enums/PolicyType.cs (+7 -6)

📄 Description

Overview

Added support for disabling Send via enterprise policy. Functionality is reduced to read and delete only.

(Note that references to "options button" below is referring to the 3-dot overflow for each item in listviews, not the new expandable options button on the Send Add/Edit page)

Files Changes/Added

Android:

  • SendviewCellRenderer.cs: Support for toggling options button visibility, added missing disabled send icon
  • SendViewCell.axml: Added missing disabled send icon

App:

  • SendviewCell.xaml: Support for toggling options button visibility
  • SendViewCell.xaml.cs: Support for toggling options button visibility
  • SendViewCellViewModel.cs: Support for toggling options button visibility
  • SendGroupingsPage.xaml: Support for toggling options button visibility, warning banner, and FAB visibility for Android
  • SendGroupingsPage.xaml.cs: Added call to init viewmodel and post-load toolbar adjustments
  • SendGroupingsPageViewModel.cs: Added SendEnabled property, set via new init method, and passed into sends list
  • SendGroupingsPageListItem.cs: Added property for options button visibility
  • SendAddEditPage.xaml: Support for disabling save button, warning banner, and bindings to disable editable components when Send is disabled
  • SendAddEditPage.xaml.cs: Moved call to init to async, post-load toolbar adjustments, and adjustments to the "More" overflow menu based on SendEnabled (also tweaked button size for android hack and added missing "Async" suffix to "TypeChanged" method)
  • SendAddEditPageViewModel.cs: Added SendEnabled property, made init method async, added SendEnabled check failsafe to SubmitAsync, use CopySendUrlAsync helper method, added missing Async suffix to ShareSendUrl
  • SendsPage.xaml: Support for toggling options button visibility
  • SendsPageViewModel.cs: Added SendEnabled property
  • AppResources.resx: Added SendLink and SendDisabledWarning text
  • AppResources.Designer.cs: System modified resources
  • AppHelpers.cs: Added IsSendDisabledByPolicyAsync and CopySendUrlAsync helper methods, and added IsSendDisabledByPolicyAsync failsafe checks to ShareSendUrlAsync and RemoveSendPasswordAsync

Core:

  • PolicyType.cs: Added DisableSend policy type

Considerations

  • Warning banner design is based on pattern already established elsewhere (password generator policies come to mind)
  • Some views lack an obvious "disabled" state change and it varies by platform. it's something I hope to improve upon with styling & XF updates

Screenshots

Screen Shot 2021-02-17 at 9 49 06 PM
Screen Shot 2021-02-17 at 9 54 53 PM
Screen Shot 2021-02-17 at 9 55 13 PM


🔄 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/1271 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 2/18/2021 **Status:** ✅ Merged **Merged:** 2/18/2021 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `send-policy` --- ### 📝 Commits (6) - [`dafcc3b`](https://github.com/bitwarden/android/commit/dafcc3bbbf196dff55aad3f9be74bde7d92df7b8) add support for disable send policy - [`3690e70`](https://github.com/bitwarden/android/commit/3690e7049eb18c47b0b8a173672987b89a1cc2d3) cleanup - [`490899a`](https://github.com/bitwarden/android/commit/490899ab11a7c0b732fd584802d2967ee5457a27) show/hide options support for send search results - [`fa0b0d3`](https://github.com/bitwarden/android/commit/fa0b0d371acc1a66fed20694279c325f1764e653) additional failsafes and copy function consolidation - [`6a50a69`](https://github.com/bitwarden/android/commit/6a50a690c2f4d3a78d6744d841e68a19e2075b1c) added missing disabled send icon to android renderer - [`f81d4e4`](https://github.com/bitwarden/android/commit/f81d4e41f2bcace6f1e8a3fdd74868cc90efd25d) async fix and string updates ### 📊 Changes **18 files changed** (+235 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Renderers/SendViewCellRenderer.cs` (+11 -0) 📝 `src/Android/Resources/layout/SendViewCell.axml` (+8 -0) 📝 `src/App/Controls/SendViewCell/SendViewCell.xaml` (+1 -0) 📝 `src/App/Controls/SendViewCell/SendViewCell.xaml.cs` (+13 -0) 📝 `src/App/Controls/SendViewCell/SendViewCellViewModel.cs` (+7 -0) 📝 `src/App/Pages/Send/SendAddEditPage.xaml` (+32 -1) 📝 `src/App/Pages/Send/SendAddEditPage.xaml.cs` (+23 -11) 📝 `src/App/Pages/Send/SendAddEditPageViewModel.cs` (+16 -11) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml` (+17 -1) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPage.xaml.cs` (+8 -1) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageListItem.cs` (+1 -0) 📝 `src/App/Pages/Send/SendGroupingsPage/SendGroupingsPageViewModel.cs` (+16 -1) 📝 `src/App/Pages/Send/SendsPage.xaml` (+2 -1) 📝 `src/App/Pages/Send/SendsPageViewModel.cs` (+8 -0) 📝 `src/App/Resources/AppResources.Designer.cs` (+12 -0) 📝 `src/App/Resources/AppResources.resx` (+9 -1) 📝 `src/App/Utilities/AppHelpers.cs` (+44 -8) 📝 `src/Core/Enums/PolicyType.cs` (+7 -6) </details> ### 📄 Description **Overview** Added support for disabling Send via enterprise policy. Functionality is reduced to read and delete only. _(Note that references to "options button" below is referring to the 3-dot overflow for each item in listviews, not the new expandable options button on the Send Add/Edit page)_ **Files Changes/Added** Android: - **SendviewCellRenderer.cs**: Support for toggling options button visibility, added missing disabled send icon - **SendViewCell.axml**: Added missing disabled send icon App: - **SendviewCell.xaml**: Support for toggling options button visibility - **SendViewCell.xaml.cs**: Support for toggling options button visibility - **SendViewCellViewModel.cs**: Support for toggling options button visibility - **SendGroupingsPage.xaml**: Support for toggling options button visibility, warning banner, and FAB visibility for Android - **SendGroupingsPage.xaml.cs**: Added call to init viewmodel and post-load toolbar adjustments - **SendGroupingsPageViewModel.cs**: Added SendEnabled property, set via new init method, and passed into sends list - **SendGroupingsPageListItem.cs**: Added property for options button visibility - **SendAddEditPage.xaml**: Support for disabling save button, warning banner, and bindings to disable editable components when Send is disabled - **SendAddEditPage.xaml.cs**: Moved call to init to async, post-load toolbar adjustments, and adjustments to the "More" overflow menu based on `SendEnabled` (also tweaked button size for android hack and added missing "Async" suffix to "TypeChanged" method) - **SendAddEditPageViewModel.cs**: Added `SendEnabled` property, made init method async, added `SendEnabled` check failsafe to `SubmitAsync`, use `CopySendUrlAsync` helper method, added missing `Async` suffix to `ShareSendUrl` - **SendsPage.xaml**: Support for toggling options button visibility - **SendsPageViewModel.cs**: Added `SendEnabled` property - **AppResources.resx**: Added `SendLink` and `SendDisabledWarning` text - **AppResources.Designer.cs**: System modified resources - **AppHelpers.cs**: Added `IsSendDisabledByPolicyAsync` and `CopySendUrlAsync` helper methods, and added `IsSendDisabledByPolicyAsync` failsafe checks to `ShareSendUrlAsync` and `RemoveSendPasswordAsync` Core: - **PolicyType.cs**: Added `DisableSend` policy type **Considerations** - Warning banner design is based on pattern already established elsewhere (password generator policies come to mind) - Some views lack an obvious "disabled" state change and it varies by platform. it's something I hope to improve upon with styling & XF updates **Screenshots** ![Screen Shot 2021-02-17 at 9 49 06 PM](https://user-images.githubusercontent.com/59324545/108304536-40ab9b80-7176-11eb-8ec4-63b97dbf19f1.png) ![Screen Shot 2021-02-17 at 9 54 53 PM](https://user-images.githubusercontent.com/59324545/108304547-43a68c00-7176-11eb-9fe6-c6a279cad1b9.png) ![Screen Shot 2021-02-17 at 9 55 13 PM](https://user-images.githubusercontent.com/59324545/108304557-46a17c80-7176-11eb-950a-f72fa87060ea.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:24:30 -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#2818