Compare commits

..

1 Commits

Author SHA1 Message Date
adeel.tajamul
9016c5996f fix: updated post actions dropdown design 2023-04-07 12:30:54 +05:00
6 changed files with 1 additions and 38 deletions

View File

@@ -55,8 +55,6 @@ export const ContentActions = {
CHANGE_TOPIC: 'topic_id',
CHANGE_TYPE: 'type',
VOTE: 'voted',
ACCEPT_REVIEW: 'accept_review',
REJECT_REVIEW: 'reject_review',
};
/**

View File

@@ -26,16 +26,6 @@ const messages = defineMessages({
defaultMessage: 'Unpin',
description: 'Action to unpin a post',
},
acceptReview: {
id: 'discussions.actions.reviewAccept',
defaultMessage: 'Accept',
description: 'Action to accept content flagged for review',
},
rejectReview: {
id: 'discussions.actions.reviewReject',
defaultMessage: 'Decline',
description: 'Action to reject content flagged for review',
},
deleteAction: {
id: 'discussions.actions.delete',
defaultMessage: 'Delete',

View File

@@ -151,7 +151,6 @@ export async function updateThread(threadId, {
pinned,
editReasonCode,
closeReasonCode,
reviewStatus,
} = {}) {
const url = `${getThreadsApiUrl()}${threadId}/`;
const patchData = snakeCaseObject({
@@ -167,7 +166,6 @@ export async function updateThread(threadId, {
pinned,
editReasonCode,
closeReasonCode,
reviewStatus,
});
const { data } = await getAuthenticatedHttpClient()
.patch(url, patchData, { headers: { 'Content-Type': 'application/merge-patch+json' } });

View File

@@ -239,7 +239,6 @@ export function createNewThread({
export function updateExistingThread(threadId, {
flagged, voted, read, topicId, type, title, content, following, closed, pinned, closeReasonCode, editReasonCode,
reviewStatus,
}) {
return async (dispatch) => {
try {
@@ -257,7 +256,6 @@ export function updateExistingThread(threadId, {
pinned,
editReasonCode,
closeReasonCode,
reviewStatus,
}));
const data = await updateThread(threadId, {
flagged,
@@ -272,7 +270,6 @@ export function updateExistingThread(threadId, {
pinned,
editReasonCode,
closeReasonCode,
reviewStatus,
});
dispatch(updateThreadSuccess(camelCaseObject(data)));
} catch (error) {

View File

@@ -44,7 +44,6 @@ function Post({
const userHasModerationPrivileges = useSelector(selectUserHasModerationPrivileges);
const displayPostFooter = post.following || post.voteCount || post.closed
|| (post.groupId && userHasModerationPrivileges);
const displayReviewContentLabel = post.reviewStatus === "PENDING";
const handleAbusedFlag = useCallback(() => {
if (post.abuseFlagged) {
@@ -86,8 +85,6 @@ function Post({
[ContentActions.COPY_LINK]: () => { navigator.clipboard.writeText(`${window.location.origin}/${courseId}/posts/${post.id}`); },
[ContentActions.PIN]: () => dispatch(updateExistingThread(post.id, { pinned: !post.pinned })),
[ContentActions.REPORT]: () => handleAbusedFlag(),
[ContentActions.ACCEPT_REVIEW]: () => dispatch(updateExistingThread(post.id, { reviewStatus: "ACCEPTED" })),
[ContentActions.REJECT_REVIEW]: () => dispatch(updateExistingThread(post.id, { reviewStatus: "REJECTED" })),
}), [
showDeleteConfirmation,
history,
@@ -147,8 +144,6 @@ function Post({
/>
<AlertBanner content={post} />
<PostHeader post={post} />
{displayReviewContentLabel && <p style= {{ background: "yellow" }}> This content is under review </p>}
<div className="d-flex mt-14px text-break font-style text-primary-500">
<HTMLLoader htmlNode={post.renderedBody} componentId="post" cssClassName="html-loader" testId={post.id} />
</div>

View File

@@ -5,8 +5,7 @@ import { generatePath, useRouteMatch } from 'react-router';
import { getConfig } from '@edx/frontend-platform';
import {
CheckCircle, CheckCircleOutline, Close, Delete, Done,
Edit, Lock, LockOpen, Pin, Report, Verified, VerifiedOutline,
CheckCircle, CheckCircleOutline, Delete, Edit, Lock, LockOpen, Pin, Report, Verified, VerifiedOutline,
} from '@edx/paragon/icons';
import { InsertLink } from '../components/icons';
@@ -174,20 +173,6 @@ export const ACTIONS_LIST = [
label: messages.deleteAction,
conditions: { canDelete: true },
},
{
id: 'accept-review',
action: ContentActions.ACCEPT_REVIEW,
icon: Done,
label: messages.acceptReview,
conditions: { reviewStatus: 'PENDING' },
},
{
id: 'reject-review',
action: ContentActions.REJECT_REVIEW,
icon: Close,
label: messages.rejectReview,
conditions: { reviewStatus: 'PENDING' },
},
];
export function useActions(content) {