From 1b9bda2af28349bcb21f422b6ec10b198d7be1c2 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Sun, 2 Feb 2025 08:59:51 +0000 Subject: [PATCH 01/37] chore: incrementing version number - v4.0.2 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index b715497852..84bbc866ba 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "4.0.1", + "version": "4.0.2", "homepage": "https://www.nodebb.org", "repository": { "type": "git", From 75588ffef14780e2ce1346a729683d2008d1dabd Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Sun, 2 Feb 2025 08:59:52 +0000 Subject: [PATCH 02/37] chore: update changelog for v4.0.2 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a76bef6d2d..2808bece2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +#### v4.0.2 (2025-02-02) + +##### Chores + +* up persona (0298a3af) +* up harmony (d77d2055) +* up themes, closes #13102 (6672de00) +* incrementing version number - v4.0.1 (a461b758) +* update changelog for v4.0.1 (3dbd2b30) +* incrementing version number - v4.0.0 (c1eaee45) + +##### New Features + +* allow selecting empty for custom selects (be62ae24) +* add uid to post.parent (4d733590) +* add description and keywords to api/config (933c18f4) + +##### Bug Fixes + +* bad logic that invisibly broke outgoing user follows completely (51e660d5) +* closes #13096, fix regression from renaming language files (0b92d525) + +##### Refactors + +* remove old comment (d4a1b4da) + +##### Tests + +* fix schema (ef5ae006) +* fix schema (47734d4c) + #### v4.0.1 (2025-01-29) ##### Chores From 58e551feaa5574876b2f9c947f0d28338a29e615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 2 Feb 2025 14:22:14 -0500 Subject: [PATCH 03/37] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 84bbc866ba..b8b08e64f0 100644 --- a/install/package.json +++ b/install/package.json @@ -108,7 +108,7 @@ "nodebb-plugin-spam-be-gone": "2.3.0", "nodebb-plugin-web-push": "0.7.2", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "2.0.7", + "nodebb-theme-harmony": "2.0.8", "nodebb-theme-lavender": "7.1.17", "nodebb-theme-peace": "2.2.36", "nodebb-theme-persona": "14.0.8", From 265e44f03ec5d8a295e8a5db99315c1334072a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 2 Feb 2025 14:31:58 -0500 Subject: [PATCH 04/37] refactor: remove deprecated methods --- src/categories/index.js | 1 - src/categories/unread.js | 46 ---------------------------------------- 2 files changed, 47 deletions(-) delete mode 100644 src/categories/unread.js diff --git a/src/categories/index.js b/src/categories/index.js index 51eea283c0..ef1879ab31 100644 --- a/src/categories/index.js +++ b/src/categories/index.js @@ -17,7 +17,6 @@ require('./data')(Categories); require('./create')(Categories); require('./delete')(Categories); require('./topics')(Categories); -require('./unread')(Categories); require('./activeusers')(Categories); require('./recentreplies')(Categories); require('./update')(Categories); diff --git a/src/categories/unread.js b/src/categories/unread.js deleted file mode 100644 index 48d80bb29d..0000000000 --- a/src/categories/unread.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -const db = require('../database'); - -module.exports = function (Categories) { - Categories.markAsRead = async function (cids, uid) { - // TODO: remove in 4.0 - console.warn('[deprecated] Categories.markAsRead deprecated'); - if (!Array.isArray(cids) || !cids.length || parseInt(uid, 10) <= 0) { - return; - } - let keys = cids.map(cid => `cid:${cid}:read_by_uid`); - const hasRead = await db.isMemberOfSets(keys, uid); - keys = keys.filter((key, index) => !hasRead[index]); - await db.setsAdd(keys, uid); - }; - - Categories.markAsUnreadForAll = async function (cid) { - // TODO: remove in 4.0 - console.warn('[deprecated] Categories.markAsUnreadForAll deprecated'); - if (!parseInt(cid, 10)) { - return; - } - await db.delete(`cid:${cid}:read_by_uid`); - }; - - Categories.hasReadCategories = async function (cids, uid) { - // TODO: remove in 4.0 - console.warn('[deprecated] Categories.hasReadCategories deprecated, see Categories.setUnread'); - if (parseInt(uid, 10) <= 0) { - return cids.map(() => false); - } - - const sets = cids.map(cid => `cid:${cid}:read_by_uid`); - return await db.isMemberOfSets(sets, uid); - }; - - Categories.hasReadCategory = async function (cid, uid) { - // TODO: remove in 4.0 - console.warn('[deprecated] Categories.hasReadCategory deprecated, see Categories.setUnread'); - if (parseInt(uid, 10) <= 0) { - return false; - } - return await db.isSetMember(`cid:${cid}:read_by_uid`, uid); - }; -}; From c1b630d484e2ca9b9ef539362400b3afae96b2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 2 Feb 2025 14:55:26 -0500 Subject: [PATCH 05/37] test: search endpoint with start & end --- test/controllers-admin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/controllers-admin.js b/test/controllers-admin.js index 1d8a19c1bf..a7206711b0 100644 --- a/test/controllers-admin.js +++ b/test/controllers-admin.js @@ -77,8 +77,14 @@ describe('Admin Controllers', () => { it('should load admin dashboard', async () => { await groups.join('administrators', adminUid); + const today = new Date(); + const end = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`; + today.setDate(today.getDate() - 1); + const start = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`; + const dashboards = [ - '/admin', '/admin/dashboard/logins', '/admin/dashboard/users', '/admin/dashboard/topics', '/admin/dashboard/searches', + '/admin', '/admin/dashboard/logins', '/admin/dashboard/users', '/admin/dashboard/topics', + '/admin/dashboard/searches', `/admin/dashboard/searches?start=${start}&end=${end}`, ]; await async.each(dashboards, async (url) => { const { response, body } = await request.get(`${nconf.get('url')}${url}`, { jar: jar }); From 8e9fdb5fd68944cc5821ace802323dc6fbcd6433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 2 Feb 2025 18:39:24 -0500 Subject: [PATCH 06/37] fix: #13115, limit bodyLength length send out notification if bodyLong.length exceeds limit add a max item limit to ttl cache get rid of has/get check if item isn't in cache get returns undefined --- src/notifications.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index 1d020e536b..65804da6ab 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -22,6 +22,7 @@ const Notifications = module.exports; // ttlcache for email-only chat notifications const notificationCache = ttlCache({ + max: 1000, ttl: (meta.config.notificationSendDelay || 60) * 1000, noDisposeOnSet: true, dispose: sendEmail, @@ -246,11 +247,14 @@ async function pushToUids(uids, notification) { const delayNotificationTypes = ['new-chat', 'new-group-chat', 'new-public-chat']; if (delayNotificationTypes.includes(notification.type)) { const cacheKey = `${notification.mergeId}|${results.uidsToEmail.join(',')}`; - if (notificationCache.has(cacheKey)) { - const payload = notificationCache.get(cacheKey); + const payload = notificationCache.get(cacheKey); + if (payload !== undefined) { notification.bodyLong = [payload.notification.bodyLong, notification.bodyLong].join('\n'); } notificationCache.set(cacheKey, { uids: results.uidsToEmail, notification }); + if (notification.bodyLong.length >= 1000) { + notificationCache.delete(cacheKey); + } } else { await sendEmail({ uids: results.uidsToEmail, notification }); } @@ -264,8 +268,7 @@ async function pushToUids(uids, notification) { } async function sendEmail({ uids, notification }, mergeId, reason) { - // Only act on cache item expiry - if (reason && reason !== 'stale') { + if (reason && reason === 'set') { return; } From 1ff8e1e47db9edd77725615adc7d2bfcc9602486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 2 Feb 2025 18:57:54 -0500 Subject: [PATCH 07/37] fix: #13115, prevent messages from getting duplicated --- src/notifications.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index 65804da6ab..7f7bb5268a 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -243,20 +243,25 @@ async function pushToUids(uids, notification) { if (notification.type) { results = await getUidsBySettings(data.uids); } + await sendNotification(results.uidsToNotify); - const delayNotificationTypes = ['new-chat', 'new-group-chat', 'new-public-chat']; - if (delayNotificationTypes.includes(notification.type)) { - const cacheKey = `${notification.mergeId}|${results.uidsToEmail.join(',')}`; - const payload = notificationCache.get(cacheKey); - if (payload !== undefined) { - notification.bodyLong = [payload.notification.bodyLong, notification.bodyLong].join('\n'); + + if (results.uidsToEmail.length) { + const delayNotificationTypes = ['new-chat', 'new-group-chat', 'new-public-chat']; + if (delayNotificationTypes.includes(notification.type)) { + const cacheKey = `${notification.mergeId}|${results.uidsToEmail.join(',')}`; + const payload = notificationCache.get(cacheKey); + let { bodyLong } = notification; + if (payload !== undefined) { + bodyLong = [payload.notification.bodyLong, bodyLong].join('\n'); + } + notificationCache.set(cacheKey, { uids: results.uidsToEmail, notification: { ...notification, bodyLong } }); + if (notification.bodyLong.length >= 1000) { + notificationCache.delete(cacheKey); + } + } else { + await sendEmail({ uids: results.uidsToEmail, notification }); } - notificationCache.set(cacheKey, { uids: results.uidsToEmail, notification }); - if (notification.bodyLong.length >= 1000) { - notificationCache.delete(cacheKey); - } - } else { - await sendEmail({ uids: results.uidsToEmail, notification }); } plugins.hooks.fire('action:notification.pushed', { @@ -268,7 +273,7 @@ async function pushToUids(uids, notification) { } async function sendEmail({ uids, notification }, mergeId, reason) { - if (reason && reason === 'set') { + if ((reason && reason === 'set') || !uids.length) { return; } From bf09ed143bd906d4fa57543c9b7cfec7b3529ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 10:40:06 -0500 Subject: [PATCH 08/37] fix recent/popular/top title --- src/controllers/recent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/recent.js b/src/controllers/recent.js index d4d577cabd..5699fee1b7 100644 --- a/src/controllers/recent.js +++ b/src/controllers/recent.js @@ -65,7 +65,7 @@ recentController.getData = async function (req, url, sort) { data.title = meta.config.homePageTitle || '[[pages:home]]'; } else { data.title = `[[pages:${url}]]`; - data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[activitypub:world-title]]` }]); + data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[${url}:title]]` }]); } const query = { ...req.query }; From 38a21e294cbcb853b961b6e6c3d2f4483434fba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 11:54:21 -0500 Subject: [PATCH 09/37] chore: up themes --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index b8b08e64f0..5f2d1808b6 100644 --- a/install/package.json +++ b/install/package.json @@ -108,10 +108,10 @@ "nodebb-plugin-spam-be-gone": "2.3.0", "nodebb-plugin-web-push": "0.7.2", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "2.0.8", + "nodebb-theme-harmony": "2.0.9", "nodebb-theme-lavender": "7.1.17", "nodebb-theme-peace": "2.2.36", - "nodebb-theme-persona": "14.0.8", + "nodebb-theme-persona": "14.0.9", "nodebb-widget-essentials": "7.0.32", "nodemailer": "6.9.16", "nprogress": "0.2.0", From 55eedcbef6576eb36ad9bb1229c2860ee99ceb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 11:56:05 -0500 Subject: [PATCH 10/37] chore: up peace --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 5f2d1808b6..a1b46e5298 100644 --- a/install/package.json +++ b/install/package.json @@ -110,7 +110,7 @@ "nodebb-rewards-essentials": "1.0.0", "nodebb-theme-harmony": "2.0.9", "nodebb-theme-lavender": "7.1.17", - "nodebb-theme-peace": "2.2.36", + "nodebb-theme-peace": "2.2.37", "nodebb-theme-persona": "14.0.9", "nodebb-widget-essentials": "7.0.32", "nodemailer": "6.9.16", From 36063d1f334c9e7af53014f3d3053600ea980e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 12:47:45 -0500 Subject: [PATCH 11/37] fix: path on windows, #13119 --- src/topics/thumbs.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/topics/thumbs.js b/src/topics/thumbs.js index 3a47033afc..5e7b5248b0 100644 --- a/src/topics/thumbs.js +++ b/src/topics/thumbs.js @@ -71,9 +71,10 @@ Thumbs.get = async function (tids, options) { if (!options.thumbsOnly) { // Add uploaded media to thumb sets - const mainPidUploads = await Promise.all(mainPids.map(async pid => await posts.uploads.list(pid))); + const mainPidUploads = await Promise.all(mainPids.map(posts.uploads.list)); mainPidUploads.forEach((uploads, idx) => { - uploads = uploads.map(path => `/${path}`); + uploads = uploads.map(upath => path.join(path.sep, `${upath}`)); + uploads = uploads.filter((upload) => { const type = mime.getType(upload); return !thumbs[idx].includes(upload) && type && type.startsWith('image/'); From 21156673e3a25b209b606625788be0dd15f306ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 13:13:49 -0500 Subject: [PATCH 12/37] fix: isDraft logic, closes #13119 topic.exists returns an array --- src/topics/thumbs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topics/thumbs.js b/src/topics/thumbs.js index 5e7b5248b0..1fe985a270 100644 --- a/src/topics/thumbs.js +++ b/src/topics/thumbs.js @@ -55,7 +55,7 @@ Thumbs.get = async function (tids, options) { }; } - const isDraft = !await topics.exists(tids); + const isDraft = (await topics.exists(tids)).map(exists => !exists); if (!meta.config.allowTopicsThumbnail || !tids.length) { return singular ? [] : tids.map(() => []); From 72091ec4e1a2c573974af2b435a1cc7549c13a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 13:40:52 -0500 Subject: [PATCH 13/37] refactor: server.destroy --- src/start.js | 2 +- src/webserver.js | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/start.js b/src/start.js index 677230e235..99f3b662c5 100644 --- a/src/start.js +++ b/src/start.js @@ -147,6 +147,6 @@ async function shutdown(code) { } catch (err) { winston.error(err.stack); - return process.exit(code || 0); + process.exit(code || 0); } } diff --git a/src/webserver.js b/src/webserver.js index 15e33897bf..23ed24df68 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -69,11 +69,16 @@ server.on('connection', (conn) => { }); }); -exports.destroy = function (callback) { - server.close(callback); - for (const connection of Object.values(connections)) { - connection.destroy(); - } +exports.destroy = function () { + return new Promise((resolve, reject) => { + server.close((err) => { + if (err) reject(err); + else resolve(); + }); + for (const connection of Object.values(connections)) { + connection.destroy(); + } + }); }; exports.getConnectionCount = function () { From b2b0ed352572c8c1147fcba1c2a0c632d47a2c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 18:17:00 -0500 Subject: [PATCH 14/37] chore: up themes --- install/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/package.json b/install/package.json index a1b46e5298..6779beadb6 100644 --- a/install/package.json +++ b/install/package.json @@ -108,10 +108,10 @@ "nodebb-plugin-spam-be-gone": "2.3.0", "nodebb-plugin-web-push": "0.7.2", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "2.0.9", + "nodebb-theme-harmony": "2.0.10", "nodebb-theme-lavender": "7.1.17", - "nodebb-theme-peace": "2.2.37", - "nodebb-theme-persona": "14.0.9", + "nodebb-theme-peace": "2.2.38", + "nodebb-theme-persona": "14.0.10", "nodebb-widget-essentials": "7.0.32", "nodemailer": "6.9.16", "nprogress": "0.2.0", From b993be6fd7387fe609be0c966327c6f75e1481db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 4 Feb 2025 19:59:16 -0500 Subject: [PATCH 15/37] refactor: move dropdown search inputs into dropdown get rid of position-absolute on search inputs --- install/package.json | 4 +- public/scss/admin/admin.scss | 2 - public/scss/generics.scss | 2 - public/src/modules/categorySearch.js | 9 +-- public/src/modules/groupSearch.js | 7 +- public/src/modules/tagFilter.js | 7 +- src/views/admin/manage/group.tpl | 70 +++++++++++-------- .../partials/categories/select-category.tpl | 27 +++---- .../category/selector-dropdown-content.tpl | 49 +++++++------ .../groups/privileges-select-category.tpl | 25 ------- .../category/filter-dropdown-content.tpl | 9 +-- .../category/selector-dropdown-content.tpl | 8 +-- src/views/partials/flags/filters.tpl | 7 +- .../partials/tags/filter-dropdown-content.tpl | 8 +-- 14 files changed, 104 insertions(+), 130 deletions(-) delete mode 100644 src/views/admin/partials/groups/privileges-select-category.tpl diff --git a/install/package.json b/install/package.json index 6779beadb6..0d82fd7f50 100644 --- a/install/package.json +++ b/install/package.json @@ -108,10 +108,10 @@ "nodebb-plugin-spam-be-gone": "2.3.0", "nodebb-plugin-web-push": "0.7.2", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "2.0.10", + "nodebb-theme-harmony": "2.0.11", "nodebb-theme-lavender": "7.1.17", "nodebb-theme-peace": "2.2.38", - "nodebb-theme-persona": "14.0.10", + "nodebb-theme-persona": "14.0.11", "nodebb-widget-essentials": "7.0.32", "nodemailer": "6.9.16", "nprogress": "0.2.0", diff --git a/public/scss/admin/admin.scss b/public/scss/admin/admin.scss index a07f7779ee..f58af12f41 100644 --- a/public/scss/admin/admin.scss +++ b/public/scss/admin/admin.scss @@ -154,11 +154,9 @@ body { } .dropdown-left { - [component="category-selector-search"] { left:0!important; } .dropdown-menu { --bs-position: start; } } .dropdown-right { - [component="category-selector-search"] { right:0!important; } .dropdown-menu { --bs-position: end; } } diff --git a/public/scss/generics.scss b/public/scss/generics.scss index db5aaa4675..808d427ba5 100644 --- a/public/scss/generics.scss +++ b/public/scss/generics.scss @@ -24,11 +24,9 @@ } } .dropdown-left { - [component="category-selector-search"] { left:0!important; } .dropdown-menu { --bs-position: start; } } .dropdown-right { - [component="category-selector-search"] { right:0!important; } .dropdown-menu { --bs-position: end; } } diff --git a/public/src/modules/categorySearch.js b/public/src/modules/categorySearch.js index 8c7461dcdf..8fa7a9f184 100644 --- a/public/src/modules/categorySearch.js +++ b/public/src/modules/categorySearch.js @@ -21,16 +21,12 @@ define('categorySearch', ['alerts', 'bootstrap', 'api'], function (alerts, boots return; } - const toggleVisibility = searchEl.parent('[component="category/dropdown"]').length > 0 || - searchEl.parent('[component="category-selector"]').length > 0; + const toggleVisibility = searchEl.parents('[component="category/dropdown"]').length > 0 || + searchEl.parents('[component="category-selector"]').length > 0; el.on('show.bs.dropdown', function () { if (toggleVisibility) { - el.find('.dropdown-toggle').css({ visibility: 'hidden' }); searchEl.removeClass('hidden'); - searchEl.css({ - 'z-index': el.find('.dropdown-toggle').css('z-index') + 1, - }); } function doSearch() { @@ -61,7 +57,6 @@ define('categorySearch', ['alerts', 'bootstrap', 'api'], function (alerts, boots el.on('hide.bs.dropdown', function () { if (toggleVisibility) { - el.find('.dropdown-toggle').css({ visibility: 'inherit' }); searchEl.addClass('hidden'); } diff --git a/public/src/modules/groupSearch.js b/public/src/modules/groupSearch.js index 66e19a1665..8d25844d7f 100644 --- a/public/src/modules/groupSearch.js +++ b/public/src/modules/groupSearch.js @@ -11,7 +11,7 @@ define('groupSearch', function () { if (!searchEl.length) { return; } - const toggleVisibility = searchEl.parent('[component="group-selector"]').length > 0; + const toggleVisibility = searchEl.parents('[component="group-selector"]').length > 0; const groupEls = el.find('[component="group-list"] [data-name]'); el.on('show.bs.dropdown', function () { @@ -31,11 +31,7 @@ define('groupSearch', function () { el.find('[component="group-list"] [component="group-no-matches"]').toggleClass('hidden', !noMatch); } if (toggleVisibility) { - el.find('.dropdown-toggle').css({ visibility: 'hidden' }); searchEl.removeClass('hidden'); - searchEl.css({ - 'z-index': el.find('.dropdown-toggle').css('z-index') + 1, - }); } searchEl.on('click', function (ev) { @@ -52,7 +48,6 @@ define('groupSearch', function () { el.on('hide.bs.dropdown', function () { if (toggleVisibility) { - el.find('.dropdown-toggle').css({ visibility: 'inherit' }); searchEl.addClass('hidden'); } searchEl.off('click').find('input').off('keyup'); diff --git a/public/src/modules/tagFilter.js b/public/src/modules/tagFilter.js index f752b0df7e..ea8f8f887f 100644 --- a/public/src/modules/tagFilter.js +++ b/public/src/modules/tagFilter.js @@ -27,16 +27,12 @@ define('tagFilter', ['hooks', 'alerts', 'bootstrap'], function (hooks, alerts, b } initialTags = selectedTags.slice(); - const toggleSearchVisibilty = searchEl.parent('[component="tag/filter"]').length && + const toggleSearchVisibilty = searchEl.parents('[component="tag/filter"]').length && app.user.privileges['search:tags']; el.on('show.bs.dropdown', function () { if (toggleSearchVisibilty) { - el.find('.dropdown-toggle').css({ visibility: 'hidden' }); searchEl.removeClass('hidden'); - searchEl.css({ - 'z-index': el.find('.dropdown-toggle').css('z-index') + 1, - }); } function doSearch() { @@ -67,7 +63,6 @@ define('tagFilter', ['hooks', 'alerts', 'bootstrap'], function (hooks, alerts, b el.on('hidden.bs.dropdown', function () { if (toggleSearchVisibilty) { - el.find('.dropdown-toggle').css({ visibility: 'inherit' }); searchEl.addClass('hidden'); } diff --git a/src/views/admin/manage/group.tpl b/src/views/admin/manage/group.tpl index 114d5e8692..79304a1e23 100644 --- a/src/views/admin/manage/group.tpl +++ b/src/views/admin/manage/group.tpl @@ -9,19 +9,23 @@ -
@@ -157,26 +161,30 @@ -
diff --git a/src/views/admin/partials/categories/select-category.tpl b/src/views/admin/partials/categories/select-category.tpl index 0de6cf30ed..72f4d3fea5 100644 --- a/src/views/admin/partials/categories/select-category.tpl +++ b/src/views/admin/partials/categories/select-category.tpl @@ -1,19 +1,21 @@ -
-
-
- -