mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Contact me added in Bug Report Screen (#1307)
* contact me added * fixing tests
This commit is contained in:
@@ -33,6 +33,7 @@ struct BugReportScreenViewState: BindableState {
|
||||
struct BugReportScreenViewStateBindings {
|
||||
var reportText: String
|
||||
var sendingLogsEnabled: Bool
|
||||
var canContact: Bool
|
||||
}
|
||||
|
||||
enum BugReportScreenViewAction {
|
||||
|
||||
@@ -38,7 +38,7 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
||||
self.userID = userID
|
||||
self.deviceID = deviceID
|
||||
|
||||
let bindings = BugReportScreenViewStateBindings(reportText: "", sendingLogsEnabled: true)
|
||||
let bindings = BugReportScreenViewStateBindings(reportText: "", sendingLogsEnabled: true, canContact: false)
|
||||
super.init(initialViewState: BugReportScreenViewState(screenshot: screenshot,
|
||||
bindings: bindings,
|
||||
isModallyPresented: isModallyPresented))
|
||||
@@ -84,6 +84,7 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
||||
text: context.reportText,
|
||||
includeLogs: context.sendingLogsEnabled,
|
||||
includeCrashLog: true,
|
||||
canContact: context.canContact,
|
||||
githubLabels: [],
|
||||
files: files)
|
||||
|
||||
|
||||
@@ -26,10 +26,9 @@ struct BugReportScreen: View {
|
||||
var body: some View {
|
||||
Form {
|
||||
textFieldSection
|
||||
|
||||
attachScreenshotSection
|
||||
|
||||
sendLogsSection
|
||||
canContactSection
|
||||
}
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
.compoundForm()
|
||||
@@ -77,6 +76,18 @@ struct BugReportScreen: View {
|
||||
.compoundFormSection()
|
||||
}
|
||||
|
||||
private var canContactSection: some View {
|
||||
Section {
|
||||
Toggle(L10n.screenBugReportContactMeTitle, isOn: $context.canContact)
|
||||
.toggleStyle(.compoundForm)
|
||||
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.canContact)
|
||||
} footer: {
|
||||
Text(L10n.screenBugReportContactMe)
|
||||
.compoundFormSectionFooter()
|
||||
}
|
||||
.compoundFormSection()
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var attachScreenshotSection: some View {
|
||||
Section {
|
||||
|
||||
Reference in New Issue
Block a user