Skip to content

Commit

Permalink
Merge d331654 into 5d113fa
Browse files Browse the repository at this point in the history
  • Loading branch information
SaturnHafen committed Jul 11, 2022
2 parents 5d113fa + d331654 commit 1c8f468
Show file tree
Hide file tree
Showing 116 changed files with 594 additions and 261 deletions.
20 changes: 3 additions & 17 deletions Squello-Core.package/SPBBoard.class/class/newWith..st
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
startup
newWith: aString

| instance projectNames chosenProject |
| instance |
instance := self new.

(SPBGithubAPI username isNil or: [SPBGithubAPI token isNil]) ifTrue: [SPBUserAuth open].
Expand All @@ -10,24 +10,10 @@ newWith: aString
(aString beginsWith: 'https://github.com/') ifFalse:
[^ UserDialogBoxMorph inform: 'Invalid repository url' asString title: 'Operation canceled'].

(aString includesSubstring: '/projects')
ifTrue:
[instance provider parseInputBoardUrl: aString]
ifFalse:
[instance projects: (instance provider getProjects: aString).
(instance projects isArray) ifFalse:
[^ UserDialogBoxMorph inform: 'Invalid repository url' asString title: 'Operation canceled'].
projectNames := instance getProjectNames.
chosenProject := UIManager default chooseFrom: projectNames values: instance projects title: 'Choose your project:'.
chosenProject ifNil: [^self].
instance provider projectID: (chosenProject at: 'id').
instance provider projectTitle: (chosenProject at: 'name').
" instance provider parseInputBoardUrl: aString, '/projects/', (chosenProject at: 'number') asString."
].
instance loadProject: aString.

instance provider error isString ifTrue: [
UserDialogBoxMorph inform: ('Getting the board failed with error: ' , instance provider error , '.<n>Do you have access to this project?<n>Is your access token correct and valid?' expandMacros) title: 'Board fetching error'.
^ SPBUserAuth open.
].
^ SPBUserAuth open].
instance buildAndOpen.
^ instance.
14 changes: 7 additions & 7 deletions Squello-Core.package/SPBBoard.class/instance/addLane.st
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
toolbuilder
addLane

| lane laneJson prompt |
prompt := FillInTheBlank request: 'Enter a lane name' initialAnswer:''.
prompt = '' ifTrue: [^ self].
laneJson := self provider createColumn: prompt.
lane := SPBLane newFrom: laneJson.
| lane prompt|
prompt := FillInTheBlankMorph request: 'Enter a lane name' initialAnswer:''.
prompt = '' ifTrue: [^ self].
lane := self provider createColumn: prompt.
lane
board: self;
provider: self provider.
provider: self provider;
changeProvider: self changeProvider.
self lanes add: lane.
lane jsonCards: {} asOrderedCollection.
self updateLanesWithCards.
4 changes: 0 additions & 4 deletions Squello-Core.package/SPBBoard.class/instance/buildAndOpen.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ buildAndOpen
| window |
self createLanes.

self
provider: self provider;
lanes: self lanes.

window := self buildWith: SPBMorphicToolBuilder new.
window openInWorld.
^ window.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildLaneBodySpecWith: aBuilder And: aSPBLane
hScrollBarPolicy: #never;
vScrollBarPolicy: #always;
children:
{aBuilder pluggablePasteUpSpec new
{aBuilder pasteUpSpec new
minimumExtent: 300@290;
model: aSPBLane;
name: aSPBLane id;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
changeProvider: anSPBChangeProvider

changeProvider := anSPBChangeProvider.
self changeProvider addDependent: self.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
changeProvider

^ changeProvider.
3 changes: 2 additions & 1 deletion Squello-Core.package/SPBBoard.class/instance/createLanes.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
accessing
createLanes

self lanes: self provider queryColumns.
self lanes: self provider queryColumns.
self lanes do: [:lane | lane changeProvider: self changeProvider].

This file was deleted.

6 changes: 5 additions & 1 deletion Squello-Core.package/SPBBoard.class/instance/initialize.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ initialize-release
initialize

super initialize.
self provider: SPBGithubBoardProvider new.
self
provider: SPBGithubBoardProvider new;
changeProvider: SPBGithubChangeProvider new.

self changeProvider api: self provider api.
19 changes: 19 additions & 0 deletions Squello-Core.package/SPBBoard.class/instance/loadProject..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
initialize-release
loadProject: aString

| chosenProject projectNames projects |
(aString includesSubstring: '/projects')
ifTrue:
[self provider parseInputBoardUrl: aString]
ifFalse:
[projects := (self provider getProjects: aString).
(projects isArray) ifFalse:
[^ UserDialogBoxMorph inform: 'Invalid repository url' asString title: 'Operation canceled'].
projectNames := projects collect: [:each | each at: 'name'].
chosenProject := UIManager default chooseFrom: projectNames values: projects title: 'Choose your project:'.
chosenProject ifNil: [^self].
self provider
projectID: (chosenProject at: 'id');
projectTitle: (chosenProject at: 'name')].

self changeProvider projectId: self provider projectID.
3 changes: 0 additions & 3 deletions Squello-Core.package/SPBBoard.class/instance/projects..st

This file was deleted.

3 changes: 0 additions & 3 deletions Squello-Core.package/SPBBoard.class/instance/projects.st

This file was deleted.

14 changes: 14 additions & 0 deletions Squello-Core.package/SPBBoard.class/instance/update.with..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
updating
update: aSymbol with: aDictionary

| lane |
aSymbol = #board ifFalse: [^ self].

((aDictionary at: 'action') = #create) ifTrue:
[lane := SPBLane newFrom: aDictionary.
lane
board: self;
provider: self provider;
changeProvider: self changeProvider.
self lanes add: lane.
self updateLanesWithCards].
3 changes: 2 additions & 1 deletion Squello-Core.package/SPBBoard.class/instance/window..st
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessing
window: anObject
window := anObject

window := anObject.
3 changes: 2 additions & 1 deletion Squello-Core.package/SPBBoard.class/instance/window.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessing
window
^ window

^ window.
29 changes: 15 additions & 14 deletions Squello-Core.package/SPBBoard.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"lastProject" : "NTK 6/1/2022 16:40",
"lastProject:" : "NTK 6/1/2022 16:40",
"newWith:" : "jh 6/21/2022 11:58",
"newWith:" : "lo 7/8/2022 14:06",
"open" : "NTK 6/1/2022 16:41",
"registerInAppsMenu" : "lo 6/4/2022 23:19" },
"instance" : {
Expand All @@ -12,16 +12,16 @@
"activeCardDescription" : "lo 5/26/2022 14:25",
"activeCardLabelList" : "lo 6/5/2022 14:58",
"activeCardTitle" : "lo 5/26/2022 14:25",
"addLane" : "tk 6/10/2022 23:04",
"addLane" : "lo 7/8/2022 14:36",
"assigneeSelected" : "mcr 5/27/2022 19:11",
"assigneeSelected:" : "mcr 5/27/2022 19:13",
"buildAddLaneButtonPanelSpecWith:" : "mcr 6/11/2022 12:29",
"buildAddLaneButtonSpecWith:" : "mcr 6/6/2022 22:30",
"buildAndOpen" : "NTK 6/1/2022 16:47",
"buildAndOpen" : "lo 7/8/2022 14:31",
"buildLaneAreaChildren" : "mcr 6/6/2022 22:42",
"buildLaneAreaSpecWith:" : "jh 6/23/2022 09:31",
"buildLaneAreaSpecWith:aWidth:" : "jh 6/23/2022 09:30",
"buildLaneBodySpecWith:And:" : "jh 6/18/2022 12:23",
"buildLaneBodySpecWith:And:" : "lo 7/3/2022 13:28",
"buildLaneHeaderAddCardButtonSpecWith:And:" : "mcr 5/27/2022 18:58",
"buildLaneHeaderMoveLaneButtonSpecWith:And:" : "lo 6/15/2022 10:09",
"buildLaneHeaderSpecWith:And:" : "mcr 6/11/2022 12:34",
Expand All @@ -41,7 +41,9 @@
"buildSyncButton:" : "mcr 5/31/2022 00:08",
"buildWith:" : "jh 6/21/2022 12:01",
"changeActiveCardTo:" : "lo 6/5/2022 14:59",
"createLanes" : "lo 6/18/2022 10:57",
"changeProvider" : "lo 7/8/2022 14:00",
"changeProvider:" : "lo 7/8/2022 15:29",
"createLanes" : "lo 7/8/2022 14:34",
"dragFromAssignees:" : "mcr 5/27/2022 19:26",
"dragFromLabels:" : "lo 6/5/2022 14:46",
"dragFromPotentialAssignees:" : "mcr 5/27/2022 19:37",
Expand All @@ -50,13 +52,13 @@
"dropOnLabels:at:" : "mcr 7/1/2022 12:13",
"dropOnPotentialAssignees:at:" : "mcr 5/30/2022 21:47",
"dropOnPotentialLabels:at:" : "mcr 7/1/2022 12:12",
"getProjectNames" : "NTK 6/17/2022 12:41",
"initialize" : "NTK 6/1/2022 16:39",
"labelIcon:" : "mcr 7/3/2022 17:04",
"labelSelected" : "mcr 7/3/2022 17:54",
"initialize" : "lo 7/8/2022 14:23",
"labelIcon:" : "mcr 6/7/2022 16:25",
"labelSelected" : "lo 6/5/2022 14:56",
"labelSelected:" : "lo 6/5/2022 15:14",
"lanes" : "lo 5/26/2022 23:15",
"lanes:" : "lo 5/26/2022 23:15",
"loadProject:" : "lo 7/8/2022 14:21",
"potentialAssigneeSelected" : "mcr 5/27/2022 19:11",
"potentialAssigneeSelected:" : "mcr 5/27/2022 19:14",
"potentialAssignees" : "mcr 5/28/2022 01:44",
Expand All @@ -68,14 +70,13 @@
"potentialLabels" : "lo 6/5/2022 14:39",
"potentialLabels:" : "lo 6/5/2022 14:39",
"potentialLabelsList" : "mcr 6/7/2022 16:12",
"projects" : "NTK 6/11/2022 14:40",
"projects:" : "NTK 6/11/2022 14:40",
"provider" : "lo 5/26/2022 22:23",
"provider:" : "lo 5/26/2022 22:24",
"resizeLaneArea" : "mcr 6/21/2022 11:59",
"showLanes" : "mcr 6/6/2022 22:40",
"showLanesButDontRebuildCards" : "lo 6/11/2022 14:48",
"synchronizeBoard" : "mcr 7/3/2022 23:55",
"synchronizeBoard" : "NTK 6/6/2022 12:52",
"update:with:" : "lo 7/8/2022 15:27",
"updateActiveCardDescription:" : "lo 5/26/2022 14:35",
"updateActiveCardTitle:" : "lo 5/26/2022 14:35",
"updateLanes" : "mcr 6/11/2022 14:09",
Expand All @@ -85,5 +86,5 @@
"usedBuilder:" : "lo 5/26/2022 15:02",
"wantsAssigneeDrop:" : "mcr 5/27/2022 18:02",
"wantsLabelDrop:" : "lo 6/5/2022 14:48",
"window" : "NTK 5/30/2022 13:52",
"window:" : "NTK 5/30/2022 13:52" } }
"window" : "lo 7/3/2022 14:09",
"window:" : "lo 7/3/2022 14:09" } }
2 changes: 2 additions & 0 deletions Squello-Core.package/SPBBoard.class/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"LastProject" ],
"commentStamp" : "LW 6/20/2022 09:44",
"instvars" : [
"changeProvider",
"activeCard",
"usedBuilder",
"lanes",
Expand All @@ -16,6 +17,7 @@
"labelSelected",
"potentialAssigneeSelected",
"potentialLabelSelected",
"projects",
"window",
"constructor" ],
"name" : "SPBBoard",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
changeProvider: anSPBGithubChangeProvider

changeProvider := anSPBGithubChangeProvider.
changeProvider addDependent: self.
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBCard.class/instance/changeProvider.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
changeProvider

^ changeProvider.
4 changes: 0 additions & 4 deletions Squello-Core.package/SPBCard.class/instance/frontCardId..st

This file was deleted.

4 changes: 0 additions & 4 deletions Squello-Core.package/SPBCard.class/instance/frontCardId.st

This file was deleted.

43 changes: 43 additions & 0 deletions Squello-Core.package/SPBCard.class/instance/update.with..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
updating
update: aSymbol with: aDictionary

| board newLane label assignee |
aSymbol = #card ifFalse: [^ self].
(self id = (aDictionary at: 'id') or: [self issueId = (aDictionary at: 'id')]) ifFalse: [^ self].

((aDictionary at: 'action') = #move) ifTrue:
[board := self lane board.
newLane := board lanes detect: [:lane | lane id = (aDictionary at: 'laneId')].
self openInWorld.
newLane removeFromOldLane: self.
newLane pasteup addMorph: self.
(aDictionary at: 'after')
ifNil: [newLane cards addFirst: self]
ifNotNil: [newLane cards add: self after: (newLane cards detect: [:card | card id = (aDictionary at: 'after')])].
newLane resizeToFitCards.
self lane alignCards.
newLane alignCards.
self lane: newLane].
((aDictionary at: 'action') = #delete) ifTrue:
[self lane deleteCard: self].
((aDictionary at: 'action') = #edit) ifTrue:
[self updateTitle: (aDictionary at: 'title').
self updateDescription: (aDictionary at: 'body')].
((aDictionary at: 'action') = #label) ifTrue:
[label := SPBLabel newFrom: (aDictionary at: 'label').
self labels add: label.
self updateLabelIcons].
((aDictionary at: 'action') = #unlabel) ifTrue:
[label := SPBLabel newFrom: (aDictionary at: 'label').
self labels remove: label.
self updateLabelIcons].
((aDictionary at: 'action') = #assign) ifTrue:
[assignee := SPBAssignee newFrom: (aDictionary at: 'assignee').
self assignees add: assignee.
self updateAssigneeCount].
((aDictionary at: 'action') = #unassign) ifTrue:
[assignee := SPBAssignee newFrom: (aDictionary at: 'assignee').
self assignees remove: assignee.
self updateAssigneeCount].

self lane board activeCard = self ifTrue: [self lane board changeActiveCardTo: self]
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ updateLabelIcons
| newLabel |
self labelMorphs do: [:each | each abandon].
self labelMorphs removeAll.

self labels withIndexDo: [:label :i |
self labels do: [:label |
newLabel := label asMorph.
self labelMorphs add: newLabel.
self addMorph: newLabel.
self alignLabels].
self lane ifNotNil: [self resizeCard].
self lane ifNotNil: [self resizeCard. self lane resizeToFitCards].
Loading

0 comments on commit 1c8f468

Please sign in to comment.