[PM-1433] Creating Item Doesn't Auto-Select Current Organization/Collection in Individual Web Vault #5302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Objective
A bug was found within individual user vaults for users who are part of an organization. When adding a new item, if the user has selected to filter all items by a collection, it is expected that the new item should auto-populate the ownership of the item to the organization who set up the collection. The item should also have the selected collection as its default selected value.
This is currently not happening, and the reason identified is that on selection of the "New Item" button, we are not identifying the organization that is associated with a selected collection filter. This change introduces a fix which ensures we set the organization ID based on the selected collection ID before showing the modal element to the user. This ensures that the organization as well as the selected collection are set by default when the user is attempting to add a new item.
Code changes
VaultComponent.addCipher()
method we are now setting theorganizationId
for theAddEditComponent
if the selected collection ID is not equal toAllCollections
. We find the first entry with within the array of collections that contains the selected collection ID and set theorganizationId
associated with the found collection item.Screenshots
Screen.Recording.2023-04-27.at.6.25.02.PM.mov
Before you submit