From af6cd1853c4aadc8dd3af9f8f79a9e6f1342e40c Mon Sep 17 00:00:00 2001 From: Brian Smith <112954497+brian-smith-tcril@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:38:17 -0400 Subject: [PATCH 1/3] revert: revert: "test: Remove support for Node 18 (#736)" (#740) (#744) This reverts commit 472bbe2d96e98c0b7a32121db42ee9c9b498683a. --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4b8dd034..ca37c3ae0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,6 @@ on: jobs: tests: runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] steps: - name: Checkout @@ -21,7 +18,7 @@ jobs: - name: Setup Nodejs uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node }} + node-version-file: '.nvmrc' - name: Install dependencies run: npm ci - name: Validate package-lock.json changes From 3cc39d83c495fe10d931dd293a73ddd8c00eda0d Mon Sep 17 00:00:00 2001 From: Farhaan Bukhsh Date: Thu, 21 Nov 2024 18:11:30 +0530 Subject: [PATCH 2/3] fix: Adds a fix to remove "Add a post" button when discussion is restricted (#742) "Add a post" button was visible even though the banner says that posting is restricted. This change helps in removing the button when posting is restricted. Signed-off-by: Farhaan Bukhsh --- src/discussions/data/hooks.js | 8 +------- src/discussions/data/hooks.test.jsx | 8 ++++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/discussions/data/hooks.js b/src/discussions/data/hooks.js index 6de5e1f0f..f4deb82a2 100644 --- a/src/discussions/data/hooks.js +++ b/src/discussions/data/hooks.js @@ -33,14 +33,11 @@ import { ContentSelectors } from './constants'; import { selectAreThreadsFiltered, selectEnableInContext, - selectIsCourseAdmin, - selectIsCourseStaff, selectIsPostingEnabled, selectIsUserLearner, selectPostThreadCount, selectUserHasModerationPrivileges, selectUserIsGroupTa, - selectUserIsStaff, } from './selectors'; import fetchCourseConfig from './thunks'; @@ -220,12 +217,9 @@ export const useCurrentDiscussionTopic = () => { export const useUserPostingEnabled = () => { const isPostingEnabled = useSelector(selectIsPostingEnabled); - const isUserAdmin = useSelector(selectUserIsStaff); const userHasModerationPrivileges = useSelector(selectUserHasModerationPrivileges); const isUserGroupTA = useSelector(selectUserIsGroupTa); - const isCourseAdmin = useSelector(selectIsCourseAdmin); - const isCourseStaff = useSelector(selectIsCourseStaff); - const isPrivileged = isUserAdmin || userHasModerationPrivileges || isUserGroupTA || isCourseAdmin || isCourseStaff; + const isPrivileged = userHasModerationPrivileges || isUserGroupTA; return (isPostingEnabled || isPrivileged); }; diff --git a/src/discussions/data/hooks.test.jsx b/src/discussions/data/hooks.test.jsx index ca58ebe82..e5648ce7e 100644 --- a/src/discussions/data/hooks.test.jsx +++ b/src/discussions/data/hooks.test.jsx @@ -19,11 +19,11 @@ const courseConfigApiUrl = getCourseConfigApiUrl(); let store; let axiosMock; -const generateApiResponse = (isPostingEnabled, isCourseAdmin = false) => ({ +const generateApiResponse = (isPostingEnabled, hasModerationPrivileges = false) => ({ isPostingEnabled, - hasModerationPrivileges: false, + hasModerationPrivileges, isGroupTa: false, - isCourseAdmin, + isCourseAdmin: false, isCourseStaff: false, isUserAdmin: false, }); @@ -160,7 +160,7 @@ describe('Hooks', () => { expect(queryByText('false')).toBeInTheDocument(); }); - test('when posting is not disabled and Role is not Learner return true', async () => { + test('when posting is disabled and Role is not Learner return true', async () => { axiosMock.onGet(`${courseConfigApiUrl}${courseId}/`) .reply(200, generateApiResponse(false, true)); await executeThunk(fetchCourseConfig(courseId), store.dispatch, store.getState); From 3ef851589106a3f2075435d2b03986fc32291773 Mon Sep 17 00:00:00 2001 From: Ihor Romaniuk Date: Tue, 10 Dec 2024 08:19:40 +0100 Subject: [PATCH 3/3] fix: block overflow when editing comment (#706) --- src/discussions/post-comments/comments/comment/Reply.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/discussions/post-comments/comments/comment/Reply.jsx b/src/discussions/post-comments/comments/comment/Reply.jsx index 1860cfcb5..a13432898 100644 --- a/src/discussions/post-comments/comments/comment/Reply.jsx +++ b/src/discussions/post-comments/comments/comment/Reply.jsx @@ -129,7 +129,7 @@ const Reply = ({ responseId }) => {