ember-admin
ember-admin copied to clipboard
Feat engine
In regards to #63
This is a WIP, see https://github.com/knownasilya/ember-admin-demo for example usage.
Please don't merge, but DO leave feedback.
awesome stuff!! hope you will continue this work!!
Basically the above works just fine, the only blocker is figuring out a nice way to theme it, which is what I'm working on now.
🎉
Awesome! Ping me when its ready and I'll review :)
At the moment I'm using something like:
{{override-area 'modelList' 'post' send=(component 'post-list')}}
To override the theme, which can be done with an addon that provides custom components that fit the API, e.g. ember-admin-bootstrap
This works just fine, but I need to split out the default data and the markup so the data can be passed to the user's theme override component. The only area of nuisance is not being able to export that {{override-area component from the engine. Currently the consuming user either has to import another addon that provides that, or create it themselves. I'm leaning to an addon, and a theme addon could import that and register it's components automatically, or a user could install the addon and do some manual overrides.
A consuming user could also do something like the following to initialize the theme, and maybe even switch themes dynamically.
{{#initialize-admin-theme 'bootstrap' adminService=adminConfig as |ui|}}
{{ui.override-area 'modelList' 'post' send=(component 'post-list')}}
{{/initialize-admin-theme}}
Which would allow having a theme and overriding/adding type specific areas.
Progress update: https://eademo.pagefrontapp.com (async ember-admin, sync theme)
Got theming working, see https://github.com/knownasilya/ember-admin-theme-manager and the custom bootstrap theme (only model list) https://github.com/knownasilya/ember-admin-bootstrap
Currently there is a theme switcher, that works dynamically, and would load themes async once the ember-admin is loaded, that is once ember-engiens supports async routeless engines. See manager code here: https://github.com/knownasilya/ember-admin-demo/blob/master/app/templates/application.hbs#L13
{{!-- themes=> ['default', 'bootstrap'] --}}
<select onchange={{action 'changeTheme' value='target.value'}}>
{{#each themes as |theme|}}
{{#if (eq selectedTheme theme)}}
<option selected="selected">{{theme}}</option>
{{else}}
<option>{{theme}}</option>
{{/if}}
{{/each}}
</select>
{{#admin-theme-manager selectedTheme adminConfig=adminConfig as |theme|}}
{{#if (eq theme 'bootstrap')}}
{{mount 'ember-admin-bootstrap'}}
{{/if}}
{{/admin-theme-manager}}
On the theme end, there is the setup of area overrides, which can be seen here:https://github.com/knownasilya/ember-admin-bootstrap/blob/master/addon/templates/application.hbs#L1
{{#init-admin-theme 'bootstrap' as |api|}}
{{api.overrideArea 'modelList' send=(component 'model-list')}}
{{/init-admin-theme}}
Both of these components come from the theme-manager addon.
What's Left
- [ ] Default admin-config service export
- [ ] Allow user overrides, even of a theme's override
- [ ] Allow users to pass options to theme/default components based on type/default
- [ ] Convert all default views to components so themes can use them
- [ ] Finish bootstrap theme/normalize ember-admin setup
- [ ] Documentation
- [ ] Tests
Hello, Just to mention here that I left an issue in the demo issue queue. I'd like to give a feedback, but I cannot run the demo, "handler._setRouteName is not a function" error is showing.
I'll be continuing on this soon 👍
Great to hear this ! It looks most promising :-)