Skip to content

Commit

Permalink
all tests are green now :)
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Jul 26, 2024
1 parent 3fe3e1d commit 7ad7b7e
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/JiraPharoAPI/JiraPharoImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ JiraPharoImporter >> api: anObject [
api := anObject
]

{ #category : #'api - import' }
JiraPharoImporter >> ensureUser: aPotentialUser [
"Search is user is already in model"

(self model allWithType: JPUser)
detect: [ :user | user = aPotentialUser ]
ifOne: [ :userFromModel | ^ userFromModel ].
^ self model add: aPotentialUser
]

{ #category : #'api - import' }
JiraPharoImporter >> extractAllIssuesOf: aUsername [

Expand Down Expand Up @@ -66,18 +76,10 @@ JiraPharoImporter >> importAllIssuesOf: aUsername [
{ #category : #'api - import' }
JiraPharoImporter >> loadAssigneeForIssuesToLoad: issuesToLoad [

| assigneeToLoad |
assigneeToLoad := issuesToLoad iterator
| [ :issue | issue assignee ] collectIt
| [ :assignee | assignee isNil ] rejectIt
|
[ :assignee | self model includes: assignee ]
rejectIt > Set.
assigneeToLoad do: [ :assignee |
(self model allWithType: JPIssue)
select: [ :issue | issue assignee = assignee ]
thenDo: [ :issue | issue assignee: assignee ] ].
self model addAll: assigneeToLoad
issuesToLoad
reject: [ :issue | issue assignee isNil ]
thenDo: [ :issue |
issue assignee: (self ensureUser: issue assignee) ]
]

{ #category : #'api - import' }
Expand Down

0 comments on commit 7ad7b7e

Please sign in to comment.