Browse Source

Merge branch 'bug_fix'

pull/1/head
devikkim 5 years ago
parent
commit
886b72450d
  1. 3
      GMERemittance/Module/EditReciepient/User Interface/Presenter/EditReciepientPresenter.swift
  2. 45
      GMERemittance/Module/EditReciepient/User Interface/View/EditReciepientViewController.swift
  3. 4
      GMERemittance/Module/ExchangeRates/User Interface/View/ExchangeRatesViewController.swift
  4. 8
      GMERemittance/Module/ForgotPassword/Application Logic/Interactor/ForgotPasswordInteractor.swift
  5. 16
      GMERemittance/Module/ForgotPassword/User Interface/View/ForgotPassword.storyboard
  6. 3
      GMERemittance/Module/ForgotPassword/User Interface/View/ForgotPasswordViewController.swift

3
GMERemittance/Module/EditReciepient/User Interface/Presenter/EditReciepientPresenter.swift

@ -116,6 +116,9 @@ class EditReciepientPresenter {
reciepient.reasonId = model.reasonId reciepient.reasonId = model.reasonId
reciepient.mobileNumber = model.mobileNumber reciepient.mobileNumber = model.mobileNumber
reciepient.email = model.email reciepient.email = model.email
reciepient.district = model.district
reciepient.districtId = model.districtId
self.view?.show(recipient: reciepient) self.view?.show(recipient: reciepient)
} }
} }

45
GMERemittance/Module/EditReciepient/User Interface/View/EditReciepientViewController.swift

@ -84,10 +84,11 @@ class EditReciepientViewController: UIViewController {
didSet { didSet {
self.countryTextField.text = selectedCountry?.name self.countryTextField.text = selectedCountry?.name
let shouldShowProvienceField = (selectedCountry?.proviencesRequired ?? "" ) == "true" let shouldShowProvienceField = (selectedCountry?.proviencesRequired ?? "" ) == "true"
self.provienceStackView.isHidden = !shouldShowProvienceField
self.districtStackView.isHidden = !shouldShowProvienceField
self.configureView(isHidden: !shouldShowProvienceField)
self.reciepient?.countryId = self.selectedCountry?.id self.reciepient?.countryId = self.selectedCountry?.id
self.reciepient?.country = self.selectedCountry?.name
self.reciepient?.country = self.selectedCountry?.name
} }
} }
@ -95,7 +96,7 @@ class EditReciepientViewController: UIViewController {
didSet { didSet {
self.stateProvinceTextField.text = selectedProvience?.name self.stateProvinceTextField.text = selectedProvience?.name
self.reciepient?.stateId = self.selectedProvience?.id self.reciepient?.stateId = self.selectedProvience?.id
}
}
} }
var selectedDistrict: SendMoneyDistrictViewModel? { var selectedDistrict: SendMoneyDistrictViewModel? {
@ -147,7 +148,7 @@ class EditReciepientViewController: UIViewController {
private func setup() { private func setup() {
// all setup should be done here // all setup should be done here
self.setupNavigation() self.setupNavigation()
self.configureView()
self.configureView(isHidden: true)
self.configureLanguage() self.configureLanguage()
} }
@ -179,9 +180,9 @@ class EditReciepientViewController: UIViewController {
self.transferReasonTextField.placeholder = StringConstants().transferPlaceholder self.transferReasonTextField.placeholder = StringConstants().transferPlaceholder
} }
private func configureView() {
self.provienceStackView.isHidden = true
self.districtStackView.isHidden = true
private func configureView(isHidden: Bool) {
self.provienceStackView.isHidden = isHidden
self.districtStackView.isHidden = isHidden
} }
private func setupDelegates() { private func setupDelegates() {
@ -221,22 +222,38 @@ class EditReciepientViewController: UIViewController {
self.firstNameTextField.text = self.reciepient?.firstName self.firstNameTextField.text = self.reciepient?.firstName
self.middleNameTextField.text = self.reciepient?.middleName self.middleNameTextField.text = self.reciepient?.middleName
self.lastNameTextField.text = self.reciepient?.lastName self.lastNameTextField.text = self.reciepient?.lastName
let country = self.countries?.filter({
$0.name == self.reciepient?.country
}).first?.name
self.countryTextField.text = country
self.addressTextField.text = reciepient?.address
let relation = self.relations?.filter({ let relation = self.relations?.filter({
$0.title == self.reciepient?.relation $0.title == self.reciepient?.relation
}).first?.title }).first?.title
self.relationTextField.text = relation self.relationTextField.text = relation
self.mobileTextField.text = self.reciepient?.mobileNumber self.mobileTextField.text = self.reciepient?.mobileNumber
self.emailTextField.text = self.reciepient?.email self.emailTextField.text = self.reciepient?.email
let transferReason = self.transferReasons?.filter({ let transferReason = self.transferReasons?.filter({
$0.title == self.reciepient?.reason $0.title == self.reciepient?.reason
}).first?.title }).first?.title
self.transferReasonTextField.text = transferReason self.transferReasonTextField.text = transferReason
self.addressTextField.text = reciepient?.address
// For sync country in reciepient model
self.selectedCountry = self.countries?.filter{
$0.name == self.reciepient?.country
}.first
// For sync provience in reciepient model
self.selectedProvience = self.selectedCountry?.proviences?.filter{
$0.id == self.reciepient?.stateId
}.first
// For sync district in reciepient model
self.selectedDistrict = self.selectedProvience?.districts?.filter{
$0.id == self.reciepient?.districtId
}.first
} }
private func setupNavigation() { private func setupNavigation() {
@ -325,6 +342,8 @@ class EditReciepientViewController: UIViewController {
($0.name ?? "") == (provience.first ?? "") ($0.name ?? "") == (provience.first ?? "")
}) })
self.selectedProvience = _provience.first self.selectedProvience = _provience.first
// according to selected province, clear district
self.selectedDistrict = nil
} }
func countrySelected(models: [SendMoneyCountryViewModel]) { func countrySelected(models: [SendMoneyCountryViewModel]) {

4
GMERemittance/Module/ExchangeRates/User Interface/View/ExchangeRatesViewController.swift

@ -198,7 +198,7 @@ class ExchangeRatesViewController: UIViewController {
let transferFee = exchageRateDetail?.transferFee ?? "" let transferFee = exchageRateDetail?.transferFee ?? ""
let currency = exchageRateDetail?.senderCurrency ?? "" let currency = exchageRateDetail?.senderCurrency ?? ""
self.transferFeeInfoLabel.text = "\(transferFee) \(currency) (" + "transfer_fee_included_text".localized()
self.transferFeeInfoLabel.text = "\(transferFee) \(currency) (" + "transfer_fee_included_text".localized() + ")"
let exchangeRate = exchageRateDetail?.exchangeRate ?? "" let exchangeRate = exchageRateDetail?.exchangeRate ?? ""
self.exchangeRateInfoLabel.text = "\(exchangeRate) " + "(" + "current_exchange_rate_text".localized() + ")" self.exchangeRateInfoLabel.text = "\(exchangeRate) " + "(" + "current_exchange_rate_text".localized() + ")"
@ -367,7 +367,7 @@ class ExchangeRatesViewController: UIViewController {
let calcBy = "c" let calcBy = "c"
let senderCountryName = "KOREA" let senderCountryName = "KOREA"
self.calculate(senderAmt: senderAmount, senderCurrency: senderCurrency, recieverAmt: nil, recieverCurrency: recieverCurrency, recieverCountryName: reciepientCountryName, recieverCountryId: recieverCountryId, paymentMethod: paymentMethod?.id, calcBy: calcBy, shouldShowLoading: false)
self.calculate(senderAmt: senderAmount, senderCurrency: senderCurrency, recieverAmt: nil, recieverCurrency: recieverCurrency, recieverCountryName: reciepientCountryName, recieverCountryId: recieverCountryId, paymentMethod: paymentMethod?.id, calcBy: calcBy, shouldShowLoading: true)
} }
private func setDefaultValuesForCountriesNotHavingDefaultValueFirsttime() { private func setDefaultValuesForCountriesNotHavingDefaultValueFirsttime() {

8
GMERemittance/Module/ForgotPassword/Application Logic/Interactor/ForgotPasswordInteractor.swift

@ -37,10 +37,10 @@ class ForgotPasswordInteractor {
} }
} }
if userName.isEmpty {
error = error + "email_valid_error".localized();
isValid = false
}
// if userName.isEmpty {
// error = error + "email_valid_error".localized();
// isValid = false
// }
let _error = NSError.init(domain: "ForgotPasswordInteractor", code: 0, userInfo: [NSLocalizedDescriptionKey : error]) let _error = NSError.init(domain: "ForgotPasswordInteractor", code: 0, userInfo: [NSLocalizedDescriptionKey : error])
return (isValid, _error) return (isValid, _error)
} }

16
GMERemittance/Module/ForgotPassword/User Interface/View/ForgotPassword.storyboard

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
@ -37,7 +37,7 @@
<rect key="frame" x="0.0" y="20" width="375" height="647"/> <rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ohC-kw-tDZ"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ohC-kw-tDZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="589"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="DSx-mj-Smq"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="DSx-mj-Smq">
<rect key="frame" x="24" y="10" width="327" height="128"/> <rect key="frame" x="24" y="10" width="327" height="128"/>
@ -73,7 +73,7 @@
</subviews> </subviews>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Xca-A6-vpb"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Xca-A6-vpb">
<rect key="frame" x="24" y="185" width="327" height="156"/>
<rect key="frame" x="24" y="185" width="327" height="78"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uhW-Q7-FWf"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uhW-Q7-FWf">
<rect key="frame" x="0.0" y="0.0" width="327" height="78"/> <rect key="frame" x="0.0" y="0.0" width="327" height="78"/>
@ -108,8 +108,8 @@
<constraint firstItem="Wtt-pY-AxG" firstAttribute="leading" secondItem="uhW-Q7-FWf" secondAttribute="leading" id="tYg-K9-Po6"/> <constraint firstItem="Wtt-pY-AxG" firstAttribute="leading" secondItem="uhW-Q7-FWf" secondAttribute="leading" id="tYg-K9-Po6"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gXD-DP-Tf9">
<rect key="frame" x="0.0" y="78" width="327" height="78"/>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gXD-DP-Tf9">
<rect key="frame" x="0.0" y="0.0" width="327" height="78"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date Of Birth" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gwV-DH-48H"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date Of Birth" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gwV-DH-48H">
<rect key="frame" x="0.0" y="7" width="327" height="17"/> <rect key="frame" x="0.0" y="7" width="327" height="17"/>
@ -144,7 +144,7 @@
</subviews> </subviews>
</stackView> </stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KBc-q5-Ydw"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KBc-q5-Ydw">
<rect key="frame" x="87.5" y="376" width="200" height="50"/>
<rect key="frame" x="87.5" y="298" width="200" height="50"/>
<color key="backgroundColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="50" id="Xfe-PO-wfr"/> <constraint firstAttribute="height" constant="50" id="Xfe-PO-wfr"/>
@ -164,7 +164,7 @@
</connections> </connections>
</button> </button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nlp-1I-0gr"> <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nlp-1I-0gr">
<rect key="frame" x="151.5" y="447" width="72" height="42"/>
<rect key="frame" x="151.5" y="369" width="72" height="42"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="72" id="d9U-EO-UY1"/> <constraint firstAttribute="width" constant="72" id="d9U-EO-UY1"/>
<constraint firstAttribute="height" constant="42" id="syv-Ef-t4W"/> <constraint firstAttribute="height" constant="42" id="syv-Ef-t4W"/>

3
GMERemittance/Module/ForgotPassword/User Interface/View/ForgotPasswordViewController.swift

@ -50,7 +50,8 @@ class ForgotPasswordViewController: UIViewController {
@IBAction func _continue(_ sender: UIButton) { @IBAction func _continue(_ sender: UIButton) {
let username = self.userNameTextField.text! let username = self.userNameTextField.text!
let dob = self.dobTextField.text!
// let dob = self.dobTextField.text!
let dob = ""
self.presenter?.reset(username: username, dob: dob) self.presenter?.reset(username: username, dob: dob)
} }

Loading…
Cancel
Save