Skip to content

Commit

Permalink
Fix IceTipCommitBrowser to have a cleaner initialization of the model…
Browse files Browse the repository at this point in the history
…s and updated its user.
  • Loading branch information
jordanmontt committed Jan 29, 2025
1 parent 1c90af6 commit 2f44a7e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Iceberg-TipUI/IceTipCommitBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,25 @@ IceTipCommitBrowser >> doCollapseSelection [

{ #category : 'actions' }
IceTipCommitBrowser >> doCommit [
| selectedItems message isPushing isSaving commitBlock|

| selectedItems message isPushing isSaving commitBlock |
selectedItems := diffPanel selectedItems.
message := commentPanel message.
isPushing := commentPanel isPushing.
isSaving := commentPanel isSaving.
commitBlock := [

commitBlock := [
self
doCommit: selectedItems
message: message
pushing: isPushing
saving: isSaving ].

(IceTipCritiquesBeforeCommitBrowser newApplication: self application model: selectedItems)
commitModel: self model;
onAccept: commitBlock ;
openIfCritiques
message: message
pushing: isPushing
saving: isSaving ].

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

{ #category : 'actions' }
Expand Down
12 changes: 12 additions & 0 deletions Iceberg-TipUI/IceTipCritiquesBeforeCommitBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ IceTipCritiquesBeforeCommitBrowser class >> buildSelectionCommandGroupWith: pres

]

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

^ self basicNew
application: anApplication;
setModelBeforeInitialization: aModel;
commitModel: aCommitModel;
onAccept: anAcceptBlock;
initialize;
yourself
]

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

Expand Down

0 comments on commit 2f44a7e

Please sign in to comment.