-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[PM-10426] Admin Console - Edit Modal #11249
Conversation
…t/pm-10426/admin-console-add-edit
…t/pm-10426/admin-console-add-edit
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #11249 +/- ##
==========================================
+ Coverage 33.26% 33.28% +0.02%
==========================================
Files 2729 2731 +2
Lines 85524 85593 +69
Branches 16314 16325 +11
==========================================
+ Hits 28449 28491 +42
- Misses 54816 54840 +24
- Partials 2259 2262 +3 ☔ View full report in Codecov by Sentry. |
No New Or Fixed Issues Found |
…t/pm-10426/admin-console-add-edit
…t/pm-10426/admin-console-add-edit
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.
Screen recordings look good as I expect the generator dialogs will be updated later when the generator PR is merged.
Should I add functionality to refresh the vault when a cipher is saved and the user is navigated to the view dialog?
Hmm, I think it would make sense to refresh the Vault on Save of a new item, if it isn't too complex. But I will differ to Shane on the final call, ideally the behavior would be consistent with what we have in the end user PM view.
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.
Nice work on this! I think its coming together nicely! I just see a few permission issues we'll need to resolve.
As for refreshing the Vault after a cipher is saved, but before closing the dialog; we can find a way to do that, but I had left it to only refresh on dialog close in the PM. Watching for the dialog result was the most straightforward way to know if a save event occured.
If we want to refresh on every save, we'll need to include some type of event emitter in our dialogRef
so that the caller can listen to both the close and save observables.
apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.ts
Outdated
Show resolved
Hide resolved
apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.ts
Outdated
Show resolved
Hide resolved
|
||
/** Opens the view dialog for the given cipher unless password reprompt fails */ | ||
async viewCipherById(id: string) { | ||
const cipher = await this.cipherService.get(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.
cipherService
. We were passing in the entire cipherView
to this method previously to avoid needing to repeat the logic performed in building the allCiphers$
observable.
I think we should still pass the view object in here directly, and if it doesn't exist we should return early as it is not possible to open the dialog in View mode without a cipher.
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.
Great thought. ca3a369
I think the edit would need the same thing, no? editCipherId follows this pattern. Any reason it isn't necessary there?
(Maybe it is, I'm having a difficult time getting the correct scenario setup to test)
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.
Ah, good catch, it will also fail there as well and we should make the same change there.
For clarity, "fail" means it will simply skip the re-prompt and continue to the edit dialog. The edit dialog opened successfully because it has custom logic internally to retrieve the cipher from the admin API if its not available in the cipherService. That's also why this has likely gone un-noticed, you would specifically need to have MP re-prompt enabled for an unassigned item that is opened in the AC.
(btw, you can create unassigned items by deleting the last collection an item is assigned to)
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.
👍 Cool, I shadowed the same view logic for the edit logic: 87ff20a
libs/vault/src/cipher-form/components/item-details/item-details-section.component.html
Outdated
Show resolved
Hide resolved
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.
Just two more small nits/suggestions and the change to pass CipherView
to editCipher()
and then I think this is good to go! Nice work!
apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.ts
Outdated
Show resolved
Hide resolved
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.
I think this looks good to go!
We should likely do a quick test/pass without the feature flag enabled to ensure we're not breaking anything with the changes related to passing in the full cipher objects. (or simply wait until after the next rc
cut next week)
🎟️ Tracking
PM-10426
📔 Objective
@shane-melton @danielleflinn You can see in my videos below that the vault doesn't update until the dialog is closed. Should I add functionality to refresh the vault when a cipher is saved and the user is navigated to the view dialog?
📸 Screenshots
ac-add-cipher.mov
ac-edit-cipher.mov
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes