From da2d989a92a8f51fde4c18f559f81763e78cf096 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 9 Oct 2022 20:30:40 -0500 Subject: [PATCH] Errors are now an OrderedCollection to improve future error cards handling. --- src/MiniDocs/LeDatabase.extension.st | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/MiniDocs/LeDatabase.extension.st b/src/MiniDocs/LeDatabase.extension.st index e22104d..a543999 100644 --- a/src/MiniDocs/LeDatabase.extension.st +++ b/src/MiniDocs/LeDatabase.extension.st @@ -62,7 +62,7 @@ LeDatabase >> docTreeForLink: aString [ ] { #category : #'*MiniDocs' } -LeDatabase >> errorCardFor: errorMessage [ +LeDatabase >> errorCardFor: error [ | keepButton overwriteButton backupButton errorMessageUI | keepButton := BrButton new @@ -89,7 +89,7 @@ LeDatabase >> errorCardFor: errorMessage [ errorMessageUI := BrEditor new aptitude: BrGlamorousRegularEditorAptitude new ; - text: errorMessage; + text: (error at: 'message'); vFitContent. ^ { errorMessageUI. keepButton. overwriteButton. backupButton } ] @@ -115,14 +115,14 @@ LeDatabase >> gtViewErrorDetailsOn: aView [ c horizontal matchParent ]; padding: (BlInsets all: 10). container - addChildren: (self errorCardFor: self errors associations first value) + addChildren: (self errorCardFor: self errors first) "container addChild: self asCardElement "]. ] { #category : #'*MiniDocs' } LeDatabase >> importErrorForLocal: page withRemote: externalDocLocation [ - | message id | + | message id error | id := page uidString. message := String streamContents: [ :stream | stream @@ -145,7 +145,12 @@ LeDatabase >> importErrorForLocal: page withRemote: externalDocLocation [ nextPutAll: 'Please choose one of the following options to addres the issue: ' ]. - self errors at: id put: message + error := Dictionary new + at: 'key' put: id; + at:'remote' put: externalDocLocation; + at: 'message' put: message; + yourself. + self errors add: error ] { #category : #'*MiniDocs' }