Document deprecations and remove old ones (#8706)

* chore: document deprecation removal versions

* chore: remove deprecations 2+ versions old
This commit is contained in:
Peter Jaszkowiak
2020-10-01 10:25:03 -06:00
committed by GitHub
parent 017af63fb0
commit 55d5cccf2e
6 changed files with 5 additions and 33 deletions

View File

@@ -76,12 +76,8 @@ async function renderWidget(widget, uid, options) {
if (!data) {
return;
}
let html = data;
if (typeof html !== 'string') {
html = data.html;
} else {
winston.warn('[widgets.render] passing a string is deprecated!, filter:widget.render:' + widget.widget + '. Please set hookData.html in your plugin.');
}
let html = data.html;
if (widget.data.container && widget.data.container.match('{body}')) {
html = await Benchpress.compileRender(widget.data.container, {
@@ -91,11 +87,11 @@ async function renderWidget(widget, uid, options) {
});
}
if (html !== undefined) {
if (html) {
html = await translator.translate(html, userLang);
}
return { html: html };
return { html };
}
async function checkVisibility(widget, uid) {