Skip to content

Commit

Permalink
Merge pull request #1838 from pharo-vcs/revert-1834-Pharo13
Browse files Browse the repository at this point in the history
Revert "Add Alerts to Iceberg's IceTipNewRepositoryPanel to Inform User of Incomplete Information"
  • Loading branch information
Ducasse authored Aug 10, 2024
2 parents 7572143 + 7e6031e commit 2ccf2af
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 61 deletions.
27 changes: 6 additions & 21 deletions Iceberg-TipUI/IceTipGitProviderRepositoryPanel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,12 @@ IceTipGitProviderRepositoryPanel >> userNameLabel [

{ #category : 'accessing' }
IceTipGitProviderRepositoryPanel >> validate [

self userName isNotEmpty
ifFalse: [
self alert: 'You must enter an owner (e.g. username).'.
^false].

"self
alert: 'You must enter a GitHub owner (e.g. username).'.

self
assert: self userName isNotEmpty
description: 'You must enter a GitHub owner (e.g. username).'."


self projectName isNotEmpty
ifFalse: [
self alert: 'You must enter a project name.'.
^false].
"self
alert: 'You must enter a GitHub owner (e.g. username).'.
description: 'You must enter a GitHub owner (e.g. username).'.
self
assert: self projectName isNotEmpty
description: 'You must enter a GitHub project name.'."

super validate.
^true.
description: 'You must enter a GitHub project name.'.
super validate
]
22 changes: 10 additions & 12 deletions Iceberg-TipUI/IceTipGitRepositoryPanel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,14 @@ IceTipGitRepositoryPanel >> validate [

| remoteString |
remoteString := self remoteUrl.
remoteString isNotEmpty ifFalse: [
self alert: 'You must enter your project url.'.
^ false ].
(IceGitRemote isValidUrl: remoteString) ifFalse: [
self alert: 'You must enter your project url.'.
^ false ].

self projectLocation location ifNil: [
self alert:
'Project location must be defined (if it does not exists, it will be created).'.
^ false ].
^ true
self
assert: remoteString isNotEmpty
description: 'You must enter your project url.'.
self
assert: (IceGitRemote isValidUrl: remoteString)
description: 'The url is incorrect.'.
self
assert: self projectLocation location isNotNil
description:
'Project location must be defined (if it does not exists, it will be created).'
]
21 changes: 5 additions & 16 deletions Iceberg-TipUI/IceTipNewRepositoryPanel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,10 @@ IceTipNewRepositoryPanel >> titleForWindow [
{ #category : 'accessing' }
IceTipNewRepositoryPanel >> validate [

self projectNameInputText text isNotEmpty ifFalse: [
self alert: 'You must enter a project name (it will be used also as part of the path).'.
^ false ].

self projectLocation location isNotNil ifFalse: [
self alert: 'You must enter a project name (it will be used also as part of the path).'.
^ false ].
^true.

"self
assert: self projectNameInputText text isNotEmpty
description:
'You must enter a project name (it will be used also as part of the path).'.
self
assert: self projectNameInputText text isNotEmpty
description: 'You must enter a project name (it will be used also as part of the path).'.
self
assert: self projectLocation location isNotNil
description:
'Project location must be defined (if it does not exists, it will be created).'"
assert: self projectLocation location isNotNil
description: 'Project location must be defined (if it does not exists, it will be created).'
]
13 changes: 1 addition & 12 deletions Iceberg-TipUI/IceTipRegisterRepositoryDialogPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ Class {
#tag : 'View-Repository'
}

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

[
self doAccept ifFalse: [ ^ false ].
self closeWindow ]
on: IceError , IceWarning
do: [ :e |
e acceptError: (IceTipInteractiveErrorVisitor newContext: self) ]
]

{ #category : 'accessing' }
IceTipRegisterRepositoryDialogPresenter >> allTypes [

Expand All @@ -48,7 +37,7 @@ IceTipRegisterRepositoryDialogPresenter >> beForCloneOfRepository: aRepository [
IceTipRegisterRepositoryDialogPresenter >> doAccept [

| newRepository |
(self selectedType validate) ifFalse: [^false].
self selectedType validate.
self isEditing ifTrue: [ self selectedType repository: repository ].
newRepository := self selectedType newRepository.
self isEditing ifFalse: [ newRepository register ].
Expand Down

0 comments on commit 2ccf2af

Please sign in to comment.