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

[MBL-2063] Delete PledgeViewController & PledgeViewControllerTests #2272

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Feb 4, 2025

📲 What

Also deletes PledgeViewController Snapshots

🤔 Why

Now that the "No Shipping" flow has been made the standard, we can start removing the legacy checkout classes.

Doing this class by class for easier reviews and simpler commits.

🛠 How

  • Deletes PledgeViewController, PledgeViewControllerTests, and Snapshots
  • Deletes PledgeViewModel and PledgeViewModelTests
  • Moves any object definitions into NoShipping files where needed.

👀 See

No visible changes

✅ Acceptance criteria

  • Crowdfund and Late Pledge checkout is untouched and functions as expected
  • Tests pass

TODO

Removing these classes next:

  • NoShippingPostCampaignViewController
  • RewardsCollectionViewController
  • RewardAddOnSelectionViewController
  • RewardsCollectionViewController

@scottkicks scottkicks self-assigned this Feb 4, 2025
@@ -538,7 +538,6 @@ final class ManagePledgeViewController: UIViewController, MessageBannerViewContr
// MARK: - Functions

private func goToRewards(_ project: Project) {
/// Render rewards carousel that has the shipping location dropdown
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this comment. It's no longer needed now that the no-shipping flow is the standard.

@@ -638,7 +638,6 @@ public final class ProjectPageViewController: UIViewController, MessageBannerVie
}

private func goToRewards(project: Project, refTag: RefTag?) {
/// Render rewards carousel that has the shipping location dropdown
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this comment. It's no longer needed now that the no-shipping flow is the standard.

Comment on lines +223 to +229
// TODO: This class will be removed as part of our legacy checkout cleanup

self.navigationController?.pushViewController(vc, animated: true)
// let vc = PledgeViewController.instantiate()
// vc.delegate = self.pledgeViewDelegate
// vc.configure(with: data)
//
// self.navigationController?.pushViewController(vc, animated: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simply commenting out this use of PledgeViewController for now since this class, RewardAddOnSelectionViewController, is a legacy class and will be deleted.

Comment on lines +289 to +295
// TODO: This class will be removed as part of our legacy checkout cleanup

self.navigationController?.pushViewController(pledgeViewController, animated: true)
// let pledgeViewController = PledgeViewController.instantiate()
// pledgeViewController.delegate = self.pledgeViewDelegate
// pledgeViewController.configure(with: data)
//
// self.navigationController?.pushViewController(pledgeViewController, animated: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here. RewardsCollectionViewController, is a legacy class and will be deleted. Simply commenting this code out for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These new lines are taken directly from PledgeViewModel. These types are still used in the checkout flow we had originally decided no to duplicate them and make NoShipping specific types.

@scottkicks scottkicks marked this pull request as ready for review February 4, 2025 16:02
@scottkicks scottkicks requested review from amy-at-kickstarter and a team February 4, 2025 16:02
Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter left a comment

Choose a reason for hiding this comment

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

LGTM, one clarifying question about a delegate.

@nativeksr
Copy link
Collaborator

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@scottkicks scottkicks force-pushed the scott/delete-legacy-pledge-view branch from 1f59cea to a916b4f Compare February 4, 2025 17:22
@scottkicks scottkicks requested review from a team and ifosli and removed request for a team February 4, 2025 17:39
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

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

Nice!

public let context: PledgeViewContext

// Convenience initializer to allow `bonusSupport` to default to `nil`.
// TODO(MBL-1670): Delete this when cleaning up the noShippingAtCheckout feature.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we delete these convenience initializers yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A few classes are using them, and I think it'll be cleaner to remove these initializers as I remove them. But yeah, they'll get removed along with everything else!

@scottkicks scottkicks merged commit 8d9e749 into main Feb 4, 2025
5 checks passed
@scottkicks scottkicks deleted the scott/delete-legacy-pledge-view branch February 4, 2025 20:25
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