Skip to content

Commit

Permalink
Merge pull request #145 from hpi-swa-teaching/FeatureLocalBoards
Browse files Browse the repository at this point in the history
Feature local boards
  • Loading branch information
Xkulton authored Jul 4, 2024
2 parents 942b73b + bcfac37 commit 9735ac5
Show file tree
Hide file tree
Showing 67 changed files with 407 additions and 76 deletions.
12 changes: 12 additions & 0 deletions Squello-Core.package/SPBAbstractCard.class/instance/asJson.st
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]).
}.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"addAssigneeLocal:" : "lo 7/31/2022 17:03",
"addLabel:" : "lo 7/31/2022 17:04",
"addLabelLocal:" : "lo 7/31/2022 17:04",
"asJson" : "FP 6/25/2024 11:53",
"assignees" : "lo 7/31/2022 16:04",
"description" : "lo 7/31/2022 16:06",
"initialize" : "lo 7/31/2022 16:02",
Expand Down
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBAssignee.class/instance/asJson.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
converting
asJson

^ JsonObject fromAssociations: {'login' -> self username. 'id' -> self id}.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"newWithName:id:" : "FP 5/23/2024 10:05" },
"instance" : {
"=" : "LW 7/14/2022 12:24",
"asJson" : "FP 6/25/2024 11:13",
"asString" : "lo 5/28/2022 12:17",
"hash" : "LW 7/14/2022 11:23",
"id" : "lo 5/16/2022 22:43",
Expand Down
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBBoard.class/class/localPrefix.st
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 Squello-Core.package/SPBBoard.class/class/newLocalWith..st
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.
10 changes: 6 additions & 4 deletions Squello-Core.package/SPBBoard.class/class/openLocal..st
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.
8 changes: 8 additions & 0 deletions Squello-Core.package/SPBBoard.class/instance/asJson.st
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])).
}.
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoard.class/instance/boardName..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
boardName: anObject

boardName := anObject.
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBBoard.class/instance/boardName.st
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.
5 changes: 5 additions & 0 deletions Squello-Core.package/SPBBoard.class/instance/makeLocal..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
initialize-release
makeLocal: aSPBLocalBoardProvider

self isLocal: true.
self boardProvider: aSPBLocalBoardProvider.
3 changes: 1 addition & 2 deletions Squello-Core.package/SPBBoard.class/instance/makeLocal.st
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.
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBBoard.class/instance/saveBoard.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ saveBoard
self isLocal
ifTrue: [
SPBLandingPage changeRecentLocalBoards: self boardProvider repo.
SPBBoardSaver defaultSaver save: self as: self boardProvider repo.]
SPBBoardSaver defaultSaver save: self asJson as: self boardProvider repo.]
ifFalse: [
SPBLandingPage changeRecentGitHubBoards: {
#name -> self boardName.
Expand Down
13 changes: 8 additions & 5 deletions Squello-Core.package/SPBBoard.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
"lastProject" : "tk 7/30/2022 21:54",
"lastProject:" : "tk 7/30/2022 21:54",
"localPrefix" : "FP 5/27/2024 17:40",
"newLocalWith:" : "FP 5/23/2024 09:43",
"newLocalWith:" : "FP 6/25/2024 15:21",
"newWith:" : "FP 6/15/2024 13:20",
"open" : "FP 6/10/2024 16:24",
"openFromPrompt:" : "FP 6/10/2024 16:26",
"openLocal:" : "FP 6/8/2024 11:59",
"openLocal:" : "FP 6/25/2024 15:31",
"promptUrl" : "FP 5/23/2024 11:00",
"registerInAppsMenu" : "lo 6/4/2022 23:19" },
"instance" : {
"activeCard" : "mcr 8/1/2022 02:31",
"addColumn" : "mcr 8/4/2022 00:40",
"addColumnLocal:" : "lo 8/3/2022 12:34",
"applyUserInterfaceTheme" : "AH 6/20/2024 16:20",
"boardName" : "FP 6/10/2024 15:37",
"asJson" : "FP 7/4/2024 12:13",
"boardName" : "FP 6/25/2024 12:13",
"boardName:" : "FP 6/25/2024 12:13",
"boardProvider" : "jh 7/29/2022 11:34",
"boardProvider:" : "lo 7/31/2022 16:32",
"buildAddColumnButtonPanelSpecWith:" : "lo 8/1/2022 13:41",
Expand Down Expand Up @@ -65,13 +67,14 @@
"isLocal" : "FP 6/10/2024 15:01",
"isLocal:" : "FP 6/10/2024 14:43",
"loadProject:" : "FP 6/15/2024 13:18",
"makeLocal" : "FP 6/10/2024 14:44",
"makeLocal" : "FP 6/25/2024 14:19",
"makeLocal:" : "FP 6/25/2024 14:19",
"parseLocalRepoFromUrl:" : "FP 5/27/2024 17:13",
"parseProjectFromUrl:" : "FP 6/15/2024 14:10",
"removeColumn:" : "lo 8/1/2022 14:09",
"rerenderColumns" : "lo 7/31/2022 16:42",
"resizeColumnArea" : "jh 8/3/2022 01:07",
"saveBoard" : "FP 6/11/2024 13:38",
"saveBoard" : "FP 6/25/2024 14:06",
"setUpChangeProvider" : "Haru 5/13/2024 14:46",
"setupColumns" : "FP 6/17/2024 17:13",
"sidebar" : "mcr 8/1/2022 00:44",
Expand Down
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBBoardSaver.class/instance/load..st
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.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
"clear" : "FP 6/3/2024 11:15",
"contains:" : "FP 6/20/2024 17:14",
"delete:" : "FP 6/3/2024 11:15",
"load:" : "FP 6/8/2024 11:58",
"loadReadonly:" : "FP 6/8/2024 11:57",
"load:" : "FP 6/25/2024 14:33",
"save:as:" : "FP 6/3/2024 11:15" } }
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 Squello-Core.package/SPBCard.class/class/newFromLocal.with..st
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 Squello-Core.package/SPBCard.class/instance/buildLocalCard..st
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.
5 changes: 4 additions & 1 deletion Squello-Core.package/SPBCard.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"class" : {
"buildFromRemote:into:" : "mcr 8/3/2022 14:56",
"buildFromLocal:into:" : "FP 7/2/2024 11:34",
"buildFromRemote:into:" : "FP 7/2/2024 11:07",
"buildFromRemoteProject:intoColumns:" : "FP 6/19/2024 18:07",
"buildNew:into:" : "mcr 8/3/2022 14:53",
"buildNewFromRemote:into:" : "mcr 8/3/2022 14:56",
"defaultCardExtent" : "AH 6/16/2024 14:53",
"indicatorCardEdgeOffset" : "lo 8/1/2022 12:23",
"newFrom:with:" : "FP 6/19/2024 16:48",
"newFromLocal:with:" : "FP 7/2/2024 11:08",
"newWithTitle:body:id:into:" : "FP 6/19/2024 16:48" },
"instance" : {
"=" : "lo 7/31/2022 18:14",
Expand All @@ -30,6 +32,7 @@
"buildContent:" : "AH 6/1/2024 17:57",
"buildIndicatorDetection" : "tk 8/2/2022 23:23",
"buildIndicatorDetectionHalf" : "lo 8/1/2022 11:37",
"buildLocalCard:" : "FP 7/4/2024 12:03",
"buildNote:" : "FP 5/20/2024 20:02",
"buildStatusText" : "AH 5/25/2024 16:59",
"buildTitle" : "AH 6/14/2024 12:14",
Expand Down
8 changes: 8 additions & 0 deletions Squello-Core.package/SPBColumn.class/instance/asJson.st
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]).
}.
1 change: 1 addition & 0 deletions Squello-Core.package/SPBColumn.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"addIndicatorAtBottom" : "mcr 8/3/2022 23:43",
"addToNewColumn:with:" : "mcr 8/4/2022 01:56",
"alignCards" : "mcr 8/3/2022 23:55",
"asJson" : "FP 6/25/2024 15:34",
"board" : "lo 5/26/2022 23:42",
"board:" : "jh 7/29/2022 12:56",
"boardProvider" : "jh 7/29/2022 12:47",
Expand Down
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBLabel.class/class/newFrom..st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ newFrom: aJsonObject
| instance |
instance := self new.
instance
title: (aJsonObject at: 'name');
title: (aJsonObject at: 'title');
id: (aJsonObject at: 'id');
color: (Color fromString: (aJsonObject at: 'color')).
^ instance.
8 changes: 8 additions & 0 deletions Squello-Core.package/SPBLabel.class/instance/asJson.st
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.
}.
3 changes: 2 additions & 1 deletion Squello-Core.package/SPBLabel.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"class" : {
"newFrom:" : "mcr 8/4/2022 02:14",
"newFrom:" : "FP 7/2/2024 11:31",
"newWithName:id:color:" : "FP 5/23/2024 10:08" },
"instance" : {
"=" : "jh 7/31/2022 13:05",
"asForm" : "tk 8/2/2022 23:37",
"asJson" : "FP 6/25/2024 11:23",
"asMorph" : "AH 6/22/2024 15:56",
"asString" : "lo 6/5/2022 14:49",
"color" : "lo 5/16/2022 22:01",
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instance creation
newWithName: aString

^ self withJson: (self defaultBoardJson: aString).
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
instance creation
withJson: aJsonObject

^ self new
boardJson: aJsonObject;
yourself.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
boardJson: aJsonObject

boardJson := aJsonObject.
self currentID: (aJsonObject at: 'currentID').
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
boardJson

^ boardJson.
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].
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
currentID: aNumber

currentId := aNumber.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
currentID

^ currentId.

This file was deleted.

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.
Loading

0 comments on commit 9735ac5

Please sign in to comment.