DEV: Remove 'capitalize' string prototype extensions (#172)
Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
This commit is contained in:
parent
9d9bf9051f
commit
d5e11a2c65
|
@ -4,6 +4,7 @@ import { ajax } from "discourse/lib/ajax";
|
||||||
import getURL from "discourse-common/lib/get-url";
|
import getURL from "discourse-common/lib/get-url";
|
||||||
import Badge from "discourse/models/badge";
|
import Badge from "discourse/models/badge";
|
||||||
import { default as computed } from "discourse-common/utils/decorators";
|
import { default as computed } from "discourse-common/utils/decorators";
|
||||||
|
import { capitalize } from "@ember/string";
|
||||||
|
|
||||||
function randomIdShort() {
|
function randomIdShort() {
|
||||||
return "xxxxxxxx".replace(/[xy]/g, () => {
|
return "xxxxxxxx".replace(/[xy]/g, () => {
|
||||||
|
@ -157,7 +158,7 @@ const QueryResultComponent = Ember.Component.extend({
|
||||||
const relationName = colRender[0];
|
const relationName = colRender[0];
|
||||||
|
|
||||||
if (relationName) {
|
if (relationName) {
|
||||||
const lookupFunc = this[`lookup${relationName.capitalize()}`];
|
const lookupFunc = this[`lookup${capitalize(relationName)}`];
|
||||||
const labelSelector = labelSelectors[relationName];
|
const labelSelector = labelSelectors[relationName];
|
||||||
|
|
||||||
if (lookupFunc && labelSelector) {
|
if (lookupFunc && labelSelector) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { categoryLinkHTML } from "discourse/helpers/category-link";
|
||||||
import { autoUpdatingRelativeAge } from "discourse/lib/formatter";
|
import { autoUpdatingRelativeAge } from "discourse/lib/formatter";
|
||||||
import { convertIconClass, iconHTML } from "discourse-common/lib/icon-library";
|
import { convertIconClass, iconHTML } from "discourse-common/lib/icon-library";
|
||||||
import getURL from "discourse-common/lib/get-url";
|
import getURL from "discourse-common/lib/get-url";
|
||||||
|
import { capitalize } from "@ember/string";
|
||||||
|
|
||||||
function icon_or_image_replacement(str, ctx) {
|
function icon_or_image_replacement(str, ctx) {
|
||||||
str = Ember.get(ctx.contexts[0], str);
|
str = Ember.get(ctx.contexts[0], str);
|
||||||
|
@ -79,7 +80,7 @@ const QueryRowContentComponent = Ember.Component.extend({
|
||||||
return esc(row[idx]);
|
return esc(row[idx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const lookupFunc = parentView[`lookup${t.name.capitalize()}`];
|
const lookupFunc = parentView[`lookup${capitalize(t.name)}`];
|
||||||
if (lookupFunc) {
|
if (lookupFunc) {
|
||||||
ctx[t.name] = lookupFunc.call(parentView, id);
|
ctx[t.name] = lookupFunc.call(parentView, id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue