-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[MBL-1288] Update pledge CTA #2000
Conversation
documentAttributes: nil | ||
) else { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the helper method simpleHtmlAttributedString
do what you need, here? Or is the custom implementation required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice find! I looked for something like this but clearly not hard enough - I really wasn't expecting us to already handle strings like this.
return text | ||
} | ||
|
||
private func getBoldRangesFromHtmlTags(plainString: String, htmlString: String) -> [NSRange] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This should live in String+SimpleHTML
or another utility file, feels too general purpose for the pledge container. (If it doesn't already exist elsewhere).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; left a few non-blocking questions. The most important one is: will having .latePledge
as a context break our assumptions down the line when we need to edit a late pledge?
var currentString = htmlString as NSString | ||
while currentString.contains("<b>") { | ||
let startTagRange = currentString.range(of: "<b>") | ||
let endTagRange = currentString.range(of: "</b>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: will this code break/infinite loop if there's no closing </b>
?
@@ -179,7 +179,7 @@ final class RewardAddOnSelectionViewController: UIViewController { | |||
.observeValues { [weak self] data in | |||
guard let self else { return } | |||
|
|||
if featurePostCampaignPledgeEnabled(), data.project.isInPostCampaignPledgingPhase { | |||
if data.context == .latePledge { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
case update | ||
case changePaymentMethod | ||
case updateReward | ||
|
||
var confirmationLabelHidden: Bool { | ||
switch self { | ||
case .fixPaymentMethod, .changePaymentMethod, .updateReward: return true | ||
case .pledge, .update: return false | ||
case .pledge, .latePledge, .update: return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you want to the update the reward of a late pledge? Is it .latePledge
or .updateReward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't update rewards (or change payment method) for late pledges, afaik. Since you're charged immediately, your pledge is also locked in as soon as you make it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it.
📲 What
Update pledge CTA by adding a separate context for late pledges and showing the "pledge immediately" string in a late pledge context.
Note: the bolding is currently a little off. I have a pr that fixes that submitted but not yet in staging, so this will be fixed the next time we make strings.
👀 See
Jira
✅ Acceptance criteria