Skip to content

Commit

Permalink
Merge branch 'Release-3.13.0' into PP-926-Implement-User-Journey-anal…
Browse files Browse the repository at this point in the history
…ytics-for-Skonto

# Conflicts:
#	BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/DocumentPagesPreview/DocumentPagesViewController.swift
  • Loading branch information
ValentinaIancu-Gini committed Jan 23, 2025
2 parents 27c5fed + d5bce4e commit a5cceea
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ final class DocumentPagesViewController: UIViewController {
private var viewModel: DocumentPagesViewModelProtocol?
private let configuration = GiniBankConfiguration.shared
private let screenTitle: String?
private let errorButtonTitle: String
private var errorView: DocumentPagesErrorView?

// Constraints
Expand All @@ -76,8 +77,9 @@ final class DocumentPagesViewController: UIViewController {
private var zoomAnalyticsEventSent: Bool = false

// MARK: - Init
init(screenTitle: String? = nil) {
init(screenTitle: String? = nil, errorButtonTitle: String) {
self.screenTitle = screenTitle
self.errorButtonTitle = errorButtonTitle
super.init(nibName: nil, bundle: nil)
}

Expand Down Expand Up @@ -109,15 +111,11 @@ final class DocumentPagesViewController: UIViewController {
}

func setError(errorType: ErrorType, tryAgainAction: @escaping () -> Void) {
let buttonTitleLocalizableString = "ginibank.transactionDocs.preview.error.tryAgain.buttonTitle"
let buttonTitle = NSLocalizedStringPreferredGiniBankFormat(buttonTitleLocalizableString,
comment: "Try again")
let errorView = DocumentPagesErrorView(errorType: errorType,
buttonTitle: buttonTitle,
buttonTitle: errorButtonTitle,
buttonAction: { [weak self] in
self?.handleTryAgainAction(tryAgainAction)
}
)
})

sendAnalyticsErrorScreenShown(with: errorType)
view.addSubview(errorView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,10 @@ extension GiniBankNetworkingScreenApiCoordinator: SkontoCoordinatorDelegate {
}

func didTapDocumentPreview(_ coordinator: Coordinator, _ skontoViewModel: SkontoViewModel) {
let viewController = DocumentPagesViewController(screenTitle: SkontoDocumentPagesViewModel.screenTitle)
let errorButtonTitle = SkontoDocumentPagesViewModel.errorButtonTitle
let screenTitle = SkontoDocumentPagesViewModel.screenTitle
let viewController = DocumentPagesViewController(screenTitle: screenTitle,
errorButtonTitle: errorButtonTitle)
viewController.modalPresentationStyle = .overCurrentContext
screenAPINavigationController.present(viewController, animated: true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ final class SkontoDocumentPagesViewModel: DocumentPagesViewModelProtocol {
private var expiryDate: Date

// Information to be displayed in the screen after highlighting Skonto details
private (set) var processedImages = [UIImage]()
private(set) var processedImages = [UIImage]()
static var screenTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.document.pages.screen.title",
comment: "Skonto discount details")
static var errorButtonTitle = NSLocalizedStringPreferredGiniBankFormat(
"ginibank.skonto.document.pages.error.tryAgain.buttonTitle",
comment: "Try again")
var bottomInfoItems: [String] {
return [expiryDateString, withDiscountPriceString, withoutDiscountPriceString]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public class TransactionDocsViewModel {
func handlePreviewDocument(for documentId: String) {
let transactionDoc = transactionDocs.first(where: { $0.documentId == documentId })
let screenTitle = transactionDoc?.fileName ?? ""
let viewController = DocumentPagesViewController(screenTitle: screenTitle)
let errorButtonTitle = NSLocalizedStringPreferredGiniBankFormat(
"ginibank.transactionDocs.preview.error.tryAgain.buttonTitle",
comment: "Try again")
let viewController = DocumentPagesViewController(screenTitle: screenTitle, errorButtonTitle: errorButtonTitle)
viewController.modalPresentationStyle = .overCurrentContext
documentPagesViewController = viewController
presentingViewController?.present(viewController, animated: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"ginibank.skonto.help.back" = "Skonto";

"ginibank.skonto.document.pages.screen.title" = "Skonto-Details";
"ginibank.skonto.document.pages.error.tryAgain.buttonTitle" = "Versuch's nochmal";

// MARK: - Transaction Docs feature
"ginibank.transactionDocs.alert.title" = "Fügen Sie der Transaktion einen Anhang hinzu?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"ginibank.skonto.help.back" = "Skonto discount";

"ginibank.skonto.document.pages.screen.title" = "Skonto discount details";
"ginibank.skonto.document.pages.error.tryAgain.buttonTitle" = "Try again";

// MARK: - Transaction Docs feature
"ginibank.transactionDocs.alert.title" = "Add an attachment to this transaction?";
Expand Down

0 comments on commit a5cceea

Please sign in to comment.