8000 [PM-16916] Custom fields need label to be saved by LRNcardozoWDF · Pull Request #1430 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[PM-16916] Custom fields need label to be saved #1430

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 24 commits into from
Apr 23, 2025

Conversation

LRNcardozoWDF
Copy link
Member
@LRNcardozoWDF LRNcardozoWDF commented Mar 11, 2025

🎟️ Tracking

PM-16916

📔 Objective

Disable OK button if there's no input.

📸 Screenshots

  • Custom field name is empty so the OK button is disabled.
  • Custom field name is filled so the OK button is enabled.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) 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

@LRNcardozoWDF LRNcardozoWDF marked this pull request as ready for review March 11, 2025 15:02
Copy link
Contributor
github-actions bot commented Mar 11, 2025

Logo
Checkmarx One – Scan Summary & Details5286d7ff-1fd6-457a-bd60-5b27622eb657

Great job, no security vulnerabilities found in this Pull Request

Copy link
codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.69%. Comparing base (277552d) to head (edb0405).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1430   +/-   ##
=======================================
  Coverage   89.68%   89.69%           
=======================================
  Files         776      777    +1     
  Lines       48896    48965   +69     
=======================================
+ Hits        43851    43917   +66     
- Misses       5045     5048    +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 29 to 30
/// The current alert shown.
private weak var currentAlertController: UIAlertController?
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Even though it's weak I'm not very fond of having this reference here in order to apply this logic.
Could you check if you could add a kind of inversion of control in the AlertTextField -> textChanged so it calls a function passed to the AlertTextField which ends up updating a reference of the alert action?

Co 10000 py link
Member

Choose a reason for hiding this comment

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

@KatherineInCode @matt-livefront what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. I'm also kind of surprised that this works because I'm not sure what's keeping a reference to the Alert to keep it from being deallocated. If Fede's suggestion doesn't work out, we already have an alert controller subclass here, could we use that house some of this logic?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also agree that we should try to do inversion of control here if possible.

@@ -28,10 +31,12 @@ public class AlertAction {
///
public init(
title: String,
shouldEnableAction: (([AlertTextField]) -> Bool)? = nil,
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Despite our desire to alphabetize parameters, I still somewhat prefer parameters that take closures to be piled at the end to potentially take advantage of trailing closure syntax.

Comment on lines 29 to 30
/// The current alert shown.
private weak var currentAlertController: UIAlertController?
Copy link
Contributor

Choose a reason for hiding this comment

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

I also agree that we should try to do inversion of control here if possible.

…Alert.swift


pm-16916 Fix PR comment

Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
@LRNcardozoWDF LRNcardozoWDF requested a review from fedemkr April 17, 2025 14:10
fedemkr
fedemkr previously approved these changes Apr 17, 2025
@phil-livefront phil-livefront removed their request for review April 21, 2025 13:41
@LRNcardozoWDF LRNcardozoWDF merged commit 989be66 into main Apr 23, 2025
10 checks passed
@LRNcardozoWDF LRNcardozoWDF deleted the cmcg/pm-16916-custom-fields-need-label-to-be-saved branch April 23, 2025 14:03
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.

4 participants
0