Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix/10498 Show New Functions Screen footernote only with delta onboarding #4854

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ class AppInformationViewController: DynamicTableViewController, NavigationBarOpa

init(
elsService: ErrorLogSubmissionProviding,
store: Store,
naveeddotio marked this conversation as resolved.
Show resolved Hide resolved
cclService: CCLServable
) {
self.cclService = cclService
self.store = store

self.model = [
.versionInfo: AppInformationCellModel(
text: AppStrings.AppInformation.newFeaturesNavigation,
accessibilityIdentifier: AccessibilityIdentifiers.AppInformation.newFeaturesNavigation,
action: .push(viewController: DeltaOnboardingNewVersionFeaturesViewController(hasCloseButton: false))
action: .push(viewController: DeltaOnboardingNewVersionFeaturesViewController(hasCloseButton: false, store: store))
),
.about: AppInformationCellModel(
text: AppStrings.AppInformation.aboutNavigation,
Expand Down Expand Up @@ -163,6 +165,7 @@ class AppInformationViewController: DynamicTableViewController, NavigationBarOpa
// MARK: - Private

private var cclService: CCLServable
private var store: Store

private func footerView() -> UIView {
let versionLabel = ENALabel()
Expand Down Expand Up @@ -193,7 +196,7 @@ class AppInformationViewController: DynamicTableViewController, NavigationBarOpa
AppInformationCellModel(
text: AppStrings.AppInformation.newFeaturesNavigation,
accessibilityIdentifier: AccessibilityIdentifiers.AppInformation.newFeaturesNavigation,
action: .push(viewController: DeltaOnboardingNewVersionFeaturesViewController(hasCloseButton: false))
action: .push(viewController: DeltaOnboardingNewVersionFeaturesViewController(hasCloseButton: false, store: store))
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ class AppInformationViewControllerTests: XCTestCase {
private var fakeCCSService: FakeCCLService!

override func setUpWithError() throws {
let store = MockTestStore()
errorLogSubmissionProvidingMock = ErrorLogSubmissionProvidingMock()
fakeCCSService = FakeCCLService()
sut = AppInformationViewController(
elsService: errorLogSubmissionProvidingMock,
store: store,
cclService: fakeCCSService
)
}
Expand Down
1 change: 1 addition & 0 deletions src/xcode/ENA/ENA/Source/Scenes/Home/HomeCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ class HomeCoordinator: RequiresAppDependencies {
rootViewController.pushViewController(
AppInformationViewController(
elsService: elsService,
store: store,
cclService: cclService
),
animated: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DeltaOnboardingNewVersionFeatures: DeltaOnboarding {
}

func makeViewController() -> DeltaOnboardingViewControllerProtocol {
let deltaOnboardingViewController = DeltaOnboardingNewVersionFeaturesViewController()
let deltaOnboardingViewController = DeltaOnboardingNewVersionFeaturesViewController(store: store)

let navigationController = DeltaOnboardingNavigationController(rootViewController: deltaOnboardingViewController)
navigationController.navigationBar.prefersLargeTitles = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class DeltaOnboardingNewVersionFeaturesViewController: DynamicTableViewControlle

// MARK: - Initializers

init(featureVersion: String = "", hasCloseButton: Bool = true) {
self.viewModel = DeltaOnboardingNewVersionFeaturesViewModel()
init(featureVersion: String = "", hasCloseButton: Bool = true, store: Store) {
self.viewModel = DeltaOnboardingNewVersionFeaturesViewModel(store: store)
self.hasCloseButton = hasCloseButton
super.init(nibName: nil, bundle: nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ struct DeltaOnboardingNewVersionFeaturesViewModel {

// MARK: - Init

init() {
init(store: Store) {

// ADD NEW FEATURES HERE

self.featureVersion = "2.28"
self.store = store

self.newVersionFeatures.append(
// Pandemic Radar
Expand Down Expand Up @@ -58,13 +59,8 @@ struct DeltaOnboardingNewVersionFeaturesViewModel {
)
$0.add(
.section(
cells: [
.body(
text: AppStrings.NewVersionFeatures.aboutAppInformation,
color: .enaColor(for: .textPrimary1),
accessibilityIdentifier: AccessibilityIdentifiers.DeltaOnboarding.newVersionFeaturesGeneralAboutAppInformation
)
]
separators: .none,
cells: showFooterNote()
)
)
}
Expand All @@ -73,6 +69,7 @@ struct DeltaOnboardingNewVersionFeaturesViewModel {
// MARK: - Private

private var newVersionFeatures: [NewVersionFeature] = []
private let store: Store

private func buildNewFeaturesCells() -> [DynamicCell] {
var cells: [DynamicCell] = []
Expand All @@ -92,4 +89,13 @@ struct DeltaOnboardingNewVersionFeaturesViewModel {
}
return cells
}

private func showFooterNote() -> [DynamicCell] {
var cells: [DynamicCell] = []
let deltaOnboarding = store.finishedDeltaOnboardings[featureVersion]
if deltaOnboarding == nil {
cells.append(.body(text: AppStrings.NewVersionFeatures.aboutAppInformation, color: .enaColor(for: .textPrimary1), accessibilityIdentifier: AccessibilityIdentifiers.DeltaOnboarding.newVersionFeaturesGeneralAboutAppInformation))
}
return cells
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import XCTest
class DeltaOnboardingNewVersionFeaturesControllerTests: CWATestCase {

private func createVC() -> DeltaOnboardingNewVersionFeaturesViewController {
DeltaOnboardingNewVersionFeaturesViewController()
let store = MockTestStore()
return DeltaOnboardingNewVersionFeaturesViewController(store: store)
}

func testCellsInSection0() {
Expand Down