Skip to content

Commit 673a0ab

Browse files
committed
refactor: delete newProtocolButton in StProtocolNameChooserPresenter
1 parent bdb6296 commit 673a0ab

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

src/NewTools-Core-Tests/StProtocolNameChooserPresenterTest.class.st

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ StProtocolNameChooserPresenterTest >> setUp [
1818
presenter := StProtocolNameChooserPresenter new
1919
]
2020

21-
{ #category : 'running' }
22-
StProtocolNameChooserPresenterTest >> testAddButtonIsDiabledWhenTextFieldIsEmpty [
23-
24-
self assertEmpty: presenter protocolName.
25-
self deny: presenter newProtocolButton isEnabled.
26-
27-
presenter protocolName: 'ANewProtocol'.
28-
self assert: presenter newProtocolButton isEnabled
29-
]
30-
3121
{ #category : 'tests' }
3222
StProtocolNameChooserPresenterTest >> testCreatingProtocolThatDoesntExists [
3323
"When creating a protocol that doesn't exist beforehand, it should create it correctly with the same name as written."

src/NewTools-Core/StProtocolNameChooserPresenter.class.st

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Class {
1818
'suggestionList',
1919
'protocolNameField',
2020
'concernedClass',
21-
'newProtocolButton',
2221
'selectedProtocolName'
2322
],
2423
#category : 'NewTools-Core-Calypso',
@@ -76,9 +75,7 @@ StProtocolNameChooserPresenter >> connectPresenters [
7675
protocolNameField whenTextChangedDo: [ self updatePresenter ].
7776
protocolNameField whenSubmitDo: [ :aString | self doAcceptFromTextInput ].
7877

79-
suggestionList whenActivatedDo: [ self doAcceptFromList ].
80-
81-
newProtocolButton action: [ self doAcceptFromTextInput ]
78+
suggestionList whenActivatedDo: [ self doAcceptFromList ]
8279
]
8380

8481
{ #category : 'layout' }
@@ -90,7 +87,6 @@ StProtocolNameChooserPresenter >> defaultLayout [
9087
add: (SpBoxLayout newLeftToRight
9188
spacing: 3;
9289
add: protocolNameField expand: true;
93-
add: newProtocolButton expand: false;
9490
yourself)
9591
expand: false;
9692
yourself
@@ -127,12 +123,6 @@ StProtocolNameChooserPresenter >> initializePresenters [
127123
protocolNameField := self newTextInput.
128124
protocolNameField placeholder: 'Protocol name (e.g. accessing)'.
129125

130-
newProtocolButton := self newButton.
131-
newProtocolButton
132-
addStyle: 'small';
133-
icon: (self iconNamed: #add);
134-
help: 'Create a new protocol with the content of the input field if this protocol is not in the list'.
135-
136126
self initializeProtocolNameField
137127
]
138128

@@ -165,12 +155,6 @@ StProtocolNameChooserPresenter >> initializeWindow: aWindowPresenter [
165155
aWindowPresenter whenOpenedDo: [ protocolNameField takeKeyboardFocus ]
166156
]
167157

168-
{ #category : 'private - accessing' }
169-
StProtocolNameChooserPresenter >> newProtocolButton [
170-
171-
^ newProtocolButton
172-
]
173-
174158
{ #category : 'private - accessing' }
175159
StProtocolNameChooserPresenter >> protocolName [
176160
^ protocolNameField text asSymbol
@@ -248,8 +232,6 @@ StProtocolNameChooserPresenter >> selectedProtocolName [
248232
{ #category : 'initialization' }
249233
StProtocolNameChooserPresenter >> updatePresenter [
250234

251-
newProtocolButton enabled: self protocolName isNotEmpty.
252-
253235
suggestionList
254236
items: self protocolsToSuggest
255237
]

0 commit comments

Comments
 (0)