-
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
[NT-558][NT-508][NT-532] Indicate Backing state on Manage Pledge View #934
Conversation
Generated by 🚫 Danger |
Apologies, this PR got a lot bigger than initially intended. |
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.
Paired with @justinswart on this PR and it looks good. I would just wait for the Strings to be deployed before merging it.
@@ -12,6 +12,10 @@ final class ManagePledgeSummaryViewController: UIViewController { | |||
private lazy var backerNumberLabel: UILabel = { UILabel(frame: .zero) }() | |||
private lazy var backingDateLabel: UILabel = { UILabel(frame: .zero) }() | |||
|
|||
private lazy var pledgeStatusLabelViewController: PledgeStatusLabelViewController = { |
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.
Just curious, why did you opt for using a VC here instead of a UIView
? 🤔
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.
I just had a good feeling about it 😄
NSAttributedString.Key.paragraphStyle: paragraphStyle | ||
] | ||
|
||
if project.stats.currentCurrency == project.stats.currency { |
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 could use if project.stats.needsConversion
here instead.
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.
Or rather if !project.stats.needsConversion
, though maybe it would make more sense to use a guard:
guard project.stats.needsConversion else {
return Strings.If_the_project_reaches_its_funding_goal_you_will_be_charged_on_project_deadline(
project_deadline: date
)
.attributed(with: font, foregroundColor: foregroundColor, attributes: attributes, bolding: [date])
}
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 cool thanks!
|> Backing.lens.status .~ $0 | ||
) | ||
|
||
self.vm.inputs.configure(with: project) |
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.
Do you need to call self.vm.inputs.viewDidLoad()
somewhere?
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.
😬 😬
attributedString.addAttributes(regularFontAttribute, range: fullRange) | ||
attributedString.addAttributes(boldFontAttribute, range: rangePledgeTotal) | ||
attributedString.addAttributes(boldFontAttribute, range: rangeProjectDeadline) | ||
if project.stats.currentCurrency == project.stats.currency { |
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.
Here too we could use project.stats.needsConversion
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.
This change seemed to break snapshots. Will dig in more tomorrow.
# Conflicts: # Kickstarter-iOS/Views/Controllers/ManagePledgeSummaryViewController.swift # Library/ViewModels/ManagePledgeSummaryViewModel.swift # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_GooglePay_lang_en_device_phone4_7inch@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_NoReward_ApplePay_lang_en_device_phone4_7inch@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_de_device_pad@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_de_device_phone4_7inch@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_en_device_pad@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_en_device_phone4_7inch@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_es_device_pad@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_es_device_phone4_7inch@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_fr_device_pad@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_fr_device_phone4_7inch@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_ja_device_pad@2x.png # Screenshots/_64/Kickstarter_Framework_iOSTests.ManagePledgeViewControllerTests/testView_lang_ja_device_phone4_7inch@2x.png
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.
I only left a couple of suggestions, but none are blockers.
self.labelText = project.map(statusLabelText(with:)).skipNil() | ||
} | ||
|
||
private let configureWithProjectStatusProperty = MutableProperty<Project?>(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.
Maybe configureWithProjectProperty
here could be more appropriated, since we're getting not only the project's state, but the whole project?
📲 What
Adds text describing the
Backing
's state toManagePledgeViewController
.🤔 Why
This provides some additional context to our backers that may be useful for them when viewing their pledge in the app.
🛠 How
attributedConfirmationString
fromPledgeViewModel
to be a bit more reusable.Note: Once we are sure that we have the final copy for all of the strings I will add them for translation and rebuild the strings.
👀 See
♿️ Accessibility
🏎 Performance
✅ Acceptance criteria
Note: It may be easiest to test by manipulating the JSON response using breakpoints with Charles proxy.
For both backer and creator:
canceled
orfailed
state, we show different copy also noted on the ticket.⏰ TODO