feat(GODT-2787): Tweaking Bug Report form with last Review.

This commit is contained in:
Romain Le Jeune
2023-08-11 05:39:34 +00:00
parent c90248920a
commit 12183fbf05
8 changed files with 47 additions and 15 deletions

View File

@ -27,7 +27,7 @@ SettingsView {
Label {
Layout.fillWidth: true
colorScheme: root.colorScheme
text: qsTr("What's the issue?")
text: qsTr("What do you want to report?")
type: Label.Heading
}

View File

@ -40,7 +40,7 @@ SettingsView {
Label {
Layout.fillWidth: true
colorScheme: root.colorScheme
text: qsTr("Describe the issue")
text: qsTr("Provide more details")
type: Label.Heading
}
@ -58,6 +58,7 @@ SettingsView {
font.letterSpacing: ProtonStyle.caption_letter_spacing
font.pixelSize: ProtonStyle.caption_font_size
font.weight: ProtonStyle.fontWeight_400
textFormat: Text.MarkdownText
readOnly: true
selectByMouse: true
selectedTextColor: root.colorScheme.text_invert
@ -87,8 +88,6 @@ SettingsView {
QuestionItem {
Layout.fillWidth: true
implicitWidth: parent.implicitWidth
colorScheme: root.colorScheme
showSeparator: index < (root.questionSet.length - 1)

View File

@ -65,6 +65,7 @@ SettingsView {
Layout.fillWidth: true
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)

View File

@ -133,7 +133,7 @@ Item {
property string text: {
return checkedButton ? checkedButton.text : "";
}
property bool error: root.mandatory
property bool error: false
function setDefaultValue(defaultValue) {
const values = root.type === root._typeChoice ? defaultValue : [];
@ -176,7 +176,7 @@ Item {
}
return str.slice(0, -delimitor.length);
}
property bool error: root.mandatory
property bool error: false
function setDefaultValue(defaultValue) {
const values = root.type === root._typeMutlichoice ? defaultValue.split(delimitor) : [];
@ -207,13 +207,43 @@ Item {
visible: root.type === root._typeMutlichoice
}
}
RowLayout {
id: footerLayout
Layout.fillWidth: true
spacing: 0
visible: {
if (root.type === root._typeOpen)
return false
return root.error
}
ColorImage {
id: errorIcon
Layout.rightMargin: 4
color: root.colorScheme.signal_danger
height: errorChoice.height
source: "/qml/icons/ic-exclamation-circle-filled.svg"
sourceSize.height: errorChoice.height
}
Label {
id: errorChoice
Layout.fillWidth: true
color: root.colorScheme.signal_danger
colorScheme: root.colorScheme
text: "Field is mandatory"
type: Label.LabelType.Caption_semibold
}
}
}
}
Rectangle {
anchors.bottom: root.bottom
anchors.left: root.left
anchors.right: root.right
color: colorScheme.border_weak
color: root.colorScheme.border_weak
height: root._lineHeight
visible: root.showSeparator
}

View File

@ -7,7 +7,7 @@
{
"name": "I cannot find emails in my email client",
"questions": [0,5,6,4],
"hint": "e.g., missing old emails or not receiving new emails"
"hint": "For example, missing old emails or not receiving new emails"
},
{
"name": "I am not able to send emails",
@ -17,12 +17,12 @@
{
"name": "Bridge is not starting correctly",
"questions": [0,2,3,4],
"hint": "e.g., Bridge does not autostart or shows an error at startup"
"hint": "For example, Bridge does not autostart or shows an error at startup"
},
{
"name": "Bridge is running slow",
"questions": [0,2,7,4],
"hint": "e.g., delay in receiving email or high resource consumption"
"hint": "For example, delay in receiving email or high resource consumption"
},
{
"name": "Something else",
@ -33,7 +33,7 @@
"questions": [
{
"id": 0,
"text": "What happened? Please also let us know if you received any error messages.",
"text": "Please describe what happened and include any error messages.",
"tips": "Type your answer here",
"type": "open",
"mandatory": true,
@ -81,7 +81,7 @@
},
{
"id": 7,
"text": "Which of these issues are you facing?",
"text": "Which of these issues are you experiencing?",
"type": "multichoice",
"answerList": ["Emails arrive with a delay", "Emails are sending slowly", "Bridge is slow to launch", "Bridge is slowing down my computer"]
}

View File

@ -37,6 +37,7 @@ Item {
anchors.fill: parent
clip: true
ScrollBar.vertical.policy: ScrollBar.vertical.size < 1.0 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff;
Component.onCompleted: contentItem.boundsBehavior = Flickable.StopAtBounds // Disable the springy effect when scroll reaches top/bottom.
Item {

View File

@ -140,7 +140,7 @@ TEST_F(BugReportFlowFixture, validFile) {
EXPECT_TRUE(flow_.setAnswer(0, "pwet"));
EXPECT_FALSE(flow_.setAnswer(1, "pwet"));
EXPECT_EQ(flow_.collectAnswers(0), " > What happened?\n\rpwet\n\r");
EXPECT_EQ(flow_.collectAnswers(0), "#### What happened?\n\r> pwet\n\r");
EXPECT_EQ(flow_.collectAnswers(1), "");
EXPECT_EQ(flow_.getAnswer(0), "pwet");
EXPECT_EQ(flow_.getAnswer(1), "");

View File

@ -131,8 +131,9 @@ QString BugReportFlow::collectAnswers(quint8 categoryId) const {
const QString& answer = getAnswer(var.toInt());
if (answer.isEmpty())
continue;
answers += " > " + questions_[var.toInt()].toMap()["text"].toString() + "\n\r";
answers += answer + "\n\r";
answers += "#### " + questions_[var.toInt()].toMap()["text"].toString() + "\n\r";
for (const QString& line : answer.split("\n"))
answers += "> " + line + "\n\r";
}
return answers;
}