mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 08:06:59 +00:00
feat(GODT-2787): Tweaking Bug Report form with last Review.
This commit is contained in:
@ -27,7 +27,7 @@ SettingsView {
|
|||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
text: qsTr("What's the issue?")
|
text: qsTr("What do you want to report?")
|
||||||
type: Label.Heading
|
type: Label.Heading
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ SettingsView {
|
|||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
text: qsTr("Describe the issue")
|
text: qsTr("Provide more details")
|
||||||
type: Label.Heading
|
type: Label.Heading
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +58,7 @@ SettingsView {
|
|||||||
font.letterSpacing: ProtonStyle.caption_letter_spacing
|
font.letterSpacing: ProtonStyle.caption_letter_spacing
|
||||||
font.pixelSize: ProtonStyle.caption_font_size
|
font.pixelSize: ProtonStyle.caption_font_size
|
||||||
font.weight: ProtonStyle.fontWeight_400
|
font.weight: ProtonStyle.fontWeight_400
|
||||||
|
textFormat: Text.MarkdownText
|
||||||
readOnly: true
|
readOnly: true
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
selectedTextColor: root.colorScheme.text_invert
|
selectedTextColor: root.colorScheme.text_invert
|
||||||
@ -87,8 +88,6 @@ SettingsView {
|
|||||||
QuestionItem {
|
QuestionItem {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
implicitWidth: parent.implicitWidth
|
|
||||||
|
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
showSeparator: index < (root.questionSet.length - 1)
|
showSeparator: index < (root.questionSet.length - 1)
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,7 @@ SettingsView {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumHeight: heightForLinesVisible(4)
|
Layout.minimumHeight: heightForLinesVisible(4)
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
|
textFormat: Text.MarkdownText
|
||||||
|
|
||||||
// set implicitHeight to explicit height because se don't
|
// set implicitHeight to explicit height because se don't
|
||||||
// want TextArea implicitHeight (which is height of all text)
|
// want TextArea implicitHeight (which is height of all text)
|
||||||
|
|||||||
@ -133,7 +133,7 @@ Item {
|
|||||||
property string text: {
|
property string text: {
|
||||||
return checkedButton ? checkedButton.text : "";
|
return checkedButton ? checkedButton.text : "";
|
||||||
}
|
}
|
||||||
property bool error: root.mandatory
|
property bool error: false
|
||||||
|
|
||||||
function setDefaultValue(defaultValue) {
|
function setDefaultValue(defaultValue) {
|
||||||
const values = root.type === root._typeChoice ? defaultValue : [];
|
const values = root.type === root._typeChoice ? defaultValue : [];
|
||||||
@ -176,7 +176,7 @@ Item {
|
|||||||
}
|
}
|
||||||
return str.slice(0, -delimitor.length);
|
return str.slice(0, -delimitor.length);
|
||||||
}
|
}
|
||||||
property bool error: root.mandatory
|
property bool error: false
|
||||||
|
|
||||||
function setDefaultValue(defaultValue) {
|
function setDefaultValue(defaultValue) {
|
||||||
const values = root.type === root._typeMutlichoice ? defaultValue.split(delimitor) : [];
|
const values = root.type === root._typeMutlichoice ? defaultValue.split(delimitor) : [];
|
||||||
@ -207,13 +207,43 @@ Item {
|
|||||||
visible: root.type === root._typeMutlichoice
|
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 {
|
Rectangle {
|
||||||
anchors.bottom: root.bottom
|
anchors.bottom: root.bottom
|
||||||
anchors.left: root.left
|
anchors.left: root.left
|
||||||
anchors.right: root.right
|
anchors.right: root.right
|
||||||
color: colorScheme.border_weak
|
color: root.colorScheme.border_weak
|
||||||
height: root._lineHeight
|
height: root._lineHeight
|
||||||
visible: root.showSeparator
|
visible: root.showSeparator
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
{
|
{
|
||||||
"name": "I cannot find emails in my email client",
|
"name": "I cannot find emails in my email client",
|
||||||
"questions": [0,5,6,4],
|
"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",
|
"name": "I am not able to send emails",
|
||||||
@ -17,12 +17,12 @@
|
|||||||
{
|
{
|
||||||
"name": "Bridge is not starting correctly",
|
"name": "Bridge is not starting correctly",
|
||||||
"questions": [0,2,3,4],
|
"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",
|
"name": "Bridge is running slow",
|
||||||
"questions": [0,2,7,4],
|
"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",
|
"name": "Something else",
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"questions": [
|
"questions": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"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",
|
"tips": "Type your answer here",
|
||||||
"type": "open",
|
"type": "open",
|
||||||
"mandatory": true,
|
"mandatory": true,
|
||||||
@ -81,7 +81,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"text": "Which of these issues are you facing?",
|
"text": "Which of these issues are you experiencing?",
|
||||||
"type": "multichoice",
|
"type": "multichoice",
|
||||||
"answerList": ["Emails arrive with a delay", "Emails are sending slowly", "Bridge is slow to launch", "Bridge is slowing down my computer"]
|
"answerList": ["Emails arrive with a delay", "Emails are sending slowly", "Bridge is slow to launch", "Bridge is slowing down my computer"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
clip: true
|
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.
|
Component.onCompleted: contentItem.boundsBehavior = Flickable.StopAtBounds // Disable the springy effect when scroll reaches top/bottom.
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|||||||
@ -140,7 +140,7 @@ TEST_F(BugReportFlowFixture, validFile) {
|
|||||||
EXPECT_TRUE(flow_.setAnswer(0, "pwet"));
|
EXPECT_TRUE(flow_.setAnswer(0, "pwet"));
|
||||||
EXPECT_FALSE(flow_.setAnswer(1, "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_.collectAnswers(1), "");
|
||||||
EXPECT_EQ(flow_.getAnswer(0), "pwet");
|
EXPECT_EQ(flow_.getAnswer(0), "pwet");
|
||||||
EXPECT_EQ(flow_.getAnswer(1), "");
|
EXPECT_EQ(flow_.getAnswer(1), "");
|
||||||
|
|||||||
@ -131,8 +131,9 @@ QString BugReportFlow::collectAnswers(quint8 categoryId) const {
|
|||||||
const QString& answer = getAnswer(var.toInt());
|
const QString& answer = getAnswer(var.toInt());
|
||||||
if (answer.isEmpty())
|
if (answer.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
answers += " > " + questions_[var.toInt()].toMap()["text"].toString() + "\n\r";
|
answers += "#### " + questions_[var.toInt()].toMap()["text"].toString() + "\n\r";
|
||||||
answers += answer + "\n\r";
|
for (const QString& line : answer.split("\n"))
|
||||||
|
answers += "> " + line + "\n\r";
|
||||||
}
|
}
|
||||||
return answers;
|
return answers;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user