diff options
author | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-10-04 18:30:17 -0300 |
---|---|---|
committer | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-10-04 18:30:17 -0300 |
commit | e9c7736ff83b9003eba960edebd2653bd5a4021f (patch) | |
tree | 81c2da8c4d1c79f465e6eb1e35f22ec597acd2ef /kodereviewer/qml/PullRequestPage.qml | |
parent | 332828d03ae455c9a3ada0f57a08bf0942082824 (diff) | |
download | kodereviewer-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.qml | 52 |
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 { |