Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion msg issue #748

Open
wants to merge 30 commits into
base: open-release/quince.master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ca86957
included css and js files
sohailm100 Jun 24, 2024
7f21599
added author first name
ts-tech-repo Aug 19, 2024
18cb2fb
change author label
ts-tech-repo Aug 19, 2024
5a4b938
added first name in proto type
ts-tech-repo Aug 19, 2024
a1fc988
reverted author name change
ts-tech-repo Aug 21, 2024
32062df
added authorfirstname in authorLabel component
sohailm100 Aug 21, 2024
473ee6d
changed variable name for author_first_name
sohailm100 Aug 21, 2024
e05c64c
added authorFirstName in postlink
sohailm100 Aug 21, 2024
10a57bd
show name after opening the post
manojp3 Aug 21, 2024
17bc09b
Display name on post
manojp3 Aug 21, 2024
ca05d79
identity by name in learner tab
manojp3 Aug 22, 2024
969db26
removed logs statements
manojp3 Aug 22, 2024
594246a
added author firstname in post header
manojp3 Aug 23, 2024
e2c6c45
added author firstname in Reply jsx file
manojp3 Aug 23, 2024
08197ec
Discussion Forum name display include First name
ts-tech-repo Aug 26, 2024
f7c7d82
Update api.js
dattatadepalli Dec 20, 2024
72ddcc3
Update api.js
dattatadepalli Dec 20, 2024
a2726a6
not found debugging
dattatadepalli Dec 20, 2024
259b539
Update api.js
dattatadepalli Dec 20, 2024
070e22f
debugging
dattatadepalli Dec 20, 2024
f9f37ec
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
fd4cccd
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
09c50c9
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
9644858
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
ce91996
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
0ee9bcf
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
2c7c77c
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
ea8b9d9
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
84597a0
Update DiscussionsHome.jsx
dattatadepalli Dec 20, 2024
226c5b0
Update api.js
dattatadepalli Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
href="<%=htmlWebpackPlugin.options.FAVICON_URL%>"
type="image/x-icon"
/>
<link href="https://static.talentsprint.com/edx_styles/header.css" rel="stylesheet" type="text/css" />
<script defer>
window.MathJax = {
tex: {
Expand Down Expand Up @@ -52,7 +53,7 @@
</head>
<body>
<div id="root" class="small"></div>

<script src = "https://static.talentsprint.com/edx_scripts/header.js"> </script>
<!-- begin usabilla live embed code -->
<script defer type="text/javascript">
window.lightningjs ||
Expand Down
113 changes: 59 additions & 54 deletions src/data/constants.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { getConfig } from '@edx/frontend-platform';
import { getConfig } from "@edx/frontend-platform";

export const getApiBaseUrl = () => getConfig().LMS_BASE_URL;
export const getFullUrl = (path) => (
new URL(`${getConfig().PUBLIC_PATH.replace(/\/$/, '')}/${path}`, window.location.origin).href
);
export const getFullUrl = (path) =>
new URL(
`${getConfig().PUBLIC_PATH.replace(/\/$/, "")}/${path}`,
window.location.origin
).href;

/**
* Enum for thread types.
* @readonly
* @enum {string}
*/
export const ThreadType = {
ALL: 'all',
QUESTION: 'question',
DISCUSSION: 'discussion',
ALL: "all",
QUESTION: "question",
DISCUSSION: "discussion",
};

/**
Expand All @@ -22,9 +24,9 @@ export const ThreadType = {
* @enum
*/
export const EndorsementStatus = {
ENDORSED: 'endorsed',
UNENDORSED: 'unendorsed',
DISCUSSION: 'discussion',
ENDORSED: "endorsed",
UNENDORSED: "unendorsed",
DISCUSSION: "discussion",
};

/**
Expand All @@ -44,20 +46,20 @@ export const EndorsementValue = {
* @enum {string}
*/
export const ContentActions = {
EDIT_CONTENT: 'raw_body',
PIN: 'pinned',
ENDORSE: 'endorsed',
CLOSE: 'closed',
COPY_LINK: 'copy_link',
REPORT: 'abuse_flagged',
DELETE: 'delete',
FOLLOWING: 'following',
CHANGE_GROUP: 'group_id',
MARK_READ: 'read',
CHANGE_TITLE: 'title',
CHANGE_TOPIC: 'topic_id',
CHANGE_TYPE: 'type',
VOTE: 'voted',
EDIT_CONTENT: "raw_body",
PIN: "pinned",
ENDORSE: "endorsed",
CLOSE: "closed",
COPY_LINK: "copy_link",
REPORT: "abuse_flagged",
DELETE: "delete",
FOLLOWING: "following",
CHANGE_GROUP: "group_id",
MARK_READ: "read",
CHANGE_TITLE: "title",
CHANGE_TOPIC: "topic_id",
CHANGE_TYPE: "type",
VOTE: "voted",
};

/**
Expand All @@ -66,11 +68,11 @@ export const ContentActions = {
* @enum {string}
*/
export const RequestStatus = {
IDLE: 'idle',
IN_PROGRESS: 'in-progress',
SUCCESSFUL: 'successful',
FAILED: 'failed',
DENIED: 'denied',
IDLE: "idle",
IN_PROGRESS: "in-progress",
SUCCESSFUL: "successful",
FAILED: "failed",
DENIED: "denied",
};

/**
Expand All @@ -79,8 +81,8 @@ export const RequestStatus = {
* @enum {string}
*/
export const AvatarOutlineAndLabelColors = {
Staff: 'staff-color',
'Community TA': 'TA-color',
Staff: "staff-color",
"Community TA": "TA-color",
};

/**
Expand All @@ -89,9 +91,9 @@ export const AvatarOutlineAndLabelColors = {
* @enum {string}
*/
export const ThreadOrdering = {
BY_LAST_ACTIVITY: 'lastActivityAt',
BY_COMMENT_COUNT: 'commentCount',
BY_VOTE_COUNT: 'voteCount',
BY_LAST_ACTIVITY: "lastActivityAt",
BY_COMMENT_COUNT: "commentCount",
BY_VOTE_COUNT: "voteCount",
};

/**
Expand All @@ -100,12 +102,12 @@ export const ThreadOrdering = {
* @enum {string}
*/
export const PostsStatusFilter = {
ALL: 'statusAll',
UNREAD: 'statusUnread',
FOLLOWING: 'statusFollowing',
REPORTED: 'statusReported',
UNANSWERED: 'statusUnanswered',
UNRESPONDED: 'statusUnresponded',
ALL: "statusAll",
UNREAD: "statusUnread",
FOLLOWING: "statusFollowing",
REPORTED: "statusReported",
UNANSWERED: "statusUnanswered",
UNRESPONDED: "statusUnresponded",
};

/**
Expand All @@ -114,33 +116,33 @@ export const PostsStatusFilter = {
* @enum {string}
*/
export const TopicsFilter = {
ALL: 'allTopics',
COURSE_SECTION: 'courseSectionTopics',
GENERAL: 'generalTopics',
ALL: "allTopics",
COURSE_SECTION: "courseSectionTopics",
GENERAL: "generalTopics",
};

export const TopicOrdering = {
BY_COURSE_STRUCTURE: 'sortByCourseStructure',
BY_LAST_ACTIVITY: 'sortByLastActivity',
BY_COMMENT_COUNT: 'sortByCommentCount',
BY_COURSE_STRUCTURE: "sortByCourseStructure",
BY_LAST_ACTIVITY: "sortByLastActivity",
BY_COMMENT_COUNT: "sortByCommentCount",
};

export const LearnersOrdering = {
BY_FLAG: 'flagged',
BY_LAST_ACTIVITY: 'activity',
BY_RECENCY: 'recency',
BY_FLAG: "flagged",
BY_LAST_ACTIVITY: "activity",
BY_RECENCY: "recency",
};

/**
* Enum for discussion provider types supported by the MFE.
* @type {{OPEN_EDX: string, LEGACY: string}}
*/
export const DiscussionProvider = {
LEGACY: 'legacy',
OPEN_EDX: 'openedx',
LEGACY: "legacy",
OPEN_EDX: "openedx",
};

const BASE_PATH = '/:courseId';
const BASE_PATH = "/:courseId";

export const Routes = {
DISCUSSIONS: {
Expand Down Expand Up @@ -180,7 +182,7 @@ export const Routes = {
category: `${BASE_PATH}/category/:category/posts/:postId`,
topics: `${BASE_PATH}/topics/:topicId/posts/:postId`,
posts: `${BASE_PATH}/posts/:postId`,
'my-posts': `${BASE_PATH}/my-posts/:postId`,
"my-posts": `${BASE_PATH}/my-posts/:postId`,
learners: `${BASE_PATH}/learners/:learnerUsername/posts/:postId`,
},
},
Expand All @@ -197,13 +199,16 @@ export const Routes = {
TOPIC_POST: `${BASE_PATH}/topics/:topicId/posts/:postId`,
TOPIC_POST_EDIT: `${BASE_PATH}/topics/:topicId/posts/:postId/edit`,
},
NOT_FOUND: {
PATH: `${BASE_PATH}/discussions/:courseId/not-found`,
},
};

export const PostsPages = {
category: `${BASE_PATH}/category/:category/posts`,
topics: `${BASE_PATH}/topics/:topicId/posts`,
posts: `${BASE_PATH}/posts`,
'my-posts': `${BASE_PATH}/my-posts`,
"my-posts": `${BASE_PATH}/my-posts`,
learners: `${BASE_PATH}/learners/:learnerUsername/posts`,
};

Expand Down
7 changes: 5 additions & 2 deletions src/discussions/common/AuthorLabel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import timeLocale from './time-locale';

const AuthorLabel = ({
author,
authorFirstName,
authorLabel,
linkToProfile,
labelColor,
Expand Down Expand Up @@ -58,9 +59,9 @@ const AuthorLabel = ({
role="heading"
aria-level="2"
>
{isRetiredUser ? '[Deactivated]' : author}
{isRetiredUser ? '[Deactivated]' : `${authorFirstName ? `${authorFirstName}(${author})` : author}`}
</span>
), [author, authorLabelMessage, isRetiredUser]);
), [author, authorFirstName, authorLabelMessage, isRetiredUser]);

const labelContents = useMemo(() => (
<>
Expand Down Expand Up @@ -132,6 +133,7 @@ const AuthorLabel = ({

AuthorLabel.propTypes = {
author: PropTypes.string.isRequired,
authorFirstName: PropTypes.string,
authorLabel: PropTypes.string,
linkToProfile: PropTypes.bool,
labelColor: PropTypes.string,
Expand All @@ -142,6 +144,7 @@ AuthorLabel.propTypes = {
};

AuthorLabel.defaultProps = {
authorFirstName: '',
linkToProfile: false,
authorLabel: null,
labelColor: '',
Expand Down
Loading