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.qml52
1 files changed, 42 insertions, 10 deletions
diff --git a/kodereviewer/qml/PullRequestPage.qml b/kodereviewer/qml/PullRequestPage.qml
index e99d81b..219762a 100644
--- a/kodereviewer/qml/PullRequestPage.qml
+++ b/kodereviewer/qml/PullRequestPage.qml
@@ -56,11 +56,26 @@ Kirigami.ScrollablePage {
}
}
- CommentModel {
- id: commentModel
- pullRequest: root.pullRequest
+ Loader {
+ id: commentModelLoader
+ active: !!root.pullRequest
+ sourceComponent: CommentModel {
+ id: commentModel
+ pullRequest: root.pullRequest
+
+ onPullRequestChanged: root.connection.getPullRequestComments(root.pullRequest.number)
+ }
+ }
- onPullRequestChanged: root.connection.getPullRequestComments(root.pullRequest.number)
+ Loader {
+ id: fileModelLoader
+ active: !!root.pullRequest
+ sourceComponent: FileModel {
+ id: fileModel
+ pullRequest: root.pullRequest
+
+ onPullRequestChanged: root.connection.getFiles(root.pullRequest.number)
+ }
}
Kirigami.PlaceholderMessage {
@@ -91,11 +106,21 @@ Kirigami.ScrollablePage {
RowLayout {
QQC2.Label {
+ text: "Author"
+ elide: Text.ElideRight
+ }
+ QQC2.Label {
+ text: root.pullRequest ? root.pullRequest.username : ""
+ elide: Text.ElideLeft
+ }
+ }
+ RowLayout {
+ QQC2.Label {
text: "State: "
elide: Text.ElideRight
}
QQC2.Label {
- text: root.pullRequest.state
+ text: root.pullRequest ? root.pullRequest.state : ""
elide: Text.ElideLeft
}
}
@@ -105,16 +130,22 @@ Kirigami.ScrollablePage {
elide: Text.ElideRight
}
QQC2.Label {
- text: root.pullRequest.draft ? i18n("Yes") : i18n("No")
+ text: root.pullRequest ? root.pullRequest.draft ? i18n("Yes") : i18n("No") : ""
elide: Text.ElideLeft
}
}
+ Loader {
+ id: labelModelLoader
+ active: !!root.pullRequest
+ sourceComponent: LabelModel {
+ pullRequest: root.pullRequest
+ }
+ }
+
RowLayout {
Repeater {
- model: LabelModel {
- pullRequest: root.pullRequest
- }
+ model: labelModelLoader.item
delegate: Rectangle {
required property string name
required property string labelColor
@@ -150,13 +181,14 @@ Kirigami.ScrollablePage {
ColumnLayout {
visible: !!root.pullRequest && root.currentView == "comments"
Repeater {
- model: commentModel
+ model: commentModelLoader.item
delegate: CommentDelegate {}
}
}
FilesView {
visible: !!root.pullRequest && root.currentView == "files"
+ fileModel: fileModelLoader.item
}
footer: Kirigami.NavigationTabBar {