Document deprecations and remove old ones (#8706)

* chore: document deprecation removal versions

* chore: remove deprecations 2+ versions old
v1.18.x
Peter Jaszkowiak 4 years ago committed by GitHub
parent 017af63fb0
commit 55d5cccf2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,11 +4,6 @@
define('admin/settings', ['uploader', 'mousetrap'], function (uploader, mousetrap) {
var Settings = {};
Settings.init = function () {
console.warn('[deprecation] require(\'admin/settings\').init() has been deprecated, please call require(\'admin/settings\').prepare() directly instead.');
Settings.prepare();
};
Settings.populateTOC = function () {
$('.settings-header').each(function () {
var header = $(this).text();

@ -212,10 +212,5 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
element.data(data);
};
taskbar.updateTitle = function (module, uuid, newTitle) {
console.warn('[taskbar] .updateTitle() is deprecated, use .update() instead');
taskbar.tasklist.find('[data-module="' + module + '"][data-uuid="' + uuid + '"] [component="taskbar/title"]').text(newTitle);
};
return taskbar;
});

@ -1,7 +1,6 @@
'use strict';
const validator = require('validator');
const winston = require('winston');
const nconf = require('nconf');
const user = require('../../user');
@ -204,12 +203,6 @@ async function parseAboutMe(userData) {
function filterLinks(links, states) {
return links.filter(function (link, index) {
// "public" is the old property, if visibility is defined, discard `public`
if (link.hasOwnProperty('public') && !link.hasOwnProperty('visibility')) {
winston.warn('[account/profileMenu (' + link.id + ')] Use of the `.public` property is deprecated, use `visibility` now');
return link && (link.public || states.self);
}
// Default visibility
link.visibility = { self: true,
other: true,

@ -3,8 +3,6 @@
const path = require('path');
const nconf = require('nconf');
const validator = require('validator');
const winston = require('winston');
const util = require('util');
const db = require('../database');
const meta = require('../meta');
@ -26,12 +24,6 @@ uploadsController.upload = async function (req, res, filesIterator) {
files = files[0];
}
// backwards compatibility
if (filesIterator.constructor && filesIterator.constructor.name !== 'AsyncFunction') {
winston.warn('[deprecated] uploadsController.upload, use an async function as iterator');
filesIterator = util.promisify(filesIterator);
}
try {
const images = [];
for (const fileObj of files) {

@ -19,6 +19,7 @@ Categories.create = async function (socket, data) {
return await categories.create(data);
};
// DEPRECATED: @1.14.3, remove in version >=1.16
Categories.getAll = async function () {
winston.warn('[deprecated] admin.categories.getAll deprecated, data is returned in the api route');
const cids = await categories.getAllCidsFromSet('categories:cid');

@ -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) {

Loading…
Cancel
Save