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.
Merge pull request #145 from hpi-swa-teaching/FeatureLocalBoards
Feature local boards
- Loading branch information
Showing
67 changed files
with
407 additions
and
76 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
Squello-Core.package/SPBAbstractCard.class/instance/asJson.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,12 @@ | ||
converting | ||
asJson | ||
|
||
^ JsonObject fromAssociations: { | ||
'id' -> self id. | ||
'title' -> self title. | ||
'body' -> self description. | ||
'closed' -> self isClosed. | ||
'isNote' -> self isNote. | ||
'assignees' -> (self assignees collect: [:each| each asJson]). | ||
'labels' -> (self labels collect: [:each| each asJson]). | ||
}. |
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,4 @@ | ||
converting | ||
asJson | ||
|
||
^ JsonObject fromAssociations: {'login' -> self username. 'id' -> self 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
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,4 +1,4 @@ | ||
startup | ||
local-boards | ||
localPrefix | ||
|
||
^ 'local.'. |
17 changes: 6 additions & 11 deletions
17
Squello-Core.package/SPBBoard.class/class/newLocalWith..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,12 +1,7 @@ | ||
startup | ||
newLocalWith: aString | ||
|
||
| instance | | ||
instance := self new. | ||
instance makeLocal. | ||
local-boards | ||
newLocalWith: aSPBLocalBoardProvider | ||
|
||
[instance parseLocalRepoFromUrl: aString] | ||
on: Error do: [self errorParsingUrl. ^ self]. | ||
|
||
instance buildAndOpen. | ||
^ instance. | ||
^ self new | ||
makeLocal: aSPBLocalBoardProvider; | ||
buildAndOpen; | ||
yourself. |
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,7 +1,9 @@ | ||
startup | ||
local-boards | ||
openLocal: aString | ||
|
||
| localFile | | ||
| localFile provider | | ||
localFile := SPBBoardSaver defaultSaver load: aString. | ||
localFile ifNotNil: [:file|^ file buildAndOpen]. | ||
^ self newLocalWith: aString. | ||
localFile | ||
ifNil: [provider := SPBLocalBoardProvider newWithName: aString] | ||
ifNotNil: [provider := SPBLocalBoardProvider withJson: localFile]. | ||
^ self newLocalWith: provider. |
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,8 @@ | ||
converting | ||
asJson | ||
|
||
^ JsonObject fromAssociations: { | ||
'title' -> self boardName. | ||
'currentID' -> self boardProvider currentID. | ||
'columns' -> (JsonObject fromAssociations: (self columns collect: [:each| each id -> each asJson])). | ||
}. |
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 | ||
boardName: anObject | ||
|
||
boardName := anObject. |
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,5 +1,5 @@ | ||
accessing | ||
boardName | ||
|
||
boardName ifNil: [boardName := self boardProvider queryBoardName]. | ||
boardName ifNil: [self boardName: self boardProvider queryBoardName]. | ||
^ boardName. |
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 @@ | ||
initialize-release | ||
makeLocal: aSPBLocalBoardProvider | ||
|
||
self isLocal: true. | ||
self boardProvider: aSPBLocalBoardProvider. |
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,5 +1,4 @@ | ||
initialize-release | ||
makeLocal | ||
|
||
self isLocal: true. | ||
self boardProvider: SPBLocalBoardProvider new. | ||
self makeLocal: SPBLocalBoardProvider new. |
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
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,4 +1,4 @@ | ||
save/load | ||
load: anObject | ||
|
||
^ (self loadReadonly: anObject) veryDeepCopy. | ||
^ self boards at: anObject ifAbsent: nil. |
4 changes: 0 additions & 4 deletions
4
Squello-Core.package/SPBBoardSaver.class/instance/loadReadonly..st
This file was deleted.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
Squello-Core.package/SPBCard.class/class/buildFromLocal.into..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,8 @@ | ||
instance creation | ||
buildFromLocal: aJsonObject into: anSPBColumn | ||
"called to build saved local cards" | ||
|
||
| instance | | ||
instance := self newFromLocal: aJsonObject with: anSPBColumn. | ||
instance setCardColumn: anSPBColumn. | ||
^ instance. |
12 changes: 12 additions & 0 deletions
12
Squello-Core.package/SPBCard.class/class/newFromLocal.with..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,12 @@ | ||
instance creation | ||
newFromLocal: aJsonObject with: anSPBColumn | ||
|
||
^ self new | ||
cardId: (aJsonObject at: 'id'); | ||
boardProvider: anSPBColumn boardProvider; | ||
changeProvider: anSPBColumn changeProvider; | ||
setupMouseEvents; | ||
buildLocalCard: aJsonObject; | ||
buildUI; | ||
openInWorld; | ||
yourself. |
14 changes: 14 additions & 0 deletions
14
Squello-Core.package/SPBCard.class/instance/buildLocalCard..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,14 @@ | ||
accessing | ||
buildLocalCard: aJsonObject | ||
|
||
self | ||
title: (aJsonObject at: 'title'); | ||
description: (aJsonObject at: 'body'); | ||
id: (aJsonObject at: 'id'); | ||
issueId: (aJsonObject at: 'id'); | ||
isClosed: (aJsonObject at: 'closed'); | ||
isNote: (aJsonObject at: 'isNote'); | ||
assignees: ((aJsonObject at: 'assignees') collect: | ||
[:each| SPBAssignee newFrom: each]) asOrderedCollection; | ||
labels: ((aJsonObject at: 'labels') collect: | ||
[:each| SPBLabel newFrom: each]) asOrderedCollection. |
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,8 @@ | ||
converting | ||
asJson | ||
|
||
^ JsonObject fromAssociations: { | ||
'id' -> self id. | ||
'name' -> self title. | ||
'cards' -> (self cards collect: [:each| each asJson]). | ||
}. |
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
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,8 @@ | ||
converting | ||
asJson | ||
|
||
^ JsonObject fromAssociations: { | ||
'id' -> self id. | ||
'title' -> self title. | ||
'color' -> self color printHtmlString. | ||
}. |
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
8 changes: 8 additions & 0 deletions
8
Squello-Core.package/SPBLocalBoardProvider.class/class/defaultBoardJson..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,8 @@ | ||
instance creation | ||
defaultBoardJson: aString | ||
|
||
^ ('{"columns":[ | ||
{"name":"ToDo","id":1,"cards":[]}, | ||
{"name":"InProgress","id":2,"cards":[]}, | ||
{"name":"Done","id":3,"cards":[]}], | ||
"title":"', aString, '"}' ) parseAsJson. |
4 changes: 4 additions & 0 deletions
4
Squello-Core.package/SPBLocalBoardProvider.class/class/newWithName..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,4 @@ | ||
instance creation | ||
newWithName: aString | ||
|
||
^ self withJson: (self defaultBoardJson: aString). |
6 changes: 6 additions & 0 deletions
6
Squello-Core.package/SPBLocalBoardProvider.class/class/withJson..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,6 @@ | ||
instance creation | ||
withJson: aJsonObject | ||
|
||
^ self new | ||
boardJson: aJsonObject; | ||
yourself. |
4 changes: 0 additions & 4 deletions
4
Squello-Core.package/SPBLocalBoardProvider.class/instance/board.st
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
Squello-Core.package/SPBLocalBoardProvider.class/instance/boardJson..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 @@ | ||
accessing | ||
boardJson: aJsonObject | ||
|
||
boardJson := aJsonObject. | ||
self currentID: (aJsonObject at: 'currentID'). |
4 changes: 4 additions & 0 deletions
4
Squello-Core.package/SPBLocalBoardProvider.class/instance/boardJson.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,4 @@ | ||
accessing | ||
boardJson | ||
|
||
^ boardJson. |
9 changes: 5 additions & 4 deletions
9
Squello-Core.package/SPBLocalBoardProvider.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,7 +1,8 @@ | ||
cards | ||
createCardsFromColumn: aSPBColumn | ||
|
||
| cards | | ||
cards := aSPBColumn cards. | ||
aSPBColumn cards: OrderedCollection new. | ||
cards do: [:card| card setCardColumn: aSPBColumn]. | ||
| cardsJson | | ||
cardsJson := ((self boardJson at: 'columns') at: aSPBColumn id) at: 'cards'. | ||
|
||
cardsJson | ||
do: [:cardJson | SPBCard buildFromLocal: cardJson into: aSPBColumn]. |
4 changes: 4 additions & 0 deletions
4
Squello-Core.package/SPBLocalBoardProvider.class/instance/currentID..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,4 @@ | ||
accessing | ||
currentID: aNumber | ||
|
||
currentId := aNumber. |
4 changes: 4 additions & 0 deletions
4
Squello-Core.package/SPBLocalBoardProvider.class/instance/currentID.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,4 @@ | ||
accessing | ||
currentID | ||
|
||
^ currentId. |
7 changes: 0 additions & 7 deletions
7
Squello-Core.package/SPBLocalBoardProvider.class/instance/defaultColumns.st
This file was deleted.
Oops, something went wrong.
7 changes: 4 additions & 3 deletions
7
Squello-Core.package/SPBLocalBoardProvider.class/instance/nextId.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,5 +1,6 @@ | ||
cards | ||
accessing | ||
nextId | ||
|
||
currentId ifNil: [currentId := 10]. | ||
^ currentId := currentId + 1. | ||
self currentID ifNil: [self currentID: 0]. | ||
self currentID: self currentID + 1. | ||
^ self currentID. |
Oops, something went wrong.