From 7e6031e15c399476f0000fc93ac39c1e223758a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Sat, 10 Aug 2024 11:18:35 +0200 Subject: [PATCH] Revert "Add Alerts to Iceberg's IceTipNewRepositoryPanel to Inform User of Incomplete Information" --- .../IceTipGitProviderRepositoryPanel.class.st | 27 +++++-------------- .../IceTipGitRepositoryPanel.class.st | 22 +++++++-------- .../IceTipNewRepositoryPanel.class.st | 21 ++++----------- ...RegisterRepositoryDialogPresenter.class.st | 13 +-------- 4 files changed, 22 insertions(+), 61 deletions(-) diff --git a/Iceberg-TipUI/IceTipGitProviderRepositoryPanel.class.st b/Iceberg-TipUI/IceTipGitProviderRepositoryPanel.class.st index d870f4f03c..977e81d533 100644 --- a/Iceberg-TipUI/IceTipGitProviderRepositoryPanel.class.st +++ b/Iceberg-TipUI/IceTipGitProviderRepositoryPanel.class.st @@ -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 ] diff --git a/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st b/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st index c38079553c..9bc444384c 100644 --- a/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st +++ b/Iceberg-TipUI/IceTipGitRepositoryPanel.class.st @@ -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).' ] diff --git a/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st b/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st index d1a9ec9c58..5627423007 100644 --- a/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st +++ b/Iceberg-TipUI/IceTipNewRepositoryPanel.class.st @@ -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).' ] diff --git a/Iceberg-TipUI/IceTipRegisterRepositoryDialogPresenter.class.st b/Iceberg-TipUI/IceTipRegisterRepositoryDialogPresenter.class.st index ea8bc90099..2388a31c59 100644 --- a/Iceberg-TipUI/IceTipRegisterRepositoryDialogPresenter.class.st +++ b/Iceberg-TipUI/IceTipRegisterRepositoryDialogPresenter.class.st @@ -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 [ @@ -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 ].