8000 BIT-348, BIT-351, & BIT-1121: Add, Save, View, & Edit Card Type Cipher by eliot-livefront · Pull Request #229 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BIT-348, BIT-351, & BIT-1121: Add, Save, View, & Edit Card Type Cipher #229

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

Merged
merged 10 commits into from
Jan 2, 2024

Conversation

eliot-livefront
Copy link
Collaborator

🎟️ Tracking

BIT-348
BIT-351
BIT-1121

🚧 Type of change

  • 🚀 New feature development

📔 Objective

Create, Read, & Update Card type Ciphers.

📋 Code changes

  • AddEditCardItemView: A new view to add/edit card items.
  • AddEditCardItemState: The state backing the AddEditCardItemView.
  • AddEditCardItemAction: Actions for the view.
  • CardComponents: Credit card component models.
  • ViewCardItemView: A new view to view card items.
  • ViewCardItemState: The state backing the ViewCardItemView.
  • AddEditCardItemAction: Actions for the AddEditCardItemView.

📸 Screenshots

card-cipher.mp4

⏰ 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

# Conflicts:
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible_largeText.1.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible_largeText.1.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.4.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.5.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.6.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.7.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.8.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.9.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditLoginItemViewTests/test_snapshot_addEditLoginItemView.6.png
#	BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessor.swift
@bitwarden-bot
Copy link
bitwarden-bot commented Dec 21, 2023

Logo
Checkmarx One – Scan Summary & Detailseebf48ad-a69c-42dd-b3fd-294c68be7857

No New Or Fixed Issues Found

Copy link
Contributor
github-actions bot commented Dec 21, 2023
5 Warnings
⚠️ BitwardenShared/UI/Auth/Login/LoginWithDevice/LoginWithDeviceProcessor.swift#L34: Will never be executed
⚠️ Ignoring duplicate libraries: '-lbitwarden_uniffi'
⚠️ GlobalTestHelpers/Extensions/Snapshotting.swift#L58: Type Contents Order Violation: A 'type_method' should not be placed amongst the type content(s) 'type_property' (type_contents_order)
⚠️ BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponent.swift has less than 80% code coverage
⚠️ BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift has less than 80% code coverage

Bitwarden code coverage

Total coverage: 87.21%

File Coverage
BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/AddEditCardItemView.swift 100.00%
BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponent.swift 77.08%
BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardItemState.swift 100.00%
BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemProcessor.swift 92.49%
BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemView.swift 99.17%
BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift 98.47%
BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewCardItem/ViewCardItemView.swift 91.72%
BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift 78.57%
BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemDetailsView.swift 94.48%
BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessor.swift 90.32%
BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemView.swift 84.51%
BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewLoginItem/Extensions/CipherView+Update.swift 98.96%

Powered by Slather

Generated by 🚫 Danger

@matt-livefront matt-livefront self-assigned this Dec 21, 2023
Comment on lines 237 to 241
matching: ViewItemView_Previews.cardPreview,
as: [
.tallPortrait,
.defaultPortraitDark,
.tallPortraitAX5(heightMultiple: 2),
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 I think one of the downsides of snapshotting the previews is that you lose out on having the ability to include context of what the snapshot contains in the generated file. Any idea if we can get the preview display name to use that + the configuration in the filename?

Having that context is nice IMO if you look back at these in Xcode or if one is failing:

Screenshot 2023-12-21 at 2 24 47 PM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I split them all out.


/// A protocol for a sendable type that models a Card Item in it's add/edit state.
///
protocol AddEditCardItemState: Equatable, Sendable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 I'm curious the benefit we get from having this protocol and ViewCardItemState over using CardItemState directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My goal was to build in some separation from the State to the ViewState and remove the ability to mutate the struct in a view configuration. I build this pattern to match the one used for CipherItemState, AddEditItemState, and ViewVaultItemState

# Conflicts:
#	BitwardenShared/Core/Vault/Extensions/TestHelpers/BitwardenSdk+VaultFixtures.swift
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemAction.swift
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemProcessor.swift
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible_largeText.1.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible_largeText.1.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.2.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.4.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.5.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.7.png
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.8.png
#	BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift
Copy link
Collaborator
@matt-livefront matt-livefront left a comment

Choose a reason for hiding this comment

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

Looks good!

@eliot-livefront eliot-livefront merged commit 158d1f2 into main Jan 2, 2024
@eliot-livefront eliot-livefront deleted the eliot/BIT-348-Add-Card-Type branch January 2, 2024 20:06
vvolkgang pushed a commit that referenced this pull request Feb 24, 2025
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.

3 participants
0