DEV: Log deprecated FA 4.7 icon names in /logs
This commit is contained in:
parent
fab3bbf705
commit
2dd9727c11
|
@ -1,4 +1,5 @@
|
||||||
import { h } from "virtual-dom";
|
import { h } from "virtual-dom";
|
||||||
|
import { reportToLogster } from "discourse/lib/utilities";
|
||||||
import attributeHook from "discourse-common/lib/attribute-hook";
|
import attributeHook from "discourse-common/lib/attribute-hook";
|
||||||
import deprecated from "discourse-common/lib/deprecated";
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
|
||||||
|
@ -584,6 +585,11 @@ function warnIfDeprecated(oldId, newId) {
|
||||||
deprecated(
|
deprecated(
|
||||||
`Please replace all occurrences of "${oldId}"" with "${newId}". FontAwesome 4.7 icon names are now deprecated and will be removed in the next release.`
|
`Please replace all occurrences of "${oldId}"" with "${newId}". FontAwesome 4.7 icon names are now deprecated and will be removed in the next release.`
|
||||||
);
|
);
|
||||||
|
const errorData = {
|
||||||
|
message: `FA icon deprecation: replace "${oldId}"" with "${newId}".`,
|
||||||
|
stacktrace: Error().stack
|
||||||
|
};
|
||||||
|
reportToLogster(errorData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleIconId(icon) {
|
function handleIconId(icon) {
|
||||||
|
|
|
@ -376,12 +376,7 @@ export function postRNWebviewMessage(prop, value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reportToLogster(name, error) {
|
export function reportToLogster(data) {
|
||||||
const data = {
|
|
||||||
message: `${name} theme/component is throwing errors`,
|
|
||||||
stacktrace: error.stack
|
|
||||||
};
|
|
||||||
|
|
||||||
Ember.$.ajax(`${Discourse.BaseUri}/logs/report_js_error`, {
|
Ember.$.ajax(`${Discourse.BaseUri}/logs/report_js_error`, {
|
||||||
data,
|
data,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
@ -392,7 +387,11 @@ function reportToLogster(name, error) {
|
||||||
export function rescueThemeError(name, error, api) {
|
export function rescueThemeError(name, error, api) {
|
||||||
/* eslint-disable-next-line no-console */
|
/* eslint-disable-next-line no-console */
|
||||||
console.error(`"${name}" error:`, error);
|
console.error(`"${name}" error:`, error);
|
||||||
reportToLogster(name, error);
|
const errorData = {
|
||||||
|
message: `${name} theme/component is throwing errors`,
|
||||||
|
stacktrace: error.stack
|
||||||
|
};
|
||||||
|
reportToLogster(errorData);
|
||||||
|
|
||||||
const currentUser = api.getCurrentUser();
|
const currentUser = api.getCurrentUser();
|
||||||
if (!currentUser || !currentUser.admin) {
|
if (!currentUser || !currentUser.admin) {
|
||||||
|
|
Loading…
Reference in New Issue