mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
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,11 +1,11 @@
|
||||
import { classNameBindings, classNames } from "@ember-decorators/component";
|
||||
import Component from "@ember/component";
|
||||
import highlightHTML from "discourse/lib/highlight-html";
|
||||
import { on } from "discourse-common/utils/decorators";
|
||||
|
||||
export default Component.extend({
|
||||
classNames: ["site-text"],
|
||||
classNameBindings: ["siteText.overridden"],
|
||||
|
||||
@classNames("site-text")
|
||||
@classNameBindings("siteText.overridden")
|
||||
export default class SiteTextSummary extends Component {
|
||||
@on("didInsertElement")
|
||||
highlightTerm() {
|
||||
const term = this._searchTerm();
|
||||
@ -19,11 +19,11 @@ export default Component.extend({
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
click() {
|
||||
this.editAction(this.siteText);
|
||||
},
|
||||
}
|
||||
|
||||
_searchTerm() {
|
||||
const regex = this.searchRegex;
|
||||
@ -37,5 +37,5 @@ export default Component.extend({
|
||||
}
|
||||
|
||||
return this.term;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user