-
Notifications
You must be signed in to change notification settings - Fork 45
[PM-13428] Remove ownership option #1405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
64cec21
7589d70
49c5320
1aa4586
7d5ddb5
dc5f086
4d07dd7
ecfe06f
c3168a4
f9044cc
e174bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -45,6 +45,9 @@ protocol AddEditItemState: Sendable { | |||||||||||||
/// The state for guided tour view. | ||||||||||||||
var guidedTourViewState: GuidedTourViewState { get set } | ||||||||||||||
|
||||||||||||||
/// Whether the user belongs to any organization. | ||||||||||||||
var hasOrganizations: Bool { get set } | ||||||||||||||
|
||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐จ From what I can see this depends on the
Suggested change
This would make the change much simpler and you avoid having to update the variable from outside the state. |
||||||||||||||
/// The state for a identity type item. | ||||||||||||||
var identityState: IdentityItemState { get set } | ||||||||||||||
|
||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,7 +166,7 @@ struct AddEditItemView: View { | |
) | ||
.accessibilityIdentifier("FolderPicker") | ||
|
||
if store.state.configuration.isAdding, let owner = store.state.owner { | ||
if let owner = store.state.owner, store.state.hasOrganizations { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. โ I'm seeing that if I edit an item in my personal vault, I can change the owner. Is that expected, or should the ownership field be disabled? (e.g. should the disabled modifier not have the And similarly, if I edit an item in an organization, should I be able to toggle the collection toggles on this screen? I think that also requires a separate API call which is why you needed to go to the edit collections screen. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you belong to an organization and the personal vault isn't disabled it will be possible to change the owner. And yes, we should be able to toggle the collection toggles. |
||
ContentBlock(dividerLeadingPadding: 16) { | ||
BitwardenMenuField( | ||
title: Localizations.owner, | ||
|
@@ -176,7 +176,7 @@ struct AddEditItemView: View { | |
get: { _ in owner }, | ||
send: AddEditItemAction.ownerChanged | ||
) | ||
) | ||
).disabled(!store.state.configuration.isAdding && !owner.isPersonal) | ||
|
||
ForEach(store.state.collectionsForOwner, id: \.id) { collection in | ||
if let collectionId = collection.id { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ค Do we need to consider if any of the organizations are disabled or if the user isn't confirmed in the organization? For example
VaultRepository.fetchCipherOwnershipOptions()
has the following checks:ios/BitwardenShared/Core/Vault/Repositories/VaultRepository.swift
Lines 1012 to 1015 in dc5f086
I wonder if it would be easier to check
state.ownershipOptions.contains { !$0.isPersonal }
rather than do another fetch from the database?