feat: warn user if whitelisted tags are less than minTags

v1.18.x
Barış Soner Uşaklı 5 years ago
parent ab244ca6cc
commit 4adbf87c6c

@ -76,6 +76,7 @@
"alert.user-search": "Search for a user here...",
"alert.find-group": "Find a Group",
"alert.group-search": "Search for a group here...",
"alert.not-enough-whitelisted-tags": "Whitelisted tags are less than minimum tags, you need to create more whitelisted tags!",
"collapse-all": "Collapse All",
"expand-all": "Expand All",
"disable-on-create": "Disable on create"

@ -48,6 +48,11 @@ define('admin/manage/category', [
$('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker);
$('#save').on('click', function () {
var tags = $('#tag-whitelist').val() ? $('#tag-whitelist').val().split(',') : [];
if (tags.length && tags.length < parseInt($('#cid-min-tags').val(), 10)) {
return app.alertError('[[admin/manage/categories:alert.not-enough-whitelisted-tags]]');
}
if (Object.keys(modified_categories).length) {
socket.emit('admin.categories.update', modified_categories, function (err, result) {
if (err) {

Loading…
Cancel
Save