Skip to content

Commit 1f240c3

Browse files
committed
feat: add new help section in course team page
1 parent 6ce7b86 commit 1f240c3

File tree

8 files changed

+53
-1
lines changed

8 files changed

+53
-1
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ ENABLE_GRADING_METHOD_IN_PROBLEMS=false
4747
LIBRARY_UNSUPPORTED_BLOCKS="conditional,step-builder,problem-builder"
4848
# Fallback in local style files
4949
PARAGON_THEME_URLS={}
50+
COURSE_TEAM_SUPPORT_EMAIL=''

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ ENABLE_GRADING_METHOD_IN_PROBLEMS=false
5050
LIBRARY_UNSUPPORTED_BLOCKS="conditional,step-builder,problem-builder"
5151
# Fallback in local style files
5252
PARAGON_THEME_URLS={}
53+
COURSE_TEAM_SUPPORT_EMAIL=''

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ ENABLE_GRADING_METHOD_IN_PROBLEMS=false
4242
# "Multi-level" blocks are unsupported in libraries
4343
LIBRARY_UNSUPPORTED_BLOCKS="conditional,step-builder,problem-builder"
4444
PARAGON_THEME_URLS=
45+
COURSE_TEAM_SUPPORT_EMAIL='[email protected]'

src/course-team/course-team-sidebar/CourseTeamSideBar.test.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ describe('<CourseTeamSidebar />', () => {
2121
expect(getByText(messages.sidebarAbout_3.defaultMessage)).toBeInTheDocument();
2222
});
2323

24+
it('renders CourseTeamSidebar component based on support email variable', () => {
25+
const { getByText } = renderComponent();
26+
const courseTeamSupportEmail = process.env.COURSE_TEAM_SUPPORT_EMAIL;
27+
28+
if (courseTeamSupportEmail) {
29+
expect(getByText(messages.helpInfoSidebarTitle.defaultMessage)).toBeInTheDocument();
30+
expect(getByText(courseTeamSupportEmail)).toBeInTheDocument();
31+
expect(getByText(/to add, remove, or update user access in bulk\./i)).toBeInTheDocument();
32+
} else {
33+
expect(getByText(messages.helpInfoSidebarTitle.defaultMessage)).not.toBeInTheDocument();
34+
expect(getByText(/to add, remove, or update user access in bulk\./i)).not.toBeInTheDocument();
35+
}
36+
});
37+
2438
it('render CourseTeamSidebar when isOwnershipHint is true', () => {
2539
const { getByText } = renderComponent({ isOwnershipHint: true });
2640

src/course-team/course-team-sidebar/CourseTeamSidebar.jsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { useIntl } from '@edx/frontend-platform/i18n';
4-
4+
import { Icon, MailtoLink } from '@openedx/paragon';
5+
import { InfoOutline } from '@openedx/paragon/icons';
56
import { HelpSidebar } from '../../generic/help-sidebar';
67
import messages from './messages';
78

89
const CourseTeamSideBar = ({ courseId, isOwnershipHint, isShowInitialSidebar }) => {
910
const intl = useIntl();
11+
const courseTeamSupportEmail = process.env.COURSE_TEAM_SUPPORT_EMAIL;
1012

1113
return (
1214
<div
@@ -30,6 +32,29 @@ const CourseTeamSideBar = ({ courseId, isOwnershipHint, isShowInitialSidebar })
3032
<p className="help-sidebar-about-descriptions">
3133
{intl.formatMessage(messages.sidebarAbout_3)}
3234
</p>
35+
{courseTeamSupportEmail && (
36+
<>
37+
<p className="help-sidebar-other-title">
38+
<sub>
39+
<Icon
40+
src={InfoOutline}
41+
className="d-inline-block mr-2"
42+
style={{ height: 21, width: 21 }}
43+
/>
44+
</sub>
45+
{intl.formatMessage(messages.helpInfoSidebarTitle)}
46+
</p>
47+
<p className="help-sidebar-about-descriptions">
48+
{intl.formatMessage(messages.helpInfoDescription, {
49+
email_address: (
50+
<MailtoLink to={courseTeamSupportEmail}>
51+
{courseTeamSupportEmail}
52+
</MailtoLink>
53+
),
54+
})}
55+
</p>
56+
</>
57+
)}
3358
</HelpSidebar>
3459
{isOwnershipHint && (
3560
<>

src/course-team/course-team-sidebar/messages.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ const messages = defineMessages({
2525
id: 'course-authoring.course-team.sidebar.ownership.description',
2626
defaultMessage: 'Every course must have an Admin. If you are the Admin and you want to transfer ownership of the course, click {strong} to make another user the Admin, then ask that user to remove you from the Course Team list.',
2727
},
28+
helpInfoSidebarTitle: {
29+
id: 'course-authoring.course-team.sidebar.helpInfoSidebarTitle',
30+
defaultMessage: 'Need help across multiple courses?',
31+
},
32+
helpInfoDescription: {
33+
id: 'course-authoring.course-team.sidebar.helpInfoDescription',
34+
defaultMessage: 'Email {email_address} to add, remove, or update user access in bulk.',
35+
},
2836
addAdminAccess: {
2937
id: 'course-authoring.course-team.sidebar.ownership.addAdminAccess',
3038
defaultMessage: 'Add admin access',

src/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ initialize({
173173
ENABLE_CHECKLIST_QUALITY: process.env.ENABLE_CHECKLIST_QUALITY || 'true',
174174
ENABLE_GRADING_METHOD_IN_PROBLEMS: process.env.ENABLE_GRADING_METHOD_IN_PROBLEMS === 'true',
175175
LIBRARY_UNSUPPORTED_BLOCKS: (process.env.LIBRARY_UNSUPPORTED_BLOCKS || 'conditional,step-builder,problem-builder').split(','),
176+
COURSE_TEAM_SUPPORT_EMAIL: process.env.COURSE_TEAM_SUPPORT_EMAIL || null,
176177
}, 'CourseAuthoringConfig');
177178
},
178179
},

src/setupTest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ mergeConfig({
4949
LMS_BASE_URL: process.env.LMS_BASE_URL || null,
5050
LIBRARY_UNSUPPORTED_BLOCKS: (process.env.LIBRARY_UNSUPPORTED_BLOCKS || 'conditional,step-builder,problem-builder').split(','),
5151
PARAGON_THEME_URLS: process.env.PARAGON_THEME_URLS || null,
52+
COURSE_TEAM_SUPPORT_EMAIL: process.env.COURSE_TEAM_SUPPORT_EMAIL || null,
5253
}, 'CourseAuthoringConfig');
5354

5455
class ResizeObserver {

0 commit comments

Comments
 (0)