From 2ad0fa34dc82b89b7f10554ff5152f41f2f635ba Mon Sep 17 00:00:00 2001 From: PaulGarewal Date: Mon, 23 Dec 2024 14:17:20 -0800 Subject: [PATCH] feat: updated conditional field about drain plugs - when first drainplug field toggled to false, second will also be false in all scenarios - updated emojis for a cleaner ui experience --- .github/workflows/main.yaml | 2 +- ipad.xcodeproj/project.pbxproj | 4 ++-- .../WatercraftInspectionViewController.swift | 23 +++++++++++-------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d49c932..c32ef19 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,7 +15,7 @@ jobs: ARCHIVE_NAME: ${{ 'invasivesbc-mussels.iOS.xcarchive' }} EXPORT_DIR: ${{ 'export' }} IPA_NAME: ${{ 'invasivesbc-mussels.iOS.ipa' }} - APP_BUILD_VERSION: "2.7.4" + APP_BUILD_VERSION: "2.7.5" steps: - uses: maxim-lobanov/setup-xcode@v1 diff --git a/ipad.xcodeproj/project.pbxproj b/ipad.xcodeproj/project.pbxproj index 73cd03d..f8cb4cd 100644 --- a/ipad.xcodeproj/project.pbxproj +++ b/ipad.xcodeproj/project.pbxproj @@ -2063,7 +2063,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.8.6; + MARKETING_VERSION = 2.8.7; PRODUCT_BUNDLE_IDENTIFIER = ca.bc.gov.InvasivesBC; PRODUCT_NAME = Inspect; PROVISIONING_PROFILE_SPECIFIER = "InvasivesBC Muscles - 2023/24"; @@ -2093,7 +2093,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.8.6; + MARKETING_VERSION = 2.8.7; PRODUCT_BUNDLE_IDENTIFIER = ca.bc.gov.InvasivesBC; PRODUCT_NAME = Inspect; PROVISIONING_PROFILE_SPECIFIER = "InvasivesBC Muscles - 2023/24"; diff --git a/ipad/ViewControllers/Watercraft Inspections/WatercraftInspectionViewController.swift b/ipad/ViewControllers/Watercraft Inspections/WatercraftInspectionViewController.swift index 04a28da..e4fae3b 100644 --- a/ipad/ViewControllers/Watercraft Inspections/WatercraftInspectionViewController.swift +++ b/ipad/ViewControllers/Watercraft Inspections/WatercraftInspectionViewController.swift @@ -309,7 +309,7 @@ class WatercraftInspectionViewController: BaseViewController { // Basic case errorInspectionTime = "Time of Inspection." case errorNumberOfPeopleInParty = "Number of people in the party." - case errorIsNoWatercraftTypeSelected = "Watercraft Type needed:\n · Non-Motorized\n · Simple\n · Complex\n · Very Complex" + case errorIsNoWatercraftTypeSelected = "Watercraft Type needed:\n ⛵ Non-Motorized\n ⛵ Simple\n ⛵ Complex\n ⛵ Very Complex" // Watercraft Details case errorPreviousAISKnowledge = "Source for Previous Knowledge of AIS or Clean, Drain, Dry." @@ -715,16 +715,8 @@ class WatercraftInspectionViewController: BaseViewController { private func getEmoji(for error: String) -> String { if error.lowercased().contains("time") { return "⏰" - } else if error.lowercased().contains("waterbody") { - return "🌊" - } else if error.lowercased().contains("destination") { - return "🎯" - } else if error.lowercased().contains("seal") { - return "🏷️" - } else if error.lowercased().contains("decontamination") { - return "💧" } else { - return "❌" + return "🔴" } } @@ -751,6 +743,17 @@ class WatercraftInspectionViewController: BaseViewController { // Keys that need a pop up/ additional actions let highRiskFieldKeys = WatercraftInspectionFormHelper.getHighriskAssessmentFieldsFields().map{ $0.key} + // Handle watercraftHasDrainplugs changes + if item.key == "watercraftHasDrainplugs" { + let newValue = item.value.get(type: item.type) as? Bool ?? false + if !newValue { + // If watercraftHasDrainplugs is set to false, also set drainplugRemovedAtInspection to false + model.set(value: false, for: "drainplugRemovedAtInspection") + model.set(value: false, for: "drainplugRemovedAtInspectionInteracted") + self.collectionView.reloadData() + } + } + if highRiskFieldKeys.contains(item.key) { let value = item.value.get(type: item.type) as? Bool let alreadyHasHighRiskForm = !model.highRiskAssessments.isEmpty