Skip to content
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-11303] Add button missing for folders #4250

Merged
merged 4 commits into from
Nov 11, 2024
Merged

Conversation

andrebispo5
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-11303

📔 Objective

  • Added the missing "Add Cipher" floating button to the folder view.
  • Updated the "Add" functionality to preselect the current folder when adding from a folder view. To achieve this, a new navigation parameter was introduced and passed to the Add/Edit screen.

📸 Screenshots

Screen.Recording.2024-11-06.at.22.04.20.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 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

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Logo
Checkmarx One – Scan Summary & Details833e938a-b167-4ec0-93c1-76b8da07e742

No New Or Fixed Issues Found

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.06%. Comparing base (db3490f) to head (c70ff9b).
Report is 20 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4250   +/-   ##
=======================================
  Coverage   89.05%   89.06%           
=======================================
  Files         445      445           
  Lines       38756    38766   +10     
  Branches     5418     5420    +2     
=======================================
+ Hits        34515    34525   +10     
  Misses       2362     2362           
  Partials     1879     1879           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -127,7 +127,7 @@ fun VaultAddEditState.ViewState.appendFolderAndOwnerData(
common = currentContentState.common.copy(
selectedFolderId = folderViewList.toSelectedFolderId(
cipherView = currentContentState.common.originalCipher,
),
) ?: currentContentState.common.selectedFolderId,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this down a line to match the chaining pattern:

)
?: currentContentState.common.selectedFolderId,

onNavigateToVaultAddItemScreen: (
cipherType: VaultItemCipherType,
selectedFolderId: String?,
) -> Unit,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you apply the formatter here

@@ -2089,7 +2096,7 @@ data class VaultItemListingState(
get() = folderId
?.let { folderName.asText() }
?: R.string.folder_none.asText()
override val hasFab: Boolean get() = false
override val hasFab: Boolean get() = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

onNavigateToVaultAddItemScreen: (
vaultItemCipherType: VaultItemCipherType,
selectedFolderId: String?,
) -> Unit,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatter

@@ -942,6 +942,26 @@ class VaultItemListingViewModelTest : BaseViewModelTest() {
}
}

@Suppress("MaxLineLength")
@Test
fun `AddVaultItemClick inside a folder should emit NavigateToAddVaultItem with a selected folder id`() = runTest {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatter, there are instructions on how to setup the macro for this here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I had it configured already I just forgot about it thinking that the gradle detekt would apply our code styling as well.

@@ -117,7 +117,9 @@ class VaultItemListingScreenTest : BaseComposeTest() {
biometricsManager = biometricsManager,
onNavigateBack = { onNavigateBackCalled = true },
onNavigateToVaultItem = { onNavigateToVaultItemId = it },
onNavigateToVaultAddItemScreen = { onNavigateToVaultAddItemScreenCalled = true },
onNavigateToVaultAddItemScreen = { _, _ ->
onNavigateToVaultAddItemScreenCalled = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise it won't even compile.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see the underscores now. 😄

@andrebispo5 andrebispo5 added this pull request to the merge queue Nov 11, 2024
Merged via the queue into main with commit a3ed2bc Nov 11, 2024
10 checks passed
@andrebispo5 andrebispo5 deleted the pm-11303/plus-icon-folders branch November 11, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants