DEV: Remove 'underscore' string prototype extensions (#16748)

Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
This commit is contained in:
Isaac Janzen 2022-05-13 11:32:38 -05:00 committed by GitHub
parent 839ae52c20
commit ce8dd8810e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { isPresent } from "@ember/utils";
import { next } from "@ember/runloop";
import { underscore } from "@ember/string";
export default Controller.extend({
queryParams: [
@ -43,7 +44,7 @@ export default Controller.extend({
return (this.reviewableTypes || []).map((type) => {
return {
id: type,
name: I18n.t(`review.types.${type.underscore()}.title`),
name: I18n.t(`review.types.${underscore(type)}.title`),
};
});
},

View File

@ -4,6 +4,7 @@ import { Promise } from "rsvp";
import RestModel from "discourse/models/rest";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import { underscore } from "@ember/string";
export const PENDING = 0;
export const APPROVED = 1;
@ -19,7 +20,7 @@ const Reviewable = RestModel.extend({
type = "ReviewableQueuedTopic";
}
return I18n.t(`review.types.${type.underscore()}.title`, {
return I18n.t(`review.types.${underscore(type)}.title`, {
defaultValue: "",
});
},