Compare commits

...

5 Commits

Author SHA1 Message Date
AsadAzam
8a6d067481 Merge pull request #455 from raccoongang/olive/fix-post-sharing-link
fix: post sharing URL
2023-03-28 15:58:09 +05:00
Eugene Dyudyunov
947dd1f1a6 fix: my posts tab search (#467)
This is a backport from the master branch:
https://github.com/openedx/frontend-app-discussions/pull/419
2023-03-15 00:50:02 +05:00
AsadAzam
e158964c41 Merge pull request #449 from raccoongang/lunyachek/fix/discussion-code-block-formatting-olive
fix: Fix for code block formatting on the post preview and published post view
2023-03-10 21:07:19 +05:00
Eugene Dyudyunov
7dfbd44552 fix: post sharing URL
When MFE uses path-based deployment (common domain for all MFEs
divided by path) - the copied link leads to 404 error.

The fix:
- construct a Post URL using MFE's `PUBLIC_PATH` env var
- works for both subdomain and subdirectory-based deployments

Note:

LMS recently started to use the discussions sidebar which has the same
button "Copy Link", but it uses its own env variable
`DISCUSSIONS_MFE_BASE_URL`
2023-02-24 16:52:10 +02:00
lunyachek
d9e60ddd92 fix: Fix for code block formatting on the post preview and published post view 2023-02-21 17:43:03 +02:00
3 changed files with 15 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ function PostsList({ posts, topics, intl }) {
topicIds,
};
if (showOwnPosts) {
if (showOwnPosts && filters.search === '') {
dispatch(fetchUserPosts(courseId, params));
} else {
dispatch(fetchThreads(courseId, params));

View File

@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import { useDispatch, useSelector } from 'react-redux';
import { useHistory, useLocation } from 'react-router-dom';
import { getConfig } from '@edx/frontend-platform';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { Hyperlink, useToggle } from '@edx/paragon';
@@ -35,6 +36,9 @@ function Post({
const { reasonCodesEnabled } = useSelector(selectModerationSettings);
const [isDeleting, showDeleteConfirmation, hideDeleteConfirmation] = useToggle(false);
const [isClosing, showClosePostModal, hideClosePostModal] = useToggle(false);
const postURL = new URL(`${getConfig().PUBLIC_PATH}${courseId}/posts/${post.id}`, window.location.origin);
const actionHandlers = {
[ContentActions.EDIT_CONTENT]: () => history.push({
...location,
@@ -50,7 +54,7 @@ function Post({
dispatch(updateExistingThread(post.id, { closed: true }));
}
},
[ContentActions.COPY_LINK]: () => { navigator.clipboard.writeText(`${window.location.origin}/${courseId}/posts/${post.id}`); },
[ContentActions.COPY_LINK]: () => { navigator.clipboard.writeText(postURL.href); },
[ContentActions.PIN]: () => dispatch(updateExistingThread(post.id, { pinned: !post.pinned })),
[ContentActions.REPORT]: () => dispatch(updateExistingThread(post.id, { flagged: !post.abuseFlagged })),
};

View File

@@ -254,3 +254,12 @@ header {
align-self: center;
}
}
.post-preview,
.discussion-comments {
blockquote {
border-left: 2px solid #ccc;
margin-left: 1.5rem;
padding-left: 1rem;
}
}