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

Fix/14996 EOL - all statistics remain visible if app is running in background when EOL is reached #5139

Merged
Show file tree
Hide file tree
Changes from all 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 @@ -69,3 +69,5 @@
"ExposureSubmission_WarnWithoutTAN_FAQLink" = "https://www.coronawarn.app/en/faq/results/#warn_without_tan";

"Home_EndOfLifeThankYouTile_FAQLink" = "https://www.coronawarn.app/en/faq/#ramp_down";

"Home_LinkCard_PandemicRadar_URL" = "https://corona-pandemieradar.de/en";
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@
"ExposureSubmission_WarnWithoutTAN_FAQLink" = "https://www.coronawarn.app/de/faq/results/#warn_without_tan";

"Home_EndOfLifeThankYouTile_FAQLink" = "https://www.coronawarn.app/de/faq/#ramp_down";

"Home_LinkCard_PandemicRadar_URL" = "https://corona-pandemieradar.de/de";
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@
"ExposureSubmission_WarnWithoutTAN_FAQLink" = "https://www.coronawarn.app/en/faq/results/#warn_without_tan";

"Home_EndOfLifeThankYouTile_FAQLink" = "https://www.coronawarn.app/en/faq/#ramp_down";

"Home_LinkCard_PandemicRadar_URL" = "https://corona-pandemieradar.de/en";
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@
"ExposureSubmission_WarnWithoutTAN_FAQLink" = "https://www.coronawarn.app/en/faq/results/#warn_without_tan";

"Home_EndOfLifeThankYouTile_FAQLink" = "https://www.coronawarn.app/en/faq/#ramp_down";

"Home_LinkCard_PandemicRadar_URL" = "https://corona-pandemieradar.de/en";
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@
"ExposureSubmission_WarnWithoutTAN_FAQLink" = "https://www.coronawarn.app/en/faq/results/#warn_without_tan";

"Home_EndOfLifeThankYouTile_FAQLink" = "https://www.coronawarn.app/en/faq/#ramp_down";

"Home_LinkCard_PandemicRadar_URL" = "https://corona-pandemieradar.de/en";
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@
"ExposureSubmission_WarnWithoutTAN_FAQLink" = "https://www.coronawarn.app/en/faq/results/#warn_without_tan";

"Home_EndOfLifeThankYouTile_FAQLink" = "https://www.coronawarn.app/en/faq/#ramp_down";

"Home_LinkCard_PandemicRadar_URL" = "https://corona-pandemieradar.de/en";
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ class HomeStatisticsCellModel {
statistics.keyFigureCards.first { $0.header.cardID == cardID }
}

self?.linkCards = statistics.supportedLinkCardIDSequence
.compactMap { cardID in
statistics.linkCards.first { $0.header.cardID == cardID }
}
if CWAHibernationProvider.shared.isHibernationState, statistics.linkCards.isEmpty {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// In hibernation, we don't have a server response, thatswhy we use the information hard coded
self?.linkCards = [.mock(cardID: HomeLinkCard.bmgPandemicRadar.rawValue)]
} else {
self?.linkCards = statistics.supportedLinkCardIDSequence
.compactMap { cardID in
statistics.linkCards.first { $0.header.cardID == cardID }
}
}
#if DEBUG
if isUITesting {
self?.setupMockLinkCards()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ class HomeStatisticsTableViewCell: UITableViewCell {
@IBOutlet private weak var scrollView: UIScrollView!
@IBOutlet private weak var stackView: UIStackView!
@IBOutlet private weak var trailingConstraint: NSLayoutConstraint!
@IBOutlet private weak var bottomConstraint: NSLayoutConstraint!

private var cellModel: HomeStatisticsCellModel?
private var subscriptions = Set<AnyCancellable>()
Expand Down Expand Up @@ -311,6 +312,7 @@ class HomeStatisticsTableViewCell: UITableViewCell {

guard !CWAHibernationProvider.shared.isHibernationState else {
trailingConstraint.constant = 12
bottomConstraint.constant = 12
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="bottomConstraint" destination="fhD-NG-SgH" id="KOo-8I-zKr"/>
<outlet property="scrollView" destination="Baz-s9-y9N" id="SMK-kU-UM8"/>
<outlet property="stackView" destination="zyc-lh-yUE" id="Uqs-gy-wdr"/>
<outlet property="trailingConstraint" destination="hFj-JQ-gfN" id="jcg-VR-hR4"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

extension SAP_Internal_Stats_LinkCard {
static let bmgPandemicRadarURLMock: String = "https://corona-pandemieradar.de/de"
static let bmgPandemicRadarURLMock: String = AppStrings.Links.pandemicRadarLink

/**
Returns a mocked `SAP_Internal_Stats_LinkCard`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class HomeTableViewModel {
let isGlobalStatisticsNotLoaded = state.statistics.supportedStatisticsCardIDSequence.isEmpty
let isLocalStatisticsNotCached = state.store.selectedLocalStatisticsRegions.isEmpty

if isStatisticsCell && isGlobalStatisticsNotLoaded && isLocalStatisticsNotCached {
if isStatisticsCell && isGlobalStatisticsNotLoaded && isLocalStatisticsNotCached, !CWAHibernationProvider.shared.isHibernationState {
Log.debug("[Autolayout] Layout issues due to preloading of statistics cell! ", log: .ui)
// if this causes (further?) crashes we have to refactor the preloading of the statistics cell
return 0
Expand Down
1 change: 1 addition & 0 deletions src/xcode/ENA/ENA/Source/View Helpers/AppStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ enum AppStrings {
static let coronaWarnAppStoreLink = NSLocalizedString("TicketValidation_CoronaWarnAppLink", tableName: "Localizable.links", comment: "")
static let stikoVaccinationRecommendations = NSLocalizedString("Stiko_VaccinationRecommendations", tableName: "Localizable.links", comment: "")
static let warnWithoutTANFAQLink = NSLocalizedString("ExposureSubmission_WarnWithoutTAN_FAQLink", tableName: "Localizable.links", comment: "")
static let pandemicRadarLink = NSLocalizedString("Home_LinkCard_PandemicRadar_URL", comment: "")
}

enum QuickActions {
Expand Down