generated from hpi-swa-teaching/SWT-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
101 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
accessing | ||
buildCard: aJsonObject | ||
|
||
(aJsonObject at: 'content_url') | ||
ifNotNil: [:aString| self buildContent: aString] | ||
ifNil: [self buildNote: aJsonObject]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
accessing | ||
buildNote: aJsonObject | ||
|
||
self | ||
isNote: true; | ||
title: (aJsonObject at: 'note'); | ||
description: ''. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
isNote: aBoolean | ||
|
||
isNote := aBoolean. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
accessing | ||
isNote | ||
|
||
isNote ifNil: [self isNote: false]. | ||
^ isNote. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Squello-Core.package/SPBGithubAPI.class/instance/updateNote.withPostData..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
api call patch request | ||
updateNote: aNumber withPostData: aDictionary | ||
|
||
"aNumber -> CardID" | ||
"aDictionary Parameter: | ||
note -> string" | ||
|
||
| stream url | | ||
url := 'https://api.github.com/projects/columns/cards/' , aNumber. | ||
stream := WriteStream with: OrderedCollection new. | ||
aDictionary jsonWriteOn: stream. | ||
|
||
self patchRequestToURL: url withData: stream. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
Squello-Core.package/SPBGithubBoardProvider.class/instance/createCardsFromColumn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
cards | ||
createCardsFromColumn: anSPBColumn | ||
|
||
| cardsJson onlyIssueCardsJson | | ||
| cardsJson | | ||
cardsJson := (self api queryCards: anSPBColumn id) asOrderedCollection. | ||
|
||
"at the moment we can just display issues and pull requests. | ||
If a card is a note (than it has no content_url) it will be skipped" | ||
onlyIssueCardsJson := cardsJson | ||
reject: [:cardJson | (cardJson at: 'content_url') isNil]. | ||
|
||
onlyIssueCardsJson | ||
cardsJson | ||
do: [:cardJson | SPBCard buildFromRemote: cardJson into: anSPBColumn]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Squello-Tests.package/SPBCardTests.class/instance/testBuildIssueFromJson.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
tests | ||
testBuildIssueFromJson | ||
|
||
| issueJson | | ||
issueJson := '{ | ||
"content_url": "https://api.github.com/repos/test-organization/test-repo/issues/42"}' parseAsJson. | ||
|
||
card buildCard: issueJson. | ||
self assert: card isNote not. | ||
self assert: card issueId = 3 |
10 changes: 10 additions & 0 deletions
10
Squello-Tests.package/SPBCardTests.class/instance/testBuildNoteFromJson.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
tests | ||
testBuildNoteFromJson | ||
|
||
| noteJson | | ||
noteJson := '{ | ||
"note": "this is a note"}' parseAsJson. | ||
|
||
card buildCard: noteJson. | ||
self assert: card isNote. | ||
self assert: card title = 'this is a note'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Squello-Tests.package/SPBGithubBoardProviderTests.class/instance/testUpdateNote.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
tests | ||
testUpdateNote | ||
|
||
| card data | | ||
card := SPBCard new | ||
id: 42; | ||
title: 'Das ist eine Note'; | ||
isNote: true. | ||
|
||
provider updateCard: card. | ||
|
||
data := provider api messages first. | ||
|
||
self assert: 'Das ist eine Note' equals: (data at: 'note'). | ||
self assert: 42 equals: (data at: 'id'). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Squello-Tests.package/SPBMockGithubAPI.class/instance/updateNote.withPostData..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
as yet unclassified | ||
updateNote: aNumber withPostData: aDictionary | ||
|
||
aDictionary at: 'id' put: aNumber. | ||
self messages add: aDictionary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters