mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:17:30 +08:00
REFACTOR: Replace Ember.Route
with proper import
This commit is contained in:
parent
a8a76198b1
commit
dd3ace5c77
|
@ -1,4 +1,6 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
|
||||
export default Route.extend({
|
||||
beforeModel() {
|
||||
this.transitionTo("adminApiKeys");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import ApiKey from "admin/models/api-key";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return ApiKey.find();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import Backup from "admin/models/backup";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
activate() {
|
||||
this.messageBus.subscribe("/admin/backups", backups =>
|
||||
this.controller.set("model", backups.map(backup => Backup.create(backup)))
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import PreloadStore from "preload-store";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
// since the logs are pushed via the message bus
|
||||
// we only want to preload them (hence the beforeModel hook)
|
||||
beforeModel() {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { emojiUrlFor } from "discourse/lib/text";
|
||||
|
||||
const badgeIntroLinks = [
|
||||
|
@ -13,7 +14,7 @@ const badgeIntroLinks = [
|
|||
}
|
||||
];
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
setupController(controller) {
|
||||
controller.setProperties({
|
||||
badgeIntroLinks,
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import Badge from "discourse/models/badge";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
serialize(m) {
|
||||
return { badge_id: Ember.get(m, "id") || "new" };
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
const all = this.modelFor("adminCustomize.colors");
|
||||
const model = all.findBy("id", parseInt(params.scheme_id));
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import ColorScheme from "admin/models/color-scheme";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return ColorScheme.findAll();
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
return {
|
||||
model: this.modelFor("adminCustomizeEmailStyle"),
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return this.store.find("email-style");
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { scrollTop } from "discourse/mixins/scroll-top";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
const all = this.modelFor("adminCustomizeEmailTemplates");
|
||||
return all.findBy("id", params.id);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return this.store.findAll("email-template");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
beforeModel() {
|
||||
this.transitionTo("adminCustomizeThemes");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return ajax("/admin/customize/robots");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
const all = this.modelFor("adminCustomizeThemes");
|
||||
const model = all.findBy("id", parseInt(params.theme_id));
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { emojiUrlFor } from "discourse/lib/text";
|
||||
|
||||
const externalResources = [
|
||||
|
@ -18,7 +19,7 @@ const externalResources = [
|
|||
}
|
||||
];
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
setupController(controller) {
|
||||
this._super(...arguments);
|
||||
this.controllerFor("adminCustomizeThemes").set("editingTheme", false);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { scrollTop } from "discourse/mixins/scroll-top";
|
||||
import { THEMES, COMPONENTS } from "admin/models/theme";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
serialize(model) {
|
||||
return { theme_id: model.get("id") };
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return this.store.findAll("theme");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return this.store.find("embedding");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return this.store.findAll("plugin");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
return this.store.find("site-text", params.id);
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
queryParams: {
|
||||
q: { replace: true },
|
||||
overridden: { replace: true }
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return this.store.findAll("web-hook");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
setupController(controller) {
|
||||
const accountCreated = this.controllerFor("account-created").get(
|
||||
"accountCreated"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
setupController(controller) {
|
||||
controller.set(
|
||||
"accountCreated",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
setupController(controller) {
|
||||
controller.set(
|
||||
"email",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import PreloadStore from "preload-store";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
setupController(controller) {
|
||||
controller.set("accountCreated", PreloadStore.get("accountCreated"));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
beforeModel: function() {
|
||||
this.transitionTo("group.messages.inbox");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { findWizard } from "wizard/models/wizard";
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return findWizard();
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
beforeModel() {
|
||||
const appModel = this.modelFor("application");
|
||||
this.replaceWith("step", appModel.start);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Ember.Route.extend({
|
||||
import Route from "@ember/routing/route";
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
const allSteps = this.modelFor("application").steps;
|
||||
const step = allSteps.findBy("id", params.step_id);
|
||||
|
|
Loading…
Reference in New Issue
Block a user