Now errors are nested dictionaries.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-10-10 07:27:15 -05:00
parent 9bde9e6492
commit 9371ddfef6
1 changed files with 10 additions and 10 deletions

View File

@ -64,8 +64,9 @@ LeDatabase >> docTreeForLink: aString [
{ #category : #'*MiniDocs' }
LeDatabase >> errorCardFor: error [
| keepButton overwriteButton backupButton errorMessageUI localPage |
localPage := self pageWithID: (error at: 'key').
| keepButton overwriteButton backupButton errorMessageUI localPage errorKey |
errorKey := error keys first.
localPage := self pageWithID: errorKey.
keepButton := BrButton new
aptitude: BrGlamorousButtonWithIconAndLabelAptitude;
label: 'Keep existing local page';
@ -80,7 +81,7 @@ LeDatabase >> errorCardFor: error [
icon: BrGlamorousVectorIcons edit;
action: [ :aButton |
self removePage: localPage.
aButton phlow spawnObject: (self addPageFromMarkdeepUrl: (error at: 'remote'))
aButton phlow spawnObject: (self addPageFromMarkdeepUrl: (error at: errorKey at: 'remote'))
];
margin: (BlInsets left: 10).
backupButton := BrButton new
@ -92,7 +93,7 @@ LeDatabase >> errorCardFor: error [
errorMessageUI := BrEditor new
aptitude: BrGlamorousRegularEditorAptitude new ;
text: (error at: 'message');
text: (error at: errorKey at: 'message');
vFitContent.
^ { errorMessageUI. keepButton. overwriteButton. backupButton }
]
@ -100,7 +101,7 @@ LeDatabase >> errorCardFor: error [
{ #category : #'*MiniDocs' }
LeDatabase >> errors [
^ self optionAt: 'errors' ifAbsent: [ self optionAt: 'errors' put: Dictionary new ]
^ self optionAt: 'errors' ifAbsentPut: [ Dictionary new ]
]
{ #category : #'*MiniDocs' }
@ -117,7 +118,7 @@ LeDatabase >> gtViewErrorDetailsOn: aView [
c horizontal matchParent ];
padding: (BlInsets all: 10).
container
addChildren: (self errorCardFor: self errors first)
addChildren: (self errorCardFor: self errors)
].
]
@ -148,11 +149,10 @@ LeDatabase >> importErrorForLocal: page withRemote: externalDocLocation [
'Please choose one of the following options to addres the issue:
' ].
error := Dictionary new
at: 'key' put: id;
at:'remote' put: externalDocLocation;
at: 'message' put: message;
at: 'remote' put: externalDocLocation;
at: 'message' put: message ;
yourself.
self errors add: error
self errors at: id put: error
]
{ #category : #'*MiniDocs' }