Skip to content

Adds button to allow users to toggle the book view via the books list… - #635

Merged
ssddanbrown merged 2 commits into
BookStackApp:masterfrom
Abijeet:feature-613
Dec 29, 2017
Merged

Adds button to allow users to toggle the book view via the books list…#635
ssddanbrown merged 2 commits into
BookStackApp:masterfrom
Abijeet:feature-613

Conversation

@Abijeet

@Abijeet Abijeet commented Dec 26, 2017

Copy link
Copy Markdown
Member

… page.

Closes #613

Signed-off-by: Abijeet abijeetpatro@gmail.com

… page.

Closes #613

Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Comment thread tests/UserProfileTest.php
->visit('/books')
->pageNotHasElement('.featured-image-container')
->pageHasElement('.entity-list-item');
->pageHasElement('.content .entity-list-item');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just made the test a little more specific.

@Abijeet

Abijeet commented Dec 26, 2017

Copy link
Copy Markdown
Member Author

@ssddanbrown - I think you might have a few things to add about the way I've handled this. Please let me know if you'd like me to make any changes.

Also I've written the test cases but I'm not able to get them to pass. Not really sure what's wrong. Any pointers will be appreciated.

Note that I've allowed even guest users to be able to toggle the view.

Image below,
screenshot-2017-12-26 books bookstack 1

@ssddanbrown ssddanbrown added this to the BookStack Beta v0.20.0 milestone Dec 29, 2017
@ssddanbrown
ssddanbrown merged commit d5a2529 into BookStackApp:master Dec 29, 2017
@ssddanbrown

Copy link
Copy Markdown
Member

Thanks @Abijeet for implementing this. Sorry I didn't answer your questions here and on the issue.

Your implementation looked good and I agree that UserController was probably the best place for this. If found to be awkward we can always move it in the future.

I done a few tweaks after pulling down and playing with it, All under commit: 141bf22

I moved the toggle to the left to separate UI options and actions which aligns it with the homepage. I changed the HTTP method to PATCH as that seemed to be the most suited to me (Since we're PATCHing the user settings with a single change). I also updated the button to change text and icon depending on view so the action behind the button is clear to the user.

Thanks again!

@Abijeet

Abijeet commented Dec 30, 2017

Copy link
Copy Markdown
Member Author

Thanks, the changes you made make sense. I will keep it in mind for future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants