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

New backer push navigate to activity #222

Merged
merged 53 commits into from
Aug 17, 2017
Merged

Conversation

bormind
Copy link
Contributor

@bormind bormind commented Aug 15, 2017

What

Clicking on the new backer notification opens activities view for the corresponding project

How

Expanded on the concept used for "Creator message push" functionality:
Added Project activity navigation node
Added navigateToActivities management signals and producers in the DashboardViewModel

See 👀

Trello

bormind and others added 22 commits August 2, 2017 07:58
…tivity

# Conflicts:
#	Library/ViewModels/DashboardViewModel.swift
…tivity

# Conflicts:
#	Library/ViewModels/DashboardViewModel.swift
…tivity

# Conflicts:
#	Library/ViewModels/DashboardViewModel.swift
# Conflicts:
#	Kickstarter-iOS/AppDelegate.swift
#	Kickstarter-iOS/ViewModels/AppDelegateViewModel.swift
#	Kickstarter-iOS/Views/Controllers/DashboardViewController.swift
#	Kickstarter-iOS/Views/Controllers/RootTabBarViewController.swift
#	Library/Navigation.swift
#	Library/ViewModels/DashboardViewModel.swift
Copy link
Contributor

@justinswart justinswart left a comment

Choose a reason for hiding this comment

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

Thanks Boris! Couple small things.

private func goToProjectActivities(_ projectId: Param) {
self.rootTabBarController?
.swithchToProjectActivities(projectId: projectId)

Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this new line.

@@ -319,6 +325,12 @@ internal final class AppDelegate: UIResponder, UIApplicationDelegate {
.switchToCreatorMessageThread(projectId: projectId, messageThread: messageThread)
}

private func goToProjectActivities(_ projectId: Param) {
self.rootTabBarController?
.swithchToProjectActivities(projectId: projectId)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should fit on one line and there's a spelling error swithch -> switch.

public func swithchToProjectActivities(projectId: Param) {
self.switchToDashboard(project: nil)

guard let dashboardNav = self.selectedViewController as? UINavigationController,
Copy link
Contributor

Choose a reason for hiding this comment

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

When we do double lets in a guard we like to nest them for readability:

guard
  let dashboardNav = self.selectedViewController as? UINavigationController,
  let dashboardVC = dashboardNav.viewControllers.first as? DashboardViewController
else {
  ...
}

navigateToActivitiesReceived.producer
.skipNil()
.filter { $0 == .id(project.id) }
.map { _ in project }
Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder if this would read better as .mapConst(project) 🤔

Copy link
Contributor Author

@bormind bormind Aug 16, 2017

Choose a reason for hiding this comment

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

For me personally .map { _ in project } feels more explicit.

@@ -772,7 +774,7 @@ final class AppDelegateViewModelTests: TestCase {
launchOptions: [UIApplicationLaunchOptionsKey.remoteNotification: backingForCreatorPushData]
)

self.goToDashboard.assertValues([param])
self.goToProjectActivities.assertValues([param])
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to the test for goToDashboard?

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 are going to ProjectActivities instead of going to the Dashboard

Copy link
Contributor

@justinswart justinswart left a comment

Choose a reason for hiding this comment

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

I'm down, pinging @stephencelis too.

@bormind bormind merged commit 356d2b8 into master Aug 17, 2017
@bormind bormind deleted the new_backer_push_activity branch August 17, 2017 22:32
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

2 participants