Skip to content

Swe 25 project wide cleanup #18

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -79,7 +79,7 @@
{
"size" : "1024x1024",
"idiom" : "watch-marketing",
"filename" : "synchrony_app_storeArtboard 2.png",
"filename" : "launch_screen_cc_2-01_1024_1024.png",
"scale" : "1x"
}
],
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_0.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_0@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_0@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_1@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_1@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_2@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_2@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_3.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_3@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_3@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_4.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_4@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_4@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_5.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_5@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_5@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_6.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_6@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_6@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "loading_cc_7.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_7@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "loading_cc_7@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -24,7 +24,7 @@
</items>
</group>
<connections>
<segue destination="Rpu-25-8st" kind="push" identifier="toAccounts" id="f1W-Bx-IrV"/>
<action selector="accountsButtonTapped" destination="Qge-pO-HLc" id="Y7y-Sk-qO7"/>
</connections>
</button>
<button alignment="center" verticalAlignment="bottom" id="Vth-km-gVm">
Expand Down Expand Up @@ -103,19 +103,19 @@
</objects>
<point key="canvasLocation" x="315" y="602"/>
</scene>
<!--Account Table Interface Controller-->
<!--AcctsTable-->
<scene sceneID="5Qe-Th-pL8">
<objects>
<controller hidesWhenLoading="NO" id="Rpu-25-8st" customClass="AccountTableInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<controller identifier="AcctsTable" hidesWhenLoading="NO" id="Rpu-25-8st" customClass="AccountTableInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="1" alignment="center" text="Accounts" textAlignment="center" id="JYm-yy-xrH"/>
<table alignment="left" id="To8-Ze-tMX">
<items>
<tableRow identifier="account" id="5xi-FS-LlJ" customClass="AccountCell" customModule="SynchronyFinancial_WatchKit_Extension">
<group key="rootItem" width="1" height="44" alignment="left" layout="vertical" id="mYi-9N-Ue7">
<group key="rootItem" width="1" height="0.0" alignment="left" layout="vertical" id="mYi-9N-Ue7">
<items>
<label alignment="left" text="Account Name" id="Tl1-Kc-YJS"/>
<label width="136" alignment="left" verticalAlignment="bottom" text="(...XXXX)" textAlignment="left" id="OWC-kI-GEy"/>
<label alignment="left" verticalAlignment="center" text="Account Name" id="Tl1-Kc-YJS"/>
<label width="136" alignment="left" verticalAlignment="center" text="(...XXXX)" textAlignment="left" id="OWC-kI-GEy"/>
</items>
</group>
<connections>
Expand Down
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>SynchronyFinancial WatchKit App</string>
<string>Care Credit</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
Expand Up @@ -11,7 +11,6 @@ import Foundation

class AccountDetailsInterfaceController: WKInterfaceController {
var selectedAccount: Account?
var dictForAcct: [String: Account] = [:]
var transactionDict: [String: Any] = [:]

@IBOutlet var loadingLabel: WKInterfaceLabel!
Expand All @@ -26,9 +25,8 @@ class AccountDetailsInterfaceController: WKInterfaceController {

@IBAction func payBillTapped() {
if let acct = selectedAccount {
dictForAcct.updateValue(acct, forKey: "acct")
pushController(withName: "PayMinimum", context: acct)
}
pushController(withName: "PayMinimum", context: dictForAcct)
}

@IBAction func recentButtonTapped() {
Expand Down Expand Up @@ -56,31 +54,19 @@ class AccountDetailsInterfaceController: WKInterfaceController {
super.awake(withContext: context)
payButton.setWidth(self.contentFrame.width / 2)
transactionsButton.setWidth(self.contentFrame.width / 2)
guard let data = context as? [String: Account] else {

guard let data = context as? Account else {
NSLog("Error receiving context containing selected account in AccountDetailInterfaceController")
return
}

selectedAccount = data["acct"]
selectedAccount = data
configureForAccount()
}

override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}

override func contextForSegue(withIdentifier segueIdentifier: String) -> Any? {
if segueIdentifier == "payBill" {
if let acct = selectedAccount {
dictForAcct.updateValue(acct, forKey: "acct")
return dictForAcct
}
if segueIdentifier == "payBill", let acct = selectedAccount {
return acct
}

return nil
Expand Down
Expand Up @@ -11,7 +11,6 @@ import Foundation

class AccountTableInterfaceController: WKInterfaceController {
var accounts: [Account] = []
var acctDict: [String: Account] = [:]
var transactionDict: [String: [Transaction]] = [:]

@IBOutlet var titleLabel: WKInterfaceLabel!
Expand All @@ -20,26 +19,17 @@ class AccountTableInterfaceController: WKInterfaceController {
override func awake(withContext context: Any?) {
super.awake(withContext: context)

if let context = context as? [String: [Account]], let accts = context["accts"] {
accounts = accts
guard let data = context as? [Account] else {
NSLog("Error getting accounts table context")
return
}

accounts = data
configureRows()
}

override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}

override func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: Int) {
acctDict.updateValue(accounts[rowIndex], forKey: "acct")
pushController(withName: "AccountDetails", context: acctDict)
pushController(withName: "AccountDetails", context: accounts[rowIndex])
}

private func configureRows() {
Expand Down
Expand Up @@ -94,12 +94,12 @@ class FetchData {
let amountString = $0["transaction_amount"].string,
let amount = Double(amountString),
let confirmationNum = $0["payment_confirmation_number"].string,
let transactionCode = $0["transaction_code"].string,
let paymentIdString = $0["payment_id"].string,
let paymentId = Int(paymentIdString),
let modifiable = $0["is_payment_modifiable"].string {
let type: TransactionType = $0["payment_amount_type"].stringValue == "" ? .purchase : .reimbursement
let isModifiable: Bool = modifiable == "Y" ? true : false
let transactionCode = $0["transaction_code"].string ?? ""
transactions.append(Transaction(type: type, amount: amount, merchantID: desc, date: date, confirmationNum: confirmationNum, paymentId: paymentId, isPending: true, isModifiable: isModifiable, transactionCode: transactionCode))
}
}
Expand All @@ -109,9 +109,9 @@ class FetchData {
if let desc = $0["description"].string,
let date = Defaults.careCreditDateFormatter.date(from: $0["transaction_date"].stringValue),
let amountString = $0["transaction_amount"].string,
let transactionCode = $0["transaction_code"].string,
let amount = Double(amountString) {
let type: TransactionType = $0["payment_amount_type"].stringValue == "" ? .purchase : .reimbursement
let transactionCode = $0["transaction_code"].string ?? ""
transactions.append(Transaction(type: type, amount: amount, merchantID: desc, date: date, isPending: false, transactionCode: transactionCode))
}
}
Expand Down