Compare commits
16 Commits
release/ul
...
aansari/is
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e216d847eb | ||
|
|
911b8b3fc5 | ||
|
|
4917da3245 | ||
|
|
e5388690b2 | ||
|
|
cefc8d9d35 | ||
|
|
f5c5913d3f | ||
|
|
687dae6b21 | ||
|
|
b812b96d77 | ||
|
|
142abd8dd4 | ||
|
|
ece4432f58 | ||
|
|
c599046813 | ||
|
|
c323c80bc8 | ||
|
|
37cec76dcb | ||
|
|
00440fc15a | ||
|
|
a4826ae62d | ||
|
|
16c49b2404 |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# Adding new check for github-actions
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup Nodejs
|
- name: Setup Nodejs
|
||||||
|
|||||||
4039
package-lock.json
generated
4039
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@@ -31,17 +31,17 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
|
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
|
||||||
"@edx/frontend-component-footer": "^14.6.0",
|
"@edx/frontend-component-footer": "^14.6.0",
|
||||||
"@edx/frontend-component-header": "^6.2.0",
|
"@edx/frontend-component-header": "^8.1.0",
|
||||||
"@edx/frontend-platform": "^8.3.3",
|
"@edx/frontend-platform": "^8.3.3",
|
||||||
"@edx/openedx-atlas": "^0.6.0",
|
"@edx/openedx-atlas": "^0.7.0",
|
||||||
"@openedx/paragon": "^23.4.5",
|
"@openedx/paragon": "^23.4.5",
|
||||||
"@reduxjs/toolkit": "1.9.7",
|
"@reduxjs/toolkit": "1.9.7",
|
||||||
"@tinymce/tinymce-react": "5.1.1",
|
"@tinymce/tinymce-react": "5.1.1",
|
||||||
"babel-polyfill": "6.26.0",
|
"babel-polyfill": "6.26.0",
|
||||||
"classnames": "2.5.1",
|
"classnames": "2.5.1",
|
||||||
"core-js": "3.21.1",
|
"core-js": "3.47.0",
|
||||||
"dompurify": "^2.4.3",
|
"dompurify": "^2.4.3",
|
||||||
"formik": "2.4.5",
|
"formik": "2.4.9",
|
||||||
"lodash.snakecase": "4.1.1",
|
"lodash.snakecase": "4.1.1",
|
||||||
"prop-types": "15.8.1",
|
"prop-types": "15.8.1",
|
||||||
"raw-loader": "4.0.2",
|
"raw-loader": "4.0.2",
|
||||||
@@ -56,20 +56,20 @@
|
|||||||
"redux": "4.2.1",
|
"redux": "4.2.1",
|
||||||
"regenerator-runtime": "0.14.1",
|
"regenerator-runtime": "0.14.1",
|
||||||
"timeago.js": "4.0.2",
|
"timeago.js": "4.0.2",
|
||||||
"tinymce": "5.10.7",
|
"tinymce": "5.10.9",
|
||||||
"yup": "0.32.11"
|
"yup": "0.32.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@edx/browserslist-config": "1.2.0",
|
"@edx/browserslist-config": "1.5.0",
|
||||||
"@openedx/frontend-build": "^14.6.2",
|
"@openedx/frontend-build": "^14.6.2",
|
||||||
"@testing-library/jest-dom": "5.17.0",
|
"@testing-library/jest-dom": "5.17.0",
|
||||||
"@testing-library/react": "14.3.1",
|
"@testing-library/react": "14.3.1",
|
||||||
"@testing-library/user-event": "13.5.0",
|
"@testing-library/user-event": "13.5.0",
|
||||||
"axios": "^0.28.0",
|
"axios": "^0.30.0",
|
||||||
"axios-mock-adapter": "1.22.0",
|
"axios-mock-adapter": "1.22.0",
|
||||||
"babel-plugin-react-intl": "8.2.25",
|
"babel-plugin-react-intl": "8.2.25",
|
||||||
"eslint-plugin-simple-import-sort": "7.0.0",
|
"eslint-plugin-simple-import-sort": "7.0.0",
|
||||||
"glob": "7.2.0",
|
"glob": "7.2.3",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"rosie": "2.1.1"
|
"rosie": "2.1.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ export const selectLearnerSorting = () => state => state.learners.sortedBy;
|
|||||||
export const selectLearnerNextPage = () => state => state.learners.nextPage;
|
export const selectLearnerNextPage = () => state => state.learners.nextPage;
|
||||||
|
|
||||||
export const selectLearnerAvatar = author => state => (
|
export const selectLearnerAvatar = author => state => (
|
||||||
state.learners.learnerProfiles[author]?.profileImage?.imageUrlSmall
|
state.learners.learnerProfiles[author]?.profileImage?.imageUrlLarge
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import {
|
|||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
import { Factory } from 'rosie';
|
import { Factory } from 'rosie';
|
||||||
|
|
||||||
import {
|
import { camelCaseObject, initializeMockApp } from '@edx/frontend-platform';
|
||||||
camelCaseObject, getConfig, initializeMockApp, setConfig,
|
|
||||||
} from '@edx/frontend-platform';
|
|
||||||
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
|
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
|
||||||
import { AppProvider } from '@edx/frontend-platform/react';
|
import { AppProvider } from '@edx/frontend-platform/react';
|
||||||
|
|
||||||
@@ -740,20 +738,6 @@ describe('ThreadView', () => {
|
|||||||
expect(screen.queryByTestId('comment-comment-4'))
|
expect(screen.queryByTestId('comment-comment-4'))
|
||||||
.toBeInTheDocument();
|
.toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it show avatar for reply author when ENABLE_PROFILE_IMAGE is true', async () => {
|
|
||||||
setConfig({
|
|
||||||
...getConfig(),
|
|
||||||
ENABLE_PROFILE_IMAGE: 'true',
|
|
||||||
});
|
|
||||||
await waitFor(() => renderComponent(discussionPostId));
|
|
||||||
|
|
||||||
const comment = await waitFor(() => screen.findByTestId('comment-comment-1'));
|
|
||||||
|
|
||||||
expect(comment).toBeInTheDocument();
|
|
||||||
const replyAuthorAvatar = within(comment).getAllByAltText('edx');
|
|
||||||
expect(replyAuthorAvatar.length).toBeGreaterThan(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('for question thread', () => {
|
describe('for question thread', () => {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const Comment = ({
|
|||||||
const {
|
const {
|
||||||
id, parentId, childCount, abuseFlagged, endorsed, threadId, endorsedAt, endorsedBy, endorsedByLabel, renderedBody,
|
id, parentId, childCount, abuseFlagged, endorsed, threadId, endorsedAt, endorsedBy, endorsedByLabel, renderedBody,
|
||||||
voted, following, voteCount, authorLabel, author, createdAt, lastEdit, rawBody, closed, closedBy, closeReason,
|
voted, following, voteCount, authorLabel, author, createdAt, lastEdit, rawBody, closed, closedBy, closeReason,
|
||||||
editByLabel, closedByLabel, users: commentUsers,
|
editByLabel, closedByLabel, users: postUsers,
|
||||||
} = comment;
|
} = comment;
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const hasChildren = childCount > 0;
|
const hasChildren = childCount > 0;
|
||||||
@@ -209,7 +209,7 @@ const Comment = ({
|
|||||||
closed={closed}
|
closed={closed}
|
||||||
createdAt={createdAt}
|
createdAt={createdAt}
|
||||||
lastEdit={lastEdit}
|
lastEdit={lastEdit}
|
||||||
commentUsers={commentUsers}
|
postUsers={postUsers}
|
||||||
/>
|
/>
|
||||||
{isEditing ? (
|
{isEditing ? (
|
||||||
<CommentEditor
|
<CommentEditor
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const CommentHeader = ({
|
|||||||
closed,
|
closed,
|
||||||
createdAt,
|
createdAt,
|
||||||
lastEdit,
|
lastEdit,
|
||||||
commentUsers,
|
postUsers,
|
||||||
}) => {
|
}) => {
|
||||||
const colorClass = AvatarOutlineAndLabelColors[authorLabel];
|
const colorClass = AvatarOutlineAndLabelColors[authorLabel];
|
||||||
const hasAnyAlert = useAlertBannerVisible({
|
const hasAnyAlert = useAlertBannerVisible({
|
||||||
@@ -31,7 +31,7 @@ const CommentHeader = ({
|
|||||||
const authorAvatar = useSelector(selectAuthorAvatar(author));
|
const authorAvatar = useSelector(selectAuthorAvatar(author));
|
||||||
|
|
||||||
const profileImage = getConfig()?.ENABLE_PROFILE_IMAGE === 'true'
|
const profileImage = getConfig()?.ENABLE_PROFILE_IMAGE === 'true'
|
||||||
? Object.values(commentUsers ?? {})[0]?.profile?.image
|
? Object.values(postUsers ?? {})[0]?.profile?.image
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -43,7 +43,7 @@ const CommentHeader = ({
|
|||||||
<Avatar
|
<Avatar
|
||||||
className={`border-0 ml-0.5 mr-2.5 ${colorClass ? `outline-${colorClass}` : 'outline-anonymous'}`}
|
className={`border-0 ml-0.5 mr-2.5 ${colorClass ? `outline-${colorClass}` : 'outline-anonymous'}`}
|
||||||
alt={author}
|
alt={author}
|
||||||
src={profileImage?.hasImage ? profileImage?.imageUrlSmall : authorAvatar?.imageUrlSmall}
|
src={profileImage?.hasImage ? profileImage?.imageUrlSmall : authorAvatar}
|
||||||
style={{
|
style={{
|
||||||
width: '32px',
|
width: '32px',
|
||||||
height: '32px',
|
height: '32px',
|
||||||
@@ -72,7 +72,7 @@ CommentHeader.propTypes = {
|
|||||||
editorUsername: PropTypes.string,
|
editorUsername: PropTypes.string,
|
||||||
reason: PropTypes.string,
|
reason: PropTypes.string,
|
||||||
}),
|
}),
|
||||||
commentUsers: PropTypes.shape({}).isRequired,
|
postUsers: PropTypes.shape({}).isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
CommentHeader.defaultProps = {
|
CommentHeader.defaultProps = {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const defaultProps = {
|
|||||||
closed: false,
|
closed: false,
|
||||||
createdAt: '2025-09-23T10:00:00Z',
|
createdAt: '2025-09-23T10:00:00Z',
|
||||||
lastEdit: null,
|
lastEdit: null,
|
||||||
commentUsers: {
|
postUsers: {
|
||||||
'test-user': {
|
'test-user': {
|
||||||
profile: { image: { hasImage: true, imageUrlSmall: 'http://avatar.test/img.png' } },
|
profile: { image: { hasImage: true, imageUrlSmall: 'http://avatar.test/img.png' } },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { Avatar, useToggle } from '@openedx/paragon';
|
|||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import * as timeago from 'timeago.js';
|
import * as timeago from 'timeago.js';
|
||||||
|
|
||||||
import { getConfig } from '@edx/frontend-platform';
|
|
||||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||||
|
|
||||||
import HTMLLoader from '../../../../components/HTMLLoader';
|
import HTMLLoader from '../../../../components/HTMLLoader';
|
||||||
@@ -25,7 +24,7 @@ import CommentEditor from './CommentEditor';
|
|||||||
const Reply = ({ responseId }) => {
|
const Reply = ({ responseId }) => {
|
||||||
timeago.register('time-locale', timeLocale);
|
timeago.register('time-locale', timeLocale);
|
||||||
const {
|
const {
|
||||||
id, abuseFlagged, author, authorLabel, endorsed, lastEdit, closed, closedBy, users: replyUsers,
|
id, abuseFlagged, author, authorLabel, endorsed, lastEdit, closed, closedBy,
|
||||||
closeReason, createdAt, threadId, parentId, rawBody, renderedBody, editByLabel, closedByLabel,
|
closeReason, createdAt, threadId, parentId, rawBody, renderedBody, editByLabel, closedByLabel,
|
||||||
} = useSelector(selectCommentOrResponseById(responseId));
|
} = useSelector(selectCommentOrResponseById(responseId));
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
@@ -79,10 +78,6 @@ const Reply = ({ responseId }) => {
|
|||||||
[ContentActions.REPORT]: handleAbusedFlag,
|
[ContentActions.REPORT]: handleAbusedFlag,
|
||||||
}), [handleEditContent, handleReplyEndorse, showDeleteConfirmation, handleAbusedFlag]);
|
}), [handleEditContent, handleReplyEndorse, showDeleteConfirmation, handleAbusedFlag]);
|
||||||
|
|
||||||
const profileImage = getConfig()?.ENABLE_PROFILE_IMAGE === 'true'
|
|
||||||
? Object.values(replyUsers ?? {})[0]?.profile?.image
|
|
||||||
: null;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="d-flex flex-column mt-2.5 " data-testid={`reply-${id}`} role="listitem">
|
<div className="d-flex flex-column mt-2.5 " data-testid={`reply-${id}`} role="listitem">
|
||||||
<Confirmation
|
<Confirmation
|
||||||
@@ -128,7 +123,7 @@ const Reply = ({ responseId }) => {
|
|||||||
<Avatar
|
<Avatar
|
||||||
className={`ml-0.5 mt-0.5 border-0 ${colorClass ? `outline-${colorClass}` : 'outline-anonymous'}`}
|
className={`ml-0.5 mt-0.5 border-0 ${colorClass ? `outline-${colorClass}` : 'outline-anonymous'}`}
|
||||||
alt={author}
|
alt={author}
|
||||||
src={profileImage?.hasImage ? profileImage?.imageUrlSmall : authorAvatar?.imageUrlSmall}
|
src={authorAvatar?.imageUrlSmall}
|
||||||
style={{
|
style={{
|
||||||
width: '32px',
|
width: '32px',
|
||||||
height: '32px',
|
height: '32px',
|
||||||
|
|||||||
@@ -30,16 +30,6 @@ Factory.define('comment')
|
|||||||
parent_id: null,
|
parent_id: null,
|
||||||
children: [],
|
children: [],
|
||||||
abuse_flagged_any_user: false,
|
abuse_flagged_any_user: false,
|
||||||
users: {
|
|
||||||
edx: {
|
|
||||||
profile: {
|
|
||||||
image: {
|
|
||||||
hasImage: true,
|
|
||||||
imageUrlSmall: 'http://test.site/default-avatar-small.png',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Factory.define('commentsResult')
|
Factory.define('commentsResult')
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export const postThread = async (
|
|||||||
content,
|
content,
|
||||||
{
|
{
|
||||||
following,
|
following,
|
||||||
cohort,
|
groupId,
|
||||||
anonymous,
|
anonymous,
|
||||||
anonymousToPeers,
|
anonymousToPeers,
|
||||||
notifyAllLearners,
|
notifyAllLearners,
|
||||||
@@ -114,7 +114,7 @@ export const postThread = async (
|
|||||||
following,
|
following,
|
||||||
anonymous,
|
anonymous,
|
||||||
anonymousToPeers,
|
anonymousToPeers,
|
||||||
groupId: cohort,
|
groupId,
|
||||||
enableInContextSidebar,
|
enableInContextSidebar,
|
||||||
notifyAllLearners,
|
notifyAllLearners,
|
||||||
captchaToken: recaptchaToken,
|
captchaToken: recaptchaToken,
|
||||||
@@ -154,6 +154,7 @@ export const updateThread = async (threadId, {
|
|||||||
pinned,
|
pinned,
|
||||||
editReasonCode,
|
editReasonCode,
|
||||||
closeReasonCode,
|
closeReasonCode,
|
||||||
|
groupId,
|
||||||
} = {}) => {
|
} = {}) => {
|
||||||
const url = `${getThreadsApiUrl()}${threadId}/`;
|
const url = `${getThreadsApiUrl()}${threadId}/`;
|
||||||
const patchData = snakeCaseObject({
|
const patchData = snakeCaseObject({
|
||||||
@@ -169,6 +170,7 @@ export const updateThread = async (threadId, {
|
|||||||
pinned,
|
pinned,
|
||||||
editReasonCode,
|
editReasonCode,
|
||||||
closeReasonCode,
|
closeReasonCode,
|
||||||
|
groupId,
|
||||||
});
|
});
|
||||||
const { data } = await getAuthenticatedHttpClient()
|
const { data } = await getAuthenticatedHttpClient()
|
||||||
.patch(url, patchData, { headers: { 'Content-Type': 'application/merge-patch+json' } });
|
.patch(url, patchData, { headers: { 'Content-Type': 'application/merge-patch+json' } });
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ export function createNewThread({
|
|||||||
following,
|
following,
|
||||||
anonymous,
|
anonymous,
|
||||||
anonymousToPeers,
|
anonymousToPeers,
|
||||||
cohort,
|
groupId,
|
||||||
enableInContextSidebar,
|
enableInContextSidebar,
|
||||||
notifyAllLearners,
|
notifyAllLearners,
|
||||||
recaptchaToken,
|
recaptchaToken,
|
||||||
@@ -224,12 +224,12 @@ export function createNewThread({
|
|||||||
following,
|
following,
|
||||||
anonymous,
|
anonymous,
|
||||||
anonymousToPeers,
|
anonymousToPeers,
|
||||||
cohort,
|
groupId,
|
||||||
notifyAllLearners,
|
notifyAllLearners,
|
||||||
recaptchaToken,
|
recaptchaToken,
|
||||||
}));
|
}));
|
||||||
const data = await postThread(courseId, topicId, type, title, content, {
|
const data = await postThread(courseId, topicId, type, title, content, {
|
||||||
cohort,
|
groupId,
|
||||||
following,
|
following,
|
||||||
anonymous,
|
anonymous,
|
||||||
anonymousToPeers,
|
anonymousToPeers,
|
||||||
@@ -252,7 +252,8 @@ export function createNewThread({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function updateExistingThread(threadId, {
|
export function updateExistingThread(threadId, {
|
||||||
flagged, voted, read, topicId, type, title, content, following, closed, pinned, closeReasonCode, editReasonCode,
|
flagged, voted, read, topicId, type, title, content, following,
|
||||||
|
closed, pinned, closeReasonCode, editReasonCode, groupId,
|
||||||
}) {
|
}) {
|
||||||
return async (dispatch) => {
|
return async (dispatch) => {
|
||||||
try {
|
try {
|
||||||
@@ -270,6 +271,7 @@ export function updateExistingThread(threadId, {
|
|||||||
pinned,
|
pinned,
|
||||||
editReasonCode,
|
editReasonCode,
|
||||||
closeReasonCode,
|
closeReasonCode,
|
||||||
|
groupId,
|
||||||
}));
|
}));
|
||||||
const data = await updateThread(threadId, {
|
const data = await updateThread(threadId, {
|
||||||
flagged,
|
flagged,
|
||||||
@@ -284,6 +286,7 @@ export function updateExistingThread(threadId, {
|
|||||||
pinned,
|
pinned,
|
||||||
editReasonCode,
|
editReasonCode,
|
||||||
closeReasonCode,
|
closeReasonCode,
|
||||||
|
groupId,
|
||||||
});
|
});
|
||||||
dispatch(updateThreadSuccess(camelCaseObject(data)));
|
dispatch(updateThreadSuccess(camelCaseObject(data)));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ const PostEditor = ({
|
|||||||
notifyAllLearners: false,
|
notifyAllLearners: false,
|
||||||
anonymous: allowAnonymous ? false : undefined,
|
anonymous: allowAnonymous ? false : undefined,
|
||||||
anonymousToPeers: allowAnonymousToPeers ? false : undefined,
|
anonymousToPeers: allowAnonymousToPeers ? false : undefined,
|
||||||
cohort: post?.cohort || 'default',
|
cohort: post?.groupId || 'default',
|
||||||
editReasonCode: post?.lastEdit?.reasonCode || (
|
editReasonCode: post?.lastEdit?.reasonCode || (
|
||||||
userIsStaff && canDisplayEditReason ? 'violates-guidelines' : undefined
|
userIsStaff && canDisplayEditReason ? 'violates-guidelines' : undefined
|
||||||
),
|
),
|
||||||
@@ -175,6 +175,8 @@ const PostEditor = ({
|
|||||||
|
|
||||||
const submitForm = useCallback(async (values, { resetForm }) => {
|
const submitForm = useCallback(async (values, { resetForm }) => {
|
||||||
let recaptchaToken;
|
let recaptchaToken;
|
||||||
|
const groupId = canSelectCohort(values.topic) ? selectedCohort(values.cohort) : undefined;
|
||||||
|
|
||||||
if (shouldRequireCaptcha && executeRecaptcha) {
|
if (shouldRequireCaptcha && executeRecaptcha) {
|
||||||
try {
|
try {
|
||||||
recaptchaToken = await executeRecaptcha('submit_post');
|
recaptchaToken = await executeRecaptcha('submit_post');
|
||||||
@@ -196,10 +198,9 @@ const PostEditor = ({
|
|||||||
title: values.title,
|
title: values.title,
|
||||||
content: values.comment,
|
content: values.comment,
|
||||||
editReasonCode: values.editReasonCode || undefined,
|
editReasonCode: values.editReasonCode || undefined,
|
||||||
|
groupId,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
const cohort = canSelectCohort(values.topic) ? selectedCohort(values.cohort) : undefined;
|
|
||||||
|
|
||||||
await dispatchSubmit(createNewThread({
|
await dispatchSubmit(createNewThread({
|
||||||
courseId,
|
courseId,
|
||||||
topicId: values.topic,
|
topicId: values.topic,
|
||||||
@@ -209,7 +210,7 @@ const PostEditor = ({
|
|||||||
following: values.follow,
|
following: values.follow,
|
||||||
anonymous: allowAnonymous ? values.anonymous : undefined,
|
anonymous: allowAnonymous ? values.anonymous : undefined,
|
||||||
anonymousToPeers: allowAnonymousToPeers ? values.anonymousToPeers : undefined,
|
anonymousToPeers: allowAnonymousToPeers ? values.anonymousToPeers : undefined,
|
||||||
cohort,
|
groupId,
|
||||||
enableInContextSidebar,
|
enableInContextSidebar,
|
||||||
notifyAllLearners: values.notifyAllLearners,
|
notifyAllLearners: values.notifyAllLearners,
|
||||||
...(shouldRequireCaptcha && recaptchaToken ? { recaptchaToken } : {}),
|
...(shouldRequireCaptcha && recaptchaToken ? { recaptchaToken } : {}),
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { mergeConfig } from '@edx/frontend-platform';
|
|
||||||
|
|
||||||
import '@testing-library/jest-dom/extend-expect';
|
import '@testing-library/jest-dom/extend-expect';
|
||||||
import 'babel-polyfill';
|
import 'babel-polyfill';
|
||||||
|
|
||||||
@@ -68,10 +66,3 @@ global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
jest.setTimeout(1000000);
|
jest.setTimeout(1000000);
|
||||||
|
|
||||||
mergeConfig({
|
|
||||||
LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,
|
|
||||||
LEARNER_FEEDBACK_URL: process.env.LEARNER_FEEDBACK_URL,
|
|
||||||
STAFF_FEEDBACK_URL: process.env.STAFF_FEEDBACK_URL,
|
|
||||||
ENABLE_PROFILE_IMAGE: process.env.ENABLE_PROFILE_IMAGE || 'false',
|
|
||||||
}, 'DiscussionsConfig');
|
|
||||||
|
|||||||
Reference in New Issue
Block a user