Skip to content

Commit

Permalink
Merge pull request #504 from SwissCovid/release/2.3.0
Browse files Browse the repository at this point in the history
Release 2.3.0
  • Loading branch information
stmitt authored Dec 3, 2021
2 parents 0c586b3 + aeda2d9 commit d1033a6
Show file tree
Hide file tree
Showing 26 changed files with 231 additions and 66 deletions.
2 changes: 1 addition & 1 deletion DP3TApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2638,7 +2638,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if ! [ -x \"$(command -v iOSTranslations)\" ]; then\n echo 'Error: iOSTranslation not installed. Download it from https://bitbucket.org/ubique-innovation/iostranslations/' >&2\n exit 1\nfi\necho \"Running Translation Script. This will take a few seconds...\"\npwd\niOSTranslations\n";
shellScript = "PATH=${PATH}:/usr/local/bin:/opt/homebrew/bin # Pick up iOSTranslations from Homebrew\n\nif ! [ -x \"$(command -v iOSTranslations)\" ]; then\n echo 'Error: iOSTranslation not installed. Download it from https://bitbucket.org/ubique-innovation/iostranslations/' >&2\n exit 1\nfi\necho \"Running Translation Script. This will take a few seconds...\"\npwd\niOSTranslations\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
20 changes: 13 additions & 7 deletions DP3TApp/Logic/Config/ConfigResponseBody.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ConfigResponseBody: UBCodable {
public let checkInUpdateNotificationEnabled: Bool?

public var showVaccinationInfo = false
public let vaccinationBookingCantons: LocalizedValue<[VaccinationBookingCanton]>
public let vaccinationBookingInfo: LocalizedValue<VaccinationBookingInfo>

class InfoBox: UBCodable {
Expand Down Expand Up @@ -94,15 +93,22 @@ class ConfigResponseBody: UBCodable {
let text: String
}

class VaccinationBookingCanton: UBCodable {
let name: String
let iconIos: String
let linkUrl: String
}

class VaccinationBookingInfo: UBCodable {
let title: String
let text: String
let info: String
let impfcheckTitle: String?
let impfcheckText: String?
let impfcheckButton: String?
let impfcheckUrl: String?
}
}

extension ConfigResponseBody.VaccinationBookingInfo {
var hasAllImpfCheckValues: Bool {
return impfcheckTitle != nil
&& impfcheckText != nil
&& impfcheckButton != nil
&& impfcheckUrl != nil
}
}
2 changes: 1 addition & 1 deletion DP3TApp/Logic/Push/UBPush/UBPushRegistrationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ open class UBPushRegistrationManager {
open var pushRegistrationRequest: URLRequest? {
guard
let pushToken = UBPushLocalStorage.shared.pushToken,
let registrationUrl = self.registrationUrl else {
let registrationUrl = registrationUrl else {
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class NSCheckInEditViewController: NSViewController {
if isCurrentCheckIn {
CheckInManager.shared.currentCheckIn = checkIn
} else {
if let checkIn = self.checkIn {
if let checkIn = checkIn {
CheckInManager.shared.updateCheckIn(checkIn: checkIn)
}
}
Expand Down Expand Up @@ -175,7 +175,7 @@ class NSCheckInEditViewController: NSViewController {
let checkIn = CheckInManager.shared.currentCheckIn {
let automaticCheckout = checkIn.venue.automaticCheckoutTimeInterval ?? NSLocalPush.defaultAutomaticCheckoutTimeInterval
return timeRange > automaticCheckout
} else if let checkIn = self.checkIn {
} else if let checkIn = checkIn {
let automaticCheckout = checkIn.venue.automaticCheckoutTimeInterval ?? NSLocalPush.defaultAutomaticCheckoutTimeInterval
return timeRange > automaticCheckout
}
Expand Down Expand Up @@ -368,7 +368,7 @@ class NSCheckInEditViewController: NSViewController {
// MARK: - Show remove warning

private func showRemoveWarning() {
guard let checkIn = self.checkIn else { return }
guard let checkIn = checkIn else { return }

let controller = NSRemoveFromDiaryWarningViewController(venueInfo: checkIn.venue)
controller.hideCallback = { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class NSCheckInViewController: NSViewController {
// MARK: - Setup

private func setupQRView() {
guard let qrView = self.qrView else { return }
guard let qrView = qrView else { return }

view.addSubview(qrView)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NSHomescreenViewController: NSTitleViewScrollViewController {
// MARK: - Views

private let infoBoxView = HomescreenInfoBoxView()
private let vaccinationInfoView = NSWhatToDoButton(title: "vaccination_info_homescreen_title".ub_localized, subtitle: "vaccination_info_homescreen_title_bold".ub_localized, image: UIImage(named: "illu-impfung-doc"))
private let vaccinationInfoView = NSWhatToDoButton(title: "vaccination_info_homescreen_title_bold".ub_localized, subtitle: "vaccination_info_homescreen_title".ub_localized, image: UIImage(named: "illu-impfung-doc"))

private let vaccinationContainerView = UIView()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class NSCheckinOnboardingViewController: NSOnboardingBaseViewController {
// MARK: - Checkin

private func checkin() {
guard let url = self.url else { return }
guard let url = url else { return }

let result = CrowdNotifier.getVenueInfo(qrCode: url, baseUrl: Environment.current.qrCodeBaseUrl)

Expand Down
72 changes: 50 additions & 22 deletions DP3TApp/Screens/Vaccination/NSVaccinationInfoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class NSVaccinationInfoViewController: NSViewController {
private func setup() {
let stackScrollView = NSStackScrollView()
stackScrollView.addArrangedView(contentView)
stackScrollView.addSpacerView(NSPadding.medium + NSPadding.small)
stackScrollView.addArrangedView(additionalExternalLink())

stackScrollView.stackView.layoutMargins = UIEdgeInsets(top: 2.0 * NSPadding.medium + 2.0, left: NSPadding.medium + NSPadding.small, bottom: 2.0 * NSPadding.medium, right: NSPadding.medium + NSPadding.small)
Expand Down Expand Up @@ -74,8 +75,9 @@ private class VaccinationInfoContentView: NSSimpleModuleBaseView {
private let config = ConfigManager.currentConfig

init() {
super.init(title: "vaccination_info_homescreen_title".ub_localized,
subtitle: config?.vaccinationBookingInfo.value?.title ?? "vaccination_booking_info_title".ub_localized, text: config?.vaccinationBookingInfo.value?.text ?? "vaccination_booking_info_text".ub_localized,
super.init(title: config?.vaccinationBookingInfo.value?.title ?? "vaccination_booking_info_title".ub_localized,
subtitle: "vaccination_info_homescreen_title".ub_localized,
text: config?.vaccinationBookingInfo.value?.text ?? "vaccination_booking_info_text".ub_localized,
image: nil,
subtitleColor: .ns_lightBlue,
bottomPadding: true)
Expand All @@ -90,36 +92,62 @@ private class VaccinationInfoContentView: NSSimpleModuleBaseView {
// MARK: - Setup

private func setup() {
if config?.vaccinationBookingInfo.value?.hasAllImpfCheckValues ?? false {
let bookNowLabel = NSLabel(.textBold)
bookNowLabel.text = config?.vaccinationBookingInfo.value?.impfcheckTitle ?? "vaccination_impf_check_title".ub_localized

contentView.addSpacerView(NSPadding.large + NSPadding.small)
contentView.addArrangedView(bookNowLabel, insets: .zero)

let bookNowTextLabel = NSLabel(.textLight)
bookNowTextLabel.text = config?.vaccinationBookingInfo.value?.impfcheckText ?? "vaccination_impf_check_info_text".ub_localized

contentView.addSpacerView(NSPadding.medium + 2.0)
contentView.addArrangedView(bookNowTextLabel, insets: .zero)

let button = NSButton(title: config?.vaccinationBookingInfo.value?.impfcheckButton ?? "vaccination_impf_check_action".ub_localized, style: .normal(.ns_blue))
button.setImage(UIImage(named: "ic-link-external"), for: .normal)
button.touchUpCallback = { [weak self] in
self?.vaccinationCheckButtonPressed()
}

contentView.addSpacerView(NSPadding.large)
let buttonWrapper = UIView()
buttonWrapper.addSubview(button)
button.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(-NSPadding.medium - NSPadding.small)
}
contentView.addArrangedView(buttonWrapper, insets: .zero)
}

let infoBoxView: NSInfoBoxView = {
var viewModel = NSInfoBoxView.ViewModel(title: "vaccination_booking_info_info_title".ub_localized, subText: config?.vaccinationBookingInfo.value?.info ?? "vaccination_booking_info_info".ub_localized, image: UIImage(named: "ic-info"), titleColor: .ns_blue, subtextColor: .ns_blue)
var viewModel = NSInfoBoxView.ViewModel(title: "vaccination_booking_info_info_title".ub_localized,
subText: config?.vaccinationBookingInfo.value?.info ?? "vaccination_booking_info_info".ub_localized,
image: UIImage(named: "ic-info"),
titleColor: .ns_blue,
subtextColor: .ns_blue)

viewModel.titleLabelType = .textBold
viewModel.dynamicIconTintColor = .ns_blue
viewModel.backgroundColor = .ns_blueBackground
return .init(viewModel: viewModel)
}()

contentView.addSpacerView(2.0 * NSPadding.medium)

contentView.addArrangedView(infoBoxView, insets: UIEdgeInsets(top: 0.0, left: -NSPadding.medium, bottom: 0.0, right: -NSPadding.medium - NSPadding.small))

let cantonLabel = NSLabel(.textBold)
cantonLabel.text = "vaccination_canton_title".ub_localized

contentView.addSpacerView(NSPadding.large + NSPadding.small)
contentView.addArrangedSubview(cantonLabel)
contentView.addSpacerView(NSPadding.medium + 2.0)

for c in config?.vaccinationBookingCantons.value ?? [] {
let externalLink = NSExternalLinkButton(style: .normal(color: .ns_blue), size: .normal, linkType: .url, buttonTintColor: .ns_blue)
externalLink.title = c.name
externalLink.titleLabel?.numberOfLines = 1
externalLink.touchUpCallback = {
guard let url = URL(string: c.linkUrl) else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
let infoWrapper = UIView()
infoWrapper.addSubview(infoBoxView)
infoBoxView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(-NSPadding.medium - NSPadding.small)
}
contentView.addArrangedView(infoWrapper, insets: .zero)
}

contentView.addArrangedView(externalLink, insets: UIEdgeInsets(top: 0.0, left: -NSPadding.small, bottom: 0.0, right: -NSPadding.small))
private func vaccinationCheckButtonPressed() {
let urlString = config?.vaccinationBookingInfo.value?.impfcheckUrl ?? "vaccination_impf_check_url".ub_localized
if let url = URL(string: urlString) {
UIApplication.shared.open(url)
}
}
}
2 changes: 1 addition & 1 deletion DP3TApp/SharedUI/Views/NSErrorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class NSErrorView: UIView {
}

static func tracingErrorView(for state: UIStateModel.TracingState, isHomeScreen: Bool, action: ((NSErrorView?) -> Void)? = nil) -> NSErrorView? {
if let model = self.model(for: state, isHomeScreen: isHomeScreen, action: action) {
if let model = model(for: state, isHomeScreen: isHomeScreen, action: action) {
return NSErrorView(model: model)
}

Expand Down
10 changes: 5 additions & 5 deletions DP3TApp/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>covidcert</string>
</array>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>org.dpppt.exposure-notification</string>
Expand All @@ -20,7 +24,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<string>2.3.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>ENAPIVersion</key>
Expand All @@ -29,10 +33,6 @@
<string>$(EN_DEVELOPER_REGION)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>covidcert</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
36 changes: 18 additions & 18 deletions DP3TAppClip/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<string>2.3.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
Expand All @@ -29,17 +29,6 @@
<key>NSAppClipRequestLocationConfirmation</key>
<false/>
</dict>
<key>UIAppFonts</key>
<array>
<string>Inter-Regular.ttf</string>
<string>Inter-Black.ttf</string>
<string>Inter-Bold.ttf</string>
<string>Inter-ExtraBold.ttf</string>
<string>Inter-Light.ttf</string>
<string>Inter-Medium.ttf</string>
<string>Inter-SemiBold.ttf</string>
<string>Inter-ExtraLight.ttf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand All @@ -61,12 +50,6 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>telephony</string>
<string>bluetooth-le</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand All @@ -80,5 +63,22 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIAppFonts</key>
<array>
<string>Inter-Regular.ttf</string>
<string>Inter-Black.ttf</string>
<string>Inter-Bold.ttf</string>
<string>Inter-ExtraBold.ttf</string>
<string>Inter-Light.ttf</string>
<string>Inter-Medium.ttf</string>
<string>Inter-SemiBold.ttf</string>
<string>Inter-ExtraLight.ttf</string>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>telephony</string>
<string>bluetooth-le</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion DP3TAppTests/ConfigResponseBodyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import XCTest
class ConfigResponseBodyTests: XCTestCase {
func testParsing() {
let json = """
{"forceUpdate": false,"forceTraceShutdown": false,"infoBox": {"deInfoBox": {"title": "Hinweis","msg": "Info box body","url": "https://www.bag.admin.ch/","urlTitle": "Weitere Informationen"},"frInfoBox": null,"itInfoBox": null,"enInfoBox": null,"ptInfoBox": null,"esInfoBox": null,"sqInfoBox": null,"bsInfoBox": null,"hrInfoBox": null,"srInfoBox": null,"rmInfoBox": null},"sdkConfig": {"numberOfWindowsForExposure": 3,"eventThreshold": 0.8,"badAttenuationThreshold": 73,"contactAttenuationThreshold": 73},"iOSGaenSdkConfig": {"lowerThreshold": 53,"higherThreshold": 60,"factorLow": 1,"factorHigh": 0.5,"triggerThreshold": 15},"androidGaenSdkConfig": {"lowerThreshold": 53,"higherThreshold": 60,"factorLow": 1,"factorHigh": 0.5,"triggerThreshold": 15}, "interOpsCountries": ["CH", "LI", "DE"], "showVaccinationInfo": true, "vaccinationBookingCantons" : {}, "vaccinationBookingInfo": {} }
{"forceUpdate": false,"forceTraceShutdown": false,"infoBox": {"deInfoBox": {"title": "Hinweis","msg": "Info box body","url": "https://www.bag.admin.ch/","urlTitle": "Weitere Informationen"},"frInfoBox": null,"itInfoBox": null,"enInfoBox": null,"ptInfoBox": null,"esInfoBox": null,"sqInfoBox": null,"bsInfoBox": null,"hrInfoBox": null,"srInfoBox": null,"rmInfoBox": null},"sdkConfig": {"numberOfWindowsForExposure": 3,"eventThreshold": 0.8,"badAttenuationThreshold": 73,"contactAttenuationThreshold": 73},"iOSGaenSdkConfig": {"lowerThreshold": 53,"higherThreshold": 60,"factorLow": 1,"factorHigh": 0.5,"triggerThreshold": 15},"androidGaenSdkConfig": {"lowerThreshold": 53,"higherThreshold": 60,"factorLow": 1,"factorHigh": 0.5,"triggerThreshold": 15}, "interOpsCountries": ["CH", "LI", "DE"], "showVaccinationInfo": true, "vaccinationBookingInfo": {} }
"""
let config = try! JSONDecoder().decode(ConfigResponseBody.self, from: json.data(using: .utf8)!)
XCTAssertEqual(config.forceUpdate, false)
Expand Down
12 changes: 11 additions & 1 deletion Translations/bs.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@
"vaccination_info_homescreen_title" = "Još niste vakcinisani?";

/*Homescreen Impfhinweis: Titel fett*/
"vaccination_info_homescreen_title_bold" = "Zakažite sada termin ";
"vaccination_info_homescreen_title_bold" = "Zakažite sada termin";

/*Impfhinweis Detail: URL unten Weitere Informationen*/
"vaccination_booking_info_url" = "https://bag-coronavirus.ch/impfung/";
Expand All @@ -1899,3 +1899,13 @@

/*Impf-Hinweis Screen: Kanton Titel*/
"vaccination_canton_title" = "Izaberite svoj kanton";

/*vaccination booking screen info about Impf-Check (impf-check.ch)*/
"vaccination_impf_check_info_text" = "Provera vakcinisanja protiv Covida-19 pruža informacije o prvim i booster dozama i navigira Vas do odgovarajućeg kontakt mesta u Vašem kantonu.";

/*button title for link to impf-check.ch*/
"vaccination_impf_check_action" = "Na proveru vakcinisanja";

/*URL to ImpfCheck*/
"vaccination_impf_check_url" = "https://covid19.impf-check.ch/";
"vaccination_impf_check_title" = "Zakažite sada termin";
10 changes: 10 additions & 0 deletions Translations/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1983,3 +1983,13 @@

/*Impf-Hinweis Screen: Kanton Titel*/
"vaccination_canton_title" = "Wählen Sie Ihren Kanton";

/*vaccination booking screen info about Impf-Check (impf-check.ch)*/
"vaccination_impf_check_info_text" = "Der Covid-19 Impf-Check gibt Auskunft über Erst- sowie Auffrischimpfungen und führt Sie zur entsprechenden Anlaufstelle in Ihrem Kanton.";

/*button title for link to impf-check.ch*/
"vaccination_impf_check_action" = "Zum Impf-Check";

/*URL to ImpfCheck*/
"vaccination_impf_check_url" = "https://covid19.impf-check.ch/";
"vaccination_impf_check_title" = "Jetzt Termin buchen";
10 changes: 10 additions & 0 deletions Translations/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1927,3 +1927,13 @@

/*Impf-Hinweis Screen: Kanton Titel*/
"vaccination_canton_title" = "Select your canton";

/*vaccination booking screen info about Impf-Check (impf-check.ch)*/
"vaccination_impf_check_info_text" = "The COVID-19 Vaccination Check provides information on initial and booster vaccinations and guides you to the relevant point of contact in your canton.";

/*button title for link to impf-check.ch*/
"vaccination_impf_check_action" = "To the Vaccination Check";

/*URL to ImpfCheck*/
"vaccination_impf_check_url" = "https://covid19.impf-check.ch/";
"vaccination_impf_check_title" = "Book an appointment now";
10 changes: 10 additions & 0 deletions Translations/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1899,3 +1899,13 @@

/*Impf-Hinweis Screen: Kanton Titel*/
"vaccination_canton_title" = "Seleccione su cantón";

/*vaccination booking screen info about Impf-Check (impf-check.ch)*/
"vaccination_impf_check_info_text" = "El Vac-Check Covid-19 le informa sobre la vacunación inicial y la vacuna de refuerzo, y le indica cuál es la oficina competente en su cantón.";

/*button title for link to impf-check.ch*/
"vaccination_impf_check_action" = "Ir al Vac-Check";

/*URL to ImpfCheck*/
"vaccination_impf_check_url" = "https://covid19.impf-check.ch/";
"vaccination_impf_check_title" = "Concierte su cita ahora";
Loading

0 comments on commit d1033a6

Please sign in to comment.