diff --git a/Iceberg-Plugin-GitHub.package/IceGitHubNewPullRequestAction.class/instance/basicExecute.st b/Iceberg-Plugin-GitHub.package/IceGitHubNewPullRequestAction.class/instance/basicExecute.st index 79644b7882..31ce9f43d5 100644 --- a/Iceberg-Plugin-GitHub.package/IceGitHubNewPullRequestAction.class/instance/basicExecute.st +++ b/Iceberg-Plugin-GitHub.package/IceGitHubNewPullRequestAction.class/instance/basicExecute.st @@ -3,22 +3,26 @@ basicExecute credentials := IceGitHubAPI ensureCredentials. - remote ifNil: [ + remote ifNil: [ remote := self repository branch hasUpstream ifTrue: [ self repository branch upstream remote ] - ifFalse: [ self askRemote: self repository ]. + ifFalse: [ self askRemote: self repository ] ]. (self validateMakePullRequestOn: self repository) ifFalse: [ ^ #() ]. - + (IceGitHubCreatePullRequestModel - repository: self repository + repository: self repository credentials: self credentials headRemote: remote) - setModal: true; + setModal: true; onAccept: [ :pullRequest | - [ - pullRequest send. - UIManager default inform: 'Pull request created.' ] - on: IceGitHubError do: [ :e | self reportError: e ] ]; - openWithSpec \ No newline at end of file + [ | pullRequestDatas url | + pullRequestDatas := pullRequest send. + url := pullRequestDatas at: 'html_url'. + UIManager default + inform: 'Pull request created. Click to view on Github.' + actionOnClick: [ self class environment at: #WebBrowser ifPresent: [ :webBrowser | webBrowser openOn: url ] ifAbsent: [ self inform: ('Cannot open "{1}" because the project WebBrowser is not present by default in Pharo 6.' format: { url }) ] ] ] + on: IceGitHubError + do: [ :e | self reportError: e ] ]; + openWithSpec \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceGitHubPullRequestDefinition.class/instance/send.st b/Iceberg-Plugin-GitHub.package/IceGitHubPullRequestDefinition.class/instance/send.st index 479e26c762..ed3cb8d10c 100644 --- a/Iceberg-Plugin-GitHub.package/IceGitHubPullRequestDefinition.class/instance/send.st +++ b/Iceberg-Plugin-GitHub.package/IceGitHubPullRequestDefinition.class/instance/send.st @@ -9,7 +9,7 @@ send 'body' -> self body. } asDictionary. - IceGitHubAPI new + ^ IceGitHubAPI new credentials: self credentials; addPullRequest: self baseRemote owner project: self baseRemote projectBasename diff --git a/Iceberg-Plugin-GitHub.package/MorphicUIManager.extension/instance/inform.actionOnClick..st b/Iceberg-Plugin-GitHub.package/MorphicUIManager.extension/instance/inform.actionOnClick..st new file mode 100644 index 0000000000..242f7222cc --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/MorphicUIManager.extension/instance/inform.actionOnClick..st @@ -0,0 +1,8 @@ +*Iceberg-Plugin-GitHub +inform: aStringOrText actionOnClick: aBlock + "Display a message for the user to read and then dismiss. When clicked, execute an action." + + (ProvideAnswerNotification signal: aStringOrText) ifNotNil: [ :answer | ^ true ]. + (GrowlMorph openWithLabel: 'Information' translated contents: aStringOrText) + vanishDelay: 2 second; + actionBlock: aBlock \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/MorphicUIManager.extension/properties.json b/Iceberg-Plugin-GitHub.package/MorphicUIManager.extension/properties.json new file mode 100644 index 0000000000..79ec76899a --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/MorphicUIManager.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "MorphicUIManager" +} \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/UIManager.extension/instance/inform.actionOnClick..st b/Iceberg-Plugin-GitHub.package/UIManager.extension/instance/inform.actionOnClick..st new file mode 100644 index 0000000000..5dda81e93c --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/UIManager.extension/instance/inform.actionOnClick..st @@ -0,0 +1,5 @@ +*Iceberg-Plugin-GitHub +inform: aString actionOnClick: aBlock + "Only the MorphicUIManager should make the growl clickable." + + ^ self inform: aString \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/UIManager.extension/properties.json b/Iceberg-Plugin-GitHub.package/UIManager.extension/properties.json new file mode 100644 index 0000000000..f0804a6722 --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/UIManager.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "UIManager" +} \ No newline at end of file