]> BookStack Code Mirror - bookstack/commit
Entity Repo & Controller Refactor (#1690)
authorDan Brown <redacted>
Sat, 5 Oct 2019 11:55:01 +0000 (12:55 +0100)
committerGitHub <redacted>
Sat, 5 Oct 2019 11:55:01 +0000 (12:55 +0100)
commit31f5786e01fc5ed439f347c6979679612baca4fb
treead773e2ade9af67fee48d0bc4ce914e1da02b2b6
parent7cd956b24b7a08a8b274d9f244bf6ab482de9635
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
72 files changed:
app/Actions/ActivityService.php
app/Actions/ViewService.php
app/Auth/Permissions/PermissionService.php
app/Auth/Role.php
app/Auth/User.php
app/Auth/UserRepo.php
app/Entities/Book.php
app/Entities/BookChild.php
app/Entities/Bookshelf.php
app/Entities/BreadcrumbsViewComposer.php
app/Entities/Chapter.php
app/Entities/Entity.php
app/Entities/EntityProvider.php
app/Entities/ExportService.php
app/Entities/HasCoverImage.php [new file with mode: 0644]
app/Entities/Managers/BookContents.php [new file with mode: 0644]
app/Entities/Managers/EntityContext.php [moved from app/Entities/EntityContextManager.php with 53% similarity]
app/Entities/Managers/PageContent.php [new file with mode: 0644]
app/Entities/Managers/PageEditActivity.php [new file with mode: 0644]
app/Entities/Managers/TrashCan.php [new file with mode: 0644]
app/Entities/Page.php
app/Entities/PageRevision.php
app/Entities/Repos/BaseRepo.php [new file with mode: 0644]
app/Entities/Repos/BookRepo.php
app/Entities/Repos/BookshelfRepo.php [new file with mode: 0644]
app/Entities/Repos/ChapterRepo.php [new file with mode: 0644]
app/Entities/Repos/EntityRepo.php [deleted file]
app/Entities/Repos/PageRepo.php
app/Entities/SlugGenerator.php
app/Exceptions/MoveOperationException.php [new file with mode: 0644]
app/Exceptions/SortOperationException.php [new file with mode: 0644]
app/Http/Controllers/AttachmentController.php
app/Http/Controllers/Auth/ConfirmEmailController.php
app/Http/Controllers/Auth/ForgotPasswordController.php
app/Http/Controllers/Auth/ResetPasswordController.php
app/Http/Controllers/Auth/UserInviteController.php
app/Http/Controllers/BookController.php
app/Http/Controllers/BookExportController.php
app/Http/Controllers/BookSortController.php [new file with mode: 0644]
app/Http/Controllers/BookshelfController.php
app/Http/Controllers/ChapterController.php
app/Http/Controllers/ChapterExportController.php
app/Http/Controllers/CommentController.php
app/Http/Controllers/Controller.php
app/Http/Controllers/HomeController.php
app/Http/Controllers/Images/ImageController.php
app/Http/Controllers/PageController.php
app/Http/Controllers/PageExportController.php
app/Http/Controllers/PageRevisionController.php [new file with mode: 0644]
app/Http/Controllers/PageTemplateController.php
app/Http/Controllers/PermissionController.php
app/Http/Controllers/SearchController.php
app/Http/Controllers/SettingController.php
app/Http/Controllers/UserController.php
app/Http/Middleware/GlobalViewData.php
resources/views/books/export.blade.php
resources/views/errors/404.blade.php
resources/views/form/entity-permissions.blade.php
resources/views/shelves/form.blade.php
resources/views/shelves/show.blade.php
routes/web.php
tests/CommandsTest.php
tests/Entity/EntityTest.php
tests/Entity/PageContentTest.php
tests/Entity/PageDraftTest.php
tests/Entity/PageRevisionTest.php
tests/Entity/SortTest.php
tests/Permissions/RestrictionsTest.php
tests/SharedTestHelpers.php
tests/Unit/PageRepoTest.php [deleted file]
tests/Uploads/AttachmentTest.php
tests/Uploads/ImageTest.php