Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Iceberg-TipUI/IceTipCommitBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ IceTipCommitBrowser >> doCollapseSelection [
{ #category : 'actions' }
IceTipCommitBrowser >> doCommit [

| selectedItems message isPushing isSaving commitBlock |
| selectedItems message isPushing isSaving commitBlock cancelBlock |
selectedItems := diffPanel selectedItems.
message := commentPanel message.
isPushing := commentPanel isPushing.
Expand All @@ -117,12 +117,14 @@ IceTipCommitBrowser >> doCommit [
message: message
pushing: isPushing
saving: isSaving ].
cancelBlock := [ self commentPanel commitButton enabled: true ].

(IceTipCritiquesBeforeCommitBrowser
onApplication: self application
model: selectedItems
commitModel: self model
acceptBlock: commitBlock) openIfCritiques
acceptBlock: commitBlock
cancelBlock: cancelBlock) openIfCritiques
]

{ #category : 'actions' }
Expand Down
19 changes: 17 additions & 2 deletions Iceberg-TipUI/IceTipCritiquesBeforeCommitBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Class {
'reasonPanel',
'detailPanel',
'browseButton',
'autofixButton'
'autofixButton',
'onCancelAction'
],
#category : 'Iceberg-TipUI-View-Commit',
#package : 'Iceberg-TipUI',
Expand All @@ -33,13 +34,14 @@ IceTipCritiquesBeforeCommitBrowser class >> buildSelectionCommandGroupWith: pres
]

{ #category : 'commands' }
IceTipCritiquesBeforeCommitBrowser class >> onApplication: anApplication model: aModel commitModel: aCommitModel acceptBlock: anAcceptBlock [
IceTipCritiquesBeforeCommitBrowser class >> onApplication: anApplication model: aModel commitModel: aCommitModel acceptBlock: anAcceptBlock cancelBlock: aCancelBlock [

^ self basicNew
application: anApplication;
setModelBeforeInitialization: aModel;
commitModel: aCommitModel;
onAccept: anAcceptBlock;
onCancel: aCancelBlock;
initialize;
yourself
]
Expand Down Expand Up @@ -69,6 +71,13 @@ IceTipCritiquesBeforeCommitBrowser >> calculateCritics [
^ calculatedCritics
]

{ #category : 'actions' }
IceTipCritiquesBeforeCommitBrowser >> cancel [

self closeWindow.
onCancelAction value
]

{ #category : 'accessing' }
IceTipCritiquesBeforeCommitBrowser >> commitModel [

Expand Down Expand Up @@ -240,6 +249,12 @@ IceTipCritiquesBeforeCommitBrowser >> onAccept: aFullBlockClosure [
onAcceptAction := aFullBlockClosure
]

{ #category : 'accessing' }
IceTipCritiquesBeforeCommitBrowser >> onCancel: aFullBlockClosure [

onCancelAction := aFullBlockClosure
]

{ #category : 'actions' }
IceTipCritiquesBeforeCommitBrowser >> openIfCritiques [

Expand Down
Loading