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",
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",
classNames: ["styleguide-example"],
value: null,

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
import Component from "@ember/component";
import computed from "discourse-common/utils/decorators";
export default Ember.Component.extend({
export default Component.extend({
tagName: "section",
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: {
dummy() {},
},

View File

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

View File

@ -1,5 +1,6 @@
import Helper from "@ember/component/helper";
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`);
});

View File

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