Skip to content

Commit

Permalink
More menu (#17)
Browse files Browse the repository at this point in the history
* feature - more menu configuration

* feature - more menu configuration

* feature - o11y removal

* chore - API key
  • Loading branch information
tibor-is-back authored May 3, 2024
1 parent b3acab1 commit fb6b551
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 38 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ abstract_target 'Common' do
pod 'SwiftLint'
pod 'BackbaseDesignSystem', '4.2.2'
pod 'UserManagerUserProfileUseCase'
pod 'RetailMoreJourney', '4.1.0'
pod 'BackbaseObservability', '~> 1.0'

target 'AccountsJourney' do
Expand Down
11 changes: 9 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ PODS:
- Resolver (= 1.2.1)
- RxCocoa (~> 5)
- RxSwift (~> 5)
- RetailMoreJourney (4.1.0):
- BackbaseDesignSystem (>= 4.0)
- BackbaseObservability (>= 1.0)
- RetailJourneyCommon (>= 2.0)
- RxCocoa (5.1.3):
- RxRelay (~> 5)
- RxSwift (~> 5)
Expand Down Expand Up @@ -102,13 +106,14 @@ DEPENDENCIES:
- IdentityAuthenticationJourney (~> 6.0)
- Resolver (= 1.2.1)
- RetailFeatureFilterAccessControlEntitlementsUseCase
- RetailMoreJourney (= 4.1.0)
- SwiftLint
- UserManagerUserProfileUseCase

SPEC REPOS:
https://repo.backbase.com/api/pods/design-ios:
- BackbaseCountryCore
https://repo.backbase.com/api/pods/ios-business:
https://repo.backbase.com/api/pods/ios-business/:
- BackbaseObservability
- BusinessJourneyCommon
- BusinessWorkspacesJourney
Expand All @@ -127,6 +132,7 @@ SPEC REPOS:
- RetailFeatureFilterAccessControlEntitlementsUseCase
- RetailFeatureFilterUseCase
- RetailJourneyCommon
- RetailMoreJourney
- UserManagerClient2
https://repo.backbase.com/api/pods/ios3:
- Backbase
Expand Down Expand Up @@ -162,6 +168,7 @@ SPEC CHECKSUMS:
RetailFeatureFilterAccessControlEntitlementsUseCase: 234024f4c07c65a473b5c442dcb8f4cacfa2bbdf
RetailFeatureFilterUseCase: ea793414c0ab37a196a4455a4d14ff0f4e5425d7
RetailJourneyCommon: ec0a1db2fcc55c9797c3883ed022f90df60be6a2
RetailMoreJourney: 8d8447f0d02d0babf1492347f708e5be2d8f40cd
RxCocoa: e2ed092d5432e4296aa818021d27de4090ac0354
RxRelay: 5a18c2eb2d68326ebaf0112f80d837ae41b92b97
RxSwift: 915abbdfb62214aa89ccd0b194d44fb478019b27
Expand All @@ -171,6 +178,6 @@ SPEC CHECKSUMS:
UserManagerUserProfileUseCase: 815483ec83429637fcd19363e87c4facd4b9f02b
UserProfileJourney: 497a5bbb443c42eb0cee3f7a9606f5539fb0f2e4

PODFILE CHECKSUM: ae4588eb5c2d916cba64eae24ba134e60308a409
PODFILE CHECKSUM: 84ec749928bbe99b1cdcbb5fc32122250d9743f9

COCOAPODS: 1.15.2
3 changes: 1 addition & 2 deletions app/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
setupIdentityJourney()
setupWorkspacesJourney()
setupAccountsJourney()
setupObservability()
appendCustomHeader()
UserProfileUseCaseHelper().setupUserProfileUseCase()
MoreMenuConfiguration.setupMoreMenu()
return true
}
}
65 changes: 65 additions & 0 deletions app/Configurations/MoreMenuConfiguration.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import Foundation
import RetailMoreJourney
import Resolver
import BackbaseDesignSystem
import IdentityAuthenticationJourney

struct MoreMenuConfiguration {

private static var demoSection: More.MenuSection {
let securityItems: [More.MenuItem] = [
.init(
title: .init(key: "retailUniversalApp.more.items.demo", in: .app),
icon: UIImage(systemName: "d.square"),
iconBackgroundColor: DesignSystem.shared.colors.primary.default,
iconTintColor: DesignSystem.shared.colors.primary.onDefault,
action: { navigationController in
navigationController.pushViewController(DemoViewController(title: "Demo"), animated: true)
}
)
]
return .init(title: nil, items: securityItems)
}

private static var securitySection: More.MenuSection {
let securityItems: [More.MenuItem] = [
.init(
title: .init(key: "retailUniversalApp.more.items.logout", in: .app),
icon: UIImage(systemName: "iphone.and.arrow.forward"),
iconBackgroundColor: DesignSystem.shared.colors.danger.default,
iconTintColor: DesignSystem.shared.colors.primary.onDefault,
action: { _ in
let useCase: AuthenticationUseCase = Resolver.resolve()
useCase.endSession(callback: nil)
}
)
]
return .init(title: nil, items: securityItems)
}

static func setupMoreMenu() {
Resolver.register { appDefault }
}

static var appDefault: More.Configuration {
let menu = More.Menu(deferredSections: [demoSection, securitySection])
var configuration = More.Configuration()
configuration.analytics.journeyName = "more_menu"
configuration.analytics.screenLabel = "more_menu"
configuration.menu = menu
configuration.design.shouldAlwaysBounceVertically = true
return configuration
}
}

// This is needed by the More Menu configuration
private extension Bundle {
static var app: Bundle? {
let podBundle = Bundle(for: BundleToken.self)
guard let resourceUrl = podBundle.url(forResource: "Assets", withExtension: "bundle") else { return podBundle }
guard let resourceBundle = Bundle(url: resourceUrl) else { return podBundle }
return resourceBundle
}
}

private final class BundleToken { }
1 change: 1 addition & 0 deletions app/Extensions/AppDelegate+MSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extension AppDelegate {
func setupBackbaseSDK() {
do {
try Backbase.initialize("config.json", forceDecryption: false)
appendCustomHeader()
} catch {
fatalError("Backbase MSDK initialization failed: \(error.localizedDescription)")
}
Expand Down
16 changes: 0 additions & 16 deletions app/Extensions/AppDelegate+Observability.swift

This file was deleted.

9 changes: 5 additions & 4 deletions app/Extensions/AppDelegate+Workspaces.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import AccessControlClient3Gen2
import BackbaseDesignSystem
import AccountsJourney
import GoldenAccountsUseCase
import RetailMoreJourney

// MARK: - Workspaces Journey methods
extension AppDelegate {
Expand Down Expand Up @@ -44,9 +45,9 @@ extension AppDelegate {
guard let self else { return }
didSelect?(navigationController)(workspace)

let comingSoonController = ComingSoonViewController(title: "Coming soon..")
comingSoonController.view.backgroundColor = DesignSystem.shared.colors.surfacePrimary.default
comingSoonController.tabBarItem.image = UIImage(systemName: "pencil.and.scribble")
let moreNavigationController = UINavigationController()
let moreViewController = More.build(navigationController: moreNavigationController)
moreNavigationController.viewControllers = [moreViewController]

let tabBarViewController = BackbaseDesignSystem.TabBarController()
Task {
Expand All @@ -55,7 +56,7 @@ extension AppDelegate {

tabBarViewController.viewControllers = [
dashboardViewController,
comingSoonController
moreNavigationController
]
navigationController.viewControllers = [tabBarViewController]
}
Expand Down
4 changes: 2 additions & 2 deletions app/Helpers/DashboardHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ struct DashboardHelper {
_ serviceAgreementName: String) -> UIViewController {
let accountsListViewController = AccountsList.build(navigationController: navigationController)
accountsListViewController.title = Bundle.main.localize("accountsJourney.accountsList.labels.title") ?? ""
let tab2ViewController = ComingSoonViewController(title: Bundle.main.localize("dashboard.menu.tab2") ?? "")
let tab3ViewController = ComingSoonViewController(title: Bundle.main.localize("dashboard.menu.tab3") ?? "")
let tab2ViewController = DemoViewController(title: Bundle.main.localize("dashboard.menu.tab2") ?? "")
let tab3ViewController = DemoViewController(title: Bundle.main.localize("dashboard.menu.tab3") ?? "")

let userPresentable = UserPresentable(name: userName, company: serviceAgreementName, image: nil)
let headerConfiguration = TabHeaderViewController.Header.UserInformationConfiguration(userPresentable: userPresentable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import UIKit
import BackbaseDesignSystem

final class ComingSoonViewController: UIViewController {
final class DemoViewController: UIViewController {

init(title: String) {
super.init(nibName: nil, bundle: .main)
Expand All @@ -24,12 +24,13 @@ final class ComingSoonViewController: UIViewController {
stateView.snp.makeConstraints { make in
make.trailing.leading.centerY.equalToSuperview()
}
view.backgroundColor = DesignSystem.shared.colors.surfacePrimary.default
}

private func getStateView() -> StateView {
let config = GenericStateViewConfiguration(iconName: DesignSystem.Assets.icStateViewLoadingFailed,
title: Bundle.main.localize("comingSoonViewController.stateViewTitle") ?? "",
subtitle: Bundle.main.localize("comingSoonViewController.stateViewSubtitle") ?? "",
title: Bundle.main.localize("demoViewController.stateViewTitle") ?? "",
subtitle: Bundle.main.localize("demoViewController.stateViewSubtitle") ?? "",
animationView: nil,
firstButtonConfiguration: nil,
secondButtonConfiguration: nil)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/backbase/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"bankTimeZone": "Europe/Amsterdam",
"custom": {
"default-http-headers": {
"X-SDBXAZ-API-KEY": "Add your API key here"
"X-SDBXAZ-API-KEY": "Add your API key here"
}
}
}
38 changes: 30 additions & 8 deletions assets/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -537,46 +537,68 @@
}
}
},
"comingSoonViewController.stateViewSubtitle" : {
"dashboard.menu.tab2" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Soon a new journey will be added to this tab. Stay tuned!"
"value" : "Tab 2"
}
}
}
},
"comingSoonViewController.stateViewTitle" : {
"dashboard.menu.tab3" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Journey under construction!"
"value" : "Tab 3"
}
}
}
},
"dashboard.menu.tab2" : {
"demoViewController.stateViewSubtitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Tab 2"
"value" : "In a Backbase powered app you would have a working journey here."
}
}
}
},
"dashboard.menu.tab3" : {
"demoViewController.stateViewTitle" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Tab 3"
"value" : "This is a demo journey"
}
}
}
},
"retailUniversalApp.more.items.demo" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Demo journey"
}
}
}
},
"retailUniversalApp.more.items.logout" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Log out"
}
}
}
Expand Down

0 comments on commit fb6b551

Please sign in to comment.