mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-29 18:46:23 -05:00
94b60e62a2
Note this commit leaves out the biggest occurrence of the editor which is the post/topic composer. To avoid major breakage, this replaces it everywhere else it was used: * User preferences (About Me) * Admin Customizations > Text Content * Category Templates * Editing Queued Posts A future commit will replace the main composer with this editor and will remove the unused pagedown code.
27 lines
1,017 B
JavaScript
27 lines
1,017 B
JavaScript
import AppEvents from 'discourse/lib/app-events';
|
|
import createStore from 'helpers/create-store';
|
|
import { loadAllHelpers } from 'discourse/initializers/load-all-helpers';
|
|
|
|
export default function(name, opts) {
|
|
opts = opts || {};
|
|
|
|
test(name, function(assert) {
|
|
if (opts.setup) {
|
|
const store = createStore();
|
|
opts.setup.call(this, store);
|
|
}
|
|
const appEvents = AppEvents.create();
|
|
|
|
loadAllHelpers();
|
|
|
|
this.container.register('site-settings:main', Discourse.SiteSettings, { instantiate: false });
|
|
this.container.register('app-events:main', appEvents, { instantiate: false });
|
|
this.container.register('capabilities:main', Ember.Object);
|
|
this.container.injection('component', 'siteSettings', 'site-settings:main');
|
|
this.container.injection('component', 'appEvents', 'app-events:main');
|
|
this.container.injection('component', 'capabilities', 'capabilities:main');
|
|
|
|
andThen(() => this.render(opts.template));
|
|
andThen(() => opts.test.call(this, assert));
|
|
});
|
|
}
|