Skip to content

Commit

Permalink
Merge pull request #331 from DP-3T/release/1.1.2
Browse files Browse the repository at this point in the history
Release 1.1.2
  • Loading branch information
UBaggeler authored Oct 20, 2020
2 parents 7e91d98 + 21df022 commit 0f07509
Show file tree
Hide file tree
Showing 32 changed files with 173 additions and 46 deletions.
9 changes: 8 additions & 1 deletion DP3TApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@
attributes = {
CLASSPREFIX = "";
LastSwiftUpdateCheck = 1130;
LastUpgradeCheck = 1130;
LastUpgradeCheck = 1220;
ORGANIZATIONNAME = Ubique;
TargetAttributes = {
8E81CC94241FCC7D006F2437 = {
Expand Down Expand Up @@ -2203,6 +2203,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -2346,6 +2347,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -2489,6 +2491,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -2607,6 +2610,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -2720,6 +2724,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -2847,6 +2852,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -2990,6 +2996,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion DP3TApp.xcodeproj/xcshareddata/xcschemes/Debug.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down
1 change: 1 addition & 0 deletions DP3TApp/Logic/Config/ConfigManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class ConfigManager: NSObject {
}

Logger.log("Load Config", appState: true)
NSSynchronizationPersistence.shared?.appendLog(eventType: .config, date: Date(), payload: nil)

dataTask = session.dataTask(with: request, completionHandler: { data, response, error in

Expand Down
19 changes: 19 additions & 0 deletions DP3TApp/Logic/Config/ConfigResponseBody.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct LocalizedValue<T: UBCodable>: UBCodable {
class ConfigResponseBody: UBCodable {
public let forceUpdate: Bool
public let infoBox: LocalizedValue<InfoBox>?
public let whatToDoPositiveTestTexts: LocalizedValue<WhatToDoPositiveTestTexts>?
public let iOSGaenSdkConfig: GAENSDKConfig?

class InfoBox: UBCodable {
Expand All @@ -55,4 +56,22 @@ class ConfigResponseBody: UBCodable {
let factorHigh: Double
let triggerThreshold: Int
}

class WhatToDoPositiveTestTexts: UBCodable {
let enterCovidcodeBoxSupertitle: String
let enterCovidcodeBoxTitle: String
let enterCovidcodeBoxText: String
let enterCovidcodeBoxButtonTitle: String
let infoBox: InfoBox
let faqEntries: [FAQEntry]

class FAQEntry: UBCodable {
let title: String
let text: String
let iconAndroid: String
let iconIos: String
let linkTitle: String?
let linkUrl: URL?
}
}
}
2 changes: 1 addition & 1 deletion DP3TApp/Logic/Tracing/DatabaseSyncer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DatabaseSyncer {
// Certificate error
UIStateManager.shared.immediatelyShowSyncError = false
UIStateManager.shared.syncErrorIsNetworkError = true
case let .HTTPFailureResponse(status: _, data: _):
case .HTTPFailureResponse:
// this means the backend is under maintanance
UIStateManager.shared.immediatelyShowSyncError = false
UIStateManager.shared.syncErrorIsNetworkError = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension NSModuleBaseView {
isAccessibilityElement = false
accessibilityElementsHidden = false
stackView.isAccessibilityElement = true
stackView.accessibilityTraits = [.button]
stackView.accessibilityTraits = [.button, .header]
}

func updateAccessibility(with sectionViews: [UIView]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class NSSynchronizationPersistence {
case fakeRequest
case nextDayKeyUpload
#endif
case config
}

init?() {
Expand Down Expand Up @@ -140,6 +141,7 @@ extension NSSynchronizationPersistence.EventType: Value {
case 3: return .fakeRequest
case 4: return .nextDayKeyUpload
#endif
case 5: return .config
default: fatalError()
}
}
Expand All @@ -153,6 +155,7 @@ extension NSSynchronizationPersistence.EventType: Value {
case .fakeRequest: return 3
case .nextDayKeyUpload: return 4
#endif
case .config: return 5
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,15 @@ import UIKit
title.text = "synchronizations_view_info_title".ub_localized
let infoQuestion = NSOnboardingInfoView(icon: UIImage(named: "ic-sync")!, text: "synchronizations_view_info_answer".ub_localized, title: "synchronizations_view_info_question".ub_localized, leftRightInset: 0, dynamicIconTintColor: .ns_blue)

let nextFakeRequest = FakePublishManager.shared.nextScheduledFakeRequestDate
let nextFakeInfoView = NSOnboardingInfoView(icon: UIImage(named: "ic-tracing")!,
text: "synchronizations_next_fake_request".ub_localized + " " + dateFormatter.string(from: nextFakeRequest),
title: nil,
leftRightInset: 0,
dynamicIconTintColor: .ns_blue)

infoView.addSubview(infoQuestion)
infoView.addSubview(nextFakeInfoView)
infoView.addSubview(title)

title.snp.makeConstraints { make in
Expand All @@ -91,6 +99,11 @@ import UIKit

infoQuestion.snp.makeConstraints { make in
make.top.equalTo(title.snp.bottom).offset(NSPadding.medium)
make.leading.trailing.equalTo(infoView.layoutMarginsGuide)
}

nextFakeInfoView.snp.makeConstraints { make in
make.top.equalTo(infoQuestion.snp.bottom).offset(NSPadding.medium)
make.leading.trailing.bottom.equalTo(infoView.layoutMarginsGuide)
}
}
Expand Down Expand Up @@ -180,6 +193,7 @@ import UIKit
case .fakeRequest: return "synchronizations_view_sync_via_fake_request".ub_localized
case .nextDayKeyUpload: return "synchronizations_view_sync_via_next_day_key_upload".ub_localized
#endif
case .config: return "synchronizations_view_config_request".ub_localized
}
}
}
Expand Down
1 change: 1 addition & 0 deletions DP3TApp/Screens/Homescreen/WhatToDo/NSWhatToDoButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class NSWhatToDoButton: UBButton {

extension NSWhatToDoButton {
func setupAccessibility() {
accessibilityTraits = [.button, .header]
accessibilityLabel = [subtitleLabel, titleTextLabel]
.compactMap { $0.text }
.joined(separator: " ")
Expand Down
5 changes: 4 additions & 1 deletion DP3TApp/Screens/Onboarding/NSOnboardingInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class NSOnboardingInfoView: UIView {

let labelAreaGuide = UILayoutGuide()

init(icon: UIImage, text: String, title: String? = nil, leftRightInset: CGFloat = 2 * NSPadding.medium, dynamicIconTintColor: UIColor? = nil) {
init(icon: UIImage?, text: String, title: String? = nil, leftRightInset: CGFloat = 2 * NSPadding.medium, dynamicIconTintColor: UIColor? = nil) {
self.leftRightInset = leftRightInset

super.init(frame: .zero)
Expand Down Expand Up @@ -59,6 +59,9 @@ class NSOnboardingInfoView: UIView {
make.top.equalToSuperview().inset(NSPadding.medium)
}
make.leading.equalToSuperview().inset(leftRightInset)
if icon == nil {
make.width.equalTo(24)
}
}

label.snp.makeConstraints { make in
Expand Down
6 changes: 6 additions & 0 deletions DP3TApp/Screens/Statistics/Chart/NSChartYAxisLegend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ class NSChartYAxisLegend: UIView {
y -= chartHeight * CGFloat(relativeStep) * CGFloat(i)
label.frame = CGRect(x: 5, y: y, width: size.width, height: size.height)
}

// remove unused labels
while labels.count > count {
_ = labels.popLast()?.removeFromSuperview()
}

invalidateIntrinsicContentSize()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class NSStatisticsChartContentView: UIView {

addSubview(infectionBarView)
infectionBarView.snp.makeConstraints { make in
make.leading.trailing.top.equalToSuperview()
make.top.equalToSuperview().inset(NSPadding.medium)
make.leading.trailing.equalToSuperview()
make.bottom.equalToSuperview().inset(39)
}

Expand Down
3 changes: 2 additions & 1 deletion DP3TApp/Screens/Statistics/Chart/NSStatisticsChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class NSStatisticsChartView: UIView {

addSubview(yLenged)
yLenged.snp.makeConstraints { make in
make.top.bottom.trailing.equalToSuperview()
make.top.equalToSuperview().inset(NSPadding.medium)
make.bottom.trailing.equalToSuperview()
}

addSubview(scrollView)
Expand Down
6 changes: 3 additions & 3 deletions DP3TApp/Screens/Statistics/NSStatsticsModuleHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NSStatsticsModuleHeader: UIView {
private let counterLabel = NSLabel(.statsCounter,
textColor: UIColor.setColorsForTheme(lightColor: .ns_darkBlueBackground, darkColor: .white),
textAlignment: .center)
private let subtitle = NSLabel(.textLight, textColor: .ns_blue, textAlignment: .center)
private let subtitle = NSLabel(.textLight, textColor: .ns_blue, numberOfLines: 0, textAlignment: .center)
private let formatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
Expand All @@ -39,13 +39,13 @@ class NSStatsticsModuleHeader: UIView {

counterLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(arrowImage.snp.bottom).inset(12)
make.top.equalTo(arrowImage.snp.bottom).inset(8)
}

subtitle.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(counterLabel.snp.bottom).inset(-NSPadding.small)
make.bottom.equalToSuperview()
make.leading.trailing.equalToSuperview()
}

counterLabel.text = formatNumber(number: nil)
Expand Down
Loading

0 comments on commit 0f07509

Please sign in to comment.