diff --git a/src/discussions/comments/CommentsView.test.jsx b/src/discussions/comments/CommentsView.test.jsx index 5b8cad6d..d9909353 100644 --- a/src/discussions/comments/CommentsView.test.jsx +++ b/src/discussions/comments/CommentsView.test.jsx @@ -12,6 +12,7 @@ import { AppProvider } from '@edx/frontend-platform/react'; import { initializeStore } from '../../store'; import { executeThunk } from '../../test-utils'; +import { DiscussionContext } from '../common/context'; import { courseConfigApiUrl } from '../data/api'; import { fetchCourseConfig } from '../data/thunks'; import DiscussionContent from '../discussions-home/DiscussionContent'; @@ -81,16 +82,20 @@ function renderComponent(postId) { render( - - - { - testLocation = location; - return null; - }} - /> - + + + + { + testLocation = location; + return null; + }} + /> + + , ); diff --git a/src/discussions/comments/comment/CommentHeader.jsx b/src/discussions/comments/comment/CommentHeader.jsx index cada8c17..8c9af624 100644 --- a/src/discussions/comments/comment/CommentHeader.jsx +++ b/src/discussions/comments/comment/CommentHeader.jsx @@ -39,7 +39,7 @@ function CommentHeader({ height: '32px', }} /> - +
diff --git a/src/discussions/comments/comment/CommentHeader.test.jsx b/src/discussions/comments/comment/CommentHeader.test.jsx index ddfc177c..0e1ba4d5 100644 --- a/src/discussions/comments/comment/CommentHeader.test.jsx +++ b/src/discussions/comments/comment/CommentHeader.test.jsx @@ -7,6 +7,7 @@ import { initializeMockApp } from '@edx/frontend-platform'; import { AppProvider } from '@edx/frontend-platform/react'; import { initializeStore } from '../../../store'; +import { DiscussionContext } from '../../common/context'; import CommentHeader from './CommentHeader'; let store; @@ -15,7 +16,11 @@ function renderComponent(comment, postType, actionHandlers) { return render( - + + + , ); diff --git a/src/discussions/comments/comment/Reply.jsx b/src/discussions/comments/comment/Reply.jsx index ae8f698f..65f5b296 100644 --- a/src/discussions/comments/comment/Reply.jsx +++ b/src/discussions/comments/comment/Reply.jsx @@ -77,7 +77,7 @@ function Reply({
- + {intl.formatMessage(messages.editedBy)} - + {intl.formatMessage(messages.reason)}: {content.lastEdit.reason}
@@ -47,7 +47,7 @@ function AlertBanner({
{intl.formatMessage(messages.closedBy)} - + {intl.formatMessage(messages.reason)}: {content.closeReason} diff --git a/src/discussions/common/AlertBanner.test.jsx b/src/discussions/common/AlertBanner.test.jsx index 1928d11a..e6f888a8 100644 --- a/src/discussions/common/AlertBanner.test.jsx +++ b/src/discussions/common/AlertBanner.test.jsx @@ -9,6 +9,7 @@ import { ThreadType } from '../../data/constants'; import { initializeStore } from '../../store'; import messages from '../comments/messages'; import AlertBanner from './AlertBanner'; +import { DiscussionContext } from './context'; import '../comments/data/__factories__'; import '../posts/data/__factories__'; @@ -26,9 +27,13 @@ function renderComponent( render( - + + + , ); @@ -53,7 +58,7 @@ describe.each([ label: 'edited content', type: 'thread', postType: null, - props: { last_edit: { reason: 'test-reason', editorUsername: 'editor-user' } }, + props: { closed: false, last_edit: { reason: 'test-reason', editorUsername: 'editor-user' } }, expectText: [messages.editedBy.defaultMessage, messages.reason.defaultMessage, 'editor-user', 'test-reason'], }, { diff --git a/src/discussions/common/AuthorLabel.jsx b/src/discussions/common/AuthorLabel.jsx index 1e0c13fe..d21a7595 100644 --- a/src/discussions/common/AuthorLabel.jsx +++ b/src/discussions/common/AuthorLabel.jsx @@ -72,10 +72,11 @@ function AuthorLabel({
); - return linkToProfile + return linkToProfile && author ? ( - + {timeago.format(content.endorsedAt, intl.locale)}
diff --git a/src/discussions/common/EndorsedAlertBanner.test.jsx b/src/discussions/common/EndorsedAlertBanner.test.jsx index 4248249f..bfc9de8a 100644 --- a/src/discussions/common/EndorsedAlertBanner.test.jsx +++ b/src/discussions/common/EndorsedAlertBanner.test.jsx @@ -8,6 +8,7 @@ import { AppProvider } from '@edx/frontend-platform/react'; import { ThreadType } from '../../data/constants'; import { initializeStore } from '../../store'; import messages from '../comments/messages'; +import { DiscussionContext } from './context'; import EndorsedAlertBanner from './EndorsedAlertBanner'; import '../comments/data/__factories__'; @@ -26,10 +27,14 @@ function renderComponent( render( - + + + , ); diff --git a/src/discussions/posts/post/PostHeader.jsx b/src/discussions/posts/post/PostHeader.jsx index b5c7ddb5..60a8b312 100644 --- a/src/discussions/posts/post/PostHeader.jsx +++ b/src/discussions/posts/post/PostHeader.jsx @@ -112,6 +112,7 @@ function PostHeader({ author={post.author || intl.formatMessage(messages.anonymous)} authorLabel={post.authorLabel} labelColor={authorLabelColor && `text-${authorLabelColor}`} + linkToProfile /> diff --git a/src/index.scss b/src/index.scss index 1ab686aa..657a43e0 100755 --- a/src/index.scss +++ b/src/index.scss @@ -111,3 +111,10 @@ $fa-font-path: "~font-awesome/fonts"; header nav.nav.secondary-menu-container { z-index: 10000; } + +#learner-posts-link { + color: inherit; + span[role=heading]:hover { + text-decoration: underline; + } +}