Browse Source

1. Changed modal style as full screen (ManageAgreement, NewRegister)

2. Edited check balance as <=
3. Set Default branch Information as GME Online
4. Added reactive method at GMEDB
5. Applied username, mobile, email as Rx
pull/1/head
InKwon James Kim 5 years ago
parent
commit
dfd51391ae
  1. 4
      GME Remit.xcodeproj/project.pbxproj
  2. 2
      GME Remit/AppDelegate.swift
  3. 4
      GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard
  4. 2
      GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframe.swift
  5. 6
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift
  6. 6
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRecharge.storyboard
  7. 2
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegister/User Interface/Wireframe/NewRegisterWireframe.swift
  8. 4
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift
  9. 14
      GME Remit/Modules/SideMenu/SideMenuViewController.swift
  10. 2
      GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.swift
  11. 44
      GME Remit/Utilities/Database/Rx+UserDefaultsWrapper.swift
  12. 1
      GME RemitTests/APITest.swift
  13. 18
      GME RemitTests/DatabaseTest.swift
  14. 2
      GME RemitTests/FunctionTest.swift

4
GME Remit.xcodeproj/project.pbxproj

@ -186,6 +186,7 @@
73149F6B22E5AF8000D66B26 /* LauncherScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73149F6022E5AF8000D66B26 /* LauncherScreen.storyboard */; };
73149F6C22E5AF8000D66B26 /* LauncherScreenViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73149F6122E5AF8000D66B26 /* LauncherScreenViewInterface.swift */; };
73149F6D22E5AF8000D66B26 /* LauncherScreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73149F6222E5AF8000D66B26 /* LauncherScreenViewController.swift */; };
7315526E23C839CF0011D37C /* Rx+UserDefaultsWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7315526D23C839CF0011D37C /* Rx+UserDefaultsWrapper.swift */; };
73157B9B22DC1EEC009B836F /* PopupNotificationModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73157B8922DC1EEC009B836F /* PopupNotificationModuleInterface.swift */; };
73157B9C22DC1EEC009B836F /* PopupNotificationServiceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73157B8C22DC1EEC009B836F /* PopupNotificationServiceType.swift */; };
73157B9D22DC1EEC009B836F /* PopupNotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73157B8D22DC1EEC009B836F /* PopupNotificationService.swift */; };
@ -2601,6 +2602,7 @@
73149F6022E5AF8000D66B26 /* LauncherScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LauncherScreen.storyboard; sourceTree = "<group>"; };
73149F6122E5AF8000D66B26 /* LauncherScreenViewInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LauncherScreenViewInterface.swift; sourceTree = "<group>"; };
73149F6222E5AF8000D66B26 /* LauncherScreenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LauncherScreenViewController.swift; sourceTree = "<group>"; };
7315526D23C839CF0011D37C /* Rx+UserDefaultsWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Rx+UserDefaultsWrapper.swift"; sourceTree = "<group>"; };
73157B8922DC1EEC009B836F /* PopupNotificationModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopupNotificationModuleInterface.swift; sourceTree = "<group>"; };
73157B8C22DC1EEC009B836F /* PopupNotificationServiceType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopupNotificationServiceType.swift; sourceTree = "<group>"; };
73157B8D22DC1EEC009B836F /* PopupNotificationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopupNotificationService.swift; sourceTree = "<group>"; };
@ -7232,6 +7234,7 @@
children = (
7383F43522DEB864003D6393 /* GMEDB.swift */,
7383F43D22DF15B8003D6393 /* UserDefaultsWrapper.swift */,
7315526D23C839CF0011D37C /* Rx+UserDefaultsWrapper.swift */,
);
path = Database;
sourceTree = "<group>";
@ -16473,6 +16476,7 @@
7301979D22535135001954AB /* kycForm1WireframeInput.swift in Sources */,
7327568B23B052DB00BF66C5 /* PDFViewController.swift in Sources */,
73F77279239749DF00E22A82 /* NewRegisterStep2Presenter.swift in Sources */,
7315526E23C839CF0011D37C /* Rx+UserDefaultsWrapper.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

2
GME Remit/AppDelegate.swift

@ -24,7 +24,7 @@ import LGSideMenuController
#if DEBUG
var server: Server = .live
#else
let server: Server = .uat
let server: Server = .live
#endif
var destination: PushNotificationDestination?

4
GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard

@ -170,7 +170,7 @@
<constraint firstItem="LDw-i1-qz8" firstAttribute="top" secondItem="0SP-YH-gKf" secondAttribute="top" constant="5" id="zDf-li-gY6"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" tag="3" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Agreement of Legal Name Confirmation for Prohibiting Manipulation of the Law and Illegal Behavior" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="ar6-Oi-V5q">
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Agreement of Legal Name Confirmation for Prohibiting Manipulation of the Law and Illegal Behavior" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="ar6-Oi-V5q">
<rect key="frame" x="43" y="2.6666666666666288" width="293" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
@ -214,7 +214,7 @@
<constraint firstAttribute="bottom" secondItem="aBP-xj-gh8" secondAttribute="bottom" constant="5" id="qsX-oI-PgJ"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Small Scale Amount Remittance " textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="pgj-on-l2H">
<label opaque="NO" userInteractionEnabled="NO" tag="3" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Small Scale Amount Remittance " textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="pgj-on-l2H">
<rect key="frame" x="43" y="2.6666666666666288" width="293" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>

2
GME Remit/Modules/ManageAgreement/User Interface/Wireframe/ManageAgreementWireframe.swift

@ -55,7 +55,7 @@ extension ManageAgreementWireframe: ManageAgreementWireframeInput {
let vc = getMainView()
let naviVC = UINavigationController(rootViewController: vc)
naviVC.modalPresentationStyle = .overFullScreen
naviVC.modalPresentationStyle = .fullScreen
source.present(naviVC, animated: true, completion: nil)
}

6
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift

@ -114,21 +114,21 @@ class PhoneCardRechargePresenter: ViewModelType {
let paymentAmount = priceModel?.price,
let amount = Int(paymentAmount) else { return (false, false) }
return (true, amount < balance)
return (true, amount <= balance)
case .fixed:
guard
let paymentAmount = carrierPlan?.facePrice,
let amount = Int(paymentAmount) else { return (false, false) }
return (true, amount < balance)
return (true, amount <= balance)
case .dataOnly:
guard
let paymentAmount = dataOnlyType?.facePrice,
let amount = Int(paymentAmount) else { return (false, false) }
return (true, amount < balance)
return (true, amount <= balance)
}
}

6
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRecharge.storyboard

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Im1-C5-3ON">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Im1-C5-3ON">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@ -887,7 +887,7 @@
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="ThemeRed">
<color red="0.92900002002716064" green="0.10599999874830246" blue="0.14100000262260437" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.92941176470588238" green="0.10588235294117647" blue="0.14117647058823529" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="ThemeSeparate">
<color red="0.82400000095367432" green="0.82400000095367432" blue="0.82400000095367432" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

2
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegister/User Interface/Wireframe/NewRegisterWireframe.swift

@ -51,7 +51,7 @@ extension NewRegisterWireframe: NewRegisterWireframeInput {
func open(on viewcontroller: UIViewController, step: NewRegisterViewController.Step) {
let vc = getMainView()
let naviVC = UINavigationController(rootViewController: vc)
naviVC.modalPresentationStyle = .overFullScreen
naviVC.modalPresentationStyle = .fullScreen
stepper?.onNext(step)

4
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift

@ -562,8 +562,10 @@ extension NewRegisterStep1ViewController {
item: model.idTypes?.first {$0.id == primaryInformation.anotherIDType}
)
let branchID = primaryInformation.branchID != "" ? primaryInformation.branchID : "2080"
self?.branchTextField.didSelect(
item: model.branches?.first {$0.id == primaryInformation.branchID}
item: model.branches?.first {$0.id == branchID}
)
guard let pictureInformation = model.pictures else { return }

14
GME Remit/Modules/SideMenu/SideMenuViewController.swift

@ -11,6 +11,9 @@ import SDWebImage
import LGSideMenuController
import Localize_Swift
import RxSwift
import RxCocoa
protocol SideMenuDelegate: class {
func didSelectMenu(_ viewController: UIViewController, didSelectMenu: SideMenuViewController.MenuType)
}
@ -74,6 +77,8 @@ class SideMenuViewController: UIViewController {
weak var sideMenuDelegate: SideMenuDelegate?
private let disposeBag = DisposeBag()
var selectedMenu: MenuType? {
didSet {
guard let menu = selectedMenu else { return }
@ -223,13 +228,16 @@ class SideMenuViewController: UIViewController {
func setUpSettingsScreen() {
//PHONE
labelPhone.text = GMEDB.shared.user.string(.mobileNumber)
GMEDB.shared.user.rx.string(key: .mobileNumber).bind(to: labelPhone.rx.text)
.disposed(by: disposeBag)
//EMAIL
labelEmail.text = GMEDB.shared.user.string(.email)
GMEDB.shared.user.rx.string(key: .email).bind(to: labelEmail.rx.text)
.disposed(by: disposeBag)
//NAME
labelProfileName.text = GMEDB.shared.user.string(.firstName)?.capitalized
GMEDB.shared.user.rx.string(key: .firstName).map {$0?.capitalized}.bind(to: labelProfileName.rx.text)
.disposed(by: disposeBag)
//IMAGE
let userDpString = GMEDB.shared.user.string(.dpUrl) ?? ""

2
GME Remit/Utilities/CustomUI/PDFVIewer/PDFViewController.swift

@ -14,7 +14,6 @@ struct PDFConfiguration {
var url: String
var autoScales = true
var displayMode: PDFDisplayMode = .singlePageContinuous
var maxScaleFactor: CGFloat = 1.0
}
class PDFViewController: UIViewController {
@ -42,7 +41,6 @@ class PDFViewController: UIViewController {
pdfView.document = document
pdfView.autoScales = configure.autoScales
pdfView.displayMode = configure.displayMode
pdfView.maxScaleFactor = 1.0
}
func showAsPush(

44
GME Remit/Utilities/Database/Rx+UserDefaultsWrapper.swift

@ -0,0 +1,44 @@
//
// Rx+UserDefaultsWrapper.swift
// GME Remit
//
// Created by InKwon James Kim on 2020/01/10.
// Copyright © 2020 Gobal Money Express Co. Ltd. All rights reserved.
//
import RxSwift
import RxCocoa
extension UserDefaultsWrapper: ReactiveCompatible {}
extension Reactive where Base: UserDefaults {
public func `default`<E: Equatable>(_ type: E.Type, _ keyPath: String) -> Observable<E?> {
let center = NotificationCenter.default
let initial = base.object(forKey: keyPath) as? E
let changes = center.rx.notification(UserDefaults.didChangeNotification)
.map { _ in
self.base.object(forKey: keyPath) as? E
}
return Observable<E?>.just(initial)
.concat(changes)
.distinctUntilChanged { previous, next in
guard let previous = previous, let next = next else {
return false
}
return previous == next
}
}
}
extension Reactive where Base: UserDefaultsWrapper<GMEDB.UserKeys> {
func set(key: GMEDB.UserKeys) -> Binder<String?> {
return Binder(self.base) { db, value in
db.set(value, key)
}
}
func string(key: GMEDB.UserKeys) -> Observable<String?> {
return UserDefaults.standard.rx.default(String.self, key.rawValue)
}
}

1
GME RemitTests/APITest.swift

@ -29,6 +29,7 @@ class APITest: XCTestCase {
let expt = expectation(description: "testFetchBankList")
service.fetchBankList(
needsAuthorization: false,
success: {
print("banks: \($0?.count ?? 0)")
expt.fulfill()

18
GME RemitTests/DatabaseTest.swift

@ -7,6 +7,9 @@
//
import XCTest
import RxSwift
import RxCocoa
@testable import GME_Remit
class DatabaseTest: XCTestCase {
@ -109,4 +112,19 @@ class DatabaseTest: XCTestCase {
XCTAssert(GMEDB.shared.user.string(.dateOfBirth) == nil)
XCTAssert(GMEDB.shared.user.string(.senderId) == nil)
}
func testGMEDBRx() {
let expt = expectation(description: "testGMEDBRx")
_ = GMEDB.shared.user.rx.string(key: .userId)
.subscribe(onNext: {
print("userID: \($0 ?? "nil")")
XCTAssert($0 == Optional("test2"), GMEDB.shared.user.string(.userId) ?? "")
expt.fulfill()
})
GMEDB.shared.user.set("test2", .userId)
wait(for: [expt], timeout: 5.0)
}
}

2
GME RemitTests/FunctionTest.swift

@ -54,7 +54,7 @@ class FunctionTest: XCTestCase {
let textField = UITextField()
textField.text = "l.e ibn$iz@55_good-)(*&"
textField.filterby(type: .alphabetNumberic, isSendAction: true)
textField.filterBy(type: .alphabetNumberic, isSendAction: true)
XCTAssertEqual(extractID, "le ibniz55good")
XCTAssertEqual(textField.text ?? "", "le ibniz55good")

Loading…
Cancel
Save