[SG-79] Add filter to search and preselect org in new cipher#1944
[SG-79] Add filter to search and preselect org in new cipher#1944
Conversation
| if (vaultFilterSelection != null) | ||
| { | ||
| _vm.VaultFilterDescription = vaultFilterSelection; | ||
| } |
There was a problem hiding this comment.
Is the if necessary? If _vm.VaultFilterDescription is null and vaultFilterSelection is also null there shouldn't be any problems, or are there any because of the property change or something like that?
| if (!string.IsNullOrWhiteSpace((Page as CiphersPage).SearchBar.Text)) | ||
| { | ||
| Search((Page as CiphersPage).SearchBar.Text, 200); | ||
| } |
There was a problem hiding this comment.
Could we have a ViewModel property SearchText or something like that that we bind TwoWay against the page SearchBar.Text? I'd really like to remove all references from the ViewModel to the pages so that we can at some moment remove the reference to Page from all the VMs and be more aligned with the MVVM pattern.
| var selection = await Page.DisplayActionSheet(AppResources.FilterByVault, AppResources.Cancel, null, | ||
| options.ToArray()); | ||
| if (selection == AppResources.Cancel || | ||
| (_vaultFilterSelection == null && selection == AppResources.AllVaults) || | ||
| (_vaultFilterSelection != null && _vaultFilterSelection == selection)) | ||
| { | ||
| return; | ||
| } |
There was a problem hiding this comment.
If I'm not mistaken selection can be null as what I see here that is triggered on Android when tapping outside the dialog, just in case confirm if here the behavior is different or somehow touching outside is disabled.
Therefore a check should added as well against null
Type of change
Objective
Code changes
AddEditPageGetVaultFilterOrgId()publicorganizationIdin constructorlist-row-button-textstyle to fix color of vault filter button to match mocksBefore you submit
dotnet tool run dotnet-format --check) (required)