DEV: introduces prettier for es6 files

This commit is contained in:
Joffrey JAFFEUX
2018-06-15 17:03:24 +02:00
committed by GitHub
parent c7ee70941e
commit 03a7d532cf
1162 changed files with 60667 additions and 29659 deletions

View File

@ -1,7 +1,7 @@
import AppEvents from 'discourse/lib/app-events';
import createStore from 'helpers/create-store';
import { autoLoadModules } from 'discourse/initializers/auto-load-modules';
import TopicTrackingState from 'discourse/models/topic-tracking-state';
import AppEvents from "discourse/lib/app-events";
import createStore from "helpers/create-store";
import { autoLoadModules } from "discourse/initializers/auto-load-modules";
import TopicTrackingState from "discourse/models/topic-tracking-state";
export default function(name, opts) {
opts = opts || {};
@ -10,14 +10,18 @@ export default function(name, opts) {
const appEvents = AppEvents.create();
this.site = Discourse.Site.current();
this.registry.register('site-settings:main', Discourse.SiteSettings, { instantiate: false });
this.registry.register('app-events:main', appEvents, { instantiate: false });
this.registry.register('capabilities:main', Ember.Object);
this.registry.register('site:main', this.site, { instantiate: false });
this.registry.injection('component', 'siteSettings', 'site-settings:main');
this.registry.injection('component', 'appEvents', 'app-events:main');
this.registry.injection('component', 'capabilities', 'capabilities:main');
this.registry.injection('component', 'site', 'site:main');
this.registry.register("site-settings:main", Discourse.SiteSettings, {
instantiate: false
});
this.registry.register("app-events:main", appEvents, {
instantiate: false
});
this.registry.register("capabilities:main", Ember.Object);
this.registry.register("site:main", this.site, { instantiate: false });
this.registry.injection("component", "siteSettings", "site-settings:main");
this.registry.injection("component", "appEvents", "app-events:main");
this.registry.injection("component", "capabilities", "capabilities:main");
this.registry.injection("component", "site", "site:main");
this.siteSettings = Discourse.SiteSettings;
@ -25,15 +29,19 @@ export default function(name, opts) {
const store = createStore();
if (!opts.anonymous) {
const currentUser = Discourse.User.create({ username: 'eviltrout' });
const currentUser = Discourse.User.create({ username: "eviltrout" });
this.currentUser = currentUser;
this.registry.register('current-user:main', this.currentUser, { instantiate: false });
this.registry.register('topic-tracking-state:main',
TopicTrackingState.create({ currentUser }),
{ instantiate: false });
this.registry.register("current-user:main", this.currentUser, {
instantiate: false
});
this.registry.register(
"topic-tracking-state:main",
TopicTrackingState.create({ currentUser }),
{ instantiate: false }
);
}
this.registry.register('service:store', store, { instantiate: false });
this.registry.register("service:store", store, { instantiate: false });
if (opts.beforeEach) {
opts.beforeEach.call(this, store);