Skip to content

Conversation

@frosty
Copy link
Contributor

@frosty frosty commented Feb 5, 2016

Adds a plan details view, as part of #4745. This is currently just the detail view itself, with no comparison / plan switching functionality. It shows the details for the plan selected from PlanListViewController.

simulator screen shot 5 feb 2016 11 37 00

Known issues

– As with #4772, prices are hardcoded – this will be dealt with as part of #4746. The purchase button is also currently shown for the Free plan.
– The current active plan isn't highlighted yet. This will come with the comparison / switcher update.
– The data is currently hardcoded into the app. It would be nice as a future improvement to fetch this from our API instead to keep up to date.
– A few design (colour, mainly) tweaks may be required. iPad is currently not dealt with, as that'll be handled by the switcher view controller that wraps this one.

Needs Review: @koke

}

func ==(lhs: PlanFeature, rhs: PlanFeature) -> Bool {
return lhs.title == rhs.title
Copy link
Member

Choose a reason for hiding this comment

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

I think that this is not correct, even if it works for this case. I believe .Support("3GB") shouldn't be equal to .Support("13GB"), even when they'll share the same title.
You can compare values with pattern matching, although I think you'll have to cover every case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... the reason I added Equatable was simply so that I could find a plan's matching feature compared to the list of all features, for use here: https://github.com/wordpress-mobile/WordPress-iOS/blob/feature/plan-details/WordPress/Classes/ViewRelated/Plans/PlanDetailViewController.swift#L80

This wouldn't work if it also checked on the associated values etc too. I'm happy to restructure the features and do this differently if we can think of a better way though!

@koke
Copy link
Member

koke commented Feb 5, 2016

The 'WEB ONLY' label is slightly misaligned with respect to the feature title:

screen shot 2016-02-05 at 16 44 46

layer.cornerRadius = cornerRadius
layer.borderWidth = borderWidth
layer.borderColor = tintColor.CGColor
layer.borderColor = tintColor.CGColor
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate line 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

⌘-C, ⌘-V... Thanks for spotting this!

@frosty
Copy link
Contributor Author

frosty commented Feb 8, 2016

I've fixed the WEB ONLY alignment, removed the duplicate line, and replaced the custom cells in PlanDetailViewController with standard WPTableViewCellValue1 cells. I've also added some unit tests to cover the various values that the cells can display.

@koke Would you mind checking over these changes please?

@koke koke mentioned this pull request Feb 8, 2016
…ground.

* PlanDetailViewController is now a standard VC, not a table view controller.
* The header is now a subview of the VC, not a header of the table view.
@@ -0,0 +1,51 @@
import UIKit
import MRProgress
Copy link
Member

Choose a reason for hiding this comment

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

I just noticed this. It's not used, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot. No, it's not currently. I was experimenting with using it to display a loading state for the button when a purchase is being made (like the App Store). Doesn't belong on this branch!

@koke
Copy link
Member

koke commented Feb 9, 2016

:shipit:

frosty added a commit that referenced this pull request Feb 9, 2016
@frosty frosty merged commit 79329ef into develop Feb 9, 2016
@frosty frosty deleted the feature/plan-details branch February 9, 2016 11:28
@koke koke mentioned this pull request Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants