summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/PullRequestPage.qml
diff options
context:
space:
mode:
authorMatias Linares <matias.linares@comprandoengrupo.net>2024-10-04 18:30:17 -0300
committerMatias Linares <matias.linares@comprandoengrupo.net>2024-10-04 18:30:17 -0300
commite9c7736ff83b9003eba960edebd2653bd5a4021f (patch)
tree81c2da8c4d1c79f465e6eb1e35f22ec597acd2ef /kodereviewer/qml/PullRequestPage.qml
parent332828d03ae455c9a3ada0f57a08bf0942082824 (diff)
downloadkodereviewer-e9c7736ff83b9003eba960edebd2653bd5a4021f.tar.gz
Fix a lot of warnings and add file view
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 {