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

View pledge screen #826

Merged
merged 18 commits into from
Sep 4, 2019
Merged

View pledge screen #826

merged 18 commits into from
Sep 4, 2019

Conversation

Scollaco
Copy link
Contributor

@Scollaco Scollaco commented Sep 3, 2019

πŸ“² What

  • Adds the ManagePledgeViewController to the Native Checkout flow.

πŸ€” Why

  • This is a screen that will allow users to manage and view their pledge. For now, this screen is empty and was created so the team can work on different screens that are part of the manage pledge flow, such as Cancel Pledge, Manage Pledge, Contact creator...

JIRA ticket

πŸ›  How

  • By adding ManagePledgeViewController and its view model
  • Adding logic to present the screen only if the featureNativeCheckoutPledgeView feature flag is enabled.
    . If this is not the case, the DeprecatedRewardPledgeViewController will be presented.

πŸ‘€ See

manage_pledge

βœ… Acceptance criteria

With featureNativeCheckoutPledgeView enabled.

On the Rewards Carousel screen:

  • Select a reward by tapping the Select button. The PledgeViewController should be presented.
  • Select a reward of a backed and live project by tapping the Manage your pledge button. The ManagePledgeViewController (blank) should be presented.
  • Select a different reward of a backed and live project by tapping the Select this reward instead button. The PledgeViewController should be presented.
  • Selected a backed and ended project. Tap View your pledge and the old BackingViewController should be presented (The logic to go to the new view pledge screen is not implemented in this PR).

With featureNativeCheckoutPledgeView disabled.

On the Rewards Carousel screen:

  • Select a reward by tapping the Select button. The DeprecatedRewardPledgeViewController should be presented.
  • Select a reward of a backed and live project by tapping the Manage your pledge button. The DeprecatedRewardPledgeViewController should be presented.
  • Select a different reward of a backed and live project by tapping the Select this reward instead button. The DeprecatedRewardPledgeViewController should be presented.
  • Selected a backed and ended project. Tap View your pledge and the BackingViewController should be presented.

Copy link
Contributor

@dusi dusi left a comment

Choose a reason for hiding this comment

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

ACs check out...I had bunch of suggestions / questions.

Also is it intentional that the navigation bar and the view background color is different? (see screenshot)

Screen Shot 2019-09-03 at 2 50 04 PM


private lazy var editButton: UIBarButtonItem = {
UIBarButtonItem(
barButtonSystemItem: .edit,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nino, we didn't have image resources to show the More button (3 dots)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't. Android has it because it's native, not a resource.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we just get PDF from Abstract?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let me know if you'd want me to extract it ... I should have a copy of Sketch on my machine

let nav = UINavigationController(rootViewController: managePledgeViewController)
|> \.modalPresentationStyle .~ .formSheet

self.present(nav, animated: true, completion: nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, we can omit completion to have less code.

@@ -0,0 +1,28 @@
import KsApi
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be cool to also prepare ManagePledgeViewModelTests.swift

@@ -0,0 +1,77 @@
import KsApi
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be cool to also prepare ManagePledgeViewControllerTests.swift

.filter { project, reward, _ -> Bool in
project.state == .live && userIsBacking(reward: reward, inProject: project)
}
.map { project, reward, refTag in
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't do this point free, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It didn't compile. Maybe because the point free syntax doesn't apply for constructors.

Copy link
Contributor

Choose a reason for hiding this comment

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

Stupid Swift :trollface:

@@ -157,6 +163,131 @@ final class RewardsCollectionViewModelTests: TestCase {
XCTAssertEqual(self.vm.outputs.selectedReward(), project.rewards[endIndex - 1])
}

func testGoToManagePledge_featureNativeCheckoutPledgeView_Enabled() {
let config = .template
|> Config.lens.features .~ [Feature.nativeCheckoutPledgeView.rawValue: true]
Copy link
Contributor

@dusi dusi Sep 3, 2019

Choose a reason for hiding this comment

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

How are we going to proceed from here taking nativeCheckoutV1 into account? Should we test for both of those flags or is nativeCheckoutPledgeView sufficient?

|> \.abExperiments .~ [Experiment.Name.nativeCheckoutV1.rawValue: "experimental"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ManagePledgeViewController is only accessible if nativeCheckoutV1 is experimental, because we're presenting from the Rewards Carousel. That said, nativeCheckoutPledgeView should be sufficient.

@ksr-ci-bot
Copy link

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

Copy link
Contributor

@dusi dusi left a comment

Choose a reason for hiding this comment

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

🚒 🚒 🚒
🚒 🚒 🚒
🚒 🚒 🚒

"Quick, merge your PR before Justin" :trollface:

@Scollaco Scollaco merged commit cbcd2ba into master Sep 4, 2019
@Scollaco Scollaco deleted the view-pledge-screen branch September 4, 2019 21:19
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.

None yet

3 participants