Commit Graph

313 Commits

Author SHA1 Message Date
3502abdd49 Fixed revision issues caused by page fillable changes 2020-05-23 12:28:14 +01:00
00c0815808 Fixed issue where updated page content would not be indexed
- Also updated html field of pages to not be fillable.
   (Since HTML should always go through app id parsing)

Related to #2042
2020-05-23 00:46:13 +01:00
9666c8c0f7 Updated shelf-list view to enforce view permissions for child books
- Aligned shelf-homepage behaviour to match
- Updated testing to cover.

For #2111
2020-05-12 22:21:45 +01:00
3c26e7b727 Updated comment md rendering to be server-side 2020-05-01 23:24:11 +01:00
d4df18098f Cleaned up the activity service
- Added test to ensure activity on entity delete works as expected.
2020-04-10 20:55:33 +01:00
47e645909e Reviewed #1688, Show parent shelves on books page
- Moved list to the left of the page to align with other navigational
items.
- Hid list of no shelves, to help hide shelf references if not in use.
- Tweaked test to ensure it wasn't finding shelf name in breadcrumb
rather than list being tested.
2020-04-09 17:29:22 +01:00
898cedf536 Merge branch 'feature/#1598' of git://github.com/cw1998/BookStack into cw1998-feature/#1598 2020-04-09 17:18:37 +01:00
f84bf8e883 Updated test files to be PSR-4 compliant
Closes #1924
2020-04-04 01:16:05 +01:00
6caedc7a37 Fixed issues preventing breadcrumb navigation menus from opening
- Added tests to cover endpoint

Fixes #1884
2020-02-15 19:09:33 +00:00
5978d9a0d3 Updated cover image methods so image parameter is not optional but still nullable 2020-02-15 18:38:36 +00:00
ea3c3cde5a Added test to ensure shelf cover image gets set on create
Related to #1897
2020-02-15 18:34:02 +00:00
017703ff1a Updated page delete to return to chapter if within one
- Added test to cover

Closes #1715
2019-12-16 11:54:53 +00:00
d64c358c4f Updated sort logic to handle chapter to book scenario
- Extended tests out to cover
2019-10-29 22:33:09 +00:00
6a1b6a97f9 Added test for page move into chapter 2019-10-29 22:25:53 +00:00
28184c6bfc Merge branch 'fix/#1662' of git://github.com/cw1998/BookStack into cw1998-fix/#1662 2019-10-27 16:44:41 +00:00
31f5786e01 Entity Repo & Controller Refactor (#1690)
* Started mass-refactoring of the current entity repos

* Rewrote book tree logic

- Now does two simple queries instead of one really complex one.
- Extracted logic into its own class.
- Remove model-level akward union field listing.
- Logic now more readable than being large separate query and
compilation functions.

* Extracted and split book sort logic

* Finished up Book controller/repo organisation

* Refactored bookshelves controllers and repo parts

* Fixed issues found via phpunit

* Refactored Chapter controller

* Updated Chapter export controller

* Started Page controller/repo refactor

* Refactored another chunk of PageController

* Completed initial pagecontroller refactor pass

* Fixed tests and continued reduction of old repos

* Removed old page remove and further reduced entity repo

* Removed old entity repo, split out page controller

* Ran phpcbf and split out some page content methods

* Tidied up some EntityProvider elements

* Fixed issued caused by viewservice change
2019-10-05 12:55:01 +01:00
4ad4dfa55a Show bookshelves that a book belongs to on a book view
Closes #1598
2019-09-27 00:45:22 +01:00
2f94f078e3 Fix Book form (create) returning to the full books list on cancel
Fixes #1662
Added a small block of logic to determine the correct URL to attribute to the cancel button on a given page create form.
If adding a book from a bookshelf, return to the bookshelf. If editing a book, return to the book. In all other cases, return to the full books list.
2019-09-26 22:51:24 +01:00
8b550991a4 Refactored some core entity actions
- Created BookChild class to share some page/chapter logic.
- Gave entities the power to generate their own permissions and slugs.
- Moved bits out of BaseController constructor since it was overly
sticky.
- Moved slug generation logic into its own class.
- Created a facade for permissions due to high use.
- Fixed failing test issues from last commits
2019-09-20 00:18:28 +01:00
cbf9d701af Updated to laravel 6 2019-09-14 14:12:39 +01:00
140298bd96 Updated to Laravel 5.8 2019-09-13 23:58:40 +01:00
7cc17934a8 Made MD editor display a sandboxed iframe
- Also added escaping of srcdoc elements in escape logic.

Related to #1531
2019-08-26 12:16:50 +01:00
2dfe6c2d56 Fixed failing test and added more accessibility improvements
- Updated linked images to have obvious focus styles
- Added proper role to notifications
- Made dropdown list focus styles a bit nicer.
- Updated book list chapter child slide down to be keyboard activatable.

Related to #1320
2019-08-25 17:21:25 +01:00
20c36d58a6 Merge pull request #1527 from BookStackApp/129-page-templates
Page Templates Implementation
2019-08-11 20:21:17 +01:00
5fdab3b8af Updated template test to be more stable 2019-08-11 20:10:27 +01:00
de3e9ab094 Added ability to use templates
- Added replace, append and prepend actions for template content into
both the WYSIWYG editor and markdown editor.
- Added further testing to cover.
2019-08-11 20:04:43 +01:00
421dd93ffd Merge branch 'v0.26' 2019-08-06 21:50:56 +01:00
2955f414dd Added iframe JS and data url escaping
Related to #1531
2019-08-06 21:08:24 +01:00
2ebbc6b658 Merge branch 'master' into 129-page-templates 2019-08-04 16:26:38 +01:00
1e7df28238 Set export service to set correct svg image mimetype
For #1538
2019-07-17 22:37:19 +01:00
c732970f6e Hardened page content script escaping
Increased range of tests to cover.

Fixes #1531
2019-07-10 20:17:22 +01:00
71167426bb Started implementation of page template 2019-07-07 13:45:46 +01:00
35e6635379 Fixed chapter description not showing in book exports
Closes #1465
2019-05-25 15:21:02 +01:00
ad542f0407 Prevented potential inline JS event usage
- Removes 'on*' attributes from elements.
- Also updated script logic to remove scripts instead of escaping.
- All JS injection removal now uses DomDocument + xpath parsing.
2019-05-05 13:53:37 +01:00
2bb06463d5 Added deeper content id de-duplication
Closes #1393
2019-04-21 12:22:41 +01:00
0bc5ccba32 Add revision restore confirm and changed http method
Closes #1321
2019-04-20 13:25:16 +01:00
6c66a8935a Added test to check page HTML id de-duplication
Relates to #1393
2019-04-20 13:01:56 +01:00
c380c10d54 Prevented bad duplicate IDs causing major exception
Related to #1393
2019-04-15 21:20:32 +01:00
7f3f6e65b9 Aligned item creation wording and updated shelf-book-add logic 2019-04-15 20:45:04 +01:00
50a9c71de0 Add tests for creating a book and adding directly to a shelf 2019-04-15 09:27:17 +01:00
faa3a8b842 Add button to add a book directly from a shelf view 2019-04-15 09:27:17 +01:00
b12ae6d11b Added bookshelves to breadcrumbs
- Updated breadcrumb dropdown switchers and back-end sibling code to handle new breadcrumbs.
- Added breadcrumb view composer and EntityContext system to mangage
tracking if in the context of a bookshelf.
2019-04-07 18:28:11 +01:00
7cda9b026e Updated tests to suit layout changes, Updated 404 page
- Also replaced 'or' usage in templates with null coalescing operator
2019-04-06 18:36:17 +01:00
042a6f9760 Updated shelf menu item to show on custom permission
- Extended new 'userCanOnAny' helper to take a entity class for
filtering.

Closes #1201
2019-03-09 21:15:45 +00:00
5c9b528517 Abstracted userCanCreatePage helper to work for any permisison
- Added test to cover scenario where someone with create-own permission
would want to copy a viewable item into a container entity that they
own.
2019-03-09 16:50:22 +00:00
0e0a17cc30 Prevented page text content includes
Avoids possible permission issues where included content shown in search or preview
where the user would not normally have permission to view the included content.

Closes #1178
2019-01-05 17:18:40 +00:00
a2087fe3ff Made delete permissions a requirement for move operations
Closes #1200
2019-01-05 14:39:40 +00:00
f4ea5f1f55 Updated page exports to use absolute time format
For #1065
2018-12-22 16:35:04 +00:00
85f330c79a Extracted many page-specific repo methods into page-specific repo 2018-10-13 11:27:55 +01:00
919660678b Re-structured the app code to be feature based rather than code type based 2018-09-25 12:30:50 +01:00