Browse Source

minor bug fixed

pull/1/head
gme_2 6 years ago
parent
commit
5604acce7f
  1. 11
      GMERemittance/Module/Auto refund/autoRefundService.swift
  2. 4
      GMERemittance/Profile/Profile.storyboard
  3. 21
      GMERemittance/Profile/ProfileChangePasswordViewController.swift

11
GMERemittance/Module/Auto refund/autoRefundService.swift

@ -21,10 +21,15 @@ extension FetchAutoRefundInfo {
func fetchAutoRefundInfo(username: String, success: @escaping (AutoRefund) -> (), failure: @escaping (Error) -> ()) {
let url = baseUrl + "refund/\(username)"
auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: AutoRefundContainer) in
if let model = response.data {
success(model)
if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
failure(error)
}else {
let error = NSError.init(domain: "FetchAutoRefundInfo", code: 0, userInfo: [NSLocalizedDescriptionKey : "Could not parse json"])
let model = response.data
if let model = response.data { success(model) }else {
let error = NSError.init(domain: "FetchAutoRefundInfo", code: 0, userInfo: [NSLocalizedDescriptionKey : "Could not parse json"])
failure(error)
}
}
}) { (error) in
failure(error)

4
GMERemittance/Profile/Profile.storyboard

@ -508,7 +508,11 @@ At least one capital letter, At least one number
<viewLayoutGuide key="safeArea" id="Vlc-t2-52s"/>
</view>
<connections>
<outlet property="confirmPasswordTitlelabel" destination="Ivp-u7-qDI" id="xDE-2n-tf0"/>
<outlet property="contentView" destination="LU1-7H-4oT" id="R59-Fz-LZU"/>
<outlet property="currentPasswowrdTitleLabel" destination="7Gs-uo-Wte" id="hfd-1g-iax"/>
<outlet property="newPasswordTitleLabel" destination="iZO-Jd-Wum" id="wXK-pp-9F0"/>
<outlet property="saveButton" destination="XqZ-xO-HOx" id="Fhc-Xo-zzM"/>
<outlet property="textFieldConfirmPassword" destination="V5J-Sb-fhg" id="2pe-97-e1x"/>
<outlet property="textFieldCurrentPassword" destination="zfD-X4-YTt" id="yQk-jC-nUD"/>
<outlet property="textFieldNewPassword" destination="GwX-M7-rY8" id="UWw-av-JIe"/>

21
GMERemittance/Profile/ProfileChangePasswordViewController.swift

@ -7,7 +7,7 @@
//
import UIKit
import Localize_Swift
// there is not time to take this to viper archi. so applying mvc here.
@ -37,6 +37,10 @@ class ProfileChangePasswordViewController: UIViewController {
@IBOutlet weak var topLabel: UILabel!
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var currentPasswowrdTitleLabel: UILabel!
@IBOutlet weak var newPasswordTitleLabel: UILabel!
@IBOutlet weak var confirmPasswordTitlelabel: UILabel!
@IBOutlet weak var saveButton: UIButton!
// MARK:- Properties
// keyboard
@ -90,7 +94,7 @@ class ProfileChangePasswordViewController: UIViewController {
self.textFieldNewPassword.delegate = self
self.textFieldConfirmPassword.delegate = self
self.textFieldCurrentPassword.delegate = self
configureLanguage()
}
override func viewWillAppear(_ animated: Bool) {
@ -103,6 +107,19 @@ class ProfileChangePasswordViewController: UIViewController {
self.navigationItem.title = ""
}
func configureLanguage() {
self.topLabel.text = "password_policy_text".localized()
self.textFieldCurrentPassword.placeholder = "current_password_placeholder_text".localized()
self.textFieldNewPassword.placeholder = "new_password_placeholder_text".localized()
self.textFieldConfirmPassword.placeholder = "confirm_password_text".localized()
self.newPasswordTitleLabel.text = "new_password_text".localized()
self.currentPasswowrdTitleLabel.text = "current_password_placeholder_text".localized()
self.confirmPasswordTitlelabel.text = "confirm_password_text".localized()
self.saveButton.setTitle("save_text", for: UIControlState.normal)
}
@IBAction func savePasswordChanges(_ sender: Any) {
let currentPassword = self.encryptedOldPassword ?? ""
let newPassword = self.encryptedPassword ?? ""

Loading…
Cancel
Save