summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/Main.qml
diff options
context:
space:
mode:
authorMatias Linares <matias.linares@comprandoengrupo.net>2024-10-30 16:27:05 -0300
committerMatias Linares <matias.linares@comprandoengrupo.net>2024-10-30 17:49:36 -0300
commit10d04e65085712fe9206c08ac9600109a4bcfc8e (patch)
tree9d501981276d6fab599eb5482470d5f3501b6b32 /kodereviewer/qml/Main.qml
parentd46b4e7470e3115df34fc96ba2f8e59974f713be (diff)
downloadkodereviewer-10d04e65085712fe9206c08ac9600109a4bcfc8e.tar.gz
Add review changes dialog to new structuremain
Diffstat (limited to 'kodereviewer/qml/Main.qml')
-rw-r--r--kodereviewer/qml/Main.qml39
1 files changed, 30 insertions, 9 deletions
diff --git a/kodereviewer/qml/Main.qml b/kodereviewer/qml/Main.qml
index dc807fe..6c13d1e 100644
--- a/kodereviewer/qml/Main.qml
+++ b/kodereviewer/qml/Main.qml
@@ -28,6 +28,8 @@ Kirigami.ApplicationWindow {
project: root.project
}
+ property PullRequest pullRequest
+
Settings {
id: settings
property alias width: root.width
@@ -37,6 +39,28 @@ Kirigami.ApplicationWindow {
pageStack.initialPage: initPage
+ property list<Kirigami.Action> commonActions: [
+ Kirigami.Action {
+ id: reviewChangesAction
+ text: "Review changes"
+ icon.name: "preview-symbolic"
+ enabled: !!root.pullRequest
+ onTriggered: reviewChangesDialog.open()
+ }
+ ]
+
+
+ ReviewDialog {
+ id: reviewChangesDialog
+ onAccepted: {
+ root.connection.createReview(
+ root.pullRequest.number, root.pullRequest.last_commit,
+ reviewBodyText, event
+ )
+ clearForm()
+ }
+ }
+
Component {
id: initPage
WelcomePage {
@@ -50,7 +74,7 @@ Kirigami.ApplicationWindow {
Loader {
id: treeFileModelLoader
active: !!pullRequest
- property var pullRequest: undefined
+ property var pullRequest: root.pullRequest
sourceComponent: TreeFileModel {
pullRequest: treeFileModelLoader.pullRequest
@@ -66,10 +90,6 @@ Kirigami.ApplicationWindow {
id: contextDrawer
enabled: treeFileModelLoader.active
model: treeFileModelLoader.item
-
- onEnabledChanged: {
- print("Enabled? " + enabled)
- }
}
@@ -83,10 +103,7 @@ Kirigami.ApplicationWindow {
onPullRequestSelected: number => {
const pullRequest = project.pullRequest(number)
- pullRequestPageLoader.item.pullRequest = pullRequest
- commentsPageLoader.item.pullRequest = pullRequest
- reviewListPageLoader.item.pullRequest = pullRequest
- filesChangedPageLoader.item.pullRequest = pullRequest
+ root.pullRequest = pullRequest
treeFileModelLoader.pullRequest = pullRequest
}
}
@@ -102,6 +119,7 @@ Kirigami.ApplicationWindow {
active: root.isProjectSelected
sourceComponent: CommentPage {
connection: root.connection
+ pullRequest: root.pullRequest
}
}
@@ -110,6 +128,7 @@ Kirigami.ApplicationWindow {
active: root.isProjectSelected
sourceComponent: PullRequestDescriptionPage {
connection: root.connection
+ pullRequest: root.pullRequest
}
}
@@ -118,6 +137,7 @@ Kirigami.ApplicationWindow {
active: root.isProjectSelected
sourceComponent: ReviewListPage {
connection: root.connection
+ pullRequest: root.pullRequest
}
}
@@ -126,6 +146,7 @@ Kirigami.ApplicationWindow {
active: root.isProjectSelected
sourceComponent: FilesChangedPage {
connection: root.connection
+ pullRequest: root.pullRequest
}
}