From 322c40842ca488438391bb8aa5253529fbd2d8de Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Wed, 19 Mar 2025 18:33:59 +0000 Subject: [PATCH 01/11] chore: incrementing version number - v4.2.0 --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index 92bb84c3a8..7b2a21f3bf 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "4.1.1", + "version": "4.2.0", "homepage": "https://www.nodebb.org", "repository": { "type": "git", @@ -200,4 +200,4 @@ "url": "https://github.com/barisusakli" } ] -} +} \ No newline at end of file From c9e0198de40e03b06921f167f4e0ba6b0ab592b8 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Wed, 19 Mar 2025 18:34:00 +0000 Subject: [PATCH 02/11] chore: update changelog for v4.2.0 --- CHANGELOG.md | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7400bbc747..33da12d0e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,103 @@ +#### v4.2.0 (2025-03-19) + +##### Chores + +* **deps:** + * update commitlint monorepo to v19.8.0 (#13244) (ee3c0bf4) + * update dependency lint-staged to v15.5.0 (#13245) (f4fe3f5f) + * update dependency sass-embedded to v1.86.0 (#13251) (3bb861ae) +* up widgets (ed57f896) +* incrementing version number - v4.1.1 (b2afbb16) +* update changelog for v4.1.1 (2c3f8561) +* add missing file to az lang (d7116adc) +* language labels for az/pl (61d17c95) +* alphabetize transifex config file languages (b7bb35f8) +* incrementing version number - v4.1.0 (36c80850) +* incrementing version number - v4.0.6 (4a52fb2e) +* incrementing version number - v4.0.5 (1792a62b) +* incrementing version number - v4.0.4 (b1125cce) +* incrementing version number - v4.0.3 (2b65c735) +* incrementing version number - v4.0.2 (73fe5fcf) +* incrementing version number - v4.0.1 (a461b758) +* incrementing version number - v4.0.0 (c1eaee45) +* **i18n:** + * fallback strings for new resources: nodebb.admin-settings-email (866cd539) + * fallback strings for new resources: nodebb.error (b4dfd7fe) + * fallback strings for new resources: nodebb.admin-settings-chat (2f957655) + * fallback strings for new resources: nodebb.user (78a2c087) + * fallback strings for new resources: nodebb.admin-manage-categories (c3993018) + * fallback strings for new resources: nodebb.admin-manage-categories (efdb416c) + * fallback strings for new resources: nodebb.category (8314d8ba) + +##### Documentation Changes + +* openapi schema for admin/extend/plugins (f2a16422) +* update openapi schema from 6c26d9f4a3c398b4d7add0a2d9c91685a0336a74 (128dd2d3) + +##### New Features + +* 1b12 category announce on post move to a new tid, #13236 (254f0738) +* add Azerbaijani localisations, təşəkkür edirəm! (825e4c70) +* if an incoming remote message is too long, don't create the room, but notify the local recipients instead (885b83e5) +* new ACP config for max length of remote chat messages, #13174 (81509b13) +* add `federatedDescription` property to a category. (dfabadbe) +* add link to category edit page in acp category sidebar (fa8216f2) +* add additional logic that checks whether a cid follows the activity actor, and asserts note into that category if so (3589c570) +* move category sidebar to ACP partial, add sidebar to category-federation (dc2dcaf1) +* add line to description exposing a category's handle if accessible by fediverse pseudo-user, closes #13126 (6c26d9f4) +* call announceObject on topic fork, #13215 (e3edfef8) + +##### Bug Fixes + +* wrong property name used (08796a0a) +* #13254, configurable ap content prune (80e03c85) +* only 1b12 announce topic fork if OP is local, fix race condition in tests (945617cb) +* bug where remote post was attempted to be announced on post move (291af926) +* handling of `href` in remote object attachments, #13169 (44354dac) +* #13100, direct access to a tag page no longer excludes cid -1 (14fd33ce) +* expose remote url in user object (78c9239b) +* hide disable and purge buttons from category-federation.tpl (43248578) +* show 'copy settings from' button in acp category sidebar only on category.tpl (1f6871e5) +* improper cc and object fields in announceObject (deb5ee5e) +* move AP send logging earlier (dca3c35d) +* #13224, handle note attributedTo when it is of type object (d9483347) +* allow actor assertion of loopback actors depending on ACP setting (73aaa990) +* **deps:** + * update dependency mongodb to v6.15.0 (#13253) (1c23d0cf) + * update dependency pg to v8.14.1 (#13247) (4d6d71d8) + * update dependency nodebb-widget-essentials to v7.0.36 (#13250) (dbd0fd22) + * update dependency sass to v1.86.0 (#13252) (a1465268) + * update dependency esbuild to v0.25.1 (#13243) (ce3bb8b5) + * update dependency ioredis to v5.6.0 (#13246) (b96f532b) + * update dependency connect-redis to v8.0.2 (#13242) (e90a8b26) + * update dependency autoprefixer to v10.4.21 (#13241) (4e69ed56) + * update dependency pg-cursor to v2.13.1 (#13248) (92727549) + * update fontsource monorepo to v5.2.5 (#13226) (8ca1d6e6) + * update dependency mongodb to v6.14.2 (#13229) (b39e4d19) + * update dependency terser-webpack-plugin to v5.3.14 (#13230) (7b40e210) + * update dependency mongodb to v6.14.1 (#13225) (a58af228) + * update dependency tough-cookie to v5.1.2 (#13217) (e19109ad) + * update dependency mongodb to v6.14.0 (#13214) (ad680d6a) + * update dependency terser-webpack-plugin to v5.3.12 (#13213) (4c22af8c) + * update dependency cron to v4.1.0 (#13200) (f56838a3) + +##### Refactors + +* remove announceObject in favour of feps.announce, added create activity mock to support (74443c3b) +* move all input note normalization into helper method, have assertPrivate mock a message object (with said normalization) before sending message (4ec7552c) + +##### Tests + +* add url/statusCode to failing test (8982923e) +* fix remoteUrl property generation, tests for topic moving (0e1006fb) +* fix actor tests (537880d2) +* openapi schema for remoteUrl (fc64e89f) +* add failing test for #13215 (feb94215) +* adjust test runner detection in AP code (7ceb6d69) +* new test file for feps (e510e826) +* log outgoing AP messages for local test runner (6e872b5f) +* allow ap/notes tests to be run in isolation (98aafaaf) + #### v4.1.1 (2025-03-12) ##### Chores From c6620170332f50555f022e94705be111d72655d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 19 Mar 2025 20:49:04 -0400 Subject: [PATCH 03/11] fix: closes #13256, allow keyboard access to icon colors --- install/package.json | 2 +- public/scss/modules/picture-switcher.scss | 64 ++++------------------- public/src/modules/accounts/picture.js | 17 +++--- src/views/modals/change-picture.tpl | 11 ++-- 4 files changed, 27 insertions(+), 67 deletions(-) diff --git a/install/package.json b/install/package.json index 7b2a21f3bf..a83a224d5e 100644 --- a/install/package.json +++ b/install/package.json @@ -108,7 +108,7 @@ "nodebb-plugin-spam-be-gone": "2.3.1", "nodebb-plugin-web-push": "0.7.3", "nodebb-rewards-essentials": "1.0.1", - "nodebb-theme-harmony": "2.0.40", + "nodebb-theme-harmony": "2.0.41", "nodebb-theme-lavender": "7.1.18", "nodebb-theme-peace": "2.2.39", "nodebb-theme-persona": "14.0.16", diff --git a/public/scss/modules/picture-switcher.scss b/public/scss/modules/picture-switcher.scss index 218f826690..2e38e55b79 100644 --- a/public/scss/modules/picture-switcher.scss +++ b/public/scss/modules/picture-switcher.scss @@ -1,59 +1,17 @@ .picture-switcher { - h4 { - line-height: 46px; - margin: 0; - } - .modal-body .btn { - padding: 10px 5px; - font-size: 13px; - } - - label { - vertical-align: top; - line-height: 26px; - - > input[type="radio"] { - display: none; - - &:checked { - + span:before { - border-radius: 50%; - border: 2px solid $primary; - position: relative; - top: -4px; - left: -4px; - } - } - - &[value="transparent"] { - &:checked + span:before { - padding-top: 2px; - padding-left: 2px; - } - - + span:before { - content: '\f05e'; - font-family: FontAwesome; - color: $gray-200; - font-size: 28px; - } - } - } - - span { - display: inline-block; - width: 24px; - height: 24px; + [data-bg-color] { + position: relative; + border-radius: 50%; + &.selected::after { + content: ''; + position: absolute; + top: -2px; left: -2px; + right: -2px; bottom: -2px; border-radius: 50%; - margin-right: .5em; - - &:before { - content: ''; - display: inline-block; - width: 32px; - height: 32px; - } + border: 2px solid $primary; + pointer-events: none; + z-index: 1; } } } \ No newline at end of file diff --git a/public/src/modules/accounts/picture.js b/public/src/modules/accounts/picture.js index ddd3005453..6fe37df734 100644 --- a/public/src/modules/accounts/picture.js +++ b/public/src/modules/accounts/picture.js @@ -60,8 +60,10 @@ define('accounts/picture', [ modal.find('.list-group-item').removeClass('active'); $(this).addClass('active'); }); - modal.on('change', 'input[type="radio"][name="icon:bgColor"]', (e) => { - const value = e.target.value; + + modal.on('click', '[data-bg-color]', function () { + const value = $(this).attr('data-bg-color'); + $(this).addClass('selected').siblings().removeClass('selected'); modal.find('[component="avatar/icon"]').css('background-color', value); }); @@ -80,18 +82,17 @@ define('accounts/picture', [ } // Update avatar background colour - const radioEl = document.querySelector(`.modal input[type="radio"][value="${ajaxify.data['icon:bgColor']}"]`); - if (radioEl) { - radioEl.checked = true; + const iconbgEl = modal.find(`[data-bg-color="${ajaxify.data['icon:bgColor']}"]`); + if (iconbgEl.length) { + iconbgEl.addClass('selected'); } else { - // Check the first one - document.querySelector('.modal input[type="radio"]').checked = true; + modal.find('[data-bg-color="transparent"]').addClass('selected'); } } function saveSelection() { const type = modal.find('.list-group-item.active').attr('data-type'); - const iconBgColor = document.querySelector('.modal.picture-switcher input[type="radio"]:checked').value || 'transparent'; + const iconBgColor = modal.find('[data-bg-color].selected').attr('data-bg-color') || 'transparent'; changeUserPicture(type, iconBgColor).then(() => { Picture.updateHeader( diff --git a/src/views/modals/change-picture.tpl b/src/views/modals/change-picture.tpl index 521ea87624..f0c16744dc 100644 --- a/src/views/modals/change-picture.tpl +++ b/src/views/modals/change-picture.tpl @@ -35,8 +35,9 @@

[[user:avatar-background-colour]]

- - -{{{ each iconBackgrounds }}} - -{{{ end }}} \ No newline at end of file +
+ + {{{ each iconBackgrounds }}} + +{{{ end }}} +
\ No newline at end of file From c258f597c536c851ff9d7f3bdd7f21881db1c8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 19 Mar 2025 20:54:31 -0400 Subject: [PATCH 04/11] refactor: make register intro heading --- src/views/registerComplete.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/registerComplete.tpl b/src/views/registerComplete.tpl index b623d32861..c770e235ba 100644 --- a/src/views/registerComplete.tpl +++ b/src/views/registerComplete.tpl @@ -1,8 +1,8 @@
-

+

{{{ if register }}}[[register:interstitial.intro-new]]{{{ else }}}[[register:interstitial.intro]]{{{ end }}} -

+

{{{ if errors.length }}}
From 6fe066ced2707d31cac6e5ae911010aae08fbfbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 19 Mar 2025 21:03:08 -0400 Subject: [PATCH 05/11] fix: check if latestversion is valid before using semver.gt --- src/controllers/admin/dashboard.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controllers/admin/dashboard.js b/src/controllers/admin/dashboard.js index d3bf019443..aa173eca07 100644 --- a/src/controllers/admin/dashboard.js +++ b/src/controllers/admin/dashboard.js @@ -28,12 +28,13 @@ dashboardController.get = async function (req, res) { getPopularSearches(), ]); const version = nconf.get('version'); + const latestValidVersion = semver.valid(latestVersion); res.render('admin/dashboard', { version: version, - lookupFailed: latestVersion === null, - latestVersion: latestVersion, - upgradeAvailable: latestVersion && semver.gt(latestVersion, version), + lookupFailed: latestValidVersion === null, + latestVersion: latestValidVersion, + upgradeAvailable: latestValidVersion && semver.gt(latestValidVersion, version), currentPrerelease: versions.isPrerelease.test(version), notices: notices, stats: stats, From 747457d7b61988b050ae3ad40c8ddad76fde155d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 19 Mar 2025 21:14:02 -0400 Subject: [PATCH 06/11] refactor: remove pointless true --- src/categories/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/categories/index.js b/src/categories/index.js index ef1879ab31..cde2f02d6a 100644 --- a/src/categories/index.js +++ b/src/categories/index.js @@ -156,7 +156,7 @@ Categories.setUnread = async function (tree, cids, uid) { if (category) { category.unread = false; if (unreadCids.includes(category.cid)) { - category.unread = category.topic_count > 0 && true; + category.unread = category.topic_count > 0; } else if (category.children.length) { category.children.forEach(setCategoryUnread); category.unread = category.children.some(c => c && c.unread); From 75f1f6fbfe8e2ad5c1b33e14ea7208f4a2faf628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 20 Mar 2025 17:10:02 -0400 Subject: [PATCH 07/11] chore: up persona --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index a83a224d5e..8907a46960 100644 --- a/install/package.json +++ b/install/package.json @@ -111,7 +111,7 @@ "nodebb-theme-harmony": "2.0.41", "nodebb-theme-lavender": "7.1.18", "nodebb-theme-peace": "2.2.39", - "nodebb-theme-persona": "14.0.16", + "nodebb-theme-persona": "14.0.17", "nodebb-widget-essentials": "7.0.36", "nodemailer": "6.10.0", "nprogress": "0.2.0", From e722e8695646c1a1d91da584efe3516ec4886284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 24 Mar 2025 10:22:27 -0400 Subject: [PATCH 08/11] refactor: get rid of async.parallel --- test/database/keys.js | 82 +++++++++++-------------------------------- 1 file changed, 21 insertions(+), 61 deletions(-) diff --git a/test/database/keys.js b/test/database/keys.js index 984a5e7a66..71f2aa9baa 100644 --- a/test/database/keys.js +++ b/test/database/keys.js @@ -1,7 +1,5 @@ 'use strict'; - -const async = require('async'); const assert = require('assert'); const db = require('../mocks/databasemock'); @@ -115,67 +113,29 @@ describe('Key methods', () => { }); }); - it('should delete all keys passed in', (done) => { - async.parallel([ - function (next) { - db.set('key1', 'value1', next); - }, - function (next) { - db.set('key2', 'value2', next); - }, - ], (err) => { - if (err) { - return done(err); - } - db.deleteAll(['key1', 'key2'], function (err) { - assert.ifError(err); - assert.equal(arguments.length, 1); - async.parallel({ - key1exists: function (next) { - db.exists('key1', next); - }, - key2exists: function (next) { - db.exists('key2', next); - }, - }, (err, results) => { - assert.ifError(err); - assert.equal(results.key1exists, false); - assert.equal(results.key2exists, false); - done(); - }); - }); - }); + it('should delete all keys passed in', async () => { + await Promise.all([ + db.set('key1', 'value1'), + db.set('key2', 'value2'), + ]); + + await db.deleteAll(['key1', 'key2']); + const [key1Exists, key2Exists] = await db.exists(['key1', 'key2']); + assert.strictEqual(key1Exists, false); + assert.strictEqual(key2Exists, false); }); - it('should delete all sorted set elements', (done) => { - async.parallel([ - function (next) { - db.sortedSetAdd('deletezset', 1, 'value1', next); - }, - function (next) { - db.sortedSetAdd('deletezset', 2, 'value2', next); - }, - ], (err) => { - if (err) { - return done(err); - } - db.delete('deletezset', (err) => { - assert.ifError(err); - async.parallel({ - key1exists: function (next) { - db.isSortedSetMember('deletezset', 'value1', next); - }, - key2exists: function (next) { - db.isSortedSetMember('deletezset', 'value2', next); - }, - }, (err, results) => { - assert.ifError(err); - assert.equal(results.key1exists, false); - assert.equal(results.key2exists, false); - done(); - }); - }); - }); + it('should delete all sorted set elements', async () => { + await db.sortedSetAddBulk([ + ['deletezset', 1, 'value1'], + ['deletezset', 2, 'value2'], + ]); + + await db.delete('deletezset'); + const [key1Exists, key2Exists] = await db.isSortedSetMembers('deletezset', ['value1', 'value2']); + + assert.strictEqual(key1Exists, false); + assert.strictEqual(key2Exists, false); }); describe('increment', () => { From 2237e17a12f52f5e5fb2c3b91bbfbee9ac6b530c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 27 Mar 2025 11:43:35 -0400 Subject: [PATCH 09/11] chore: up persona --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 8907a46960..05497b2009 100644 --- a/install/package.json +++ b/install/package.json @@ -111,7 +111,7 @@ "nodebb-theme-harmony": "2.0.41", "nodebb-theme-lavender": "7.1.18", "nodebb-theme-peace": "2.2.39", - "nodebb-theme-persona": "14.0.17", + "nodebb-theme-persona": "14.0.18", "nodebb-widget-essentials": "7.0.36", "nodemailer": "6.10.0", "nprogress": "0.2.0", From d161eb6f6c37e62c092668a7a750f24f7d51378e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 27 Mar 2025 11:57:21 -0400 Subject: [PATCH 10/11] 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 05497b2009..24fdf6cd75 100644 --- a/install/package.json +++ b/install/package.json @@ -108,7 +108,7 @@ "nodebb-plugin-spam-be-gone": "2.3.1", "nodebb-plugin-web-push": "0.7.3", "nodebb-rewards-essentials": "1.0.1", - "nodebb-theme-harmony": "2.0.41", + "nodebb-theme-harmony": "2.0.43", "nodebb-theme-lavender": "7.1.18", "nodebb-theme-peace": "2.2.39", "nodebb-theme-persona": "14.0.18", From 33d50637a33814f10bb5e8d78b8e314a39bea417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 10 Apr 2025 09:53:20 -0400 Subject: [PATCH 11/11] fix: closes #13317, fix email confirm for changing email --- public/language/en-GB/notifications.json | 1 - public/openapi/read/confirm/code.yaml | 3 --- src/controllers/index.js | 6 ------ src/views/confirm.tpl | 7 +------ 4 files changed, 1 insertion(+), 16 deletions(-) diff --git a/public/language/en-GB/notifications.json b/public/language/en-GB/notifications.json index f4d04ebe27..065cd6aeed 100644 --- a/public/language/en-GB/notifications.json +++ b/public/language/en-GB/notifications.json @@ -83,7 +83,6 @@ "email-confirmed": "Email Confirmed", "email-confirmed-message": "Thank you for validating your email. Your account is now fully activated.", "email-confirm-error-message": "There was a problem validating your email address. Perhaps the code was invalid or has expired.", - "email-confirm-error-message-already-validated": "Your email address was already validated.", "email-confirm-sent": "Confirmation email sent.", "none": "None", diff --git a/public/openapi/read/confirm/code.yaml b/public/openapi/read/confirm/code.yaml index 9677cb1a66..9d55b016c1 100644 --- a/public/openapi/read/confirm/code.yaml +++ b/public/openapi/read/confirm/code.yaml @@ -24,9 +24,6 @@ get: error: type: string description: Translation key for client-side localisation - alreadyValidated: - type: boolean - description: set to true if the email was already validated required: - title - $ref: ../../components/schemas/CommonProps.yaml#/CommonProps \ No newline at end of file diff --git a/src/controllers/index.js b/src/controllers/index.js index f8152a6933..879774c17f 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -235,12 +235,6 @@ Controllers.confirmEmail = async (req, res) => { return renderPage(); } try { - if (req.loggedIn) { - const emailValidated = await user.getUserField(req.uid, 'email:confirmed'); - if (emailValidated) { - return renderPage({ alreadyValidated: true }); - } - } await user.email.confirmByCode(req.params.code, req.session.id); if (req.session.registration) { // After confirmation, no need to send user back to email change form diff --git a/src/views/confirm.tpl b/src/views/confirm.tpl index 0235ced0d5..00396818b8 100644 --- a/src/views/confirm.tpl +++ b/src/views/confirm.tpl @@ -1,14 +1,9 @@ -{{{ if alreadyValidated }}} -
-

[[notifications:email-confirm-error-message-already-validated]]

-{{{ end }}} - {{{ if error }}}

[[notifications:email-confirm-error-message]]

{{{ end }}} -{{{ if (!error && !alreadyValidated )}}} +{{{ if !error }}}
[[notifications:email-confirmed]]

[[notifications:email-confirmed-message]]