Repository navigation
Move the generic dashboard code into core - #32
Merged
Merged
Conversation
Parallel workers shared the Testbench public directory and the compiled views directory, so concurrent mkdir calls and tests that build, publish, or upload into public/ raced each other.
…core - Register the dashboard's generic Blade components from the package. They keep their names, and an application view under resources/components or a class under App\View\Components with the same name overrides them. - Ship functions.js, themer.js, the redot plugins, redot.css, the shared runtime, and the third-party libraries, published to public/vendor/redot by the new redot:publish command, which also publishes the datatables assets and replaces datatables:link. - Add <x-redot-styles> and <x-redot-scripts> so layouts load the runtime without listing every file. - Build the package initializers into init.js, letting same-named application inits override them, and track package files outside the application in the dependency lock. - Extract language tokens from the package views and scripts.
- Move the select search, uploader, and HugeRTE upload controllers into the package and register their global routes before the application's, so an application route with the same URI and name replaces the package one. - Add the is_dashboard_request() and current_sessions() helpers.
…igurable - Add redot.paths for the application route files and the layouts directory and namespace. - Add redot.features.dashboard.guard and use it wherever the sidebar, route_guard(), route_allowed(), and permissions:sync assumed "admins". - Build the dashboard root for is_dashboard_request() from the configured prefix instead of requiring a dashboard.index route.
…edot config Datatables and Toastify now read their settings from the datatables and toastify keys of config/redot.php, so a project has one Redot config file. The remaining datatables publish tags move under redot:: as redot::datatables-views and redot::datatables-lang.
… namespace Datatable views move to redot::datatables.* and translations to redot::datatables.*, so they are overridden from resources/views/vendor/redot/datatables and lang/vendor/redot.
Blade keeps stack pushes in order only within the same view depth. Now that <x-toasts> renders inside <x-redot-scripts>, a page whose components push scripts at that depth first put the initializer ahead of the plugin script pushed by the nested <x-assets.redot-toasts>, so RedotToasts was undefined. Push both from the toasts view itself.
…oints Add redot.components with enabled and middleware settings for the select, uploader, and HugeRTE endpoints. They are throttled by default, and an application can turn one off or add middleware such as auth to it.
Applications ignore vendor/ in Git, so the extractor's Git ignore filtering skipped core's views and scripts. Add searchInPackages() for directories scanned regardless of ignore rules and use it for core's sources.
The uploader, HugeRTE, and icon picker scripts used root-relative paths, which break when the application runs in a subdirectory. The components now pass route and asset urls, and the rich editor turns off image uploads when the HugeRTE endpoint is disabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves everything generic from the dashboard starter kit into core so a project keeps only its own code.
What moves into core
resources/componentsor a class inApp\View\Components.functions.js,themer.js,runtime.js(the code that was in the dashboard'sapp.js), theredot-*plugins,redot.css, the initializers, and the third-party libraries.php artisan redot:publishpublishes them, with the datatables assets, topublic/vendor/redot, replacingdatatables:link.<x-redot-styles>and<x-redot-scripts>load the runtime.is_dashboard_request()andcurrent_sessions()helpers.Configuration
redot.pathssets the route files and the layouts directory and namespace.redot.features.dashboard.guardreplaces the hardcodedadminsguard.config/redot.php, and every publish tag isredot::.redot::datatables.*namespace.Also
Status
Work in progress: the companion dashboard PR still needs testing in a browser.