[PR #1951] [MERGED] [SG-79] [SG-389] Additional logic around vault filter display #3247

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1951
Author: @mpbw2
Created: 6/13/2022
Status: Merged
Merged: 6/14/2022
Merged by: @mpbw2

Base: masterHead: bugfix-vaultfilter


📝 Commits (3)

  • 107a31a Additional logic around filter display
  • c6c4056 move logic to vault filter base class
  • df30fbb init VaultFilterCommand in base class

📊 Changes

4 files changed (+144 additions, -154 deletions)

View changed files

📝 src/App/Pages/Vault/CiphersPageViewModel.cs (+8 -74)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs (+12 -80)
src/App/Pages/VaultFilterViewModel.cs (+118 -0)
📝 src/Core/Services/PolicyService.cs (+6 -0)

📄 Description

Type of change

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

Objective

  • Hide the "My Vault" option if the Personal Ownership Policy is enabled in an organization
  • Hide the vault filters altogether if the Personal Ownership & Single Org policies are both enabled in an organization

Code changes

  • GroupingsPageViewModel/CiphersPageViewModel.cs: Added _hideMyVaultFilterOption bool based on _policyService.PolicyAppliesToUser(PolicyType.PersonalOwnership)
  • PolicyService.cs: Added additional policy checks in ShouldShowVaultFilterAsync() method

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/1951 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 6/13/2022 **Status:** ✅ Merged **Merged:** 6/14/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `bugfix-vaultfilter` --- ### 📝 Commits (3) - [`107a31a`](https://github.com/bitwarden/android/commit/107a31a9792fab430cdbbf53b7888c85f71a6b4d) Additional logic around filter display - [`c6c4056`](https://github.com/bitwarden/android/commit/c6c40568aeeda8021064fdae3a3f9af9c8585d2b) move logic to vault filter base class - [`df30fbb`](https://github.com/bitwarden/android/commit/df30fbbf543217738b9154e19d3956a11a409471) init VaultFilterCommand in base class ### 📊 Changes **4 files changed** (+144 additions, -154 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Vault/CiphersPageViewModel.cs` (+8 -74) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs` (+12 -80) ➕ `src/App/Pages/VaultFilterViewModel.cs` (+118 -0) 📝 `src/Core/Services/PolicyService.cs` (+6 -0) </details> ### 📄 Description ## Type of change - [X] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> - Hide the "My Vault" option if the Personal Ownership Policy is enabled in an organization - Hide the vault filters altogether if the Personal Ownership & Single Org policies are both enabled in an organization ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **GroupingsPageViewModel/CiphersPageViewModel.cs:** Added `_hideMyVaultFilterOption` bool based on `_policyService.PolicyAppliesToUser(PolicyType.PersonalOwnership)` * **PolicyService.cs:** Added additional policy checks in `ShouldShowVaultFilterAsync()` method ## 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) - [ ] 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:30:14 -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#3247