DEV: Use Ember imports in the styleguide code (#16123)

This commit is contained in:
Jarek Radosz 2022-03-07 21:38:09 +01:00 committed by GitHub
parent c528de3288
commit 6e7cdc5bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 27 additions and 11 deletions

View File

@ -1,4 +1,6 @@
export default Ember.Component.extend({ import Component from "@ember/component";
export default Component.extend({
tagName: "section", tagName: "section",
classNameBindings: [":color-example"], classNameBindings: [":color-example"],
}); });

View File

@ -1,4 +1,6 @@
export default Ember.Component.extend({ import Component from "@ember/component";
export default Component.extend({
tagName: "section", tagName: "section",
classNames: ["styleguide-example"], classNames: ["styleguide-example"],
value: null, value: null,

View File

@ -1,7 +1,8 @@
import Component from "@ember/component";
import { afterRender } from "discourse-common/utils/decorators"; import { afterRender } from "discourse-common/utils/decorators";
import { later } from "@ember/runloop"; import { later } from "@ember/runloop";
export default Ember.Component.extend({ export default Component.extend({
tagName: "section", tagName: "section",
classNames: ["styleguide-icons"], classNames: ["styleguide-icons"],
iconIds: [], iconIds: [],

View File

@ -1,3 +1,5 @@
export default Ember.Component.extend({ import Component from "@ember/component";
export default Component.extend({
tagName: "", tagName: "",
}); });

View File

@ -1,6 +1,7 @@
import Component from "@ember/component";
import { cookAsync } from "discourse/lib/text"; import { cookAsync } from "discourse/lib/text";
export default Ember.Component.extend({ export default Component.extend({
didInsertElement() { didInsertElement() {
this._super(...arguments); this._super(...arguments);

View File

@ -1,6 +1,7 @@
import Component from "@ember/component";
import computed from "discourse-common/utils/decorators"; import computed from "discourse-common/utils/decorators";
export default Ember.Component.extend({ export default Component.extend({
tagName: "section", tagName: "section",
classNameBindings: [":styleguide-section", "sectionClass"], classNameBindings: [":styleguide-section", "sectionClass"],

View File

@ -1,4 +1,6 @@
export default Ember.Controller.extend({ import Controller from "@ember/controller";
export default Controller.extend({
actions: { actions: {
dummy() {}, dummy() {},
}, },

View File

@ -1,3 +1,5 @@
export default Ember.Controller.extend({ import Controller from "@ember/controller";
export default Controller.extend({
sections: null, sections: null,
}); });

View File

@ -1,5 +1,6 @@
import Helper from "@ember/component/helper";
import I18n from "I18n"; import I18n from "I18n";
export default Ember.Helper.helper(function (params) { export default Helper.helper(function (params) {
return I18n.t(`styleguide.sections.${params[0].replace(/\-/g, "_")}.title`); return I18n.t(`styleguide.sections.${params[0].replace(/\-/g, "_")}.title`);
}); });

View File

@ -1,10 +1,11 @@
import Route from "@ember/routing/route";
import { import {
findNote, findNote,
sectionById, sectionById,
} from "discourse/plugins/styleguide/discourse/lib/styleguide"; } from "discourse/plugins/styleguide/discourse/lib/styleguide";
import { createData } from "discourse/plugins/styleguide/discourse/lib/dummy-data"; import { createData } from "discourse/plugins/styleguide/discourse/lib/dummy-data";
export default Ember.Route.extend({ export default Route.extend({
model(params) { model(params) {
return sectionById(params.section); return sectionById(params.section);
}, },

View File

@ -1,6 +1,7 @@
import Route from "@ember/routing/route";
import { allCategories } from "discourse/plugins/styleguide/discourse/lib/styleguide"; import { allCategories } from "discourse/plugins/styleguide/discourse/lib/styleguide";
export default Ember.Route.extend({ export default Route.extend({
model() { model() {
return allCategories(); return allCategories();
}, },