-
Notifications
You must be signed in to change notification settings - Fork 310
Add default board #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default board #527
Conversation
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
…Test Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
juliusknorr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small codestyle comments. But besides that, really nice work.
| } | ||
|
|
||
| public function testCheckFirstRunCaseTrue() { | ||
| $appName = "Deck"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always use single quotes please 😉
| $this->cardService = $this->createMock(CardService::class); | ||
| $this->config = $this->createMock(IConfig::class); | ||
|
|
||
| $this->l10n = $this->request = $this->getMockBuilder( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use createMock here.
| } | ||
|
|
||
| public function testCheckFirstRunCaseFalse() { | ||
| $appName = "deck"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single quotes
| public function testIndexOnFirstRun() { | ||
|
|
||
| $board = new Board(); | ||
| $board->setTitle("Personal"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single quotes
lib/Service/DefaultBoardService.php
Outdated
| } | ||
|
|
||
| public function checkFirstRun($userId, $appName) { | ||
| $firstRun = $this->config->getUserValue($userId,$appName,'firstRun','yes'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a space after the ,
lib/Service/DefaultBoardService.php
Outdated
| $userBoards = $this->boardMapper->findAllByUser($userId); | ||
|
|
||
| if ($firstRun === 'yes' && count($userBoards) === 0) { | ||
| $this->config->setUserValue($userId,$appName,'firstRun','no'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after ,
|
|
||
| public function testIndexOnSecondRun() { | ||
|
|
||
| $this->config->setUserValue($this->userId,'deck','firstRun','no'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after ,
| "View more" : "View more", | ||
| "Move board to archive" : "Move board to archive", | ||
| "Create a new board" : "Create a new board" | ||
| "Create a new board" : "Create a new board" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change can be removed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this string part of the l10n definitions? I see it in every other file, all I did here was remove the comma I appended at the end of the line, and obvious I accidentally added in some extra white space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to the whitespace 😉 But that's a non-blocker.
| "View more" : "View more", | ||
| "Move board to archive" : "Move board to archive", | ||
| "Create a new board" : "Create a new board" | ||
| "Create a new board" : "Create a new board" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
|
👍 for adding tests. There seems to be one still failing: |
Part of this test is checking that the name of the stacks is being set, and those names are going through l10n->t which does not yet have a definition for those strings, hence why the test fails. Should I be removing that part of the test? |
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
| ->willReturn($board); | ||
|
|
||
| $stackToDoId = '123'; | ||
| $stackToDo = $this->assembleTestStack($this->l10n->t('To do'), $stackToDoId, $boardId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mock the t call on l10n with something like:
$this->l10n->expects($this->any())
->method('t')
->willReturnCallback(function($text) { return $text } );
you can just call $this->assembleTestStack('To do' ... then and use the plain string for further checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, just submitted the revision, once your build server finishes it's thing you should be good to go :).
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
|
Sign off check failing due to github branch update. Let's merge this. |
|
@Nebri Congratulations to your first open source contribution. 🎉 I'm glad to have you on board for the deck app. |
This PR should close #197, this is my first PR into an open source project.
If I have missed anything / need revisions please advise upon completing your review.
Thanks very much, this was a great learning experience!