Skip to content

Commit

Permalink
Merge pull request #61 from flighttactics/cf/nav-fix
Browse files Browse the repository at this point in the history
Onboarding Flow Fix for iPad Users
  • Loading branch information
CoryFoy authored Jun 30, 2024
2 parents 5c43f3e + 6035eec commit 0413bb8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
12 changes: 6 additions & 6 deletions TAKTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = TAKTracker/TAKTracker.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_ASSET_PATHS = "TAKTracker/Preview\\ Content";
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -934,7 +934,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = TAKTracker/TAKTracker.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_ASSET_PATHS = "TAKTracker/Preview\\ Content";
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -972,7 +972,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -994,7 +994,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1014,7 +1014,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.1;
Expand All @@ -1032,7 +1032,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.1;
Expand Down
3 changes: 1 addition & 2 deletions TAKTracker/Data Models/SettingsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ class SettingsStore: ObservableObject {


func storeIdentity(identity: SecIdentity, label: String) {

//Clean up any existing identities
clearAllIdentities()
self.clearAllIdentities()

//Add the new identity in
let addQuery: [String: Any] = [kSecValueRef as String: identity,
Expand Down
24 changes: 13 additions & 11 deletions TAKTracker/Parsers/TAKDataPackageParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,20 @@ class TAKDataPackageParser: NSObject {
func storeUserCertificate(packageContents: DataPackageContents) {
TAKLogger.debug("[TAKDataPackageParser]: Storing User Certificate")

//Parse the cert file
let parsedCert = PKCS12(data: packageContents.userCertificate, password: packageContents.userCertificatePassword)

guard let identity = parsedCert.identity else {
parsingErrors.append("No User Certificate found")
TAKLogger.error("[TAKDataPackageParser]: Identity was not present in the parsed cert")
return
DispatchQueue.global(qos: .background).async {
//Parse the cert file
let parsedCert = PKCS12(data: packageContents.userCertificate, password: packageContents.userCertificatePassword)

guard let identity = parsedCert.identity else {
self.parsingErrors.append("No User Certificate found")
TAKLogger.error("[TAKDataPackageParser]: Identity was not present in the parsed cert")
return
}

SettingsStore.global.storeIdentity(identity: identity, label: packageContents.serverURL)

TAKLogger.debug("[TAKDataPackageParser]: User Certificate Stored")
}

SettingsStore.global.storeIdentity(identity: identity, label: packageContents.serverURL)

TAKLogger.debug("[TAKDataPackageParser]: User Certificate Stored")
}

func storeServerCertificate(packageContents: DataPackageContents) {
Expand Down
1 change: 1 addition & 0 deletions TAKTracker/Screens/MainScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ struct MapView: UIViewRepresentable {
mapView.mapType = MKMapType(rawValue: UInt(mapType))!
mapView.layer.borderColor = UIColor.black.cgColor
mapView.layer.borderWidth = 1.0
mapView.isHidden = false
return mapView
}

Expand Down
3 changes: 2 additions & 1 deletion TAKTracker/Screens/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct OnboardingView: View {
case .ConnectToServer:
HStack {
Spacer()
Text("Connect to a TAK Server?")
Text("Would you like to connect to a TAK Server?")
.bold()
.listRowSeparator(.hidden)
Spacer()
Expand Down Expand Up @@ -157,5 +157,6 @@ struct OnboardingView: View {
Spacer()
}
}
.navigationViewStyle(.stack)
}
}
12 changes: 6 additions & 6 deletions TAKTracker/Screens/SettingsScreens/ConnectionOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,19 @@ struct DataPackageEnrollment: View {
VStack(alignment: .center) {
HStack {
Button {
isProcessingDataPackage = true
isShowingFilePicker.toggle()
} label: {
HStack {
Text("Upload Data Package")
Text("Connect with a Data Package")
Spacer()
Image(systemName: "square.and.arrow.up")
.multilineTextAlignment(.trailing)
}
.contentShape(Rectangle())

}
.buttonStyle(.plain)

.fileImporter(isPresented: $isShowingFilePicker, allowedContentTypes: [.zip], allowsMultipleSelection: false, onCompletion: { results in

switch results {
case .success(let fileurls):
isProcessingDataPackage = true
Expand All @@ -210,7 +208,9 @@ struct DataPackageEnrollment: View {
TAKLogger.error("Unable to securely access \(String(describing: fileurl))")
}
}
isProcessingDataPackage = false
case .failure(let error):
isProcessingDataPackage = false
TAKLogger.debug(String(describing: error))
}

Expand All @@ -229,7 +229,7 @@ struct ConnectionOptions: View {

var body: some View {
NavigationLink(destination: ConnectionOptionsScreen(isProcessingDataPackage: $isProcessingDataPackage)) {
Text("Connect to a TAK Server")
Text("Connect with credentials")
}
DataPackageEnrollment(isProcessingDataPackage: $isProcessingDataPackage)
}
Expand Down Expand Up @@ -348,7 +348,7 @@ struct ConnectionOptionsScreen: View {

Section(header:
Text("Advanced Options")
.font(.system(size: 14, weight: .medium))
.font(.system(size: 14, weight: .medium))
) {
VStack {
HStack {
Expand Down

0 comments on commit 0413bb8

Please sign in to comment.