summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/PullRequestPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'kodereviewer/qml/PullRequestPage.qml')
-rw-r--r--kodereviewer/qml/PullRequestPage.qml104
1 files changed, 95 insertions, 9 deletions
diff --git a/kodereviewer/qml/PullRequestPage.qml b/kodereviewer/qml/PullRequestPage.qml
index 5a687e9..e99d81b 100644
--- a/kodereviewer/qml/PullRequestPage.qml
+++ b/kodereviewer/qml/PullRequestPage.qml
@@ -20,6 +20,41 @@ Kirigami.ScrollablePage {
property string currentView: "info"
+ actions: [
+ Kirigami.Action {
+ id: reviewChangesAction
+ text: "Review changes"
+ icon.name: "preview-symbolic"
+ enabled: !!root.pullRequest
+ onTriggered: reviewChangesDialog.open()
+ }
+ ]
+
+ Kirigami.Dialog {
+ id: reviewChangesDialog
+ standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
+ title: i18nc("@title:window", "Review changes")
+ padding: Kirigami.Units.largeSpacing
+ preferredWidth: Kirigami.Units.gridUnit * 20
+ ColumnLayout {
+ MarkdownTextArea {
+ Layout.fillWidth: true
+ }
+ Kirigami.Separator {
+ Kirigami.FormData.isSection: true
+ Layout.fillWidth: true
+ }
+ QQC2.RadioButton {
+ text: "Approve"
+ }
+ QQC2.RadioButton {
+ text: "Comment"
+ }
+ QQC2.RadioButton {
+ text: "Request changes"
+ }
+ }
+ }
CommentModel {
id: commentModel
@@ -28,7 +63,6 @@ Kirigami.ScrollablePage {
onPullRequestChanged: root.connection.getPullRequestComments(root.pullRequest.number)
}
-
Kirigami.PlaceholderMessage {
visible: !root.pullRequest
anchors.centerIn: parent
@@ -36,11 +70,10 @@ Kirigami.ScrollablePage {
text: "Select a pull request"
}
- ColumnLayout {
- id: mainLayout
+ Kirigami.FormLayout {
+ id: descriptionLayout
visible: !!root.pullRequest && root.currentView == "info"
-
- spacing: Kirigami.Units.largeSpacing * 2
+ anchors.fill: parent
Kirigami.Heading {
Layout.fillWidth: true
@@ -52,9 +85,57 @@ Kirigami.ScrollablePage {
wrapMode: Text.WordWrap
}
- Kirigami.ListSectionHeader {
- Layout.fillWidth: true
- text: "description"
+ Kirigami.Separator {
+ Kirigami.FormData.isSection: true
+ }
+
+ RowLayout {
+ QQC2.Label {
+ text: "State: "
+ elide: Text.ElideRight
+ }
+ QQC2.Label {
+ text: root.pullRequest.state
+ elide: Text.ElideLeft
+ }
+ }
+ RowLayout {
+ QQC2.Label {
+ text: "Draft?: "
+ elide: Text.ElideRight
+ }
+ QQC2.Label {
+ text: root.pullRequest.draft ? i18n("Yes") : i18n("No")
+ elide: Text.ElideLeft
+ }
+ }
+
+ RowLayout {
+ Repeater {
+ model: LabelModel {
+ pullRequest: root.pullRequest
+ }
+ delegate: Rectangle {
+ required property string name
+ required property string labelColor
+ required property string textColor
+ color: labelColor
+ width: thelabel.implicitWidth
+ height: thelabel.implicitHeight
+ radius: 5
+ QQC2.Label {
+ id: thelabel
+ padding: Kirigami.Units.smallSpacing
+ text: name
+ color: textColor
+ }
+ }
+ }
+ }
+
+ Kirigami.Separator {
+ Kirigami.FormData.isSection: true
+ Kirigami.FormData.label: "Description"
}
MarkdownLabel {
@@ -62,7 +143,8 @@ Kirigami.ScrollablePage {
Layout.fillHeight: false
leftPadding: Kirigami.Units.largeSpacing
rightPadding: Kirigami.Units.largeSpacing
- text: root.pullRequest ? root.pullRequest.body : ""
+ text: root.pullRequest ?
+ (root.pullRequest.body != "" ? root.pullRequest.body : "*No description provided.*") : ""
}
}
ColumnLayout {
@@ -73,6 +155,10 @@ Kirigami.ScrollablePage {
}
}
+ FilesView {
+ visible: !!root.pullRequest && root.currentView == "files"
+ }
+
footer: Kirigami.NavigationTabBar {
actions: [
Kirigami.Action {