-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added additional report info and extended UI customisation #1
Merged
Kaww
merged 7 commits into
Kaww:main
from
lawmaestro:feature/add-additional-report-info-and-extend-customisation
Jan 29, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
549c5f8
Added additional report info to notion API integration
lawmaestro b9d41c7
Corrected typo in english "oops" error text
lawmaestro 91d8383
Added option to customise the text foreground colour for the cancel a…
lawmaestro 16cd76b
Submit text color is now gray when the button is disabled
lawmaestro 229e0ca
Removed needlessly added localisations
lawmaestro 30d1cb7
Updated inline with MR feedback
lawmaestro e5b36c8
Added basic level of accessibility identifiers to support UI testing
lawmaestro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
import UIKit | ||
|
||
public struct FeedbackFormData { | ||
let email: String | ||
let message: String | ||
|
||
let deviceModelIdentifier: String | ||
let systemNameAndVersion: String | ||
let appVersion: String | ||
let language: String | ||
|
||
public init( | ||
email: String, | ||
message: String | ||
) { | ||
self.email = email | ||
self.message = message | ||
|
||
deviceModelIdentifier = UIDevice.modelIdentifier | ||
systemNameAndVersion = "\(UIDevice.current.systemName) \(UIDevice.current.systemVersion)" | ||
appVersion = "\(Bundle.main.appVersionLong) (\(Bundle.main.appBuild))" | ||
language = Locale.current.localizedString(forIdentifier: Locale.current.identifier) ?? Locale.current.identifier | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Foundation | ||
|
||
extension Bundle { | ||
var appBuild: String { getInfo("CFBundleVersion") } | ||
var appVersionLong: String { getInfo("CFBundleShortVersionString") } | ||
var appVersionShort: String { getInfo("CFBundleShortVersion") } | ||
|
||
private func getInfo(_ string: String) -> String { | ||
infoDictionary?[string] as? String ?? "⚠️" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import UIKit | ||
|
||
extension UIDevice { | ||
|
||
/// The device model identifier e.g. "iPhone14,5" (iPhone 13) or "Simulator" | ||
static var modelIdentifier: String { | ||
var systemInfo = utsname() | ||
uname(&systemInfo) | ||
let machineMirror = Mirror(reflecting: systemInfo.machine) | ||
let identifier = machineMirror.children.reduce("") { identifier, element in | ||
guard let value = element.value as? Int8, value != 0 else { return identifier } | ||
return identifier + String(UnicodeScalar(UInt8(value))) | ||
} | ||
|
||
switch identifier { | ||
case "i386", "x86_64": | ||
return "Simulator" | ||
default: | ||
return identifier | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ extension View { | |
} | ||
} | ||
#endif | ||
|
||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ I can't check that now but I remember I added plateforme support for MacOS in the
Package.swift
. I'm wondering then if this won't break because UIKit can't be imported on MacOS.Can you have a look ? It's not critical, you can remove MacOS support if needed 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will. I hadn't noticed there was Mac support in the
Package.swift
there are however several existing compilation issues, including existing UIKit imports, use of iOS specific SwiftUI view modifiers which mean it would require a bit more work to get running on Mac. For that reason, I've removed support as per your suggestion.