[PM-23379] bug: custom fields: hide or show move up or down actions depending on the items' index#5480
Conversation
…items' index - When only one custom field is present no move actions are displayed - When two fields are added only move down for the first or move up for the last is displayed - When there are three or more items both actions are displayed for fields between the first and the last
|
|
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt
Show resolved
Hide resolved
app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditCustomField.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditCustomField.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditCustomField.kt
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5480 +/- ##
==========================================
+ Coverage 85.33% 85.34% +0.01%
==========================================
Files 957 872 -85
Lines 60714 60148 -566
Branches 8634 8599 -35
==========================================
- Hits 51808 51335 -473
+ Misses 5900 5818 -82
+ Partials 3006 2995 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
New Issues (128)Checkmarx found the following issues in this Pull Request
|
|
@gabrbrand The code looks good to me but it seems you have a failing test. Once that is addressed, we can get this merged. |
|
Should I add tests for the cases listed in "Objective" in the description to verify that only the needed move actions are displayed? |
@gabrbrand That would be great! |
|
What is causing "Label PR by Changed Files" to fail? Looks like gh cli can't add labels (already added). Any suggestions on improvement for the tests? (I will add the missing comma, pre-commit checks are now enabled) |
app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreenTest.kt
Outdated
Show resolved
Hide resolved
Adding the comma to the test will address the failing static analysis checks. You don't need to worry about the |


📔 Objective
Currently move up and down actions are displayed for all custom fields, although no action is triggered in some scenarios.
This PR hides the corresponding action, if it's not needed for the specific field.
📸 Screenshots
⏰ 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 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