From cf6e8101e86e0d5f91b491421e6477a2b74d3a81 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Mon, 19 Sep 2022 16:23:58 +0000 Subject: [PATCH 01/10] chore: incrementing version number - v2.5.3 --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index 3a1c865b5e..18bc65668e 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "2.5.2", + "version": "2.5.3", "homepage": "http://www.nodebb.org", "repository": { "type": "git", @@ -186,4 +186,4 @@ "url": "https://github.com/barisusakli" } ] -} +} \ No newline at end of file From fdf240f6516a0b4a72ca0de24e143c316bcf0184 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Mon, 19 Sep 2022 16:23:59 +0000 Subject: [PATCH 02/10] chore: update changelog for v2.5.3 --- CHANGELOG.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 312cd0d726..fd4ac1c692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,45 @@ +#### v2.5.3 (2022-09-19) + +##### Chores + +* remove duplicate version increment lines in changelog (5dbcfef9) +* bring back treding plugins (8aa1596d) +* incrementing version number - v2.5.2 (babcd17e) +* update changelog for v2.5.2 (84b6a7c7) +* incrementing version number - v2.5.1 (ce3aa950) +* incrementing version number - v2.5.0 (01d276cb) +* incrementing version number - v2.4.5 (dd3e1a28) +* incrementing version number - v2.4.4 (d5525c87) +* incrementing version number - v2.4.3 (9c647c6c) +* incrementing version number - v2.4.2 (3aa7b855) +* incrementing version number - v2.4.1 (60cbd148) +* incrementing version number - v2.4.0 (4834cde3) +* incrementing version number - v2.3.1 (d2425942) +* incrementing version number - v2.3.0 (046ea120) + +##### New Features + +* store topic title and tags in diffs (#10900) (b5dd89e1) + +##### Bug Fixes + +* #10906, allow `middleware.checkAccountPermissions` to be called with either uid or userslug in params (cf4f5447) +* #10896, unescape / in taskbar (8e2129f8) +* add back timeago to post history modal (d3e38df8) +* **deps:** bump composer-default to v9.1.1 (1d80a07e) + +##### Other Changes + +* fix lint (3d5a6b39) + +##### Performance Improvements + +* disable trending plugins, too slow due to nbbpm (b392450c) + +##### Tests + +* add back /admin/extend/plugins test (1c9c39a8) + #### v2.5.2 (2022-09-04) ##### Chores From 14515f6004513d86b1189c5609c3b54b19961236 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 21 Sep 2022 16:02:20 -0400 Subject: [PATCH 03/10] fix: add lru-cache to checked packages, to fix upgrade issue with lru-cache --- src/cli/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli/index.js b/src/cli/index.js index 5c3c01fd88..86bfc127b4 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -41,6 +41,7 @@ try { checkVersion('commander'); checkVersion('chalk'); checkVersion('lodash'); + checkVersion('lru-cache'); } catch (e) { if (['ENOENT', 'DEP_WRONG_VERSION', 'MODULE_NOT_FOUND'].includes(e.code)) { console.warn('Dependencies outdated or not yet installed.'); From aad0a618c86f45055827dada020bad11b041bd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 23 Sep 2022 09:09:15 -0400 Subject: [PATCH 04/10] fix: scroll to post if theme doesn't have top navbar --- public/src/modules/navigator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index 824f55434a..2937470707 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -559,7 +559,7 @@ define('navigator', ['forum/pagination', 'components', 'hooks', 'alerts'], funct } const postHeight = scrollTo.outerHeight(true); - const navbarHeight = components.get('navbar').outerHeight(true); + const navbarHeight = components.get('navbar').outerHeight(true) || 0; const topicHeaderHeight = $('.topic-header').outerHeight(true) || 0; const viewportHeight = $(window).height(); From 803398e91549b59129a44f558a6eeb1556a057bc Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 23 Sep 2022 13:10:14 -0400 Subject: [PATCH 05/10] fix: broken flag history on flag update --- public/src/client/flags/detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/flags/detail.js b/public/src/client/flags/detail.js index fdffc096f2..782304f318 100644 --- a/public/src/client/flags/detail.js +++ b/public/src/client/flags/detail.js @@ -26,7 +26,7 @@ define('forum/flags/detail', [ return memo; }, {}); - api.put(`/flags/${ajaxify.data.flagId}`, data).then((history) => { + api.put(`/flags/${ajaxify.data.flagId}`, data).then(({ history }) => { alerts.success('[[flags:updated]]'); Detail.reloadHistory(history); }).catch(alerts.error); From 7240e8ce575fbca92ffb94ad6fdf4a81621679d8 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 28 Sep 2022 10:27:50 -0400 Subject: [PATCH 06/10] =?UTF-8?q?chore:=20=F0=9F=A4=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd4ac1c692..2fa3d9ec12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,6 @@ * bring back treding plugins (8aa1596d) * incrementing version number - v2.5.2 (babcd17e) * update changelog for v2.5.2 (84b6a7c7) -* incrementing version number - v2.5.1 (ce3aa950) -* incrementing version number - v2.5.0 (01d276cb) -* incrementing version number - v2.4.5 (dd3e1a28) -* incrementing version number - v2.4.4 (d5525c87) -* incrementing version number - v2.4.3 (9c647c6c) -* incrementing version number - v2.4.2 (3aa7b855) -* incrementing version number - v2.4.1 (60cbd148) -* incrementing version number - v2.4.0 (4834cde3) -* incrementing version number - v2.3.1 (d2425942) -* incrementing version number - v2.3.0 (046ea120) ##### New Features From 989b55d07e6fc720e1d9792c6a192546dacc8971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 1 Oct 2022 22:15:06 -0400 Subject: [PATCH 07/10] fix: crash in category drag, closes #10932 happens when a child is dragged to root or from root to a nested level --- public/src/admin/manage/categories.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/src/admin/manage/categories.js b/public/src/admin/manage/categories.js index cae9f782ca..d5eb350038 100644 --- a/public/src/admin/manage/categories.js +++ b/public/src/admin/manage/categories.js @@ -212,11 +212,17 @@ define('admin/manage/categories', [ const oldParentCid = parseInt(e.from.getAttribute('data-cid'), 10); const newParentCid = parseInt(e.to.getAttribute('data-cid'), 10); if (oldParentCid !== newParentCid) { - document.querySelector(`.categories li[data-cid="${newParentCid}"] .toggle`).classList.toggle('hide', false); + const toggle = document.querySelector(`.categories li[data-cid="${newParentCid}"] .toggle`); + if (toggle) { + toggle.classList.toggle('hide', false); + } const children = document.querySelectorAll(`.categories li[data-cid="${oldParentCid}"] ul[data-cid] li[data-cid]`); if (!children.length) { - document.querySelector(`.categories li[data-cid="${oldParentCid}"] .toggle`).classList.toggle('hide', true); + const toggle = document.querySelector(`.categories li[data-cid="${oldParentCid}"] .toggle`); + if (toggle) { + toggle.classList.toggle('hide', true); + } } e.item.dataset.parentCid = newParentCid; From 177d9048128b39f4daf2322cc5958fea118f95bb 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 Oct 2022 09:40:54 -0400 Subject: [PATCH 08/10] fix: category ordering add test --- src/categories/update.js | 2 +- test/categories.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/categories/update.js b/src/categories/update.js index 20b14361fb..d4be83edb8 100644 --- a/src/categories/update.js +++ b/src/categories/update.js @@ -108,7 +108,7 @@ module.exports = function (Categories) { if (currentIndex === -1) { throw new Error('[[error:no-category]]'); } - // moves cid to index order-1 in the array + // moves cid to index order - 1 in the array if (childrenCids.length > 1) { childrenCids.splice(Math.max(0, order - 1), 0, childrenCids.splice(currentIndex, 1)[0]); } diff --git a/test/categories.js b/test/categories.js index 98d15c28bc..cd28ee33ef 100644 --- a/test/categories.js +++ b/test/categories.js @@ -421,6 +421,22 @@ describe('Categories', () => { assert.equal(data.icon, updateData[cid].icon); }); + it('should properly order categories', async () => { + const p1 = await Categories.create({ name: 'p1', description: 'd', parentCid: 0, order: 1 }); + const c1 = await Categories.create({ name: 'c1', description: 'd1', parentCid: p1.cid, order: 1 }); + const c2 = await Categories.create({ name: 'c2', description: 'd2', parentCid: p1.cid, order: 2 }); + const c3 = await Categories.create({ name: 'c3', description: 'd3', parentCid: p1.cid, order: 3 }); + // move c1 to second place + await apiCategories.update({ uid: adminUid }, { [c1.cid]: { order: 2 } }); + let cids = await db.getSortedSetRange(`cid:${p1.cid}:children`, 0, -1); + assert.deepStrictEqual(cids.map(Number), [c2.cid, c1.cid, c3.cid]); + + // move c3 to front + await apiCategories.update({ uid: adminUid }, { [c3.cid]: { order: 1 } }); + cids = await db.getSortedSetRange(`cid:${p1.cid}:children`, 0, -1); + assert.deepStrictEqual(cids.map(Number), [c3.cid, c2.cid, c1.cid]); + }); + it('should not remove category from parent if parent is set again to same category', async () => { const parentCat = await Categories.create({ name: 'parent', description: 'poor parent' }); const updateData = {}; From fe0020fb31e64a5cd9ccd8039786fdd248a32106 Mon Sep 17 00:00:00 2001 From: Ashish Kurmi Date: Sun, 2 Oct 2022 14:32:42 -0700 Subject: [PATCH 09/10] ci: add minimum GitHub token permissions for workflows Signed-off-by: Ashish Kurmi --- .github/workflows/docker.yml | 3 +++ .github/workflows/test.yaml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 01ca27e133..a901a4ee46 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,6 +11,9 @@ on: workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel +permissions: + contents: read + jobs: release: runs-on: ubuntu-latest diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 225615aa72..df9e180c78 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,8 +14,14 @@ defaults: run: shell: bash +permissions: + contents: read + jobs: test: + permissions: + checks: write # for coverallsapp/github-action to create new checks + contents: read # for actions/checkout to fetch code name: Lint and test strategy: fail-fast: false @@ -194,6 +200,8 @@ jobs: parallel: true finish: + permissions: + checks: write # for coverallsapp/github-action to create new checks needs: test runs-on: ubuntu-latest steps: From ebd5dcc6d62841dbcd120351919cdf7cf59f5933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 11 Oct 2022 08:13:59 -0400 Subject: [PATCH 10/10] fix: EEXISTS error on linux if plugin/theme overrides core js file --- src/meta/js.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/meta/js.js b/src/meta/js.js index 69ab76f369..454b682cc3 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -27,14 +27,6 @@ JS.scripts = { modules: { }, }; -async function linkIfLinux(srcPath, destPath) { - if (process.platform === 'win32') { - await fs.promises.copyFile(srcPath, destPath); - } else { - await file.link(srcPath, destPath, true); - } -} - const basePath = path.resolve(__dirname, '../..'); async function linkModules() { @@ -55,7 +47,7 @@ async function linkModules() { if (stats.isDirectory()) { await file.linkDirs(srcPath, destPath, true); } else { - await linkIfLinux(srcPath, destPath); + await fs.promises.copyFile(srcPath, destPath); } })); }