Manos Chorianopoulos

History, SharingHistory accesibilities

......@@ -51,5 +51,13 @@ extension AnalysisHeaderViewCell {
itemImage.image = UIImage(named: "ic_gift_history", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
}
setupAccessibilty()
}
func setupAccessibilty() {
// Disable accessibility for the whole cell
self.isAccessibilityElement = false
emptyLabel.isAccessibilityElement = true
}
}
......
......@@ -85,6 +85,8 @@ extension AnalysisItemViewCell {
} else if ("received" == item._sharing_type) {
subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι από " + item._sender_msisdn)
}
setupAccessibilty(item: item)
}
func configureCell(item: swiftApi.SharingCouponModel, isMarket: Bool) {
......@@ -118,6 +120,8 @@ extension AnalysisItemViewCell {
} else if ("received" == item._sharing_type) {
subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι από " + item._sender_msisdn)
}
setupAccessibilty(item: item)
}
func configureCell(item: swiftApi.CouponItemModel) {
......@@ -160,6 +164,7 @@ extension AnalysisItemViewCell {
// let htmlText = couponSetData?.inner_text ?? ""
// subtitleLabel.text = htmlText.htmlToString
setupAccessibilty(item: item)
}
func configureCell(item: swiftApi.CouponItemModel, isMarket: Bool) {
......@@ -202,5 +207,44 @@ extension AnalysisItemViewCell {
// let htmlText = couponSetData?.inner_text ?? ""
// subtitleLabel.text = htmlText.htmlToString
setupAccessibilty(item: item)
}
func setupAccessibilty (item: swiftApi.CouponItemModel) {
var formatedDate = ""
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
if let date = item.redeemed_date {
// Set output format in Greek
dateFormatter.locale = Locale(identifier: "el_GR") // Greek locale
dateFormatter.dateFormat = "d MMMM yyyy"
let resultString = dateFormatter.string(from: date)
formatedDate = resultString
} else {
formatedDate = dateLabel.text ?? ""
}
let accessibilityLabel = formatedDate + ", " + (titleLabel.text ?? "") + ", " + (subtitleLabel.text ?? "") + ", " + (priceLabel.text ?? "")
self.isAccessibilityElement = true
self.accessibilityLabel = accessibilityLabel
}
func setupAccessibilty (item: swiftApi.SharingCouponModel) {
var formatedDate = ""
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
if let date = item._dateValue {
// Set output format in Greek
dateFormatter.locale = Locale(identifier: "el_GR") // Greek locale
dateFormatter.dateFormat = "d MMMM yyyy"
let resultString = dateFormatter.string(from: date)
formatedDate = resultString
} else {
formatedDate = dateLabel.text ?? ""
}
let accessibilityLabel = formatedDate + ", " + (titleLabel.text ?? "") + ", " + (subtitleLabel.text ?? "") + ", " + (priceLabel.text ?? "")
self.isAccessibilityElement = true
self.accessibilityLabel = accessibilityLabel
}
}
......
......@@ -1862,6 +1862,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="arrowImage" destination="w3t-uo-L5p" id="gDu-xC-MXj"/>
<outlet property="stackView" destination="Ujy-Ns-gSY" id="kJV-gV-Dqh"/>
<outlet property="titleLabel" destination="jD8-wg-76D" id="K6c-qT-EMs"/>
</connections>
</tableViewCell>
......@@ -7706,6 +7707,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="arrowImage" destination="eGc-lu-1DB" id="msZ-3k-oO3"/>
<outlet property="stackView" destination="DHl-3e-Mz6" id="2Ea-MF-eLD"/>
<outlet property="titleLabel" destination="gOz-Rd-1D4" id="5Ps-AV-qMQ"/>
</connections>
</tableViewCell>
......
......@@ -6855,6 +6855,7 @@ public class swiftApi {
public class SharingCouponModel: Codable {
private var couponset_uuid: String?
private var date: String?
private var dateValue: Date?
private var discount: String?
private var merchant_uuid: String?
private var sharing_type: String?
......@@ -6868,6 +6869,7 @@ public class swiftApi {
public init() {
self.couponset_uuid = ""
self.date = ""
self.dateValue = nil
self.discount = ""
self.merchant_uuid = ""
self.sharing_type = ""
......@@ -6907,8 +6909,10 @@ public class swiftApi {
dateFormatter.dateFormat = "dd/MM/yyyy"
let resultString = dateFormatter.string(from: date)
self.date = resultString
self.dateValue = date
} else {
self.date = ""
self.dateValue = nil
}
if let transaction_metadata_json = dictionary["transaction_metadata"] as? AnyObject {
......@@ -6961,6 +6965,15 @@ public class swiftApi {
}
}
public var _dateValue: Date? {
get { // getter
return self.dateValue
}
set(newValue) { //setter
self.dateValue = newValue
}
}
public var _discount: String {
get { // getter
return self.discount ?? ""
......