-
Notifications
You must be signed in to change notification settings - Fork 842
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-13351] Prevent editing of TOTP key in 'can edit except passwords' collection #4583
Conversation
Fixed Issues (12)Great job! The following issues were fixed in this Pull Request
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4583 +/- ##
========================================
Coverage 88.40% 88.41%
========================================
Files 604 607 +3
Lines 40987 41188 +201
Branches 5770 5774 +4
========================================
+ Hits 36236 36415 +179
- Misses 2746 2754 +8
- Partials 2005 2019 +14 ☔ View full report in Codecov by Sentry. |
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt
Outdated
Show resolved
Hide resolved
The code looks good to me, do we have any tests for this? |
Still working on that |
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt
Outdated
Show resolved
Hide resolved
.fillMaxWidth(), | ||
) | ||
} | ||
item(key = AddEditItemCoachMark.TOTP) { |
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.
🎨 We could have also left this:
coachMarkHighlightItem(
key = AddEditItemCoachMark.TOTP,
title = R.string.coachmark_2_of_3.asText(),
description = R.string.you_ll_only_need_to_set_up_authenticator_key.asText(),
onDismiss = onCoachMarkDismissed,
leftAction = {
CoachMarkActionText(
actionLabel = stringResource(R.string.back),
onActionClick = onPreviousCoachMark,
)
},
rightAction = {
CoachMarkActionText(
actionLabel = stringResource(R.string.next),
onActionClick = onNextCoachMark,
)
},
modifier = Modifier.standardHorizontalMargin(),
) {
TotpRow(
totpKey = loginState.totp,
canViewTotp = loginState.canViewPassword,
loginItemTypeHandlers = loginItemTypeHandlers,
onTotpSetupClick = onTotpSetupClick,
)
}
And made it so TotpRow
still encapsulated the if/else logic, but didn't need to have any deps on the coach mark related code.
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.
@dseverns-livefront I took a similar approach to PasswordRow
for consistency, but I'm also not familiar with coach mark best practices. Feel free to change it if there's a better way, I won't be offended :)
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-13351
📔 Objective
This disables the ability to edit the TOTP key if the item is part of a collection with
Can Edit, Except Passwords
permission📸 Screenshots
Item with existing TOTP key:
Item without existing TOTP key:
⏰ Reminders before review
🦮 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 confirmedissue 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