DEV: Convert admin component definitions to native class syntax (#20311)
This conversion was achieved using the ember-native-class-codemod, plus a handful of manual fixes/tweaks
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { tagName } from "@ember-decorators/component";
|
||||
import Component from "@ember/component";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
|
||||
export default Component.extend({
|
||||
tagName: "canvas",
|
||||
type: "line",
|
||||
@tagName("canvas")
|
||||
export default class AdminGraph extends Component {
|
||||
type = "line";
|
||||
|
||||
refreshChart() {
|
||||
const ctx = this.element.getContext("2d");
|
||||
@@ -49,11 +50,11 @@ export default Component.extend({
|
||||
};
|
||||
|
||||
this._chart = new window.Chart(ctx, config);
|
||||
},
|
||||
}
|
||||
|
||||
didInsertElement() {
|
||||
loadScript("/javascripts/Chart.min.js").then(() =>
|
||||
this.refreshChart.apply(this)
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user