Skip to content

Commit

Permalink
Merge pull request #54 from hpi-swa-teaching/feature/move-lane
Browse files Browse the repository at this point in the history
Feature/move lane
  • Loading branch information
SaturnHafen authored Jun 20, 2022
2 parents 0933d97 + 4ada6a3 commit 1253a36
Show file tree
Hide file tree
Showing 97 changed files with 632 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ activeCardAssigneeList

self activeCard ifNil: [^ {}].
self activeCard assignees ifNil: [^ {#('---assigned---')}].
^ #('---assigned---'), self activeCard assignees
^ #('---assigned---') , self activeCard assignees
5 changes: 1 addition & 4 deletions Squello-Core.package/SPBBoard.class/instance/addLane.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ addLane
board: self;
provider: self provider.
self lanes add: lane.
self lanes do: [:each | each cards: OrderedCollection new].
self changed: #buildLaneAreaChildren.
lane jsonCards: {} asOrderedCollection.
self showLanes.

self updateLanesWithCards.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ buildLaneAreaChildren
| children |
children := ((self buildLanesSpecWith: self usedBuilder) collect:
[:spec | self usedBuilder build: spec]) asOrderedCollection.
children add: ((self usedBuilder build: (self buildAddLaneButtonPanelSpecWith: self usedBuilder)) color: (Color lightGray)).
children add: ((self usedBuilder build: (self buildAddLaneButtonPanelSpecWith: self usedBuilder)) color: Color lightGray).

^ children.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ buildLaneBodySpecWith: aBuilder And: aSPBLane
name: aSPBLane id;
frame: (0@0.05 corner: 1@1);
dropped: #cardDropped:Event:;
reject: [:morph :event | (morph class = SPBCard) not];
reject: [:morph :event | ((morph class = SPBCard) or: [morph class = SPBGhostLane]) not];
yourself.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ toolbuilder
buildLaneHeaderAddCardButtonSpecWith: aBuilder And: aSPBLane

^ aBuilder pluggableActionButtonSpec new
frame: (0@0.6 corner: 1@1);
frame: (0@0.6 corner: 0.85@1);
model: aSPBLane;
action: #addCard;
label: '+ Add card';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
toolbuilder
buildLaneHeaderMoveLaneButtonSpecWith: aBuilder And: aSPBLane

^ aBuilder pluggableActionButtonSpec new
frame: (0.85@0.6 corner: 1@1);
model: aSPBLane;
action: #moveLane;
label: '<->';
help: 'move the lane to another place';
yourself.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ buildLaneHeaderSpecWith: aBuilder And: aSPBLane
children: {
self buildLaneHeaderTitleSpecWith: aBuilder And: aSPBLane.
self buildLaneHeaderAddCardButtonSpecWith: aBuilder And: aSPBLane.
self buildLaneHeaderMoveLaneButtonSpecWith: aBuilder And: aSPBLane.
};
yourself.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ buildLaneSpecWith: aBuilder And: aSPBLane At: aNumber
self buildLaneHeaderSpecWith: aBuilder And: aSPBLane.
self buildLaneBodySpecWith: aBuilder And: aSPBLane.
};
name: ('lane' , aSPBLane id asString) asSymbol;
verticalResizing: #spaceFill;
yourself.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ buildSidebarAssigneePanelSpecWith: aBuilder
minimumHeight: 20;
children: {
self buildSidebarAssigneeListSpecWith: aBuilder.
self buildSidebarPotentialAssigneeListSpecWith: aBuilder}
self buildSidebarPotentialAssigneeListSpecWith: aBuilder};
yourself.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ buildSidebarLabelPanelSpecWith: aBuilder
minimumHeight: 20;
children: {
self buildSidebarLabelListSpecWith: aBuilder.
self buildSidebarPotentialLabelListSpecWith: aBuilder}
self buildSidebarPotentialLabelListSpecWith: aBuilder};
yourself.

2 changes: 1 addition & 1 deletion Squello-Core.package/SPBBoard.class/instance/buildWith..st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildWith: aBuilder
children: {
self buildLaneAreaSpecWith: aBuilder.
self buildSidebarSpecWith: aBuilder};
yourself.
yourself.

self window: (aBuilder build: spec).

Expand Down
6 changes: 1 addition & 5 deletions Squello-Core.package/SPBBoard.class/instance/createLanes.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
accessing
createLanes

| lane lanesJson|
lanesJson := self provider queryColumns.
self lanes: (lanesJson collect:
[:each | lane := SPBLane newFrom: each.
lane provider: self provider]) asOrderedCollection.
self lanes: self provider queryColumns.
4 changes: 3 additions & 1 deletion Squello-Core.package/SPBBoard.class/instance/showLanes.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
drag and drop
showLanes

self lanes do: [:each | each pasteup: (self usedBuilder widgetAt: each id).
self lanes do: [:each |
each pasteup: (self usedBuilder widgetAt: each id).
each lane: (self usedBuilder widgetAt: ('lane' , each id asString) asSymbol).
each buildCards.
each board: self].
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
drag and drop
showLanesButDontRebuildCards

self lanes do: [:each |
each pasteup: (self usedBuilder widgetAt: each id).
each lane: (self usedBuilder widgetAt: ('lane' , each id asString) asSymbol).
each rerenderCards.
each board: self].
6 changes: 4 additions & 2 deletions Squello-Core.package/SPBBoard.class/instance/updateLanes.st
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
drag and drop
accessing
updateLanes

self lanes do: [:each | each pasteup: (self usedBuilder widgetAt: each id).
self lanes do: [:each |
each pasteup: (self usedBuilder widgetAt: each id).
each lane: (self usedBuilder widgetAt: ('lane' , each id asString) asSymbol).
each fetchCards.
each buildCards.
each board: self].
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
updateLanesWithCards

self changed: #buildLaneAreaChildren.
self showLanesButDontRebuildCards.
35 changes: 18 additions & 17 deletions Squello-Core.package/SPBBoard.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@
"instance" : {
"activeCard" : "lo 5/26/2022 14:24",
"activeCard:" : "lo 5/26/2022 14:24",
"activeCardAssigneeList" : "mcr 5/27/2022 19:15",
"activeCardAssigneeList" : "lo 6/18/2022 10:36",
"activeCardDescription" : "lo 5/26/2022 14:25",
"activeCardLabelList" : "mcr 6/7/2022 16:17",
"activeCardTitle" : "lo 5/26/2022 14:25",
"addLane" : "NTK 6/8/2022 02:40",
"addLane" : "tk 6/10/2022 23:04",
"assigneeSelected" : "mcr 5/27/2022 19:11",
"assigneeSelected:" : "mcr 5/27/2022 19:13",
"buildAddLaneButtonPanelSpecWith:" : "mcr 6/6/2022 22:41",
"buildAddLaneButtonSpecWith:" : "mcr 6/6/2022 22:30",
"buildAndOpen" : "NTK 6/1/2022 16:47",
"buildLaneAreaChildren" : "mcr 6/6/2022 22:42",
"buildLaneAreaSpecWith:" : "LW 6/17/2022 12:06",
"buildLaneAreaSpecWith:aWidth:" : "LW 6/17/2022 12:04",
"buildLaneBodySpecWith:And:" : "mcr 5/28/2022 02:45",
"buildLaneHeaderAddCardButtonSpecWith:And:" : "mcr 5/27/2022 18:58",
"buildLaneHeaderSpecWith:And:" : "lo 5/26/2022 15:51",
"buildLaneAreaChildren" : "lo 6/8/2022 10:26",
"buildLaneAreaSpecWith:" : "NTK 6/6/2022 13:07",
"buildLaneBodySpecWith:And:" : "lo 6/10/2022 21:13",
"buildLaneHeaderAddCardButtonSpecWith:And:" : "lo 6/10/2022 19:39",
"buildLaneHeaderMoveLaneButtonSpecWith:And:" : "lo 6/15/2022 10:09",
"buildLaneHeaderSpecWith:And:" : "lo 6/10/2022 19:37",
"buildLaneHeaderTitleSpecWith:And:" : "lo 5/26/2022 15:45",
"buildLaneSpecWith:And:At:" : "NTK 6/6/2022 13:11",
"buildLaneSpecWith:And:At:" : "lo 6/10/2022 19:58",
"buildLanesSpecWith:" : "NTK 6/5/2022 15:53",
"buildSidebarAssigneeListSpecWith:" : "mcr 5/27/2022 18:28",
"buildSidebarAssigneePanelSpecWith:" : "mcr 5/27/2022 19:05",
"buildSidebarAssigneePanelSpecWith:" : "lo 6/8/2022 09:54",
"buildSidebarDescriptionSpecWith:" : "lo 6/5/2022 14:45",
"buildSidebarLabelListSpecWith:" : "lo 6/6/2022 12:20",
"buildSidebarLabelPanelSpecWith:" : "lo 6/5/2022 14:45",
"buildSidebarLabelPanelSpecWith:" : "lo 6/8/2022 09:54",
"buildSidebarPotentialAssigneeListSpecWith:" : "mcr 5/27/2022 18:28",
"buildSidebarPotentialLabelListSpecWith:" : "lo 6/6/2022 12:43",
"buildSidebarSpecWith:" : "LW 6/17/2022 12:21",
"buildSidebarSpecWith:aWidth:" : "LW 6/17/2022 12:20",
"buildSidebarTitleSpecWith:" : "mcr 5/27/2022 19:06",
"buildSyncButton:" : "mcr 5/31/2022 00:08",
"buildWith:" : "NTK 6/6/2022 12:52",
"buildWith:" : "lo 6/10/2022 19:55",
"changeActiveCardTo:" : "lo 6/5/2022 14:59",
"constructor" : "NTK 5/30/2022 14:25",
"constructor:" : "NTK 5/30/2022 14:25",
"createLanes" : "NTK 6/6/2022 00:59",
"createLanes" : "lo 6/18/2022 10:57",
"dragFromAssignees:" : "mcr 5/27/2022 19:26",
"dragFromLabels:" : "mcr 6/7/2022 16:19",
"dragFromPotentialAssignees:" : "mcr 5/27/2022 19:37",
Expand Down Expand Up @@ -70,12 +70,13 @@
"potentialLabelsList" : "mcr 6/7/2022 16:12",
"provider" : "lo 5/26/2022 22:23",
"provider:" : "lo 5/26/2022 22:24",
"showLanes" : "mcr 6/6/2022 22:40",
"synchronizeBoard" : "LW 6/17/2022 12:30",
"showLanes" : "lo 6/11/2022 14:37",
"showLanesButDontRebuildCards" : "lo 6/11/2022 14:48",
"synchronizeBoard" : "NTK 6/6/2022 12:52",
"updateActiveCardDescription:" : "lo 5/26/2022 14:35",
"updateActiveCardTitle:" : "lo 5/26/2022 14:35",
"updateLanes" : "NTK 6/6/2022 12:36",
"updateLanesAndSidebar" : "LW 6/17/2022 12:30",
"updateLanes" : "lo 6/11/2022 14:02",
"updateLanesWithCards" : "lo 6/18/2022 12:05",
"usedBuilder" : "lo 5/26/2022 15:02",
"usedBuilder:" : "lo 5/26/2022 15:02",
"wantsAssigneeDrop:" : "mcr 5/27/2022 18:02",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
initialization
initialize

super initialize.
self color: (Color darkGray alpha: 0.5).
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
sourceLane: aSPBLane

sourceLane := aSPBLane.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
sourceLane

^ sourceLane.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
dropping/grabbing
wantsToBeDroppedInto: aMorph

| laneIndex center |
(aMorph class = SPBPluggablePasteUpMorph or: [aMorph class = SPBMockLane]) ifFalse: [^ false].

laneIndex := aMorph actionModel board lanes indexOf: aMorph actionModel.
center := aMorph positionInWorld x + (aMorph width // 2).
self position x > center
ifTrue: [
self sourceLane changeIndexOfLane: laneIndex + 1
] ifFalse: [
self sourceLane changeIndexOfLane: laneIndex
].

^ false.
8 changes: 8 additions & 0 deletions Squello-Core.package/SPBGhostLane.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"class" : {
},
"instance" : {
"initialize" : "lo 6/11/2022 14:30",
"sourceLane" : "lo 6/10/2022 21:12",
"sourceLane:" : "lo 6/10/2022 21:12",
"wantsToBeDroppedInto:" : "lo 6/18/2022 12:47" } }
14 changes: 14 additions & 0 deletions Squello-Core.package/SPBGhostLane.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "Squello-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"sourceLane" ],
"name" : "SPBGhostLane",
"pools" : [
],
"super" : "Morph",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
api call post request
moveLane: aNumber withPostData: aDictionary

"aNumber -> columnID"
"aDictionary Parameter:
position -> string (first / last / after: <column_id>)"

| stream url |
url := 'https://api.github.com/projects/columns/' , aNumber , '/moves'.
stream := WriteStream with: OrderedCollection new.
aDictionary jsonWriteOn: stream.

^ self postRequestToURL: url withData: stream.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"listPossibleAssigneesForUser:repo:" : "mcr 5/28/2022 00:47",
"listPossibleLabelsForUser:repo:" : "lo 6/5/2022 14:33",
"moveCard:withPostData:" : "mcr 5/28/2022 00:32",
"moveLane:withPostData:" : "tk 6/10/2022 22:17",
"patchRequestToURL:withData:" : "mcr 5/28/2022 03:00",
"postRequestToURL:withData:" : "mcr 5/31/2022 16:46",
"queryCardContent:" : "mcr 5/28/2022 02:33",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cards
moveLane: aSPBLane after: aNumber

"move aSPBLane after lane with ID = aNumber"
| payload |
payload := Dictionary newFrom: {'position' -> ('after:', aNumber)}.
^ self api moveLane: aSPBLane id withPostData: payload.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cards
moveLaneToFront: aSPBLane

| payload |
payload := Dictionary newFrom: {'position' -> 'first'}.
^ self api moveLane: aSPBLane id withPostData: payload.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
columns
queryColumns

^ self api queryColumns: self projectID.
| lane lanesJson |
lanesJson := self api queryColumns: self projectID.

^ (lanesJson collect:
[:each | lane := SPBLane newFrom: each.
lane provider: self]) asOrderedCollection.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@
"listLabelsForCard:" : "mcr 5/28/2022 02:30",
"listPossibleAssignees" : "mcr 5/28/2022 02:29",
"listPossibleLabels" : "lo 6/5/2022 14:37",
"moveCard:after:toColumn:" : "mcr 6/3/2022 13:14",
"moveCard:after:toColumn:" : "tk 6/10/2022 22:15",
"moveCardToTop:toColumn:" : "mcr 6/3/2022 13:14",
"moveLane:after:" : "tk 6/10/2022 22:15",
"moveLaneToFront:" : "tk 6/10/2022 22:17",
"parseInputBoardUrl:" : "jh 6/1/2022 01:49",
"projectID" : "mcr 5/28/2022 01:05",
"projectID:" : "mcr 5/28/2022 01:06",
"projectTitle" : "jh 5/28/2022 17:31",
"projectTitle:" : "jh 5/28/2022 17:31",
"queryCardContent:" : "mcr 5/28/2022 02:30",
"queryCards:" : "mcr 5/28/2022 02:30",
"queryColumns" : "mcr 5/28/2022 01:31",
"queryCards:" : "lo 6/18/2022 11:52",
"queryColumns" : "lo 6/18/2022 10:48",
"renameColumn:to:" : "mcr 5/31/2022 14:29",
"repo" : "mcr 5/22/2022 01:01",
"repo:" : "mcr 5/22/2022 01:02",
Expand Down
9 changes: 9 additions & 0 deletions Squello-Core.package/SPBLane.class/instance/^equals.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
comparing
= anObject
"Answer whether the receiver and anObject represent the same object."

self == anObject
ifTrue: [ ^ true ].
self class = anObject class
ifFalse: [ ^ false ].
^ self id = anObject id
4 changes: 3 additions & 1 deletion Squello-Core.package/SPBLane.class/instance/addToNewLane..st
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ addToNewLane: aSPBCard
[:each | each position y > aSPBCard position y ifTrue: [nextCard ifNil: [nextCard := each]]].
nextCard ifNil:
[self cards addLast: aSPBCard.
^ (self cards size > 1 ifTrue: [aSPBCard frontCardId: (self cards at: self cards size -1) id])].
^ (self cards size > 1
ifTrue: [aSPBCard frontCardId: (self cards at: self cards size -1) id]
ifFalse: [aSPBCard frontCardId: nil])].
self cards add: aSPBCard before: nextCard.
index := self cards indexOf: aSPBCard.
nextCard frontCardId: aSPBCard id.
Expand Down
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBLane.class/instance/alignCards.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ card movement
alignCards

self cards withIndexDo:
[:each :index | each walkToPosition: ((self pasteup position x + 10) @ (self pasteup position y + 10 + ((index-1) * 120))). ].
[:each :index | each walkToPosition: ((self pasteup position x + 10) @ (self pasteup position y + 10 + ((index-1) * 120)))].
Loading

0 comments on commit 1253a36

Please sign in to comment.