Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
5cb0067
CoreDataManager: Reset Public API
jleandroperez Aug 17, 2018
4388a39
StorageManagerType: DidReset Notification
jleandroperez Aug 17, 2018
c250481
Added NewOrdersViewController
bummytime Aug 22, 2018
1d3f322
Dashboard: Tweaked some padding constraint values
bummytime Aug 22, 2018
432c448
Dashboard: Added show/hide animation for NewOrdersVC
bummytime Aug 22, 2018
8c043b1
Tweaked hide animation
bummytime Aug 22, 2018
1d1a7da
Dashboard: Added UI elements to new orders
bummytime Aug 23, 2018
c92c97b
Dashboard: Added chevron
bummytime Aug 23, 2018
fe84115
Fixed some label insets
bummytime Aug 23, 2018
f019ce0
Dashboard: New order UI updates
bummytime Aug 23, 2018
193a3cb
Added a button
bummytime Aug 23, 2018
cd46248
Title label and body label table view cell for Settings
mindgraffiti Aug 23, 2018
554f62d
Merge branch 'develop' of github.com:woocommerce/woocommerce-ios into…
bummytime Aug 23, 2018
fefdcb6
Display the site url (without host) and the WP.com username
mindgraffiti Aug 23, 2018
5d648a7
Merge branch 'develop' into feature/149-primary-store
mindgraffiti Aug 23, 2018
1d543ec
Updated animations
bummytime Aug 23, 2018
85e0b0d
“Fixed” IBDesignable issue with PaddedLabel; added touch events for n…
bummytime Aug 24, 2018
26b94c0
Updates to UIButton extension
bummytime Aug 24, 2018
f7f3b40
Navigate to orders tab…
bummytime Aug 24, 2018
39113f4
Added helpers to MainTabBarController
bummytime Aug 24, 2018
12b2c04
Dashboard: UI Tweaks
bummytime Aug 24, 2018
62812a1
Dashboard: Wired up the resultscontroller to new orders
bummytime Aug 24, 2018
f5a0cd2
Fixed animation issue
bummytime Aug 24, 2018
897dd91
Added pluralize helper
bummytime Aug 25, 2018
195273d
Fixed typo
bummytime Aug 25, 2018
d04bbf2
ChartMarker: Nukes extra space
jleandroperez Aug 27, 2018
ea3a731
Fix background color to match Woo styles
mindgraffiti Aug 27, 2018
66d54e0
Set `adjustsFontForContentSizeCategory = true`
mindgraffiti Aug 27, 2018
0b6253b
Adjust footer view to use multiline label
mindgraffiti Aug 27, 2018
c0820d9
Removed extra qualification for an Enum
bummytime Aug 27, 2018
7c64806
Merge branch 'develop' of github.com:woocommerce/woocommerce-ios into…
bummytime Aug 27, 2018
ecf4310
Adjust logout button to support dynamic type
mindgraffiti Aug 27, 2018
5636bd8
Order Details > Details cell supports dynamic type
mindgraffiti Aug 27, 2018
ede9ea3
Order note date label supports dynamic type
mindgraffiti Aug 27, 2018
d7980fe
Add body style to "Add a note" cell
mindgraffiti Aug 27, 2018
309b3f8
"Email note to customer" label to multiline to support dynamic type
mindgraffiti Aug 27, 2018
8fe3952
Product Details title to multiline. Fix background colors.
mindgraffiti Aug 27, 2018
2cdd084
Fix resizing bug for heart icon
mindgraffiti Aug 27, 2018
71d8bea
Make discount line multiline
mindgraffiti Aug 27, 2018
10a0b12
Force single-line, full-width for order list totals
mindgraffiti Aug 27, 2018
4a3ff11
Fix display name cutting off at the bottom when dynamic type size is …
mindgraffiti Aug 27, 2018
7f9e027
Merge branch 'develop' into feature/accessibility-dynamic-type
mindgraffiti Aug 28, 2018
b18a77b
Rogue whitespace
mindgraffiti Aug 28, 2018
274a4a1
Touch up localized string
mindgraffiti Aug 28, 2018
e6a0486
Add accessibility traits to the Settings nav button and Filter Orders…
mindgraffiti Aug 28, 2018
84b3ab3
Let VoiceOver users know that the "Add a note" row is a button they c…
mindgraffiti Aug 28, 2018
0161a46
Make the "Show billing" / "Hide billing" footer support VoiceOver
mindgraffiti Aug 28, 2018
5bb823c
Order Note cell - VoiceOver ignores note icon, since it's a non-funct…
mindgraffiti Aug 28, 2018
c4cfaff
Converts the "Add a note" cell into a full-row button for VoiceOver.
mindgraffiti Aug 28, 2018
01673af
VoiceOver support for Create an Order Note screen
mindgraffiti Aug 28, 2018
347e4ff
Order Details > Payment section. Make VoiceOver read payment informat…
mindgraffiti Aug 28, 2018
2002dcd
My Store VoiceOver support: reorder Visitors, Orders, and Revenue to …
mindgraffiti Aug 28, 2018
b46fdb2
Merge pull request #268 from woocommerce/issue/fixing-bot-warning
jleandroperez Aug 29, 2018
fa0e542
Merge pull request #269 from woocommerce/feature/accessibility-dynami…
mindgraffiti Aug 29, 2018
70c27d6
Merge branch 'develop' into feature/accessibility-voice-over
mindgraffiti Aug 29, 2018
cb79c00
Added some accessibility labels for the chart axes
bummytime Aug 29, 2018
ceae175
Add a note button, email button with hint, phone number button with hint
mindgraffiti Aug 29, 2018
a024c66
Speak the switch status and add a hint.
mindgraffiti Aug 29, 2018
3427147
Updated axis accessiblity strings
bummytime Aug 29, 2018
24e56a7
Store picker cell styling consistent with Sketch requirements. Suppor…
mindgraffiti Aug 30, 2018
613912e
Merge pull request #270 from woocommerce/feature/accessibility-voice-…
mindgraffiti Aug 30, 2018
9c14a4b
Merge pull request #271 from woocommerce/feature/accessibility-site-p…
mindgraffiti Aug 30, 2018
0289aac
Updated the accessibility text
bummytime Aug 30, 2018
d53dc02
Right-to-left support for Order List, Order Details, and Product deta…
mindgraffiti Aug 30, 2018
d7ff39c
Updated xAxis min/max logic
bummytime Aug 30, 2018
a6ff41d
Remove manually calculated LTR centering
mindgraffiti Aug 30, 2018
c4f9d01
Added voiceover summary to the chart view
bummytime Aug 30, 2018
6fb2e21
Moar dashboard chart accessibility updates
bummytime Aug 30, 2018
e06b46f
Merge branch 'develop' of github.com:woocommerce/woocommerce-ios into…
bummytime Aug 30, 2018
6f74db7
Added chart acc helper views to accessibilityElements
bummytime Aug 30, 2018
6baf959
Light refactoring of accessibility helpers in PeriodDataVC
bummytime Aug 31, 2018
cd17b29
Merge pull request #272 from woocommerce/feature/accessibility-rtl
mindgraffiti Aug 31, 2018
c0b3527
Merge branch 'develop' into feature/149-primary-store
mindgraffiti Aug 31, 2018
381aa21
Merge pull request #273 from woocommerce/feature/accessibility-dashboard
bummytime Aug 31, 2018
54502e1
Merge branch 'develop' of github.com:woocommerce/woocommerce-ios into…
bummytime Aug 31, 2018
98e8ca9
Code review updates.
bummytime Aug 31, 2018
f6b4568
Use existing string utility
mindgraffiti Aug 31, 2018
162584d
Fix bug where site URL doesn't display after first-time login.
mindgraffiti Aug 31, 2018
1fd5446
Quick fix for the pluralize func
bummytime Aug 31, 2018
8e8cbd1
Merge pull request #265 from woocommerce/feature/149-primary-store
mindgraffiti Aug 31, 2018
edaca14
Merge pull request #266 from woocommerce/feature/35-neworders-mark1
bummytime Aug 31, 2018
6979cba
Added a few more unit tests for AccountAction
bummytime Aug 31, 2018
a239dc0
Fixed typo 🙄
bummytime Aug 31, 2018
bc287c2
Mapping WordPressUI Ghost PR
jleandroperez Sep 3, 2018
3214888
OrderListCell: Nukes Shipping Label
jleandroperez Sep 3, 2018
54ea878
Updates TODO(s)
jleandroperez Sep 3, 2018
42a7227
ResultsController: New Public API
jleandroperez Sep 3, 2018
ea0f3db
Updates WordPressUI Reference
jleandroperez Sep 3, 2018
178bc84
OrdersViewController: Wiring Ghost Extensions
jleandroperez Sep 3, 2018
ab25fd0
Merge remote-tracking branch 'origin/develop' into issue/164-nuking-d…
jleandroperez Sep 3, 2018
84eebcc
ResultsController: Handling Reset events
jleandroperez Sep 3, 2018
84f5afe
StoresManager: Nuking CoreData Stack upon logout
jleandroperez Sep 3, 2018
842882e
ResultsController+UIKit: Relaying reset events
jleandroperez Sep 3, 2018
8eb7548
CoreDataManager: Fixing runtime assertion
jleandroperez Sep 3, 2018
a72395c
StorageManagerType: New reset API
jleandroperez Sep 3, 2018
0e95cab
MockupStorage: Implements reset method
jleandroperez Sep 3, 2018
9ad7f15
ResultsControllerTests: New Test
jleandroperez Sep 3, 2018
0f558fa
Merge pull request #274 from woocommerce/fix/add-accountaction-tests
bummytime Sep 4, 2018
cd5e264
Updating WordPressUI Reference
jleandroperez Sep 4, 2018
5bdf4da
Merge pull request #277 from woocommerce/issue/164-nuking-database-up…
jleandroperez Sep 4, 2018
c75d048
Merge pull request #276 from woocommerce/issue/136-orders-loading-state
jleandroperez Sep 4, 2018
77e924a
Nukes NoResultsTableViewCell
jleandroperez Sep 4, 2018
230a7da
OrdersViewController: Removes TODO's
jleandroperez Sep 4, 2018
80c1531
OrdersViewController: Nukes dead cell registration
jleandroperez Sep 4, 2018
12421cc
Nukes FootnoteView
jleandroperez Sep 4, 2018
782446f
Added test reponse JSON for top-performers
bummytime Sep 4, 2018
d30348e
WIP: Top earner model + remote+ mapper in Networking fmwk
bummytime Sep 4, 2018
556d38b
WIP: Got the basic mapper tests working for top earners
bummytime Sep 4, 2018
8adfa4d
Changed the default sort for TopEarnerStatsItem
bummytime Sep 4, 2018
0bcce0f
UIButton+Helpers: New Style
jleandroperez Sep 5, 2018
a52fc26
UIImage+Woo: New Assets
jleandroperez Sep 5, 2018
c804a1b
Filled out remaining tests in TopEarnerStatsMapperTests
bummytime Sep 5, 2018
069d048
Added TopEarnerStatsRemoteTests
bummytime Sep 5, 2018
30f47a2
Implements OverlayMessageView
jleandroperez Sep 5, 2018
bd95d48
OrdersViewController: Nes State Enum
jleandroperez Sep 5, 2018
51dd8f1
OrdersViewController: Implements FSM Management
jleandroperez Sep 5, 2018
8c910b8
OrdersViewController: Wire renamed constants
jleandroperez Sep 5, 2018
9ac6a82
OrdersViewController: Placeholder Orders Management
jleandroperez Sep 5, 2018
6b358bb
OrdersViewController: Updates Sync Signature
jleandroperez Sep 5, 2018
7d9d144
OrdersViewController: State Management
jleandroperez Sep 5, 2018
b080e60
OrdersViewController: Handling "Share your Store" Action
jleandroperez Sep 5, 2018
fab96a2
Revert to this commit to test: Empty State
jleandroperez Sep 5, 2018
1c91002
Revert to this commit to test: Error State
jleandroperez Sep 5, 2018
09e2aaf
OrdersViewController: Reverts Testing Code
jleandroperez Sep 5, 2018
624f206
Merge pull request #282 from woocommerce/feature/178-top-performers-m…
bummytime Sep 5, 2018
b942aac
OrdersViewController: Supporting Empty + Filtered State
jleandroperez Sep 5, 2018
b1aa0cf
OrdersViewController: Documents transitions
jleandroperez Sep 5, 2018
4fbdb76
OrdersViewController: Removes extra space
jleandroperez Sep 5, 2018
0d6953b
OrdersViewController: Updates message
jleandroperez Sep 5, 2018
402557f
Added TopEarnerStats + TopEarnerStatsItem to Storage fmwk
bummytime Sep 5, 2018
dacfb2e
OverlayMessageView: Attach now disables tAMC
jleandroperez Sep 6, 2018
647e6b1
OrdersViewController: Removes extra spaces
jleandroperez Sep 6, 2018
4c1a17a
OverlayMessageView: MessageLabel is now multiline
jleandroperez Sep 6, 2018
b73e2f9
OverlayMessageView: Updating StackView Distribution
jleandroperez Sep 6, 2018
7036ad4
Removed lastUpdated field from TopEarnerStats
bummytime Sep 6, 2018
40310a8
ReadOnlyConvertible imp for TopEarners
bummytime Sep 6, 2018
4e3a8f6
Merge pull request #284 from woocommerce/issue/136-orders-list-states
jleandroperez Sep 6, 2018
9681bc9
WIP: Updates to StatsStore for top earners
bummytime Sep 6, 2018
248ed41
Added TopEarners store test
bummytime Sep 6, 2018
9641a8a
More tests
bummytime Sep 7, 2018
928739b
Updates + final tests for top earner in Storage + Yosemite
bummytime Sep 7, 2018
11da69f
Merge branch 'develop' of github.com:woocommerce/woocommerce-ios into…
bummytime Sep 7, 2018
9bbb121
Doc comment fix
bummytime Sep 7, 2018
28ed413
Merge pull request #285 from woocommerce/feature/178-top-performers-m…
bummytime Sep 7, 2018
494bd14
Delete items and coupons if they are removed
bummytime Sep 7, 2018
8b96df5
Fixed failing unit test
bummytime Sep 7, 2018
fa4ebfd
Merge pull request #288 from woocommerce/fix/orderstore-items-coupons…
bummytime Sep 7, 2018
ebaa934
Clear barChart data after period VC disappears
bummytime Sep 10, 2018
220bbce
Increasing version to Mark 0.7
jleandroperez Sep 11, 2018
3e7629d
Merge pull request #294 from woocommerce/fix/292-chart-animation
bummytime Sep 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions Networking/Networking.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions Networking/Networking/Mapper/TopEarnerStatsMapper.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Foundation


/// Mapper: TopEarnerStats
///
class TopEarnerStatsMapper: Mapper {

/// (Attempts) to convert a dictionary into an TopEarnerStats entity.
///
func map(response: Data) throws -> TopEarnerStats {
let decoder = JSONDecoder()
return try decoder.decode(TopEarnerStats.self, from: response)
}
}
19 changes: 19 additions & 0 deletions Networking/Networking/Model/Account.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,22 @@ private extension Account {
case gravatarUrl = "avatar_URL"
}
}


// MARK: - Comparable Conformance
//
extension Account: Comparable {
public static func == (lhs: Account, rhs: Account) -> Bool {
return lhs.userID == rhs.userID &&
lhs.displayName == rhs.displayName &&
lhs.email == rhs.email &&
lhs.username == rhs.username &&
lhs.gravatarUrl == rhs.gravatarUrl
}

public static func < (lhs: Account, rhs: Account) -> Bool {
return lhs.userID < rhs.userID ||
(lhs.userID == rhs.userID && lhs.username < rhs.username) ||
(lhs.userID == rhs.userID && lhs.username == rhs.username && lhs.displayName < rhs.displayName)
}
}
3 changes: 2 additions & 1 deletion Networking/Networking/Model/Order.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ extension Order: Comparable {
lhs.paymentMethodTitle == rhs.paymentMethodTitle &&
lhs.billingAddress == rhs.billingAddress &&
lhs.shippingAddress == rhs.shippingAddress &&
lhs.coupons == rhs.coupons &&
lhs.coupons.count == rhs.coupons.count &&
lhs.coupons.sorted() == rhs.coupons.sorted() &&
lhs.items.count == rhs.items.count &&
lhs.items.sorted() == rhs.items.sorted()
}
Expand Down
20 changes: 20 additions & 0 deletions Networking/Networking/Model/Site.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ public struct Site: Decodable {
}


// MARK: - Comparable Conformance
//
extension Site: Comparable {
public static func == (lhs: Site, rhs: Site) -> Bool {
return lhs.siteID == rhs.siteID &&
lhs.name == rhs.name &&
lhs.description == rhs.description &&
lhs.url == rhs.url &&
lhs.isWooCommerceActive == rhs.isWooCommerceActive &&
lhs.isWordPressStore == rhs.isWordPressStore
}

public static func < (lhs: Site, rhs: Site) -> Bool {
return lhs.siteID < rhs.siteID ||
(lhs.siteID == rhs.siteID && lhs.name < rhs.name) ||
(lhs.siteID == rhs.siteID && lhs.name == rhs.name && lhs.description < rhs.description)
}
}


/// Defines all of the Site CodingKeys.
///
private extension Site {
Expand Down
65 changes: 65 additions & 0 deletions Networking/Networking/Model/Stats/TopEarnerStats.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import Foundation


/// Represents Top Earner (aka top performer) stats over a specific period.
///
public struct TopEarnerStats: Decodable {
public let date: String
public let granularity: StatGranularity
public let limit: String
public let items: [TopEarnerStatsItem]?


/// The public initializer for top earner stats.
///
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)

let date = try container.decode(String.self, forKey: .date)
let granularity = try container.decode(StatGranularity.self, forKey: .unit)
let limit = try container.decode(String.self, forKey: .limit)
let items = try container.decode([TopEarnerStatsItem].self, forKey: .items)

self.init(date: date, granularity: granularity, limit: limit, items: items)
}


/// TopEarnerStats struct initializer.
///
public init(date: String, granularity: StatGranularity, limit: String, items: [TopEarnerStatsItem]?) {
self.date = date
self.granularity = granularity
self.limit = limit
self.items = items
}
}


/// Defines all of the TopEarnerStats CodingKeys.
///
private extension TopEarnerStats {
enum CodingKeys: String, CodingKey {
case date = "date"
case unit = "unit"
case limit = "limit"
case items = "data"
}
}


// MARK: - Comparable Conformance
//
extension TopEarnerStats: Comparable {
public static func == (lhs: TopEarnerStats, rhs: TopEarnerStats) -> Bool {
return lhs.date == rhs.date &&
lhs.granularity == rhs.granularity &&
lhs.limit == rhs.limit &&
lhs.items?.count == rhs.items?.count &&
lhs.items?.sorted() == rhs.items?.sorted()
}

public static func < (lhs: TopEarnerStats, rhs: TopEarnerStats) -> Bool {
return lhs.date < rhs.date ||
(lhs.date == rhs.date && lhs.limit < rhs.limit)
}
}
83 changes: 83 additions & 0 deletions Networking/Networking/Model/Stats/TopEarnerStatsItem.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import Foundation


/// Represents a single top earner stat for a specific period.
///
public struct TopEarnerStatsItem: Decodable {

/// Product ID
///
public let productID: Int

/// Product name
///
public let productName: String

/// Quantity sold
///
public let quantity: Int

/// Average price of item
///
public let price: Double

/// Total revenue from product
///
public let total: Double

/// Currency
///
public let currency: String

/// Image URL for product
///
public let imageUrl: String?


/// Designated Initializer.
///
public init(productID: Int, productName: String, quantity: Int, price: Double, total: Double, currency: String, imageUrl: String?) {
self.productID = productID
self.productName = productName
self.quantity = quantity
self.price = price
self.total = total
self.currency = currency
self.imageUrl = imageUrl
}
}


/// Defines all of the TopEarnerStatsItem CodingKeys.
///
private extension TopEarnerStatsItem {
enum CodingKeys: String, CodingKey {
case productID = "ID"
case productName = "name"
case total = "total"
case quantity = "quantity"
case price = "price"
case imageUrl = "image"
case currency = "currency"
}
}


// MARK: - Comparable Conformance
//
extension TopEarnerStatsItem: Comparable {
public static func == (lhs: TopEarnerStatsItem, rhs: TopEarnerStatsItem) -> Bool {
return lhs.productID == rhs.productID &&
lhs.productName == rhs.productName &&
lhs.quantity == rhs.quantity &&
lhs.price == rhs.price &&
lhs.total == rhs.total &&
lhs.currency == rhs.currency &&
lhs.imageUrl == rhs.imageUrl
}

public static func < (lhs: TopEarnerStatsItem, rhs: TopEarnerStatsItem) -> Bool {
return lhs.quantity < rhs.quantity ||
(lhs.quantity == rhs.quantity && lhs.productName < rhs.productName)
}
}
45 changes: 45 additions & 0 deletions Networking/Networking/Remote/TopEarnersStatsRemote.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Foundation
import Alamofire


/// TopEarnersStats: Remote Endpoints
///
public class TopEarnersStatsRemote: Remote {

/// Fetch the top earner (aka Top Performer) stats ( stats for a given site for the current day, week, month, or year (depends on the given granularity of the `unit` parameter).
///
/// - Parameters:
/// - siteID: The site ID
/// - unit: Defines the granularity of the stats we are fetching (one of 'day', 'week', 'month', or 'year')
/// - latestDateToInclude: The latest date to include in the results (see Note below)
/// - limit: Maximum number of `unit`s to fetch
/// - completion: Closure to be executed upon completion.
///
/// Note: `latestDateToInclude` date string must be formatted appropriately given the `unit` param. See: `DateFormatter.Stats` extension for some helper funcs.
///
public func loadTopEarnersStats(for siteID: Int, unit: StatGranularity, latestDateToInclude: String, limit: Int, completion: @escaping (TopEarnerStats?, Error?) -> Void) {
let path = "\(Constants.sitesPath)/\(siteID)/\(Constants.topEarnersStatsPath)/"
let parameters = [ParameterKeys.unit: unit.rawValue,
ParameterKeys.date: latestDateToInclude,
ParameterKeys.limit: String(limit)]
let request = DotcomRequest(wordpressApiVersion: .wpcomMark2, method: .get, path: path, parameters: parameters)
let mapper = TopEarnerStatsMapper()
enqueue(request, mapper: mapper, completion: completion)
}
}


// MARK: - Constants!
//
private extension TopEarnersStatsRemote {
enum Constants {
static let sitesPath: String = "sites"
static let topEarnersStatsPath: String = "stats/top-earners"
}

enum ParameterKeys {
static let unit: String = "unit"
static let date: String = "date"
static let limit: String = "limit"
}
}
Loading