feat(GODT-3121): finalize UI for KB suggestions.

This commit is contained in:
Xavier Michelon
2023-12-01 17:18:51 +01:00
parent 39b31abef8
commit 120ddbbcbb
3 changed files with 122 additions and 113 deletions

View File

@ -36,7 +36,7 @@ Item {
}
function showBugQuestion() {
bugQuestion.setCategoryId(root.categoryId);
bugQuestion.positionViewAtBegining();
bugQuestion.positionViewAtBeginning();
bugReportFlow.currentIndex = 1;
}
function showBugReport() {

View File

@ -18,9 +18,8 @@ import ".."
SettingsView {
id: root
property var selectedAddress
property var categoryId:-1
property var categoryId: -1
property string category: Backend.getBugCategory(root.categoryId)
property var suggestions: null
@ -53,6 +52,9 @@ SettingsView {
root.setDefaultValue();
}
ColumnLayout {
spacing: 32
Label {
colorScheme: root.colorScheme
text: qsTr("Send report")
@ -68,13 +70,12 @@ SettingsView {
Layout.minimumHeight: heightForLinesVisible(4)
colorScheme: root.colorScheme
textFormat: Text.MarkdownText
// set implicitHeight to explicit height because se don't
// want TextArea implicitHeight (which is height of all text)
// to be considered in SettingsView internal scroll view
implicitHeight: height
label: "Your answers to: " + qsTr(root.category);
readOnly : true
readOnly: true
}
ColumnLayout {
@ -99,8 +100,12 @@ SettingsView {
}
}
RowLayout {
spacing: 12
TextField {
id: address
Layout.preferredWidth: 1
Layout.fillWidth: true
colorScheme: root.colorScheme
label: qsTr("Your contact email")
@ -113,6 +118,7 @@ SettingsView {
}
TextField {
id: emailClient
Layout.preferredWidth: 1
Layout.fillWidth: true
colorScheme: root.colorScheme
label: qsTr("Your email client (including version)")
@ -123,37 +129,36 @@ SettingsView {
}
}
}
}
RowLayout {
spacing: 12
CheckBox {
id: includeLogs
checked: true
colorScheme: root.colorScheme
text: qsTr("Include my recent logs")
}
Button {
Layout.leftMargin: 12
colorScheme: root.colorScheme
secondary: true
text: qsTr("View logs")
onClicked: Backend.openExternalLink(Backend.logsPath)
}
}
TextEdit {
Label {
Layout.fillWidth: true
verticalAlignment: Qt.AlignVCenter
colorScheme: root.colorScheme
type: Label.Caption
color: root.colorScheme.text_weak
font.family: ProtonStyle.font_family
font.letterSpacing: ProtonStyle.caption_letter_spacing
font.pixelSize: ProtonStyle.caption_font_size
font.weight: ProtonStyle.fontWeight_400
readOnly: true
selectByMouse: true
selectedTextColor: root.colorScheme.text_invert
// No way to set lineHeight: ProtonStyle.caption_line_height
selectionColor: root.colorScheme.interaction_norm
text: qsTr("Reports are not end-to-end encrypted, please do not send any sensitive information.")
wrapMode: Text.WordWrap
}
}
Button {
id: sendButton
colorScheme: root.colorScheme
@ -174,13 +179,17 @@ SettingsView {
function onBugReportSendSuccess() {
root.bugReportWasSent();
}
function onReportBugFinished() {
sendButton.loading = false;
}
function onReceivedKnowledgeBaseSuggestions(suggestions) {
root.suggestions = suggestions
}
target: Backend
}
}
}
}

View File

@ -30,7 +30,7 @@ Item {
property bool fillHeight: false
default property alias items: content.children
function positionViewAtBegining() {
function positionViewAtBeginning() {
scrollView.ScrollBar.vertical.position = 0
}
signal back