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-11304] Ownership Not Defaulting To Org and Collection #4254

Merged
merged 16 commits into from
Nov 14, 2024

Conversation

andrebispo5
Copy link
Contributor

@andrebispo5 andrebispo5 commented Nov 7, 2024

🎟️ Tracking

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

📔 Objective

Fix bug where the ownership and collection is not defaulting to the screen where it is being created at.
Also fixed the add item float button that wasn't showing for collection.

📸 Screenshots

Screen.Recording.2024-11-08.at.09.01.42.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 7, 2024

Logo
Checkmarx One – Scan Summary & Details4c89ce87-953b-44a7-9521-0f5f267ab436

No New Or Fixed Issues Found

…ection

# Conflicts:
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingNavigation.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultGraphNavigation.kt
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 64.51613% with 11 lines in your changes missing coverage. Please review.

Project coverage is 89.00%. Comparing base (f33296b) to head (2ecd65e).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...vault/feature/addedit/util/CipherViewExtensions.kt 70.58% 3 Missing and 2 partials ⚠️
...t/feature/itemlisting/VaultItemListingViewModel.kt 37.50% 4 Missing and 1 partial ⚠️
.../ui/vault/feature/addedit/VaultAddEditViewModel.kt 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4254      +/-   ##
==========================================
- Coverage   89.01%   89.00%   -0.02%     
==========================================
  Files         453      453              
  Lines       39049    39067      +18     
  Branches     5480     5485       +5     
==========================================
+ Hits        34758    34770      +12     
- Misses       2369     2374       +5     
- Partials     1922     1923       +1     

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

@@ -134,11 +134,16 @@ fun VaultAddEditState.ViewState.appendFolderAndOwnerData(
),
selectedOwnerId = activeAccount.toSelectedOwnerId(
cipherView = currentContentState.common.originalCipher,
),
)
?: collectionViewList.firstOrNull {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is now chaining, can we clean up the formatting here:

selectedOwnerId = activeAccount
    .toSelectedOwnerId(cipherView = currentContentState.common.originalCipher)
    ?: collectionViewList
        .firstOrNull { it.id == currentContentState.common.selectedCollectionId }
        ?.organizationId,

@@ -93,7 +94,8 @@ fun NavGraphBuilder.vaultItemListingDestinationAsRoot(
onNavigateToVaultAddItemScreen: (
cipherType: VaultItemCipherType,
selectedFolderId: String?,
) -> Unit,
selectedCollectionId: 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.

This should not have the extra indentation.

@@ -23,7 +23,8 @@ fun NavGraphBuilder.vaultGraph(
onNavigateToVaultAddItemScreen: (
vaultItemCipherType: VaultItemCipherType,
selectedFolderId: String?,
) -> Unit,
selectedCollectionId: 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.

Same here

@david-livefront
Copy link
Collaborator

Code looks swell, just the minor formatting stuff

@andrebispo5 andrebispo5 changed the title [PM-11304] Missing add cipher in collections [PM-11304] Ownership Not Defaulting To Org and Collection Nov 8, 2024
id = UUID.randomUUID().toString(),
id = UUID
.randomUUID()
.toString(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason to make this change?

Copy link
Contributor Author

@andrebispo5 andrebispo5 Nov 11, 2024

Choose a reason for hiding this comment

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

image It was automatically formatted by the IDE after the file format.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, that should not happen as part of the formatter. To be clear, there is nothing wrong with this change but the regular auto-formatter does not normally do this. 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Screenshot 2024-11-12 at 11 32 52 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated to match yours, thanks

Base automatically changed from pm-11303/plus-icon-folders to main November 11, 2024 16:48
# Conflicts:
#	app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlocked/VaultUnlockedNavigation.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarNavigation.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditNavigation.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensions.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingNavigation.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingScreen.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultGraphNavigation.kt
#	app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreenTest.kt
#	app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingScreenTest.kt
# Conflicts:
#	app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt
private fun handleSshKeyCipherItemsFeatureFlagReceive(
action: VaultAddEditAction.Internal.SshKeyCipherItemsFeatureFlagReceive,
) {
mutableStateFlow.update {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a test for this action

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was actually a merge mistake, I've already reverted it. Thanks for catching that!

@andrebispo5
Copy link
Contributor Author

@david-livefront Cleaned everything up it should be good now, thanks for the heads up! 👍

@andrebispo5 andrebispo5 added this pull request to the merge queue Nov 14, 2024
Merged via the queue into main with commit 40f33df Nov 14, 2024
9 checks passed
@andrebispo5 andrebispo5 deleted the pm-11304/add-item-collection branch November 14, 2024 08:38
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