Report Content v2 (#659)

* created the empty files

* set up the view content

* connected the Room Coordinator to the ReportContent Coordinator

* added the loading indicators and the dismiss behaviour

* almost completed but I need to display the success indicator when the report is sent succesfully

* completed

* added an untranslated string

* tests

* Update ElementX/Sources/Screens/RoomScreen/RoomScreenCoordinator.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update ElementX/Sources/Screens/ReportContent/View/ReportContentScreen.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* pr comment

* pr suggestion

* removing unused identifiers

* fixing compilation error

* added a form text editor view

* changelog

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-03-02 19:24:10 +01:00
committed by GitHub
parent 1c09a7eace
commit eed031c9cc
27 changed files with 472 additions and 85 deletions
@@ -57,7 +57,7 @@ final class BugReportCoordinator: CoordinatorProtocol {
case .cancel:
self.completion?(.cancel)
case let .submitStarted(progressTracker):
self.startLoading(label: ElementL10n.bugReportScreenSending, progressPublisher: progressTracker)
self.startLoading(label: ElementL10n.sending, progressPublisher: progressTracker)
case .submitFinished:
self.stopLoading()
self.completion?(.finish)
@@ -61,35 +61,10 @@ struct BugReportScreen: View {
}
}
@ViewBuilder
private var descriptionTextEditor: some View {
ZStack(alignment: .topLeading) {
RoundedRectangle(cornerRadius: 14, style: .continuous)
.fill(Color.element.formRowBackground)
TextEditor(text: $context.reportText)
.tint(.element.brand)
.padding(.horizontal, 10)
.padding(.vertical, 4)
.cornerRadius(14)
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.report)
.scrollContentBackground(.hidden)
if context.reportText.isEmpty {
Text(ElementL10n.bugReportScreenDescription)
.font(.element.body)
.foregroundColor(Color.element.secondaryContent)
.padding(.horizontal, 16)
.padding(.vertical, 12)
.allowsHitTesting(false)
}
RoundedRectangle(cornerRadius: 14, style: .continuous)
.stroke(Color.element.quaternaryContent)
}
.frame(maxWidth: .infinity)
.frame(height: 220)
.font(.body)
FormTextEditor(text: $context.reportText,
placeholder: ElementL10n.bugReportScreenDescription,
editorAccessibilityIdentifier: A11yIdentifiers.bugReportScreen.report)
}
@ViewBuilder
@@ -164,7 +139,6 @@ struct BugReportScreen: View {
context.send(viewAction: .submit)
}
.disabled(context.reportText.count < 5)
.accessibilityIdentifier(A11yIdentifiers.bugReportScreen.send)
}
}
}