Skip to content

Commit

Permalink
added save on close for local boards
Browse files Browse the repository at this point in the history
  • Loading branch information
FePrHPI committed May 27, 2024
1 parent 40e776f commit 1750794
Show file tree
Hide file tree
Showing 45 changed files with 166 additions and 52 deletions.
5 changes: 0 additions & 5 deletions Squello-Core.package/.squot-contents

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessing
repo: anObject
repo := anObject

repo := anObject.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessing
user: anObject
user := anObject

user := anObject.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
"moveColumnToFront:" : "FP 5/23/2024 10:35",
"queryColumns" : "FP 5/23/2024 10:35",
"renameColumn:to:" : "FP 5/23/2024 10:35",
"updateCard:" : "FP 5/23/2024 10:39" } }
"repo" : "FP 5/27/2024 17:23",
"repo:" : "FP 5/27/2024 17:23",
"updateCard:" : "FP 5/23/2024 10:39",
"user" : "FP 5/27/2024 17:23",
"user:" : "FP 5/27/2024 17:23" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"commentStamp" : "",
"instvars" : [
],
"user",
"repo" ],
"name" : "SPBAbstractBoardProvider",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
initialize-release
startup
localPrefix

^ 'local.'.
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBBoard.class/class/open.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ open
prompt := self promptUrl.
prompt = '' ifTrue: [^ self].
self lastProject: prompt.
(prompt beginsWith: 'local') ifTrue: [^ self newLocalWith: prompt].
(prompt beginsWith: self localPrefix) ifTrue: [^ self openLocal: prompt].
^ self newWith: prompt.

4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoard.class/class/openInBackground.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
startup
openInBackground

^ [self open] fork.
7 changes: 7 additions & 0 deletions Squello-Core.package/SPBBoard.class/class/openLocal..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
startup
openLocal: aString

| localFile |
localFile := SPBBoardSaver load: aString.
localFile ifNotNil: [:file|^ file window openInWorld].
^ self newLocalWith: aString.
1 change: 1 addition & 0 deletions Squello-Core.package/SPBBoard.class/instance/buildWith..st
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ buildWith: aBuilder
children:
{self buildColumnAreaSpecWith: aBuilder.
self buildSidebarSpecWith: aBuilder};
closeAction: #saveBoard;
yourself.

^ self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
initialize-release
parseLocalRepoFromUrl: aString

| repoNum |
(aString beginsWith: self localPrefix) ifFalse: [^ self error].
repoNum := aString allButFirst: self localPrefix size.

self boardProvider repo: repoNum asInteger.
self boardProvider repo: aString.
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoard.class/instance/saveBoard.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
updating
saveBoard

SPBBoardSaver save: self as: self boardProvider repo.
11 changes: 7 additions & 4 deletions Squello-Core.package/SPBBoard.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"errorParsingUrl" : "mcr 8/4/2022 01:05",
"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",
"newWith:" : "mcr 8/4/2022 01:09",
"open" : "FP 5/23/2024 09:26",
"open" : "FP 5/27/2024 17:40",
"openInBackground" : "FP 5/27/2024 15:33",
"openLocal:" : "FP 5/27/2024 18:06",
"promptUrl" : "FP 5/23/2024 11:00",
"registerInAppsMenu" : "lo 6/4/2022 23:19" },
"instance" : {
Expand Down Expand Up @@ -39,7 +42,7 @@
"buildSidebarSpecWith:" : "mcr 8/1/2022 00:48",
"buildSidebarSpecWith:width:" : "lo 8/1/2022 11:08",
"buildSidebarTitleSpecWith:" : "lo 8/1/2022 11:08",
"buildWith:" : "mcr 8/3/2022 23:25",
"buildWith:" : "FP 5/27/2024 18:00",
"changeActiveCardTo:" : "mcr 8/1/2022 00:54",
"changeProvider" : "lo 7/8/2022 14:00",
"changeProvider:" : "lo 7/8/2022 15:29",
Expand All @@ -56,13 +59,13 @@
"indexOfColumn:" : "lo 8/3/2022 12:57",
"initialize" : "jh 7/29/2022 11:36",
"loadProject:" : "mcr 8/4/2022 01:24",
"localPrefix" : "FP 5/23/2024 09:38",
"makeLocal" : "FP 5/23/2024 09:30",
"parseLocalRepoFromUrl:" : "FP 5/23/2024 09:40",
"parseLocalRepoFromUrl:" : "FP 5/27/2024 17:13",
"parseRepoFromUrl:" : "mcr 8/4/2022 01:06",
"removeColumn:" : "lo 8/1/2022 14:09",
"rerenderColumns" : "lo 7/31/2022 16:42",
"resizeColumnArea" : "jh 8/3/2022 01:07",
"saveBoard" : "FP 5/27/2024 18:02",
"setUpChangeProvider" : "Haru 5/13/2024 14:46",
"setupColumns" : "jh 8/3/2022 00:48",
"sidebar" : "mcr 8/1/2022 00:44",
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/class/boards..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
boards: anObject

boards := anObject.
5 changes: 5 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/class/boards.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
boards

boards ifNil: [self boards: Dictionary new].
^ boards.
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/class/clear.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save/load
clear

self boards removeAll.
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/class/delete..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save/load
delete: anObject

self boards removeKey: anObject ifAbsent: [].
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/class/load..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save/load
load: anObject

^ (self boards at: anObject ifAbsent: nil) veryDeepCopy.
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/class/save.as..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save/load
save: anObject as: anotherObject

self boards at: anotherObject put: anObject veryDeepCopy.
10 changes: 10 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"class" : {
"boards" : "FP 5/27/2024 15:39",
"boards:" : "FP 5/27/2024 15:39",
"clear" : "FP 5/27/2024 17:17",
"delete:" : "FP 5/27/2024 16:21",
"load:" : "FP 5/27/2024 16:18",
"save:as:" : "FP 5/27/2024 16:15" },
"instance" : {
} }
14 changes: 14 additions & 0 deletions Squello-Core.package/SPBBoardSaver.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "Squello-Core",
"classinstvars" : [
"boards" ],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SPBBoardSaver",
"pools" : [
],
"super" : "Object",
"type" : "normal" }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,5 @@
"queryCardContent:" : "mcr 5/28/2022 02:30",
"queryColumns" : "mcr 8/3/2022 14:24",
"renameColumn:to:" : "tk 7/30/2022 22:22",
"repo" : "mcr 5/22/2022 01:01",
"repo:" : "mcr 5/22/2022 01:02",
"updateCard:" : "FP 5/21/2024 11:22",
"user" : "mcr 5/22/2022 01:02",
"user:" : "mcr 5/22/2022 01:02",
"webhookId" : "NTK 7/30/2022 12:46" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
],
"commentStamp" : "lo 5/16/2022 20:46",
"instvars" : [
"user",
"repo",
"api",
"projectId",
"webhookId" ],
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,4 @@
"nextId" : "FP 5/23/2024 10:28",
"queryColumns" : "FP 5/23/2024 10:14",
"renameColumn:to:" : "FP 5/23/2024 10:38",
"repo" : "FP 5/23/2024 09:40",
"repo:" : "FP 5/23/2024 09:40",
"updateCard:" : "FP 5/23/2024 10:39",
"user" : "FP 5/23/2024 09:40",
"user:" : "FP 5/23/2024 09:40" } }
"updateCard:" : "FP 5/23/2024 10:39" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
],
"commentStamp" : "",
"instvars" : [
"user",
"repo",
"currentId" ],
"name" : "SPBLocalBoardProvider",
"pools" : [
Expand Down
5 changes: 0 additions & 5 deletions Squello-Tests.package/.squot-contents

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
values
copyableObject

^ Object new.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
values
defaultKey

^ #superLongTestSymbolTheUserWillOnlyUseStrings.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
values
defaultValue

^ #somethingThatWeWantToSave.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setup
setUp

SPBBoardSaver delete: self defaultKey.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setup
tearDown

SPBBoardSaver delete: self defaultKey.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tests
testDeleteReturnsNil
"the delete happens in setUp"

| loadedValue |
loadedValue := SPBBoardSaver load: self defaultKey.
self assert: loadedValue isNil.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testLoadCreatesCopy

| obj1 obj2 |
SPBBoardSaver save: self copyableObject as: self defaultKey.
obj1 := SPBBoardSaver load: self defaultKey.
obj2 := SPBBoardSaver load: self defaultKey.
self assert: (obj1 hash = obj2 hash) not.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tests
testLoadIsCopyOfSave

| insertedObject loadedObject |
insertedObject := self copyableObject.
SPBBoardSaver save: insertedObject as: self defaultKey.
loadedObject := SPBBoardSaver load: self defaultKey.

self assert: (insertedObject hash = loadedObject hash) not.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests
testSaveIsSameAsLoad

| valueAfterInsertion|
SPBBoardSaver save: self defaultValue as: self defaultKey.
valueAfterInsertion := SPBBoardSaver load: self defaultKey.

self assert: valueAfterInsertion = self defaultValue.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"class" : {
},
"instance" : {
"copyableObject" : "FP 5/27/2024 16:03",
"defaultKey" : "FP 5/27/2024 15:57",
"defaultValue" : "FP 5/27/2024 15:57",
"setUp" : "FP 5/27/2024 16:16",
"tearDown" : "FP 5/27/2024 16:17",
"testDeleteReturnsNil" : "FP 5/27/2024 16:17",
"testLoadCreatesCopy" : "FP 5/27/2024 16:18",
"testLoadIsCopyOfSave" : "FP 5/27/2024 16:17",
"testSaveIsSameAsLoad" : "FP 5/27/2024 16:17" } }
14 changes: 14 additions & 0 deletions Squello-Tests.package/SPBLocalSaveTests.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "Squello-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SPBLocalSaveTests",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }

0 comments on commit 1750794

Please sign in to comment.